]> git.lizzy.rs Git - rust.git/blob - src/test/ui/resolve/resolve-self-in-impl.rs
Merge commit '533f0fc81ab9ba097779fcd27c8f9ea12261fef5' into psimd
[rust.git] / src / test / ui / resolve / resolve-self-in-impl.rs
1 #![feature(associated_type_defaults)]
2
3 struct S<T = u8>(T);
4 trait Tr<T = u8> {
5     type A = ();
6 }
7
8 impl Tr<Self> for S {} // OK
9 impl<T: Tr<Self>> Tr<T> for S {} // OK
10 impl Tr for S where Self: Copy {} // OK
11 impl Tr for S where S<Self>: Copy {} // OK
12 impl Tr for S where Self::A: Copy {} // OK
13
14 impl Tr for Self {} //~ ERROR cycle detected
15 impl Tr for S<Self> {} //~ ERROR cycle detected
16 impl Self {} //~ ERROR cycle detected
17 impl S<Self> {} //~ ERROR cycle detected
18 impl Tr<Self::A> for S {} //~ ERROR cycle detected
19
20 fn main() {}