]> git.lizzy.rs Git - rust.git/blob - tests/ui/generic-associated-types/generic-associated-types-where.rs
Rollup merge of #103702 - WaffleLapkin:lift-sized-bounds-from-pointer-methods-where...
[rust.git] / tests / ui / generic-associated-types / generic-associated-types-where.rs
1 // Checking the interaction with this other feature
2 #![feature(associated_type_defaults)]
3
4 use std::fmt::{Display, Debug};
5
6 trait Foo {
7     type Assoc where Self: Sized;
8     type Assoc2<T> where T: Display;
9     type Assoc3<T>;
10     type WithDefault<'a, T: Debug + 'a>: ?Sized = dyn Iterator<Item=T>;
11     type NoGenerics;
12 }
13
14 struct Bar;
15
16 impl Foo for Bar {
17     type Assoc = usize;
18     type Assoc2<T> = Vec<T>;
19     //~^ ERROR `T` doesn't implement `std::fmt::Display`
20     type Assoc3<T> = Vec<T> where T: Iterator;
21     //~^ ERROR impl has stricter requirements than trait
22     type WithDefault<'a, T: Debug + 'a> = &'a dyn Iterator<Item=T>;
23     type NoGenerics = ::std::cell::Cell<i32>;
24 }
25
26 fn main() {}