2022-11-18 07:51:24 -06:00
|
|
|
//@ revisions: current negative
|
2022-07-27 00:06:46 -05:00
|
|
|
#![feature(specialization)]
|
2022-11-18 07:51:24 -06:00
|
|
|
#![cfg_attr(negative, feature(with_negative_coherence))]
|
2022-07-27 00:06:46 -05:00
|
|
|
#![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() {}
|