Closed
Description
The following code (playground)
#![crate_type = "lib"]
#![feature(specialization)] // comment this line to get the expected behavior
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 {}
produces
error: internal compiler error: /checkout/src/librustc/traits/specialize/mod.rs:201: failed to fully normalize <T as std::convert::From<<A<T> as Z>::Assoc>>: [FulfillmentError(Obligation(predicate=Binder(TraitPredicate(<T as X>)),depth=1),Unimplemented)]
Metadata
Metadata
Assignees
Labels
Area: Trait impl specializationCategory: This is a bug.`#![feature(specialization)]`Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Relevant to the compiler team, which will review and decide on the PR/issue.ICE tracked in rust-lang/glacier.Performance or correctness regression from one stable version to another.