aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/torture/generics27.rs
blob: c4ca4db81e0151b31f9c9a0fd4f7547c1243893b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#[lang = "sized"]
pub trait Sized {}

// github issue #415
fn test<A>(a: &A) -> &A {
    a
}

fn main() {
    let a = 123;
    let b = &a;
    let c = test(b);
    // { dg-warning "unused name" "" { target *-*-* } .-1 }

    let a = 123f32;
    let b = &a;
    let c = test(b);
    // { dg-warning "unused name" "" { target *-*-* } .-1 }
}