1 #![feature(associated_type_defaults)]
3 // A more complex version of `defaults-cyclic-fail-1.rs`, with non-trivial defaults.
5 // Having a cycle in assoc. type defaults is okay...
11 // ...but is an error in any impl that doesn't override at least one of the defaults
13 //~^ ERROR type mismatch resolving `<() as Tr>::B == _`
15 // As soon as at least one is redefined, it works:
29 // ...but only if this actually breaks the cycle
31 //~^ ERROR type mismatch resolving `<bool as Tr>::B == _`
32 type A = Box<Self::B>;
33 //~^ ERROR type mismatch resolving `<bool as Tr>::B == _`
35 // (the error is shown twice for some reason)
38 //~^ ERROR type mismatch resolving `<usize as Tr>::B == _`
39 type B = &'static Self::A;
40 //~^ ERROR type mismatch resolving `<usize as Tr>::A == _`
44 // We don't check that the types project correctly because the cycle errors stop compilation
45 // before `main` is type-checked.
46 // `defaults-cyclic-pass-2.rs` does this.