1 // Tests that default impls do not have to supply all items but regular impls do. 2 3 #![feature(specialization)] //~ WARN the feature `specialization` is incomplete 4 5 trait Foo { foo_one(&self) -> &'static str6 fn foo_one(&self) -> &'static str; foo_two(&self) -> &'static str7 fn foo_two(&self) -> &'static str; 8 } 9 10 struct MyStruct; 11 12 default impl<T> Foo for T { foo_one(&self) -> &'static str13 fn foo_one(&self) -> &'static str { 14 "generic" 15 } 16 } 17 18 impl Foo for MyStruct {} 19 //~^ ERROR not all trait items implemented, missing: `foo_two` [E0046] 20 main()21fn main() { 22 println!("{}", MyStruct.foo_one()); 23 } 24