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

"No def'n found for DefId" ICE for impl appearing before trait declaration that includes an associated type #20371

Closed
huonw opened this issue Dec 31, 2014 · 0 comments
Labels
A-associated-items Area: Associated items (types, constants & functions) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@huonw
Copy link
Member

huonw commented Dec 31, 2014

#![feature(associated_types)]
impl X for f64 { type Y = int; }
trait X {type Y; }
//impl X for f64 { type Y = int; }
fn main() {}

gives

error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'No def'n found for DefId { krate: 0, node: 13 } in tcx.impl_or_trait_items', /build/rust-git/src/rust/src/librustc/middle/ty.rs:4801

Swapping the comments on the impls removes the ICE. Similar to #18611.

(Side note: the above test case started as 46KB of source, but creduce only took two minutes to reduce to basically the above; very cool.)

@huonw huonw added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-associated-items Area: Associated items (types, constants & functions) labels Dec 31, 2014
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

1 participant