Closed
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