1 #![feature(generic_associated_types)]
2 
3 // Checking the interaction with this other feature
4 #![feature(associated_type_defaults)]
5 
6 use std::fmt::{Display, Debug};
7 
8 trait Foo {
9     type Assoc where Self: Sized;
10     type Assoc2<T> where T: Display;
11     type Assoc3<T>;
12     type WithDefault<'a, T: Debug + 'a>: ?Sized = dyn Iterator<Item=T>;
13     type NoGenerics;
14 }
15 
16 struct Bar;
17 
18 impl Foo for Bar {
19     type Assoc = usize;
20     type Assoc2<T> = Vec<T>;
21     //~^ ERROR `T` doesn't implement `std::fmt::Display`
22     type Assoc3<T> where T: Iterator = Vec<T>;
23     //~^ ERROR impl has stricter requirements than trait
24     type WithDefault<'a, T: Debug + 'a> = &'a dyn Iterator<Item=T>;
25     type NoGenerics = ::std::cell::Cell<i32>;
26 }
27 
main()28 fn main() {}
29