#[lang = "sized"] pub trait Sized {} struct Foo(T, bool); impl Foo { fn test() -> i32 { 123 } } fn main() { let a = Foo::test(); // { dg-error "type annotations needed" "" { target *-*-* } .-1 } }