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:panicked at 'expected NodeId to be lowered already for res Local(NodeId(14), )', compiler/rustc_ast_lowering/src/lib.rs:710:17 #80978

Closed
chengniansun opened this issue Jan 13, 2021 · 5 comments
Labels
A-closures Area: closures (`|args| { .. }`) C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@chengniansun
Copy link

Code

fn main() {
    |arg| -> arg {}
}

Meta

rustc --version --verbose:

rustc 1.51.0-nightly (7a9b552cb 2021-01-12)
binary: rustc
commit-hash: 7a9b552cb1621c9c57898d147228aab32b65a7c3
commit-date: 2021-01-12
host: x86_64-unknown-linux-gnu
release: 1.51.0-nightly

Error output

error[E0573]: expected type, found local variable `arg`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:14
  |
2 |     |arg| -> arg {}
  |              ^^^ not a type

thread 'rustc' panicked at 'expected `NodeId` to be lowered already for res Local(
    NodeId(14),
)', compiler/rustc_ast_lowering/src/lib.rs:710:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.51.0-nightly (7a9b552cb 2021-01-12) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
error: aborting due to previous error

For more information about this error, try `rustc --explain E0573`.
Backtrace

error[E0573]: expected type, found local variable `arg`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:14
  |
2 |     |arg| -> arg {}
  |              ^^^ not a type

thread 'rustc' panicked at 'expected `NodeId` to be lowered already for res Local(
    NodeId(14),
)', compiler/rustc_ast_lowering/src/lib.rs:710:17
stack backtrace:
   0: rust_begin_unwind
             at /rustc/7a9b552cb1621c9c57898d147228aab32b65a7c3/library/std/src/panicking.rs:493:5
   1: std::panicking::begin_panic_fmt
             at /rustc/7a9b552cb1621c9c57898d147228aab32b65a7c3/library/std/src/panicking.rs:435:5
   2: rustc_ast_lowering::LoweringContext::lower_node_id_generic
   3: rustc_ast_lowering::path::<impl rustc_ast_lowering::LoweringContext>::lower_path_segment
   4: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
   5: rustc_ast_lowering::path::<impl rustc_ast_lowering::LoweringContext>::lower_qpath
   6: rustc_ast_lowering::LoweringContext::lower_ty_direct
   7: rustc_ast_lowering::LoweringContext::lower_fn_decl
   8: rustc_ast_lowering::expr::<impl rustc_ast_lowering::LoweringContext>::lower_expr_closure
   9: rustc_ast_lowering::expr::<impl rustc_ast_lowering::LoweringContext>::lower_expr_mut::{{closure}}
  10: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
  11: <core::iter::adapters::flatten::Flatten<I> as core::iter::traits::iterator::Iterator>::next
  12: <smallvec::SmallVec<A> as core::iter::traits::collect::Extend<<A as smallvec::Array>::Item>>::extend
  13: rustc_arena::cold_path
  14: rustc_ast_lowering::item::<impl rustc_ast_lowering::LoweringContext>::lower_fn_body_block
  15: rustc_ast_lowering::item::<impl rustc_ast_lowering::LoweringContext>::lower_maybe_async_body
  16: rustc_ast_lowering::item::<impl rustc_ast_lowering::LoweringContext>::lower_item
  17: rustc_ast_lowering::LoweringContext::with_hir_id_owner
  18: <rustc_ast_lowering::item::ItemLowerer as rustc_ast::visit::Visitor>::visit_mod
  19: rustc_ast_lowering::lower_crate
  20: rustc_interface::passes::BoxedResolver::access::{{closure}}
  21: rustc_interface::passes::configure_and_expand::{{closure}}
  22: rustc_interface::passes::BoxedResolver::access
  23: rustc_interface::queries::Queries::lower_to_hir
  24: rustc_interface::queries::Queries::global_ctxt
  25: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  26: rustc_span::with_source_map
  27: rustc_interface::interface::create_compiler_and_run
  28: rustc_span::with_session_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.51.0-nightly (7a9b552cb 2021-01-12) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
error: aborting due to previous error

For more information about this error, try `rustc --explain E0573`.

@chengniansun chengniansun added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 13, 2021
@jonas-schievink jonas-schievink added A-closures Area: closures (`|args| { .. }`) I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Jan 13, 2021
@apiraino
Copy link
Contributor

apiraino commented Jan 13, 2021

seems related to #79537, possibly a duplicate @chengniansun?

@chengniansun
Copy link
Author

@apiraino Yes. Sorry for the duplicate report.

I used the keyword compiler/rustc_ast_lowering/src/lib.rs:710 to search for the duplicate.

Closing this report.

@chengniansun
Copy link
Author

Seems that I cannot mark this as a duplicate to #79537

@jyn514
Copy link
Member

jyn514 commented Jan 13, 2021

Seems that I cannot mark this as a duplicate to #79537

That's ok, it's clear by looking at the issue :)

I used the keyword compiler/rustc_ast_lowering/src/lib.rs:710 to search for the duplicate.

The line numbers change a lot because the compiler is released so frequently. I would search for the text of the panic and maybe the file name, but not the specific line number.

@chengniansun
Copy link
Author

@jyn514

Thanks. I usually use the message as a keyword.

Reporting bugs at 2am is not a good idea, and clearly my head did not function well at that time. lol.

@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-closures Area: closures (`|args| { .. }`) C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants