]>
Commit | Line | Data |
---|---|---|
ff7c6d11 | 1 | use std::ops::Deref; |
ea8adc8c | 2 | |
ff7c6d11 XL |
3 | trait PointerFamily<U> { |
4 | type Pointer<T>: Deref<Target = T>; | |
5 | //~^ ERROR generic associated types are unstable | |
6 | type Pointer2<T>: Deref<Target = T> where T: Clone, U: Clone; | |
7 | //~^ ERROR generic associated types are unstable | |
0531ce1d | 8 | //~| ERROR where clauses on associated types are unstable |
ea8adc8c XL |
9 | } |
10 | ||
ff7c6d11 | 11 | struct Foo; |
8faf50e0 | 12 | |
ff7c6d11 | 13 | impl PointerFamily<u32> for Foo { |
0731742a | 14 | type Pointer<Usize> = Box<Usize>; |
ff7c6d11 | 15 | //~^ ERROR generic associated types are unstable |
0731742a | 16 | type Pointer2<U32> = Box<U32>; |
ff7c6d11 | 17 | //~^ ERROR generic associated types are unstable |
29967ef6 | 18 | //~| ERROR the trait bound `U32: Clone` is not satisfied |
ea8adc8c XL |
19 | } |
20 | ||
0531ce1d XL |
21 | trait Bar { |
22 | type Assoc where Self: Sized; | |
23 | //~^ ERROR where clauses on associated types are unstable | |
24 | } | |
25 | ||
8faf50e0 | 26 | impl Bar for Foo { |
5e7ed085 | 27 | type Assoc = Foo where Self: Sized; |
8faf50e0 XL |
28 | //~^ ERROR where clauses on associated types are unstable |
29 | } | |
0531ce1d | 30 | |
ff7c6d11 | 31 | fn main() {} |