Skip to content

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

Description

@chengniansun

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-genericsArea: const generics (parameters and arguments)C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions