Skip to content

ICE on trait with mixed lifetimes #27989

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
malbarbo opened this issue Aug 25, 2015 · 3 comments
Closed

ICE on trait with mixed lifetimes #27989

malbarbo opened this issue Aug 25, 2015 · 3 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@malbarbo
Copy link
Contributor

This code generates

trait Y<'a>: Sized {
    fn f(&'a self) {
    }

    fn g(&self) where Self: for<'r> Y<'r> {
        self.f();
    }
}

this ICE

<anon>:6:14: 6:17 error: internal compiler error: coherence failed to report ambiguity: cannot locate the impl of the trait `Y<'_>` for the type `Self`
<anon>:6         self.f();
                      ^~~
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>', ../src/libsyntax/diagnostic.rs:176


playpen: application terminated with error code 101
@frewsxcv
Copy link
Member

for the lazy: playpen link

@frewsxcv
Copy link
Member

reduced:

trait Y<'a>: Sized {
    fn g() where Self: for<'r> Y<'r> {
    }
}

fn main() {}

playpen link

EDIT: this appears to only be failing in nightly

@Aatch Aatch added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Aug 25, 2015
@arielb1
Copy link
Contributor

arielb1 commented Aug 25, 2015

Duplicate of #24424

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

5 participants