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: 'expected NodeId to be lowered already for res Local #82866

Closed
chengniansun opened this issue Mar 7, 2021 · 2 comments · Fixed by #95752
Closed

ICE: 'expected NodeId to be lowered already for res Local #82866

chengniansun opened this issue Mar 7, 2021 · 2 comments · Fixed by #95752
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. glacier ICE tracked in rust-lang/glacier. 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 () {
  match x {
    Some :: <v<>>(v)  => ()
  }
}

Meta

rustc --version --verbose:

rustc 1.52.0-nightly (51748a8fc 2021-03-05)
binary: rustc
commit-hash: 51748a8fc77283914d4135f31b5966a407208187
commit-date: 2021-03-05
host: x86_64-unknown-linux-gnu
release: 1.52.0-nightly
LLVM version: 12.0.0

Error output

error[E0425]: cannot find value `x` in this scope
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:9
  |
2 |   match x {
  |         ^ not found in this scope

error[E0573]: expected type, found local variable `v`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:3:14
  |
3 |     Some :: <v<>>(v)  => ()
  |              ^^^ not a type

thread 'rustc' panicked at 'expected `NodeId` to be lowered already for res Local(
    NodeId(20),
)', compiler/rustc_ast_lowering/src/lib.rs:715: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.52.0-nightly (51748a8fc 2021-03-05) running on x86_64-unknown-linux-gnu

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

Some errors have detailed explanations: E0425, E0573.
For more information about an error, try `rustc --explain E0425`.
Backtrace

error[E0425]: cannot find value `x` in this scope
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:9
  |
2 |   match x {
  |         ^ not found in this scope

error[E0573]: expected type, found local variable `v`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:3:14
  |
3 |     Some :: <v<>>(v)  => ()
  |              ^^^ not a type

thread 'rustc' panicked at 'expected `NodeId` to be lowered already for res Local(
    NodeId(20),
)', compiler/rustc_ast_lowering/src/lib.rs:715:17
stack backtrace:
   0: rust_begin_unwind
             at /rustc/51748a8fc77283914d4135f31b5966a407208187/library/std/src/panicking.rs:493:5
   1: std::panicking::begin_panic_fmt
             at /rustc/51748a8fc77283914d4135f31b5966a407208187/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_generic_arg
   8: <smallvec::SmallVec<A> as core::iter::traits::collect::Extend<<A as smallvec::Array>::Item>>::extend
   9: rustc_ast_lowering::path::<impl rustc_ast_lowering::LoweringContext>::lower_angle_bracketed_parameter_data
  10: rustc_ast_lowering::path::<impl rustc_ast_lowering::LoweringContext>::lower_path_segment
  11: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
  12: rustc_ast_lowering::path::<impl rustc_ast_lowering::LoweringContext>::lower_qpath
  13: rustc_ast_lowering::pat::<impl rustc_ast_lowering::LoweringContext>::lower_pat::{{closure}}
  14: rustc_ast_lowering::expr::<impl rustc_ast_lowering::LoweringContext>::lower_arm
  15: rustc_ast_lowering::Arena::alloc_from_iter
  16: rustc_ast_lowering::expr::<impl rustc_ast_lowering::LoweringContext>::lower_expr_mut::{{closure}}
  17: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
  18: <core::iter::adapters::flatten::Flatten<I> as core::iter::traits::iterator::Iterator>::next
  19: <smallvec::SmallVec<A> as core::iter::traits::collect::Extend<<A as smallvec::Array>::Item>>::extend
  20: rustc_arena::cold_path
  21: rustc_ast_lowering::item::<impl rustc_ast_lowering::LoweringContext>::lower_fn_body_block
  22: rustc_ast_lowering::item::<impl rustc_ast_lowering::LoweringContext>::lower_item
  23: rustc_ast_lowering::LoweringContext::with_hir_id_owner
  24: rustc_ast_lowering::lower_crate
  25: rustc_interface::passes::BoxedResolver::access::{{closure}}
  26: rustc_interface::passes::configure_and_expand::{{closure}}
  27: rustc_interface::passes::BoxedResolver::access
  28: rustc_interface::queries::Queries::lower_to_hir
  29: rustc_interface::queries::Queries::global_ctxt
  30: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  31: rustc_span::with_source_map
  32: rustc_interface::interface::create_compiler_and_run
  33: 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.52.0-nightly (51748a8fc 2021-03-05) running on x86_64-unknown-linux-gnu

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

Some errors have detailed explanations: E0425, E0573.
For more information about an error, try `rustc --explain E0425`.

@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 Mar 7, 2021
@jyn514
Copy link
Member

jyn514 commented Mar 7, 2021

Slightly smaller (x being undeclared doesn't matter):

fn main () {
  match None {
    Some :: <v<>>(v)  => (),
    None => (),
  }
}

@jyn514 jyn514 added the A-frontend Area: Compiler frontend (errors, parsing and HIR) label Mar 7, 2021
fanninpm added a commit to fanninpm/glacier that referenced this issue Mar 12, 2021
Running rustfmt on this example causes the ICE to go away. Specifically,
the turbofish in line 3 needs to contain 'v<>' instead of just 'v'.

Issue: rust-lang/rust#82866
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Mar 12, 2021
@Alexendoo
Copy link
Member

Fixed by #92237

@Alexendoo Alexendoo added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Dec 30, 2021
compiler-errors added a commit to compiler-errors/rust that referenced this issue Apr 7, 2022
bors added a commit to rust-lang-ci/rust that referenced this issue Apr 7, 2022
Rollup of 4 pull requests

Successful merges:

 - rust-lang#95189 (Stop flagging unexpected inner attributes as outer ones in certain diagnostics)
 - rust-lang#95752 (Regression test for rust-lang#82866)
 - rust-lang#95753 (Correct safety reasoning in `str::make_ascii_{lower,upper}case()`)
 - rust-lang#95757 (Use gender neutral terms)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors closed this as completed in 870ab12 Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. glacier ICE tracked in rust-lang/glacier. 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

Successfully merging a pull request may close this issue.

4 participants