Skip to content

thread 'rustc' panicked at 'LocalTableInContext: key not found' #82438

Closed

Description

Code

use std::error::Error;
struct A {
}

impl A {
    pub fn new() -> A {
        A {
        }
    }

    pub fn f<'a>(
        &'a self,
        team_name: &'a str,
        c: &'a mut dyn FnMut(String, String, u64, u64)
    ) -> Result<(), Box<dyn Error>> {
        Ok(())
    }
}


fn main() {
    let A = A::new();
    let participant_name = "A";

    let c = |a, b, c, d| {};

    A.f(participant_name, &mut c);
}

Meta

rustc --version --verbose:

rustc 1.52.0-nightly (07194ffcd 2021-02-10)
binary: rustc
commit-hash: 07194ffcd25b0871ce560b9f702e52db27ac9f77
commit-date: 2021-02-10
host: x86_64-pc-windows-msvc
release: 1.52.0-nightly
LLVM version: 11.0.1

Error output

thread 'rustc' panicked at 'LocalTableInContext: key not found', compiler\rustc_mir\src\borrow_check\diagnostics\mutability_errors.rs:515:30
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 (07194ffcd 2021-02-10) running on x86_64-pc-windows-msvc

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin

note: some of the compiler flags provided by cargo are hidden
Backtrace

