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 'compiler/rustc_resolve/src/late.rs:1780:18: unexpected resolution for an identifier in pattern: Def(ConstParam, DefId(0:4))', #85348

Closed
chengniansun opened this issue May 15, 2021 · 1 comment · Fixed by #85478
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@chengniansun
Copy link

Code

impl<const N: usize> ArrayWindowsExample {
    fn next() {
        let mut N;
    }
}

Meta

rustc --version --verbose:

rustc 1.54.0-nightly (1025db84a 2021-05-14)
binary: rustc
commit-hash: 1025db84a68b948139b5adcd55da31bce32da8f3
commit-date: 2021-05-14
host: x86_64-unknown-linux-gnu
release: 1.54.0-nightly
LLVM version: 12.0.1

Error output

thread 'rustc' panicked at 'compiler/rustc_resolve/src/late.rs:1780:18: unexpected resolution for an identifier in pattern: Def(ConstParam, DefId(0:4))', /rustc/1025db84a68b948139b5adcd55da31bce32da8f3/library/std/src/panic.rs:59:5
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.54.0-nightly (1025db84a 2021-05-14) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
Backtrace

thread 'rustc' panicked at 'compiler/rustc_resolve/src/late.rs:1780:18: unexpected resolution for an identifier in pattern: Def(ConstParam, DefId(0:4))', /rustc/1025db84a68b948139b5adcd55da31bce32da8f3/library/std/src/panic.rs:59:5
stack backtrace:
   0: std::panicking::begin_panic
   1: std::panic::panic_any
   2: rustc_middle::ty::context::tls::with_opt
   3: rustc_middle::util::bug::opt_span_bug_fmt
   4: rustc_middle::util::bug::span_bug_fmt
   5: rustc_resolve::late::LateResolutionVisitor::try_resolve_as_non_binding
   6: rustc_ast::ast::Pat::walk
   7: rustc_resolve::late::LateResolutionVisitor::resolve_pattern_top
   8: <rustc_resolve::late::LateResolutionVisitor as rustc_ast::visit::Visitor>::visit_block
   9: <rustc_resolve::late::LateResolutionVisitor as rustc_ast::visit::Visitor>::visit_fn
  10: rustc_ast::visit::walk_assoc_item
  11: rustc_resolve::late::LateResolutionVisitor::resolve_item
  12: rustc_ast::visit::walk_crate
  13: rustc_resolve::late::<impl rustc_resolve::Resolver>::late_resolve_crate
  14: rustc_session::utils::<impl rustc_session::session::Session>::time
  15: rustc_resolve::Resolver::resolve_crate
  16: rustc_interface::passes::configure_and_expand_inner
  17: rustc_interface::passes::configure_and_expand::{{closure}}
  18: rustc_data_structures::box_region::PinnedGenerator<I,A,R>::new
  19: rustc_interface::passes::configure_and_expand
  20: rustc_interface::queries::Queries::expansion
  21: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  22: rustc_span::with_source_map
  23: rustc_interface::interface::create_compiler_and_run
  24: scoped_tls::ScopedKey<T>::set
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.54.0-nightly (1025db84a 2021-05-14) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack

@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 May 15, 2021
@jonas-schievink jonas-schievink added A-const-generics Area: const generics (parameters and arguments) I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels May 15, 2021
@apiraino
Copy link
Contributor

Assigning priority as discussed in the Zulip thread of the Prioritization Working Group.

@rustbot label -I-prioritize +P-medium

@rustbot rustbot added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels May 19, 2021
@bors bors closed this as completed in 69c78a9 May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority 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