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

polonius liveness facts not implemented yet #54212

Closed
bhuztez opened this issue Sep 14, 2018 · 1 comment
Closed

polonius liveness facts not implemented yet #54212

bhuztez opened this issue Sep 14, 2018 · 1 comment
Labels
A-NLL Area: Non-lexical lifetimes (NLL) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@bhuztez
Copy link

bhuztez commented Sep 14, 2018

when compiling unicode-xid v0.1.0 with rustc 1.30.0-nightly (7061b2775 2018-08-28) and compiler flags: -Z external-macro-backtrace -Z borrowck=mir -Z polonius, the compiler panicked.

error: internal compiler error: librustc_mir/borrow_check/nll/type_check/liveness/trace.rs:531: polonius liveness facts not implemented yet

thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:587:9
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:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:481
   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::ty::fold::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::any_free_region_meets::RegionVisitor<F> as rustc::ty::fold::TypeVisitor<'tcx>>::visit_region
  15: rustc::ty::structural_impls::<impl rustc::ty::fold::TypeFoldable<'tcx> for &'tcx rustc::ty::TyS<'tcx>>::super_visit_with
  16: rustc_mir::borrow_check::nll::type_check::liveness::generate
  17: rustc_mir::borrow_check::nll::type_check::type_check
  18: rustc_mir::borrow_check::nll::compute_regions
  19: rustc_mir::borrow_check::do_mir_borrowck
  20: rustc::ty::context::GlobalCtxt::enter_local
  21: rustc_mir::borrow_check::mir_borrowck
  22: rustc::ty::query::__query_compute::mir_borrowck
  23: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::mir_borrowck<'tcx>>::compute
  24: rustc::dep_graph::graph::DepGraph::with_task_impl
  25: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start
  26: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  27: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  28: rustc::ty::query::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::mir_borrowck
  29: rustc::ty::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::par_body_owners
  30: rustc::util::common::time
  31: rustc::ty::context::tls::enter_context
  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
             at libpanic_unwind/lib.rs:103
  40: rustc_driver::run
  41: rustc_driver::main
  42: std::rt::lang_start::{{closure}}
  43: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  44: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:103
  45: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:392
             at libstd/rt.rs:58
  46: main
  47: __libc_start_main
  48: <unknown>
query stack during panic:
#0 [mir_borrowck] processing `tables::bsearch_range_table`
end of query stack
error: aborting due to previous error
@estebank estebank added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Sep 14, 2018
@csmoe csmoe added the A-NLL Area: Non-lexical lifetimes (NLL) label Sep 14, 2018
@robsmith11
Copy link

Same issue compiling this crate:
https://github.com/robsmith11/krust

bors added a commit that referenced this issue Sep 27, 2018
[NLL] Get Polonius borrow check to work in simple cases

* Restores the generation of outlives facts from subtyping.
* Restore liveness facts.
* Generate invalidates facts at the start point of each location,
  where we check for errors.
* Add a small test for simple cases (previously these cases have compiled, and more recently ICEd).

Closes #54212
cc #53142 (will need test)

### Known limitations

* Two phase borrows aren't implemented for Polonius yet
* Invalidation facts haven't been updated for some of the recent changes to make `Drop` terminators access fewer things.
* Fact generation is not as optimized as it could be.
* Around 30 tests fail in compare mode, often tests that are ignored in nll compare mode

r? @nikomatsakis
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) ❄️
Projects
None yet
Development

No branches or pull requests

5 participants