]> git.proxmox.com Git - rustc.git/blame - src/test/ui/feature-gates/feature-gate-generic_associated_types.rs
New upstream version 1.64.0+dfsg1
[rustc.git] / src / test / ui / feature-gates / feature-gate-generic_associated_types.rs
CommitLineData
ff7c6d11 1use std::ops::Deref;
ea8adc8c 2
ff7c6d11
XL
3trait 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 11struct Foo;
8faf50e0 12
ff7c6d11 13impl 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
21trait Bar {
22 type Assoc where Self: Sized;
23 //~^ ERROR where clauses on associated types are unstable
24}
25
8faf50e0 26impl 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 31fn main() {}