summaryrefslogtreecommitdiffstats
path: root/src/test/ui/coherence/issue-100191.rs
blob: e8597fde54d3ba133ec922311d78233642e949cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#![crate_type = "lib"]
#![feature(specialization, with_negative_coherence)]
#![allow(incomplete_features)]

trait X {}
trait Y: X {}
trait Z {
    type Assoc: Y;
}
struct A<T>(T);

impl<T> Y for T where T: X {}
impl<T: X> Z for A<T> {
    type Assoc = T;
}

// this impl is invalid, but causes an ICE anyway
impl<T> From<<A<T> as Z>::Assoc> for T {}
//~^ ERROR type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)

fn main() {}