Skip to content

rustc panic when trying to unwrap DistinctSources #63800

Closed
@software-opal

Description

@software-opal

When trying to compile the tests for my code I get this error:

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: DistinctSources(DistinctSources { begin: (Real("tests/macros.rs"), BytePos(2369)), end: (Macros("::archivelib::support::debug::check_rust_against_sys_decompress"), BytePos(8771655)) })', src/libcore/result.rs:999:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

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.37.0 (eae3437df 2019-08-13) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C incremental -C link-arg=-fuse-ld=gold -C opt-level=0

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

error: Could not compile `archivelib`.
`RUST_BACKTRACE=full cargo test`
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: DistinctSources(DistinctSources { begin: (Real("tests/macros.rs"), BytePos(2369)), end: (Macros("::archivelib::support::debug::check_rust_against_sys_decompress"), BytePos(8771655)) })', src/libcore/result.rs:999:5
stack backtrace:
   0:     0x7f2a2283636b - backtrace::backtrace::libunwind::trace::hfe5db90796807973                                                                                                                                                                                                                           at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/libunwind.rs:88
   1:     0x7f2a2283636b - backtrace::backtrace::trace_unsynchronized::h34b865a835594335
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/mod.rs:66
   2:     0x7f2a2283636b - std::sys_common::backtrace::_print::h527254ae44989167
                               at src/libstd/sys_common/backtrace.rs:47
   3:     0x7f2a2283636b - std::sys_common::backtrace::print::he85dd5ddddf46503
                               at src/libstd/sys_common/backtrace.rs:36
   4:     0x7f2a2283636b - std::panicking::default_hook::{{closure}}::h847a2eb38b396f14
                               at src/libstd/panicking.rs:200
   5:     0x7f2a22836047 - std::panicking::default_hook::h2ca0f9a30a0e206b
                               at src/libstd/panicking.rs:214
   6:     0x7f2a1fd83211 - rustc::util::common::panic_hook::hd4598aac709d8bd1
   7:     0x7f2a22836bc9 - std::panicking::rust_panic_with_hook::hffcefc09751839d1
                               at src/libstd/panicking.rs:481
   8:     0x7f2a22836662 - std::panicking::continue_panic_fmt::hc0f142c930c846fc
                               at src/libstd/panicking.rs:384
   9:     0x7f2a22836546 - rust_begin_unwind
                               at src/libstd/panicking.rs:311
  10:     0x7f2a22863dcd - core::panicking::panic_fmt::h2daf88b2616ca2b2
                               at src/libcore/panicking.rs:85
  11:     0x7f2a2139a5de - core::result::unwrap_failed::h6fc0053c9f46fa1a
  12:     0x7f2a2114a6d9 - rustc_mir::borrow_check::move_errors::<impl rustc_mir::borrow_check::MirBorrowckCtxt>::report::hf8f36da850a20b7c
  13:     0x7f2a21154cd8 - rustc_mir::borrow_check::do_mir_borrowck::hb7a693a299dea277
  14:     0x7f2a20ff89dd - rustc::ty::context::GlobalCtxt::enter_local::h07eff323eb978daa
  15:     0x7f2a2115332a - rustc_mir::borrow_check::mir_borrowck::h284fb7de9a37bcfa
  16:     0x7f2a21a772c7 - rustc::ty::query::__query_compute::mir_borrowck::hff15ac0e1f9f6137
  17:     0x7f2a21a87e35 - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::mir_borrowck>::compute::hee288ed314d409e6
  18:     0x7f2a21abcb60 - rustc::dep_graph::graph::DepGraph::with_task_impl::hf31f0af6331d7b71
  19:     0x7f2a21aa4f7a - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query::hee29daf6559cca17
  20:     0x7f2a21a87cb3 - rustc::ty::<impl rustc::ty::context::TyCtxt>::par_body_owners::hcfdff9dc5dadc257
  21:     0x7f2a21a4548e - rustc::util::common::time::hac94dadf7399ba87
  22:     0x7f2a21a001d2 - rustc_interface::passes::analysis::h39d33eb2a40812a3
  23:     0x7f2a22afa246 - rustc::ty::query::__query_compute::analysis::hf896d9719452bef1
  24:     0x7f2a22af9f99 - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::analysis>::compute::h314df7d2740153f0
  25:     0x7f2a22b8f138 - rustc::dep_graph::graph::DepGraph::with_task_impl::h5bfe7e398dba7700
  26:     0x7f2a22aff3be - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query::hf803a152be45b4ee
  27:     0x7f2a22b00da6 - rustc::ty::context::tls::enter_global::h7f57e6c49574182e
  28:     0x7f2a22b052f7 - rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}::h04fd22292950fbf4
  29:     0x7f2a21a4843a - rustc_interface::passes::create_global_ctxt::{{closure}}::h70f679c0b82043da
  30:     0x7f2a22b065f8 - rustc_interface::interface::run_compiler_in_existing_thread_pool::h1ee6f3bf0ba37faf
  31:     0x7f2a22b28d42 - std::thread::local::LocalKey<T>::with::h83b0a2026f4a2c6e
  32:     0x7f2a22b3c891 - scoped_tls::ScopedKey<T>::set::h47171c9859321621
  33:     0x7f2a22b548b4 - syntax::with_globals::h7dd1a1171ce8a4bf
  34:     0x7f2a22b7fb1d - std::sys_common::backtrace::__rust_begin_short_backtrace::h1ed9f0eaa05c0996
  35:     0x7f2a2284748a - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:82
  36:     0x7f2a22b08cc9 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h3b9a37e8ad92df6e
  37:     0x7f2a22819e0f - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h42806b83647d4c79
                               at /rustc/eae3437dfe991621e8afdc82734f4a172d7ddf9b/src/liballoc/boxed.rs:746
  38:     0x7f2a22846170 - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h83c921c8e826dd1d
                               at /rustc/eae3437dfe991621e8afdc82734f4a172d7ddf9b/src/liballoc/boxed.rs:746
  39:     0x7f2a22846170 - std::sys_common::thread::start_thread::h2613204ce513782e
                               at src/libstd/sys_common/thread.rs:13
  40:     0x7f2a22846170 - std::sys::unix::thread::Thread::new::thread_start::h4570080769500bcd
                               at src/libstd/sys/unix/thread.rs:79
  41:     0x7f2a225a76db - start_thread
  42:     0x7f2a21ea188f - __clone
  43:                0x0 - <unknown>
query stack during panic:
#0 [mir_borrowck] processing `short_sample::test_decompress_level_0`                                                                                                                                                                                                            #1 [analysis] running analysis passes on this crate                                                                                                                                                                                                                             end of query stack
                                                                                                                                                                                                                                                                                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.37.0 (eae3437df 2019-08-13) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C incremental -C link-arg=-fuse-ld=gold -C opt-level=0

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

error: Could not compile `archivelib`.                      

My understanding is that the compiler was trying to tell me about a borrow checker error; but I have no idea where to start minimizing this error(sorry).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-NLLArea: Non-lexical lifetimes (NLL)A-borrow-checkerArea: The borrow checkerA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions