]> git.lizzy.rs Git - rust.git/blob - src/test/ui/specialization/deafult-associated-type-bound-1.rs
Move `{core,std}::stream::Stream` to `{core,std}::async_iter::AsyncIterator`.
[rust.git] / src / test / ui / specialization / deafult-associated-type-bound-1.rs
1 // Check that we check that default associated types satisfy the required
2 // bounds on them.
3 // ignore-compare-mode-chalk
4
5 #![feature(specialization)]
6 //~^ WARNING `specialization` is incomplete
7
8 trait X {
9     type U: Clone;
10     fn unsafe_clone(&self, x: Option<&Self::U>) {
11         x.cloned();
12     }
13 }
14
15 // We cannot normalize `<T as X>::U` to `str` here, because the default could
16 // be overridden. The error here must therefore be found by a method other than
17 // normalization.
18 impl<T> X for T {
19     default type U = str;
20     //~^ ERROR the trait bound `str: Clone` is not satisfied
21 }
22
23 pub fn main() {
24     1.unsafe_clone(None);
25 }