1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#[lang = "sized"] pub trait Sized {} pub trait Foo { fn foo(); } impl Foo for u16 { fn foo() { <u16 as Foo>::foo() } } fn main() { let a: u16 = 123; a.foo(); // { dg-error "no method named .foo. found in the current scope" "" { target *-*-* } .-1 } }