Debian Codegraph @

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

raw
1 struct Foo {
2 a: fn(i32) -> i32,
3 b: i32,
4 }
5
6 fn test(a: i32) -> i32 {
7 a + 1
8 }
9
10 fn main() {
11 let a = test(1);
12 // { dg-warning "unused name" "" { target *-*-* } .-1 }
13
14 let b: fn(i32) -> i32 = test;
15 let c = b(1);
16
17 let d = Foo { a: test, b: c };
18 let e = (d.a)(d.b);
19 // { dg-warning "unused name" "" { target *-*-* } .-1 }
20 }