Skip to content

ICE: More than one activation introduced at the same location #49662

@Robbepop

Description

@Robbepop

The Rust compiler told me to file an issue here.

This seems to be a NLL or Borrow-Checker regression as this works on nightly-2018-04-03.

What happened: cargo test --verbose of my project with the new contents of:

enum ExprErrorKind {
	ExtractHiOverflow { hi: usize, expr: Extract },
	// some other variants here
}

impl fmt::Display for ExprError {
	fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
		use self::ExprErrorKind::*;
		match &self.kind {
			ExtractHiOverflow { .. } => write!(f, "dayum"),
			// some other cases here
		}
	}
}

Link to Extract struct used: click me!

Rust compiler output points to librustc_mir/dataflow/impls/borrows.rs:216:21

thread 'rustc' panicked at 'More than one activation introduced at the same location.', librustc_mir/dataflow/impls/borrows.rs:216:21
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:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:207
   3: std::panicking::default_hook
             at libstd/panicking.rs:223
   4: core::ops::function::Fn::call
   5: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:403
   6: std::panicking::begin_panic
   7: <rustc_mir::dataflow::impls::borrows::Borrows::new::GatherBorrows<'a, 'gcx, 'tcx> as rustc::mir::visit::Visitor<'tcx>>::visit_assign
   8: rustc_mir::dataflow::impls::borrows::Borrows::new
   9: rustc_mir::borrow_check::do_mir_borrowck
  10: <std::thread::local::LocalKey<T>>::with
  11: rustc::ty::context::GlobalCtxt::enter_local
  12: rustc_mir::borrow_check::mir_borrowck
  13: rustc::ty::maps::<impl rustc::ty::maps::queries::mir_borrowck<'tcx>>::compute_result
  14: rustc::dep_graph::graph::DepGraph::with_task_impl
  15: rustc_errors::Handler::track_diagnostics
  16: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
  17: rustc::ty::maps::<impl rustc::ty::maps::queries::mir_borrowck<'tcx>>::force
  18: rustc::ty::maps::<impl rustc::ty::maps::queries::mir_borrowck<'tcx>>::try_get
  19: rustc::ty::maps::TyCtxtAt::mir_borrowck
  20: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::mir_borrowck
  21: rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}::{{closure}}
  22: <std::thread::local::LocalKey<T>>::with
  23: <std::thread::local::LocalKey<T>>::with
  24: rustc::ty::context::TyCtxt::create_and_enter
  25: rustc_driver::driver::compile_input
  26: rustc_driver::run_compiler_impl
  27: syntax::with_globals

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.27.0-nightly (637ac17c5 2018-04-03) running on x86_64-unknown-linux-gnu
note: compiler flags: -C debuginfo=2 -C incremental
note: some of the compiler flags provided by cargo are hidden
error: Could not compile `stevia`.

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

