summaryrefslogtreecommitdiffstats
path: root/src/test/ui/feature-gates/feature-gate-generic_associated_types.rs
blob: c5c13451488915c496e44b210e5a5ab7388a4a01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use std::ops::Deref;

trait PointerFamily<U> {
    type Pointer<T>: Deref<Target = T>;
    //~^ ERROR generic associated types are unstable
    type Pointer2<T>: Deref<Target = T> where T: Clone, U: Clone;
    //~^ ERROR generic associated types are unstable
    //~| ERROR where clauses on associated types are unstable
}

struct Foo;

impl PointerFamily<u32> for Foo {
    type Pointer<Usize> = Box<Usize>;
    //~^ ERROR generic associated types are unstable
    type Pointer2<U32> = Box<U32>;
    //~^ ERROR generic associated types are unstable
    //~| ERROR the trait bound `U32: Clone` is not satisfied
}

trait Bar {
    type Assoc where Self: Sized;
    //~^ ERROR where clauses on associated types are unstable
}

impl Bar for Foo {
    type Assoc = Foo where Self: Sized;
    //~^ ERROR where clauses on associated types are unstable
}

fn main() {}