Skip to content
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

ICE: ty_is_local invoked on unexpected type: [type error] implementing trait for undeclared type #30589

Closed
Ms2ger opened this issue Dec 28, 2015 · 0 comments · Fixed by #30676
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@Ms2ger
Copy link
Contributor

Ms2ger commented Dec 28, 2015

use std::fmt;

impl fmt::Display for DecoderError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "Missing data: {}", self.0)
    }
}
fn main() {
}
/tmp/y:3:23: 3:35 error: use of undeclared type name `DecoderError` [E0412]
/tmp/y:3 impl fmt::Display for DecoderError {
                               ^~~~~~~~~~~~
/tmp/y:3:23: 3:35 help: run `rustc --explain E0412` to see a detailed explanation
error: internal compiler error: ty_is_local invoked on unexpected type: [type error]
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/errors/mod.rs:230
@apasel422 apasel422 added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Dec 28, 2015
nikomatsakis added a commit to nikomatsakis/rust that referenced this issue Jan 9, 2016
bors added a commit that referenced this issue Jan 11, 2016
This is an alternative to #29954 for fixing #29857 that seems to me to be more inline with the general strategy around `TyError`. It also includes the fix for #30589 -- in fact, just the minimal change of making `ty_is_local` tolerate `TyError` avoids the ICE, but you get a lot of duplicate error reports, so in the case where the impl's trait reference already includes `TyError`, we just ignore the impl altogether.

cc @arielb1 @sanxiyn

Fixes #29857.
Fixes #30589.
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

Successfully merging a pull request may close this issue.

2 participants