]> git.proxmox.com Git - rustc.git/blob - tests/ui/specialization/defaultimpl/specialization-trait-not-implemented.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / specialization / defaultimpl / specialization-trait-not-implemented.rs
1 // Tests that:
2 // - default impls do not have to supply all items and
3 // - a default impl does not count as an impl (in this case, an incomplete default impl).
4
5 #![feature(specialization)] //~ WARN the feature `specialization` is incomplete
6
7 trait Foo {
8 fn foo_one(&self) -> &'static str;
9 fn foo_two(&self) -> &'static str;
10 }
11
12 struct MyStruct;
13
14 default impl<T> Foo for T {
15 fn foo_one(&self) -> &'static str {
16 "generic"
17 }
18 }
19
20
21 fn main() {
22 println!("{}", MyStruct.foo_one());
23 //~^ ERROR the method
24 }