aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/torture/generics15.rs
blob: 2b1f31c0217ee87851ede73c29e2b24e5ab607d2 (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 {}

struct Foo<T>(T, bool);

impl Foo<i32> {
    fn bar(self) -> i32 {
        self.0
    }
}

impl Foo<f32> {
    fn bar(self) -> f32 {
        self.0
    }
}

fn main() {
    let a = Foo(123, true);
    let aa = a.bar();
    // { dg-warning "unused name" "" { target *-*-* } .-1 }

    let b = Foo(456f32, true);
    let bb = b.bar();
    // { dg-warning "unused name" "" { target *-*-* } .-1 }
}