Skip to content

ICE with NLL: 'assertion failed: identity_substs.is_empty()', librustc_mir/borrow_check/nll/universal_regions.rs:593:17 #47598

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

Closed
SimonSapin opened this issue Jan 19, 2018 · 4 comments

Comments

@SimonSapin
Copy link
Contributor

On servo/rust-mozjs@d829b21:

  • cargo +nightly-2018-01-19 build --features promises succeeds with a warning
  • Running again with RUST_BACKTRACE=1 RUSTFLAGS=-Znll produces the same warning, then a borrowck error followed by an ICE:
   Compiling mozjs v0.1.10 (file:///home/simon/projects/rust-mozjs)
warning: the type of this value must be known in this context
    --> src/rust.rs:1481:43
     |
1481 |             let string_handle = js_string.handle_mut();
     |                                           ^^^^^^^^^^
     |
     = note: #[warn(tyvar_behind_raw_pointer)] on by default
     = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
     = note: for more information, see issue #46906 <https://github.com/rust-lang/rust/issues/46906>

error[E0506]: cannot assign to `*self.stackTop` because it is borrowed
   --> src/rust.rs:524:9
    |
524 |         *self.stackTop = self;
    |         ^^^^^^^^^^^^^^^^^----
    |         |                |
    |         |                borrow of `*self.stackTop` occurs here
    |         assignment to borrowed `*self.stackTop` occurs here

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.25.0-nightly (3bd4af88b 2018-01-18) running on x86_64-unknown-linux-gnu

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

thread 'rustc' panicked at 'assertion failed: identity_substs.is_empty()', librustc_mir/borrow_check/nll/universal_regions.rs:593:17
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:68
             at libstd/sys_common/backtrace.rs:57
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:380
   3: std::panicking::default_hook
             at libstd/panicking.rs:390
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:576
   5: std::panicking::begin_panic
   6: rustc_mir::borrow_check::nll::universal_regions::UniversalRegions::new
   7: rustc::ty::context::tls::enter
   8: rustc::infer::InferCtxtBuilder::enter
   9: rustc_mir::borrow_check::mir_borrowck
  10: rustc::ty::maps::<impl rustc::ty::maps::queries::mir_borrowck<'tcx>>::compute_result
  11: rustc::dep_graph::graph::DepGraph::with_task_impl
  12: rustc_errors::Handler::track_diagnostics
  13: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
  14: rustc::ty::maps::<impl rustc::ty::maps::queries::mir_borrowck<'tcx>>::force
  15: rustc::ty::maps::<impl rustc::ty::maps::queries::mir_borrowck<'tcx>>::try_get
  16: rustc::ty::maps::TyCtxtAt::mir_borrowck
  17: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::mir_borrowck
  18: rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}::{{closure}}
  19: <std::thread::local::LocalKey<T>>::with
  20: <std::thread::local::LocalKey<T>>::with
  21: rustc::ty::context::TyCtxt::create_and_enter
  22: rustc_driver::driver::compile_input
  23: rustc_driver::run_compiler

error: Could not compile `mozjs`.
@aturon
Copy link
Member

aturon commented Jan 19, 2018

cc @rust-lang/wg-compiler-nll

@spastorino
Copy link
Member

I'm pretty sure this one is fixed by #47495

@nikomatsakis
Copy link
Contributor

Yep, this has a pending fix. Going to close (that PR is already p=1, though)

@SimonSapin
Copy link
Contributor Author

SimonSapin commented Jan 22, 2018

Confirmed that the ICE is fixed. The NLL-only borrowck error remains, I’ve added it back to #47596.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants