rust-lang/rust

internal compiler error: local_def_id: no entry for HirId { owner ...

dwrensha opened this issue · 3 comments

I'm seeing an internal compiler error on the following input (found by fuzz-rustc):

async fn foo();
fn main() {}
$ rustc --edition=2018 main.rs
error: free function without a body
 --> main.rs:1:1
  |
1 | async fn foo();
  | ^^^^^^^^^^^^^^-
  |               |
  |               help: provide a definition for the function: `{ <body> }`

error: internal compiler error: src/librustc_middle/hir/map/mod.rs:177: local_def_id: no entry for `HirId { owner: DefId(0:3 ~ main[317d]::foo[0]), local_id: 8 }`, which has a map of `Some(Entry { parent: HirId { owner: DefId(0:3 ~ main[317d]::foo[0]), local_id: 14 }, node: Expr(Expr { hir_id: HirId { owner: DefId(0:3 ~ main[317d]::foo[0]), local_id: 8 }, kind: Closure(Value, FnDecl { inputs: [Ty { hir_id: HirId { owner: DefId(0:3 ~ main[317d]::foo[0]), local_id: 1 }, kind: Infer, span: main.rs:1:1: 1:16 }], output: DefaultReturn(main.rs:1:1: 1:16), c_variadic: false, implicit_self: None }, BodyId { hir_id: HirId { owner: DefId(0:3 ~ main[317d]::foo[0]), local_id: 7 } }, main.rs:1:1: 1:16, Some(Static)), attrs: ThinVec(None), span: main.rs:1:1: 1:16 }) })`

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:880:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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: rustc 1.44.0-nightly (76b11980a 2020-04-01) running on x86_64-unknown-linux-gnu

error: aborting due to 2 previous errors

Report from cargo-bisect-rustc:

searched nightlies: from nightly-2020-03-09 to nightly-2020-04-03
regressed nightly: nightly-2020-03-16
searched commits: from 7cdbc87 to 45ebd58
regressed commit: e0f5df0

Fixed by #70739.