Skip to content

thread 'rustc' panicked at 'assertion failed: (left == right) (left: ..., right: ...)', ../src/librustc_borrowck/borrowck/mod.rs:453 #28150

Closed
@srijs

Description

@srijs

Trying to compile a project of mine via cargo run leads to an assertion failure in the borrow checker. The code I introduced that triggered it is in src/zipper.rs, function take beginning line 86. The code might be a bit nonsensical, since I was just fighting the borrow checker when this happened.

The branch I created to time-capsule the bug: https://github.com/srijs/rust-lambed/tree/snapshot/compilerbug

sreis :: Repositories/rust-lambed » rustc --version --verbose
rustc 1.2.0 (082e47636 2015-08-03)
binary: rustc
commit-hash: 082e4763615bdbe7b4dd3dfd6fc2210b7773edf5
commit-date: 2015-08-03
host: x86_64-apple-darwin
release: 1.2.0
sreis :: Repositories/rust-lambed » cargo --version
cargo 0.4.0-nightly (15b497b 2015-07-08) (built 2015-07-09)

Backtrace:

sreis :: Repositories/rust-lambed » RUST_BACKTRACE=1 cargo run --verbose
       Fresh libc v0.1.10
       Fresh fixpoint v0.2.0
       Fresh combine v1.0.0-beta.3
       Fresh bitflags v0.1.1
   Compiling lambed v0.1.0 (file:///Users/sreis/Repositories/rust-lambed)
     Running `rustc src/lib.rs --crate-name lambed --crate-type lib -g --out-dir /Users/sreis/Repositories/rust-lambed/target/debug --emit=dep-info,link -L dependency=/Users/sreis/Repositories/rust-lambed/target/debug -L dependency=/Users/sreis/Repositories/rust-lambed/target/debug/deps --extern copperline=/Users/sreis/Repositories/rust-lambed/target/debug/deps/libcopperline-0429f0fed0573d2f.rlib --extern fixpoint=/Users/sreis/Repositories/rust-lambed/target/debug/deps/libfixpoint-d3beaa72963e84b1.rlib --extern combine=/Users/sreis/Repositories/rust-lambed/target/debug/deps/libcombine-fdfed96f4d2e869f.rlib`
       Fresh nix v0.3.9
       Fresh copperline v0.1.2
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
thread 'rustc' panicked at 'assertion failed: `(left == right)` (left: `collections::string::String`, right: `Box<zipper::Ctx<T>>`)', ../src/librustc_borrowck/borrowck/mod.rs:453

stack backtrace:
   1:        0x111ba37b5 - sys::backtrace::write::hf5ea20500b66cd24uns
   2:        0x111bac013 - panicking::on_panic::hbe02cb0d925cad49iGw
   3:        0x111b67dd2 - rt::unwind::begin_unwind_inner::h12ba0ba9dffdecc2uow
   4:        0x111b68b29 - rt::unwind::begin_unwind_fmt::hadf0dbf11d345ebfAnw
   5:        0x10e93368e - borrowck::LoanPath<'tcx>::common::h38c8ca06e07ec084irf
   6:        0x10e93166d - borrowck::check_loans::CheckLoanCtxt<'a, 'tcx>::report_error_if_loan_conflicts_with_restriction::h9e6281b29cbce21azGa
   7:        0x10e9314fa - borrowck::check_loans::CheckLoanCtxt<'a, 'tcx>::report_error_if_loans_conflict::h9db6e8829e2a1ce8fEa
   8:        0x10e921250 - borrowck::check_loans::CheckLoanCtxt<'a, 'tcx>.euv..Delegate<'tcx>::borrow::hda5797bef3402e59Ria
   9:        0x10e928d2c - middle::mem_categorization::MemCategorizationContext<'t, TYPER>::cat_pattern_::h14467536489201103802
  10:        0x10e9295eb - middle::mem_categorization::MemCategorizationContext<'t, TYPER>::cat_pattern_::h14467536489201103802
  11:        0x10e92912a - middle::mem_categorization::MemCategorizationContext<'t, TYPER>::cat_pattern_::h14467536489201103802
  12:        0x10e9286e5 - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::walk_pat::h9458671995004733122
  13:        0x10e92d403 - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::walk_expr::h982213050074646850
  14:        0x10e9306a2 - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::consume_expr::h8840565628159227535
  15:        0x10e92d649 - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::walk_expr::h982213050074646850
  16:        0x10e9306a2 - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::consume_expr::h8840565628159227535
  17:        0x10e94ab45 - borrowck::borrowck_fn::h1de21a9e0166e8daEPe
  18:        0x10e94a1d9 - borrowck::BorrowckCtxt<'a, 'tcx>.Visitor<'v>::visit_fn::h93ef453410da10bc2Ge
  19:        0x10e94cb14 - visit::walk_impl_item::h15300236788859175913
  20:        0x10e94d7ca - visit::walk_item::h3483642570553201847
  21:        0x10e94d40a - visit::walk_item::h3483642570553201847
  22:        0x10e94cc68 - borrowck::check_crate::h138dee6ce4dd468bHJe
  23:        0x10e4978a1 - driver::phase_3_run_analysis_passes::closure.15766
  24:        0x10e494204 - middle::ty::with_ctxt::h14728011725879770170
  25:        0x10e48f00a - driver::phase_3_run_analysis_passes::h16713467199444562124
  26:        0x10e472107 - driver::compile_input::hb6d2be5b0fa2247fTba
  27:        0x10e54e13f - run_compiler::h21d74b88eec3fe3bx7b
  28:        0x10e54b9f3 - boxed::F.FnBox<A>::call_box::h1689969825914258414
  29:        0x10e54b1b7 - rt::unwind::try::try_fn::h11273853850686318048
  30:        0x111c36cc8 - rust_try_inner
  31:        0x111c36cb5 - rust_try
  32:        0x111b95c95 - rt::unwind::try::inner_try::h480e3107f6a4b5b9nkw
  33:        0x10e54b3e8 - boxed::F.FnBox<A>::call_box::h888215220722514405
  34:        0x111baaa9d - sys::thread::Thread::new::thread_start::hdb3d925f69c5da4aHIv
  35:     0x7fff91365898 - _pthread_body
  36:     0x7fff91365729 - _pthread_start

Could not compile `lambed`.

Caused by:
  Process didn't exit successfully: `rustc src/lib.rs --crate-name lambed --crate-type lib -g --out-dir /Users/sreis/Repositories/rust-lambed/target/debug --emit=dep-info,link -L dependency=/Users/sreis/Repositories/rust-lambed/target/debug -L dependency=/Users/sreis/Repositories/rust-lambed/target/debug/deps --extern copperline=/Users/sreis/Repositories/rust-lambed/target/debug/deps/libcopperline-0429f0fed0573d2f.rlib --extern fixpoint=/Users/sreis/Repositories/rust-lambed/target/debug/deps/libfixpoint-d3beaa72963e84b1.rlib --extern combine=/Users/sreis/Repositories/rust-lambed/target/debug/deps/libcombine-fdfed96f4d2e869f.rlib` (exit code: 101)

Metadata

Metadata

Assignees

No one assigned

    Labels

    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