/* { dg-output "Hello World 123\r*\n" }*/ extern "C" { fn printf(s: *const i8, ...); } #[lang = "sized"] pub trait Sized {} struct Foo(T); struct Bar { a: Foo, b: bool, // { dg-warning "field is never read" "" { target *-*-* } .-1 } } fn test(a: Bar) -> Foo { a.a } fn main() -> i32 { let a: Bar = Bar:: { a: Foo::(123), b: true, }; let result: Foo = test(a); unsafe { let a = "Hello World %i\n"; let b = a as *const str; let c = b as *const i8; printf(c, result.0); } 0 }