-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Description
I was trying to do things with recursive associated types:
pub struct S<T: Tr> {
u: <T as Tr>::I,
}
pub trait Tr {
type I: Tr;
}
impl<T: Tr> Tr for T {
type I = S<T>;
}
fn main() {}
and got a strange trans coherence error:
<anon>:11:1: 13:2 error: internal compiler error: coherence failed to report ambiguity: cannot locate the impl of the trait `Tr` for the type `<T as Tr>::I`
<anon>:11 impl<T: Tr> Tr for T {
<anon>:12 type I = S<T>;
<anon>:13 }
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:129
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️