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

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

Closed
OmnipotentEntity opened this issue Nov 13, 2017 · 2 comments
Closed
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@OmnipotentEntity
Copy link

OmnipotentEntity commented Nov 13, 2017

   Compiling multigroup v0.1.0 (file:///home/omnipotententity/college/NRE4802/HW07/multigroup)
error: expected identifier, found `1.0`
   --> main.rs:470:39
    |
470 |     let mut criticality_history = Vec{1.0};
    |                                       ^^^

error[E0425]: cannot find function `max` in this scope
   --> main.rs:426:15
    |
426 |         res = max((*s1 / *s2 - 1.0).abs(), res);
    |               ^^^ not found in this scope
    |
help: possible candidate is found in another module, you can import it into scope
    |
11  | use std::cmp::max;
    |

error[E0618]: expected function, found `{float}`
   --> main.rs:398:57
    |
398 |         1.0 * (if l != 0.0 {1.0} else {0.0}) * (if r != 0.0(r != 0.0) {1.0} else {0.0});
    |                                                         ^^^^^^^^^^^^^

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/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.21.0 (3b72af97e 2017-10-09) running on x86_64-unknown-linux-gnu

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'LocalTableInContext: key not found', /checkout/src/libcore/option.rs:819:4
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:381
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:391
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:611
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:572
   6: std::panicking::begin_panic_fmt
             at /checkout/src/libstd/panicking.rs:522
   7: rust_begin_unwind
             at /checkout/src/libstd/panicking.rs:498
   8: core::panicking::panic_fmt
             at /checkout/src/libcore/panicking.rs:71
   9: core::option::expect_failed
             at /checkout/src/libcore/option.rs:819
  10: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  11: rustc::middle::expr_use_visitor::ExprUseVisitor::consume_expr
  12: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  13: rustc::middle::expr_use_visitor::ExprUseVisitor::consume_expr
  14: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  15: rustc::middle::expr_use_visitor::ExprUseVisitor::consume_expr
  16: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  17: rustc::middle::expr_use_visitor::ExprUseVisitor::consume_expr
  18: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  19: rustc::middle::expr_use_visitor::ExprUseVisitor::consume_expr
  20: rustc::middle::expr_use_visitor::ExprUseVisitor::consume_body
  21: <rustc_typeck::check::upvar::InferBorrowKindVisitor<'a, 'gcx, 'tcx> as rustc::hir::intravisit::Visitor<'gcx>>::visit_expr
  22: rustc::hir::intravisit::walk_block
  23: <rustc_typeck::check::upvar::InferBorrowKindVisitor<'a, 'gcx, 'tcx> as rustc::hir::intravisit::Visitor<'gcx>>::visit_expr
  24: rustc_typeck::check::typeck_tables_of::{{closure}}
  25: rustc_typeck::check::typeck_tables_of
  26: rustc::dep_graph::graph::DepGraph::with_task
  27: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::try_get
  28: rustc::ty::maps::TyCtxtAt::typeck_tables_of
  29: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_tables_of
  30: rustc_typeck::check::typeck_item_bodies
  31: rustc::dep_graph::graph::DepGraph::with_task
  32: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_item_bodies<'tcx>>::try_get
  33: rustc::ty::maps::TyCtxtAt::typeck_item_bodies
  34: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_item_bodies
  35: rustc_typeck::check_crate
  36: rustc::ty::context::TyCtxt::create_and_enter
  37: rustc_driver::driver::compile_input
  38: rustc_driver::run_compiler

error: Could not compile `multigroup`.

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

My code is about 500 lines long. I'm running up against an assignment deadline, so I don't have time right now to make a minimal demonstration. But if needed I can do so after Thursday, if someone hasn't gotten to it already.

Sorry to dump and run. I normally try to be better about bug reports. :/

I expect this to be related to my copy paste error with repeated if clause: (if r != 0.0(r != 0.0) {1.0} else {0.0});

EDIT: Removed code, as there is a minimal example below.

@OmnipotentEntity
Copy link
Author

Minimal example:

fn main() {
    let a = |r: f64| if r != 0.0(r != 0.0) {1.0} else {0.0};
}

Gives output:

error[E0618]: expected function, found `{float}`
 --> test.rs:2:30
  |
2 |     let a = |r: f64| if r != 0.0(r != 0.0) {1.0} else {0.0};
  |                              ^^^^^^^^^^^^^

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/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.21.0 (3b72af97e 2017-10-09) running on x86_64-unknown-linux-gnu

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'LocalTableInContext: key not found', /checkout/src/libcore/option.rs:819:4
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:381
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:391
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:611
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:572
   6: std::panicking::begin_panic_fmt
             at /checkout/src/libstd/panicking.rs:522
   7: rust_begin_unwind
             at /checkout/src/libstd/panicking.rs:498
   8: core::panicking::panic_fmt
             at /checkout/src/libcore/panicking.rs:71
   9: core::option::expect_failed
             at /checkout/src/libcore/option.rs:819
  10: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  11: rustc::middle::expr_use_visitor::ExprUseVisitor::consume_expr
  12: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  13: rustc::middle::expr_use_visitor::ExprUseVisitor::consume_expr
  14: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  15: rustc::middle::expr_use_visitor::ExprUseVisitor::consume_expr
  16: rustc::middle::expr_use_visitor::ExprUseVisitor::consume_body
  17: <rustc_typeck::check::upvar::InferBorrowKindVisitor<'a, 'gcx, 'tcx> as rustc::hir::intravisit::Visitor<'gcx>>::visit_expr
  18: rustc::hir::intravisit::walk_block
  19: <rustc_typeck::check::upvar::InferBorrowKindVisitor<'a, 'gcx, 'tcx> as rustc::hir::intravisit::Visitor<'gcx>>::visit_expr
  20: rustc_typeck::check::typeck_tables_of::{{closure}}
  21: rustc_typeck::check::typeck_tables_of
  22: rustc::dep_graph::graph::DepGraph::with_task
  23: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::try_get
  24: rustc::ty::maps::TyCtxtAt::typeck_tables_of
  25: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_tables_of
  26: rustc_typeck::check::typeck_item_bodies
  27: rustc::dep_graph::graph::DepGraph::with_task
  28: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_item_bodies<'tcx>>::try_get
  29: rustc::ty::maps::TyCtxtAt::typeck_item_bodies
  30: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_item_bodies
  31: rustc_typeck::check_crate
  32: rustc::ty::context::TyCtxt::create_and_enter
  33: rustc_driver::driver::compile_input
  34: rustc_driver::run_compiler

@TimNN TimNN added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Nov 14, 2017
@OmnipotentEntity
Copy link
Author

I like to check back in on my issues from time to time to ensure that they haven't become invalid.

I found that this issue still exists in the 2017/12/11 nightly (9fe7aa3).

topecongiro added a commit to topecongiro/rust that referenced this issue Dec 26, 2017
bors added a commit that referenced this issue Dec 27, 2017
Add tests to fixed ICEs

Closes #27078. Closes #27985. Closes #39848. Closes #42164.
Closes #42479. Closes #45662. Closes #45965. Closes #46152.
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) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants