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

Closed
chengniansun opened this issue Nov 29, 2020 · 4 comments · Fixed by #81249
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@chengniansun
Copy link

Code

fn change_parameter_pattern() {
    |x: x| x
}

Meta

rustc --version --verbose:

rustc 1.50.0-nightly (e37f25aa3 2020-11-28)
binary: rustc
commit-hash: e37f25aa3f356546ab851e394d5598fc575eabda
commit-date: 2020-11-28
host: x86_64-unknown-linux-gnu
release: 1.50.0-nightly

Error output

error[E0573]: expected type, found local variable `x`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:9
  |
2 |     |x: x| x
  |         ^ 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:674: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.50.0-nightly (e37f25aa3 2020-11-28) 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 `x`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:9
  |
2 |     |x: x| x
  |         ^ 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:674:17
stack backtrace:
   0: rust_begin_unwind
             at /rustc/e37f25aa3f356546ab851e394d5598fc575eabda/library/std/src/panicking.rs:493:5
   1: std::panicking::begin_panic_fmt
             at /rustc/e37f25aa3f356546ab851e394d5598fc575eabda/library/std/src/panicking.rs:435:5
   2: rustc_ast_lowering::LoweringContext::lower_res::{{closure}}::{{closure}}
   3: rustc_ast_lowering::LoweringContext::lower_node_id_generic
   4: rustc_ast_lowering::path::<impl rustc_ast_lowering::LoweringContext>::lower_path_segment
   5: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
   6: rustc_ast_lowering::path::<impl rustc_ast_lowering::LoweringContext>::lower_qpath
   7: rustc_ast_lowering::LoweringContext::lower_ty_direct
   8: rustc_ast_lowering::LoweringContext::lower_fn_decl
   9: rustc_ast_lowering::expr::<impl rustc_ast_lowering::LoweringContext>::lower_expr_closure
  10: rustc_data_structures::stack::ensure_sufficient_stack
  11: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
  12: <core::iter::adapters::flatten::Flatten<I> as core::iter::traits::iterator::Iterator>::next
  13: <smallvec::SmallVec<A> as core::iter::traits::collect::Extend<<A as smallvec::Array>::Item>>::extend
  14: rustc_arena::cold_path
  15: rustc_ast_lowering::item::<impl rustc_ast_lowering::LoweringContext>::lower_block_expr_opt
  16: rustc_ast_lowering::item::<impl rustc_ast_lowering::LoweringContext>::lower_fn_body_block
  17: rustc_ast_lowering::item::<impl rustc_ast_lowering::LoweringContext>::lower_item
  18: rustc_ast_lowering::LoweringContext::with_hir_id_owner
  19: <rustc_ast_lowering::item::ItemLowerer as rustc_ast::visit::Visitor>::visit_mod
  20: rustc_ast_lowering::lower_crate
  21: rustc_interface::passes::BoxedResolver::access::{{closure}}
  22: rustc_interface::passes::configure_and_expand::{{closure}}
  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: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

NOTE: The bug is found by our work-in-progress compiler testing tool Kira, and the test program is reduced/minimized by Perses

@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 Nov 29, 2020
@SNCPlay42
Copy link
Contributor

Doesn't ICE on stable or beta

@rustbot label: regression-from-stable-to-nightly

@rustbot rustbot added regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Nov 29, 2020
@jyn514 jyn514 added the E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc label Nov 29, 2020
@SNCPlay42
Copy link
Contributor

searched nightlies: from nightly-2020-11-25 to nightly-2020-11-29
regressed nightly: nightly-2020-11-27
searched commits: from b48cafd to 72da5a9
regressed commit: 0beba93

bisected with cargo-bisect-rustc v0.6.0

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --regress=ice --preserve 

Maybe #79362?

@camelid
Copy link
Member

camelid commented Nov 29, 2020

Assigning P-medium and removing I-prioritize as discussed in the prioritization working group.

@camelid camelid added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Nov 29, 2020
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Dec 12, 2020
@Mark-Simulacrum
Copy link
Member

@cjgillot - would you be up for fixing this bug or temporarily reverting PR #79362 presuming it is the cause?

@Mark-Simulacrum Mark-Simulacrum added regression-from-stable-to-stable Performance or correctness regression from one stable version to another. and removed regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. labels Jan 21, 2021
@camelid camelid removed the E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc label Jan 22, 2021
@bors bors closed this as completed in fcf1129 Jan 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants