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

Compiler crashes during borrow checking. #64610

Closed
RazrFalcon opened this issue Sep 19, 2019 · 3 comments
Closed

Compiler crashes during borrow checking. #64610

RazrFalcon opened this issue Sep 19, 2019 · 3 comments
Labels
A-associated-items Area: Associated items (types, constants & functions) A-borrow-checker Area: The borrow checker C-bug Category: This is a bug. 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

@RazrFalcon
Copy link

struct Data<'a> {
    data: [u8; Self::SIZE],
}

impl<'a> Data<'a> {
    const SIZE: usize = 12;
}
Compiling playground v0.0.1 (/playground)
error: internal compiler error: src/librustc_mir/borrow_check/nll/universal_regions.rs:741: cannot convert `ReEarlyBound(0, 'a)` to a region vid

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:643:9
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/git.luolix.top-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/git.luolix.top-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:76
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:60
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1030
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1412
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:64
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:196
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:210
  10: rustc_driver::report_ice
  11: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:477
  12: std::panicking::begin_panic
  13: rustc_errors::Handler::bug
  14: rustc::util::bug::opt_span_bug_fmt::{{closure}}
  15: rustc::ty::context::tls::with_opt::{{closure}}
  16: rustc::ty::context::tls::with_context_opt
  17: rustc::ty::context::tls::with_opt
  18: rustc::util::bug::opt_span_bug_fmt
  19: rustc::util::bug::bug_fmt
  20: rustc_mir::borrow_check::nll::universal_regions::UniversalRegionIndices::to_region_vid::{{closure}}
  21: rustc_mir::borrow_check::nll::type_check::constraint_conversion::ConstraintConversion::to_region_vid
  22: rustc_mir::borrow_check::nll::type_check::constraint_conversion::ConstraintConversion::convert_all
  23: rustc_mir::borrow_check::nll::type_check::TypeChecker::fully_perform_op
  24: rustc_mir::borrow_check::nll::type_check::type_check
  25: rustc_mir::borrow_check::nll::compute_regions
  26: rustc_mir::borrow_check::do_mir_borrowck
  27: rustc::ty::context::GlobalCtxt::enter_local
  28: rustc_mir::borrow_check::mir_borrowck
  29: rustc::ty::query::__query_compute::mir_borrowck
  30: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::mir_borrowck>::compute
  31: rustc::dep_graph::graph::DepGraph::with_task_impl
  32: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  33: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::ensure_query
  34: rustc_mir::transform::optimized_mir
  35: rustc::ty::query::__query_compute::optimized_mir
  36: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::optimized_mir>::compute
  37: rustc::dep_graph::graph::DepGraph::with_task_impl
  38: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  39: rustc_mir::interpret::eval_context::InterpCx<M>::load_mir
  40: rustc_mir::const_eval::const_eval_raw_provider
  41: rustc::ty::query::__query_compute::const_eval_raw
  42: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::const_eval_raw>::compute
  43: rustc::dep_graph::graph::DepGraph::with_task_impl
  44: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  45: rustc_mir::const_eval::const_eval_provider
  46: rustc::ty::query::__query_compute::const_eval
  47: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::const_eval>::compute
  48: rustc::dep_graph::graph::DepGraph::with_task_impl
  49: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  50: rustc_mir::const_eval::const_eval_provider
  51: rustc::ty::query::__query_compute::const_eval
  52: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::const_eval>::compute
  53: rustc::dep_graph::graph::DepGraph::with_task_impl
  54: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  55: rustc::ty::sty::Const::eval
  56: <rustc::traits::project::AssocTypeNormalizer as rustc::ty::fold::TypeFolder>::fold_ty
  57: rustc::traits::project::normalize
  58: rustc_typeck::check::FnCtxt::normalize_associated_types_in
  59: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
  60: rustc::ty::context::GlobalCtxt::enter_local
  61: rustc_typeck::check::wfcheck::check_item_well_formed
  62: rustc::ty::query::__query_compute::check_item_well_formed
  63: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::check_item_well_formed>::compute
  64: rustc::dep_graph::graph::DepGraph::with_task_impl
  65: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  66: <rustc_typeck::check::wfcheck::CheckTypeWellFormedVisitor as rustc::hir::itemlikevisit::ParItemLikeVisitor>::visit_item
  67: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:80
  68: rustc_data_structures::sync::par_for_each_in
  69: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:80
  70: rustc::hir::Crate::par_visit_all_item_likes
  71: rustc::util::common::time
  72: rustc_typeck::check_crate
  73: rustc_interface::passes::analysis
  74: rustc::ty::query::__query_compute::analysis
  75: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  76: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
  77: rustc_interface::passes::create_global_ctxt::{{closure}}
  78: rustc_interface::interface::run_compiler_in_existing_thread_pool
  79: std::thread::local::LocalKey<T>::with
  80: syntax::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.39.0-nightly (eceec57f7 2019-09-18) running on x86_64-unknown-linux-gnu

note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [mir_borrowck] processing `Data::data::{{constant}}#0`
#1 [optimized_mir] processing `Data::data::{{constant}}#0`
 --> src/lib.rs:2:16
  |
2 |     data: [u8; Self::SIZE],
  |                ^^^^^^^^^^
#2 [const_eval_raw] const-evaluating `Data::data::{{constant}}#0`
#3 [const_eval] const-evaluating + checking `Data::data::{{constant}}#0`
#4 [const_eval] const-evaluating + checking `Data::data::{{constant}}#0`
#5 [check_item_well_formed] processing `Data`
#6 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

error: Could not compile `playground`.

To learn more, run the command again with --verbose.

Crashes on stable and nightly.

@matthewjasper matthewjasper added A-associated-items Area: Associated items (types, constants & functions) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Sep 19, 2019
@srdhruv
Copy link

srdhruv commented Sep 19, 2019

Any mentor here. I would like to work on this one.
Can you guide me.

@jonas-schievink jonas-schievink added C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-borrow-checker Area: The borrow checker I-nominated labels Sep 19, 2019
@DutchGhost
Copy link
Contributor

This is a duplicate of #64173 and #56445

@Centril
Copy link
Contributor

Centril commented Sep 19, 2019

Closing as a dupe of ^---.

@Centril Centril closed this as completed Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-associated-items Area: Associated items (types, constants & functions) A-borrow-checker Area: The borrow checker C-bug Category: This is a bug. 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

6 participants