thread 'rustc' panicked at 'LocalTableInContext: key not found', compiler\rustc_mir\src\borrow_check\diagnostics\mutability_errors.rs:515:30
stack backtrace:
   0:     0x7ffbe171896e - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h160322fcc0f12a19
   1:     0x7ffbe17447bb - core::fmt::write::ha3ea633b18d2da75
   2:     0x7ffbe170bc48 - <std::io::IoSliceMut as core::fmt::Debug>::fmt::h0112a934cd010a1c
   3:     0x7ffbe171cb3d - std::panicking::take_hook::h7c389d310fc84231
   4:     0x7ffbe171c609 - std::panicking::take_hook::h7c389d310fc84231
   5:     0x7ffbae422757 - rustc_driver::report_ice::hd4f773c8d782ddcc
   6:     0x7ffbe171d5a2 - std::panicking::rust_panic_with_hook::h13af0da83034d6f3
   7:     0x7ffbe171d091 - rust_begin_unwind
   8:     0x7ffbe17192ff - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h160322fcc0f12a19
   9:     0x7ffbe171cfe9 - rust_begin_unwind
  10:     0x7ffbe1740a70 - core::panicking::panic_fmt::h45da916c710b88f7
  11:     0x7ffbe1740662 - core::option::expect_failed::h10e986651fedbefa
  12:     0x7ffbb1672998 - <rustc_mir::borrow_check::constraint_generation::ConstraintGeneration as rustc_middle::mir::visit::Visitor>::visit_terminator::hab4a7aed9adbb356
  13:     0x7ffbb166e855 - <rustc_mir::borrow_check::constraint_generation::ConstraintGeneration as rustc_middle::mir::visit::Visitor>::visit_terminator::hab4a7aed9adbb356
  14:     0x7ffbb1681ddc - <rustc_mir::borrow_check::MirBorrowckCtxt as rustc_mir::dataflow::framework::visitor::ResultsVisitor>::visit_terminator_after_primary_effect::h9ae0111032217782
  15:     0x7ffbb1680488 - <rustc_mir::borrow_check::MirBorrowckCtxt as rustc_mir::dataflow::framework::visitor::ResultsVisitor>::visit_statement_before_primary_effect::h5a67661933df941f
  16:     0x7ffbb1458e57 - <rustc_mir::borrow_check::renumber::NllVisitor as rustc_middle::mir::visit::MutVisitor>::visit_const::heacffb162ebd9411
  17:     0x7ffbb1222c0b - <rustc_mir::borrow_check::type_check::TypeVerifier as rustc_middle::mir::visit::Visitor>::visit_body::heae462dc9bbc1737
  18:     0x7ffbb167afbe - rustc_mir::borrow_check::provide::hcca461ae48ff4737
  19:     0x7ffbb139938b - <rustc_mir::transform::early_otherwise_branch::OptimizationInfo as core::fmt::Debug>::fmt::h3378c483dc2fcfde
  20:     0x7ffbb167721b - rustc_mir::borrow_check::provide::hcca461ae48ff4737
  21:     0x7ffbae5b4bae - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h055d5881bebd66a2
  22:     0x7ffbae5f6e16 - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h055d5881bebd66a2
  23:     0x7ffbae572e00 - rustc_interface::util::commit_date_str::h2101977ea4670309
  24:     0x7ffbae5faa88 - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h055d5881bebd66a2
  25:     0x7ffbae5c94cf - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h055d5881bebd66a2
  26:     0x7ffbae5b9a17 - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h055d5881bebd66a2
  27:     0x7ffbae5c7409 - <rustc_interface::proc_macro_decls::Finder as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item::h055d5881bebd66a2
  28:     0x7ffbae6141cd - rustc_interface::passes::QueryContext::print_stats::hcf9482dcf489c697
  29:     0x7ffbae3cfd0b - <tracing_subscriber::util::TryInitError as core::fmt::Display>::fmt::ha43055df5546b109
  30:     0x7ffbae394466 - <rustc_lint::BuiltinCombinedModuleLateLintPass as rustc_lint::passes::LateLintPass>::check_impl_item_post::hc9cbccfc374f5770
  31:     0x7ffbae410c4d - <tracing_subscriber::util::TryInitError as core::fmt::Display>::fmt::ha43055df5546b109
  32:     0x7ffbae44be11 - <rustc_driver::args::Error as core::fmt::Debug>::fmt::h6e636cdd0f329a33
  33:     0x7ffbae3d4dff - <tracing_subscriber::util::TryInitError as core::fmt::Display>::fmt::ha43055df5546b109
  34:     0x7ffbae3d44cc - <tracing_subscriber::util::TryInitError as core::fmt::Display>::fmt::ha43055df5546b109
  35:     0x7ffbae42cafc - <rustc_driver::Compilation as core::fmt::Debug>::fmt::h565c544a3fcd0386
  36:     0x7ffbae396ff2 - <rustc_mir::shim::DropShimElaborator as rustc_mir::util::elaborate_drops::DropElaborator>::deref_subpath::ha4d2e420fbea5398
  37:     0x7ffbae4257ac - <rustc_driver::Compilation as core::fmt::Debug>::fmt::h565c544a3fcd0386
  38:     0x7ffbae3981f9 - <rustc_mir::shim::DropShimElaborator as rustc_mir::util::elaborate_drops::DropElaborator>::deref_subpath::ha4d2e420fbea5398
  39:     0x7ffbae442424 - <rustc_driver::args::Error as core::fmt::Debug>::fmt::h6e636cdd0f329a33
  40:     0x7ffbae44d1de - <rustc_driver::args::Error as core::fmt::Debug>::fmt::h6e636cdd0f329a33
  41:     0x7ffbae3cc8cd - <tracing_subscriber::util::TryInitError as core::fmt::Display>::fmt::ha43055df5546b109
  42:     0x7ffbe172cb8a - std::sys::windows::thread::Thread::new::hd38a560d738a063d
  43:     0x7ffc1f227034 - BaseThreadInitThunk
  44:     0x7ffc211fd241 - RtlUserThreadStart

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 (07194ffcd 2021-02-10) running on x86_64-pc-windows-msvc

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [mir_borrowck] borrow-checking `main`
#1 [analysis] running analysis passes on this crate
end of query stack
warning: 6 warnings emitted

error: could not compile `bug_example`

To learn more, run the command again with --verbose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

A-borrow-checkerArea: The borrow checkerA-diagnosticsArea: Messages for errors, warnings, and lintsC-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.glacierICE tracked in rust-lang/glacier.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions