Skip to content

ICE: coherence failed to report ambiguity with recursive projection in type-contents and #22918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
arielb1 opened this issue Mar 1, 2015 · 1 comment
Labels
A-associated-items Area: Associated items (types, constants & functions) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@arielb1
Copy link
Contributor

arielb1 commented Mar 1, 2015

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
@kmcallister kmcallister added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-associated-items Area: Associated items (types, constants & functions) labels Mar 2, 2015
@arielb1
Copy link
Contributor Author

arielb1 commented May 20, 2015

Fixed (probably by #23424).

@arielb1 arielb1 closed this as completed May 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-associated-items Area: Associated items (types, constants & functions) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants