Debian Codegraph @

gcc/testsuite/rust/compile/torture/coercion2.rs

raw
1 pub fn main() {
2 let a: *const i32 = &123;
3 // { dg-warning "unused name" "" { target *-*-* } .-1 }
4 let b: &i32 = &123;
5 // { dg-warning "unused name" "" { target *-*-* } .-1 }
6
7 let c: &mut i32 = &mut 123;
8 // { dg-warning "unused name" "" { target *-*-* } .-1 }
9 let d: *mut i32 = &mut 123;
10 // { dg-warning "unused name" "" { target *-*-* } .-1 }
11
12 let e: &i32 = &mut 123;
13 // { dg-warning "unused name" "" { target *-*-* } .-1 }
14 let f: *const i32 = &mut 123;
15 // { dg-warning "unused name" "" { target *-*-* } .-1 }
16
17 let g = &123;
18 let h: *const i32 = g;
19 // { dg-warning "unused name" "" { target *-*-* } .-1 }
20 }