1 #![feature(specialization)] //~ WARN the feature `specialization` is incomplete
3 // Make sure we can't project defaulted associated types
10 default type Assoc = ();
17 fn generic<T>() -> <T as Foo>::Assoc {
18 // `T` could be some downstream crate type that specializes (or,
19 // for that matter, `u8`).
21 () //~ ERROR mismatched types
24 fn monomorphic() -> () {
25 // Even though we know that `()` is not specialized in a
26 // downstream crate, typeck refuses to project here.
28 generic::<()>() //~ ERROR mismatched types
32 // No error here, we CAN project from `u8`, as there is no `default`
34 let s: String = generic::<u8>();
35 println!("{}", s); // bad news if this all compiles