]> git.lizzy.rs Git - rust.git/blob - src/test/ui/specialization/defaultimpl/specialization-trait-item-not-implemented.rs
2a121e61aaa977c7524e25ad7f9d0eaf4a254a9f
[rust.git] / src / test / ui / specialization / defaultimpl / specialization-trait-item-not-implemented.rs
1 // Tests that default impls do not have to supply all items but regular impls do.
2
3 #![feature(specialization)]
4
5 trait Foo {
6     fn foo_one(&self) -> &'static str;
7     fn foo_two(&self) -> &'static str;
8 }
9
10 struct MyStruct;
11
12 default impl<T> Foo for T {
13     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
21 fn main() {
22     println!("{}", MyStruct.foo_one());
23 }