1 #![feature(associated_type_defaults)]
3 // Having a cycle in assoc. type defaults is okay...
9 // ...but is an error in any impl that doesn't override at least one of the defaults
11 //~^ ERROR overflow evaluating the requirement
13 // As soon as at least one is redefined, it works:
27 // ...but only if this actually breaks the cycle
29 //~^ ERROR type mismatch resolving `<bool as Tr>::B == _`
30 type A = Box<Self::B>;
31 //~^ ERROR type mismatch resolving `<bool as Tr>::B == _`
33 // (the error is shown twice for some reason)
36 //~^ ERROR type mismatch resolving `<usize as Tr>::B == _`
37 type B = &'static Self::A;
38 //~^ ERROR type mismatch resolving `<usize as Tr>::A == _`
42 // We don't check that the types project correctly because the cycle errors stop compilation
43 // before `main` is type-checked.
44 // `defaults-cyclic-pass-1.rs` does this.