Skip to content

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

Closed
@OmnipotentEntity

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions