1 // It should not be possible to use the concrete value of a defaulted
2 // associated type in the impl defining it -- otherwise, what happens
5 #![feature(specialization)] //~ WARN the feature `specialization` is incomplete
9 fn generate(self) -> Self::Output;
12 impl<T> Example for T {
13 default type Output = Box<T>;
14 default fn generate(self) -> Self::Output {
15 Box::new(self) //~ ERROR mismatched types
19 impl Example for bool {
21 fn generate(self) -> bool { self }
24 fn trouble<T>(t: T) -> Box<T> {
25 Example::generate(t) //~ ERROR mismatched types
28 fn weaponize() -> bool {
29 let b: Box<bool> = trouble(true);