]> git.lizzy.rs Git - rust.git/blob - src/test/ui/resolve/resolve-self-in-impl.rs
use proper spans
[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 `Self` is not valid in the self type of an impl block
15 impl Tr for S<Self> {} //~ ERROR `Self` is not valid in the self type of an impl block
16 impl Self {} //~ ERROR `Self` is not valid in the self type of an impl block
17 impl S<Self> {} //~ ERROR `Self` is not valid in the self type of an impl block
18 impl (Self, Self) {} //~ ERROR `Self` is not valid in the self type of an impl block
19 impl Tr<Self::A> for S {} //~ ERROR cycle detected
20
21 fn main() {}