Full RUST_BACKTRACE

   0:     0x7f3d1b99781b - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::haf21fb2d1a534f52
                               at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1:     0x7f3d1b965950 - std::sys_common::backtrace::print::h222ac106928ee2b8
                               at libstd/sys_common/backtrace.rs:71
                               at libstd/sys_common/backtrace.rs:59
   2:     0x7f3d1b98b25d - std::panicking::default_hook::{{closure}}::ha0ec7d04c7618490
                               at libstd/panicking.rs:207
   3:     0x7f3d1b98afbb - std::panicking::default_hook::h94862576a4900944
                               at libstd/panicking.rs:223
   4:     0x7f3d17fbd46d - core::ops::function::Fn::call::h7f5866913c0a5607
   5:     0x7f3d1b98b7a9 - std::panicking::rust_panic_with_hook::ha4fb1372609c4048
                               at libstd/panicking.rs:403
   6:     0x7f3d18b514a5 - std::panicking::begin_panic::h2b7788e9181b7095
   7:     0x7f3d18c7cd76 - <rustc_mir::dataflow::impls::borrows::Borrows::new::GatherBorrows<'a, 'gcx, 'tcx> as rustc::mir::visit::Visitor<'tcx>>::visit_assign::h35f9347a7832f8c4
   8:     0x7f3d18c7b650 - rustc_mir::dataflow::impls::borrows::Borrows::new::h9c0408c0400a81c9
   9:     0x7f3d18b2c7d1 - rustc_mir::borrow_check::do_mir_borrowck::h47e6140075bc43eb
  10:     0x7f3d18ab60c8 - <std::thread::local::LocalKey<T>>::with::h6f6a4179110e7243
  11:     0x7f3d18b90298 - rustc::ty::context::GlobalCtxt::enter_local::h6a5455630fef40da
  12:     0x7f3d18b2b6bc - rustc_mir::borrow_check::mir_borrowck::hebec48d216acf899
  13:     0x7f3d17ed643f - rustc::ty::maps::<impl rustc::ty::maps::queries::mir_borrowck<'tcx>>::compute_result::he167f10bbbb61ef0
  14:     0x7f3d17b5d500 - rustc::dep_graph::graph::DepGraph::with_task_impl::h26e8e7cd35f6e0c6
  15:     0x7f3d17bc48dc - rustc_errors::Handler::track_diagnostics::h0169b067a940efbb
  16:     0x7f3d17e248a7 - rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check::h5f78a4f3ed5ba6ff
  17:     0x7f3d17ed64d6 - rustc::ty::maps::<impl rustc::ty::maps::queries::mir_borrowck<'tcx>>::force::h7c21a818484f92e3
  18:     0x7f3d17ed6d70 - rustc::ty::maps::<impl rustc::ty::maps::queries::mir_borrowck<'tcx>>::try_get::h7511b02b472da79f
  19:     0x7f3d17e8504e - rustc::ty::maps::TyCtxtAt::mir_borrowck::h5cc03182edce72e1
  20:     0x7f3d17e817f8 - rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::mir_borrowck::h7fad85c586aefb83
  21:     0x7f3d1bd298e3 - rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}::{{closure}}::hc73ec1e4941c1f93
  22:     0x7f3d1bd9d65a - <std::thread::local::LocalKey<T>>::with::h4190da1571fbd5ee
  23:     0x7f3d1bda1256 - <std::thread::local::LocalKey<T>>::with::h8b90a925ea17281a
  24:     0x7f3d1be150ae - rustc::ty::context::TyCtxt::create_and_enter::hf44c69229c58e5c3
  25:     0x7f3d1bd0f217 - rustc_driver::driver::compile_input::h01406b737f8d9fb7
  26:     0x7f3d1bdc236f - rustc_driver::run_compiler_impl::h72592b1443483e40
  27:     0x7f3d1bd0c3c8 - syntax::with_globals::h861641f6eadc73c4
  28:     0x7f3d1bd2a4dd - std::sys_common::backtrace::__rust_begin_short_backtrace::hce542848eb39a647
  29:     0x7f3d1b9a5e7e - __rust_maybe_catch_panic
                               at libpanic_unwind/lib.rs:102
  30:     0x7f3d1bd3630d - <F as alloc::boxed::FnBox<A>>::call_box::h9ee6f2e4318cb3c5
  31:     0x7f3d1b99cf07 - std::sys_common::thread::start_thread::h4e87150995e528f2
                               at /checkout/src/liballoc/boxed.rs:794
                               at libstd/sys_common/thread.rs:24
  32:     0x7f3d1b96bf78 - std::sys::unix::thread::Thread::new::thread_start::h77e7f544c30e5001
                               at libstd/sys/unix/thread.rs:90
  33:     0x7f3d15d0e08b - start_thread
  34:     0x7f3d1b64ce7e - __GI___clone
  35:                0x0 - <unknown>

Caused by:

Caused by: (normalized paths)
  process didn't exit successfully: `rustc --crate-name stevia src/lib.rs --emit=dep-info,link -C debuginfo=2 --test -C metadata=881e46fe75c53b3a -C extra-filename=-881e46fe75c53b3a --out-dir src/stevia/target/debug/deps -C incremental=src/stevia/target/debug/incremental -L dependency=/src/stevia/target/debug/deps --extern vec_map=src/stevia/target/debug/deps/libvec_map-9f866549548d61ab.rlib --extern string_interner=src/stevia/target/debug/deps/libstring_interner-5cb7f2653f042239.rlib --extern smallvec=src/stevia/target/debug/deps/libsmallvec-2ac8459e26212a86.rlib --extern num=src/stevia/target/debug/deps/libnum-d6ba17589bd7fa8a.rlib --extern log=src/stevia/target/debug/deps/liblog-ffd9680ce992ac22.rlib --extern apint=src/stevia/target/debug/deps/libapint-c1a44822f4da5864.rlib --extern itertools=src/stevia/target/debug/deps/libitertools-55ed19e3ad349b48.rlib --extern unreachable=src/stevia/target/debug/deps/libunreachable-55873e15e2bf903b.rlib --extern either=src/stevia/target/debug/deps/libeither-b909279f6a7cb3fe.rlib --extern lazy_static=src/stevia/target/debug/deps/liblazy_static-7f08ac2d8dec98b9.rlib` (exit code: 101)

I can provide more information about the source code if necesary. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions