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

'rustc' panicked at 'LocalTableInContext: key not found' #82526

Closed
evan-brass opened this issue Feb 25, 2021 · 4 comments
Closed

'rustc' panicked at 'LocalTableInContext: key not found' #82526

evan-brass opened this issue Feb 25, 2021 · 4 comments
Assignees
Labels
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.

Comments

@evan-brass
Copy link

evan-brass commented Feb 25, 2021

Code

fn main() {
    let inner;
    let outer = || {
        inner = || {};
        inner();
    };
    outer();
}

Meta

rustc --version --verbose:

rustc 1.52.0-nightly (a15f484b9 2021-02-22)
binary: rustc
commit-hash: a15f484b918a4533ad633ea903ccce82910af342
commit-date: 2021-02-22
host: x86_64-unknown-linux-gnu
release: 1.52.0-nightly
LLVM version: 11.0.1

Doesn't panic in Stable.

Error output

thread 'rustc' panicked at 'LocalTableInContext: key not found', compiler/rustc_mir/src/borrow_check/diagnostics/mutability_errors.rs:516: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 (a15f484b9 2021-02-22) running on x86_64-unknown-linux-gnu

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::{closure#0}`
#1 [mir_borrowck] borrow-checking `main`
end of query stack
error: could not compile `rs-min`

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

   Compiling rs-min v0.1.0 (/home/evan/Code/Repos/rs-min)
thread 'rustc' panicked at 'LocalTableInContext: key not found', compiler/rustc_mir/src/borrow_check/diagnostics/mutability_errors.rs:516:30
stack backtrace:
   0: rust_begin_unwind
             at /rustc/a15f484b918a4533ad633ea903ccce82910af342/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/a15f484b918a4533ad633ea903ccce82910af342/library/core/src/panicking.rs:92:14
   2: core::option::expect_failed
             at /rustc/a15f484b918a4533ad633ea903ccce82910af342/library/core/src/option.rs:1292:5
   3: <rustc_middle::ty::context::LocalTableInContext<V> as core::ops::index::Index<rustc_hir::hir_id::HirId>>::index
   4: rustc_mir::borrow_check::diagnostics::mutability_errors::<impl rustc_mir::borrow_check::MirBorrowckCtxt>::show_mutating_upvar
   5: rustc_mir::borrow_check::diagnostics::mutability_errors::<impl rustc_mir::borrow_check::MirBorrowckCtxt>::report_mutability_error
   6: rustc_mir::borrow_check::MirBorrowckCtxt::access_place
   7: rustc_mir::borrow_check::MirBorrowckCtxt::mutate_place
   8: <rustc_mir::borrow_check::MirBorrowckCtxt as rustc_mir::dataflow::framework::visitor::ResultsVisitor>::visit_statement_before_primary_effect
   9: <rustc_mir::dataflow::framework::direction::Forward as rustc_mir::dataflow::framework::direction::Direction>::visit_results_in_block
  10: rustc_mir::dataflow::framework::visitor::visit_results
  11: rustc_mir::borrow_check::do_mir_borrowck
  12: rustc_infer::infer::InferCtxtBuilder::enter
  13: rustc_mir::borrow_check::mir_borrowck
  14: core::ops::function::FnOnce::call_once
  15: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  16: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  17: rustc_data_structures::stack::ensure_sufficient_stack
  18: rustc_query_system::query::plumbing::force_query_with_job
  19: rustc_query_system::query::plumbing::get_query_impl
  20: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck
  21: rustc_mir::borrow_check::type_check::TypeChecker::check_rvalue
  22: rustc_mir::borrow_check::type_check::TypeChecker::typeck_mir
  23: rustc_mir::borrow_check::type_check::type_check
  24: rustc_mir::borrow_check::nll::compute_regions
  25: rustc_mir::borrow_check::do_mir_borrowck
  26: rustc_infer::infer::InferCtxtBuilder::enter
  27: rustc_mir::borrow_check::mir_borrowck
  28: core::ops::function::FnOnce::call_once
  29: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  30: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  31: rustc_data_structures::stack::ensure_sufficient_stack
  32: rustc_query_system::query::plumbing::force_query_with_job
  33: rustc_query_system::query::plumbing::get_query_impl
  34: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck
  35: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::par_body_owners
  36: rustc_interface::passes::analysis
  37: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  38: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  39: rustc_data_structures::stack::ensure_sufficient_stack
  40: rustc_query_system::query::plumbing::force_query_with_job
  41: rustc_query_system::query::plumbing::get_query_impl
  42: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  43: rustc_interface::passes::QueryContext::enter
  44: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  45: rustc_span::with_source_map
  46: rustc_interface::interface::create_compiler_and_run
  47: 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.52.0-nightly (a15f484b9 2021-02-22) running on x86_64-unknown-linux-gnu

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::{closure#0}`
#1 [mir_borrowck] borrow-checking `main`
#2 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `rs-min`

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

Maybe duplicate of #82438?

@evan-brass evan-brass 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 Feb 25, 2021
@Aaron1011 Aaron1011 self-assigned this Feb 25, 2021
@Aaron1011
Copy link
Member

This is indeed a duplicate of #82438

fanninpm added a commit to fanninpm/glacier that referenced this issue Feb 26, 2021
This is actually rust-lang/rust#82526, a minimized duplicate of 82438.

Issue: rust-lang/rust#82438
@fanninpm
Copy link

@Aaron1011 is this issue safe to close, since its duplicate is also closed?

@evan-brass
Copy link
Author

@Aaron1011
Copy link
Member

#82438 was closed with a regression test, so I'm closing this issue as well.

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. 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

No branches or pull requests

3 participants