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 panics during build with cannot convert ReScope(Destruction(847)) to a region vid #61090

Closed
nemosupremo opened this issue May 23, 2019 · 4 comments
Labels
A-NLL Area: Non-lexical lifetimes (NLL) 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

@nemosupremo
Copy link

I was trying to compile my application - and unfortunately I've made a large number of changes between the last time I could get it to build so figuring out that is going on will be tough (I'm also newer with Rust). I'll take a look at #51351 and see if I have any similar constructs in my program

I am simply running this command:

RUST_BACKTRACE=1 cargo build

Meta

rustc --version --verbose:

rustc 1.34.2 (6c2484dc3 2019-05-13)
binary: rustc
commit-hash: 6c2484dc3c532c052f159264e970278d8b77cdc9
commit-date: 2019-05-13
host: x86_64-apple-darwin
release: 1.34.2
LLVM version: 8.0

Backtrace:

error: internal compiler error: src/librustc_mir/borrow_check/nll/universal_regions.rs:745: cannot convert `ReScope(Destruction(847))` to a region vid

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:620:9
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::_print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::begin_panic
   7: rustc_errors::Handler::bug
   8: rustc::util::bug::opt_span_bug_fmt::{{closure}}
   9: rustc::ty::context::tls::with_opt::{{closure}}
  10: rustc::ty::context::tls::with_context_opt
  11: rustc::ty::context::tls::with_opt
  12: rustc::util::bug::opt_span_bug_fmt
  13: rustc::util::bug::bug_fmt
  14: rustc_mir::borrow_check::nll::universal_regions::UniversalRegionIndices::to_region_vid::{{closure}}
  15: rustc_mir::borrow_check::nll::universal_regions::UniversalRegionIndices::to_region_vid
  16: rustc_mir::borrow_check::nll::type_check::constraint_conversion::ConstraintConversion::convert_all
  17: rustc_mir::borrow_check::nll::type_check::TypeChecker::prove_predicate
  18: rustc_mir::borrow_check::nll::type_check::TypeChecker::normalize_and_prove_instantiated_predicates
  19: <rustc_mir::borrow_check::nll::type_check::TypeVerifier<'a, 'b, 'gcx, 'tcx> as rustc::mir::visit::Visitor<'tcx>>::visit_constant
  20: <rustc_mir::borrow_check::nll::type_check::TypeVerifier<'a, 'b, 'gcx, 'tcx> as rustc::mir::visit::Visitor<'tcx>>::visit_mir
  21: rustc_mir::borrow_check::nll::type_check::type_check
  22: rustc_mir::borrow_check::nll::compute_regions
  23: rustc_mir::borrow_check::do_mir_borrowck
  24: rustc::ty::context::GlobalCtxt::enter_local
  25: rustc_mir::borrow_check::mir_borrowck
  26: rustc::ty::query::__query_compute::mir_borrowck
  27: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::mir_borrowck<'tcx>>::compute
  28: rustc::dep_graph::graph::DepGraph::with_task_impl
  29: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  30: rustc::ty::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::par_body_owners
  31: rustc::util::common::time
  32: <std::thread::local::LocalKey<T>>::with
  33: rustc::ty::context::TyCtxt::create_and_enter
  34: rustc_driver::driver::compile_input
  35: rustc_driver::run_compiler_with_pool
  36: <scoped_tls::ScopedKey<T>>::set
  37: rustc_driver::run_compiler
  38: syntax::with_globals
  39: __rust_maybe_catch_panic
  40: <F as alloc::boxed::FnBox<A>>::call_box
  41: std::sys::unix::thread::Thread::new::thread_start
  42: _pthread_body
  43: _pthread_start
query stack during panic:
#0 [mir_borrowck] processing `run`
end of query stack
error: aborting due to previous error
@Centril Centril added A-NLL Area: Non-lexical lifetimes (NLL) 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. I-nominated labels May 23, 2019
@Centril
Copy link
Contributor

Centril commented May 23, 2019

cc @matthewjasper @pnkfelix

@matthewjasper
Copy link
Contributor

Does this still fail on nightly/beta? (1.36.0)

@nemosupremo
Copy link
Author

I apologize - I don't think this report is very useful. I should have tested nightly first. What ended up happening is I decided to comment out modules, one by one in my code base to see if I could isolate the piece of code that was causing this error. Once I commented out the first module, I began getting borrow check errors in another separate module preventing my from compiling the program (basic stuff like using the reference in two separate closures). Once I fixed the problem module, my program compiled. I then thought the error was in the first module I commented it, but to make sure I uncommented out the module and now my program compiles :(. I neglected to save the code base which caused this error and I can't seem to Ctrl+Z enough to reproduce it.

@matthewjasper
Copy link
Contributor

Closing as inactionable.
@nemosupremo please open a new issue of you run into this again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-NLL Area: Non-lexical lifetimes (NLL) 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