aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-2166.rs
blob: 318f0a61b7ec4076aececa7cf6b3d958157eead0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#[lang = "sized"]
pub trait Sized {}

trait Add {
    type Output;

    fn add(self) -> u32;
}

impl Add for u32 {
    type Output = u32;

    fn add(self) -> u32 {
        // { dg-warning "unused name" "" { target *-*-* } .-1 }
        0
    }
}

impl<'a> Add for &'a u32 {
    type Output = u32;

    fn add(self) -> <u32 as Add>::Output {
        // { dg-warning "unused name" "" { target *-*-* } .-1 }
        0
    }
}