]> git.lizzy.rs Git - rust.git/blob - tests/ui/specialization/issue-43037.rs
Rollup merge of #106638 - RalfJung:realstd, r=thomcc
[rust.git] / tests / ui / specialization / issue-43037.rs
1 // revisions: current negative
2 #![feature(specialization)]
3 #![cfg_attr(negative, feature(with_negative_coherence))]
4 #![allow(incomplete_features)]
5
6 trait X {}
7 trait Y: X {}
8 trait Z {
9     type Assoc: Y;
10 }
11 struct A<T>(T);
12
13 impl<T> Y for T where T: X {}
14 impl<T: X> Z for A<T> {
15     type Assoc = T;
16 }
17
18 // this impl is invalid, but causes an ICE anyway
19 impl<T> From<<A<T> as Z>::Assoc> for T {}
20 //~^ ERROR type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
21
22 fn main() {}