Skip to content

ICE: Rerunning drop data query produced no error. #137329

Closed
@matthiaskrgr

Description

@matthiaskrgr

snippet:

pub trait Helper {
    type Assoc<'a> = i32;
}
pub trait Trait {
    type Item: Helper;
    fn wrap<T, J: Trait<Item = T>>(&self) -> Wrapper<J> {
        todo!()
    }
}
pub struct Wrapper<LI: Trait> {
    _next: LI,
    _item: Option<<LI::Item as Helper>::Assoc>,
}

Version information

rustc 1.87.0-nightly (28b83ee59 2025-02-20)
binary: rustc
commit-hash: 28b83ee59698ae069f5355b8e03f976406f410f5
commit-date: 2025-02-20
host: x86_64-unknown-linux-gnu
release: 1.87.0-nightly
LLVM version: 20.1.0

Possibly related line of code:

}
};
if !errors.is_empty() {
typeck.infcx.err_ctxt().report_fulfillment_errors(errors);
} else {
span_bug!(span, "Rerunning drop data query produced no error.");
}
DropData { dropck_result: Default::default(), region_constraint_data: None }
}
}
}
}

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

error[E0658]: associated type defaults are unstable
 --> /tmp/icemaker_global_tempdir.I36Ae518C0f7/rustc_testrunner_tmpdir_reporting.q1npcKtMVRva/mvce.rs:2:5
  |
2 |     type Assoc<'a> = i32;
  |     ^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #29661 <https://github.com/rust-lang/rust/issues/29661> for more information
  = help: add `#![feature(associated_type_defaults)]` to the crate attributes to enable
  = note: this compiler was built on 2025-02-20; consider upgrading it if it is out of date

error[E0601]: `main` function not found in crate `mvce`
  --> /tmp/icemaker_global_tempdir.I36Ae518C0f7/rustc_testrunner_tmpdir_reporting.q1npcKtMVRva/mvce.rs:13:2
   |
13 | }
   |  ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.I36Ae518C0f7/rustc_testrunner_tmpdir_reporting.q1npcKtMVRva/mvce.rs`

error[E0107]: missing generics for associated type `Helper::Assoc`
  --> /tmp/icemaker_global_tempdir.I36Ae518C0f7/rustc_testrunner_tmpdir_reporting.q1npcKtMVRva/mvce.rs:12:41
   |
12 |     _item: Option<<LI::Item as Helper>::Assoc>,
   |                                         ^^^^^ expected 1 lifetime argument
   |
note: associated type defined here, with 1 lifetime parameter: `'a`
  --> /tmp/icemaker_global_tempdir.I36Ae518C0f7/rustc_testrunner_tmpdir_reporting.q1npcKtMVRva/mvce.rs:2:10
   |
2  |     type Assoc<'a> = i32;
   |          ^^^^^ --
help: add missing lifetime argument
   |
12 |     _item: Option<<LI::Item as Helper>::Assoc<'a>>,
   |                                              ++++

error: internal compiler error: compiler/rustc_borrowck/src/type_check/liveness/trace.rs:632:21: Rerunning drop data query produced no error.
 --> /tmp/icemaker_global_tempdir.I36Ae518C0f7/rustc_testrunner_tmpdir_reporting.q1npcKtMVRva/mvce.rs:6:46
  |
6 |     fn wrap<T, J: Trait<Item = T>>(&self) -> Wrapper<J> {
  |                                              ^^^^^^^^^^


thread 'rustc' panicked at compiler/rustc_borrowck/src/type_check/liveness/trace.rs:632:21:
Box<dyn Any>
stack backtrace:
   0:     0x7c568bf82604 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hb3499c71873ab373
   1:     0x7c568c619dac - core::fmt::write::h3c0ddcf203733d0b
   2:     0x7c568d5bd391 - std::io::Write::write_fmt::hb7d43dcbd458abfc
   3:     0x7c568bf82462 - std::sys::backtrace::BacktraceLock::print::h9dcb07e02fbd8ac3
   4:     0x7c568bf84c6e - std::panicking::default_hook::{{closure}}::h2e9f56059442a373
   5:     0x7c568bf84844 - std::panicking::default_hook::haeff5dd1cc53d172
   6:     0x7c568b0e1e57 - std[4b0371f87181aae0]::panicking::update_hook::<alloc[b12c3a5d7bfbabac]::boxed::Box<rustc_driver_impl[b1a9b9b37b2b3640]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x7c568bf854e3 - std::panicking::rust_panic_with_hook::hc8f8cfb01e455274
   8:     0x7c568b11d4f1 - std[4b0371f87181aae0]::panicking::begin_panic::<rustc_errors[f5030a51dcfe735c]::ExplicitBug>::{closure#0}
   9:     0x7c568b111906 - std[4b0371f87181aae0]::sys::backtrace::__rust_end_short_backtrace::<std[4b0371f87181aae0]::panicking::begin_panic<rustc_errors[f5030a51dcfe735c]::ExplicitBug>::{closure#0}, !>
  10:     0x7c568b10e299 - std[4b0371f87181aae0]::panicking::begin_panic::<rustc_errors[f5030a51dcfe735c]::ExplicitBug>
  11:     0x7c568b126f91 - <rustc_errors[f5030a51dcfe735c]::diagnostic::BugAbort as rustc_errors[f5030a51dcfe735c]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:     0x7c568b67638c - <rustc_errors[f5030a51dcfe735c]::DiagCtxtHandle>::span_bug::<rustc_span[3e00b4df5327a340]::span_encoding::Span, alloc[b12c3a5d7bfbabac]::string::String>
  13:     0x7c568b6f601a - rustc_middle[f0fe857346b4c3c4]::util::bug::opt_span_bug_fmt::<rustc_span[3e00b4df5327a340]::span_encoding::Span>::{closure#0}
  14:     0x7c568b6df26a - rustc_middle[f0fe857346b4c3c4]::ty::context::tls::with_opt::<rustc_middle[f0fe857346b4c3c4]::util::bug::opt_span_bug_fmt<rustc_span[3e00b4df5327a340]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  15:     0x7c568b6df0fb - rustc_middle[f0fe857346b4c3c4]::ty::context::tls::with_context_opt::<rustc_middle[f0fe857346b4c3c4]::ty::context::tls::with_opt<rustc_middle[f0fe857346b4c3c4]::util::bug::opt_span_bug_fmt<rustc_span[3e00b4df5327a340]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  16:     0x7c5689ec1037 - rustc_middle[f0fe857346b4c3c4]::util::bug::span_bug_fmt::<rustc_span[3e00b4df5327a340]::span_encoding::Span>
  17:     0x7c568ca39062 - <rustc_borrowck[8cbcc55ac765ba10]::type_check::liveness::trace::LivenessContext>::compute_drop_data
  18:     0x7c5688fac1ea - rustc_borrowck[8cbcc55ac765ba10]::type_check::liveness::trace::trace
  19:     0x7c568a1f0c21 - rustc_borrowck[8cbcc55ac765ba10]::type_check::type_check
  20:     0x7c5688f94df7 - rustc_borrowck[8cbcc55ac765ba10]::nll::compute_regions
  21:     0x7c568d72fe72 - rustc_borrowck[8cbcc55ac765ba10]::do_mir_borrowck
  22:     0x7c568d7232ee - rustc_query_impl[c9e7281a182dfec0]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[c9e7281a182dfec0]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[f0fe857346b4c3c4]::query::erase::Erased<[u8; 8usize]>>
  23:     0x7c568c99380c - rustc_query_system[5efec9b1f4856d32]::query::plumbing::try_execute_query::<rustc_query_impl[c9e7281a182dfec0]::DynamicConfig<rustc_data_structures[754fb36ec7e94dd8]::vec_cache::VecCache<rustc_span[3e00b4df5327a340]::def_id::LocalDefId, rustc_middle[f0fe857346b4c3c4]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[5efec9b1f4856d32]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[c9e7281a182dfec0]::plumbing::QueryCtxt, false>
  24:     0x7c568c99330c - rustc_query_impl[c9e7281a182dfec0]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  25:     0x7c568c99a87a - rustc_interface[1c7a3477b23a35f0]::passes::run_required_analyses
  26:     0x7c568d5b933a - rustc_interface[1c7a3477b23a35f0]::passes::analysis
  27:     0x7c568d5b9319 - rustc_query_impl[c9e7281a182dfec0]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[c9e7281a182dfec0]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[f0fe857346b4c3c4]::query::erase::Erased<[u8; 0usize]>>
  28:     0x7c568d63c0cb - rustc_query_system[5efec9b1f4856d32]::query::plumbing::try_execute_query::<rustc_query_impl[c9e7281a182dfec0]::DynamicConfig<rustc_query_system[5efec9b1f4856d32]::query::caches::SingleCache<rustc_middle[f0fe857346b4c3c4]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[c9e7281a182dfec0]::plumbing::QueryCtxt, false>
  29:     0x7c568d63bdb9 - rustc_query_impl[c9e7281a182dfec0]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  30:     0x7c568d692e7d - rustc_interface[1c7a3477b23a35f0]::passes::create_and_enter_global_ctxt::<core[f73f0748c8878a8d]::option::Option<rustc_interface[1c7a3477b23a35f0]::queries::Linker>, rustc_driver_impl[b1a9b9b37b2b3640]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  31:     0x7c568d686724 - rustc_interface[1c7a3477b23a35f0]::interface::run_compiler::<(), rustc_driver_impl[b1a9b9b37b2b3640]::run_compiler::{closure#0}>::{closure#1}
  32:     0x7c568d506210 - std[4b0371f87181aae0]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[1c7a3477b23a35f0]::util::run_in_thread_with_globals<rustc_interface[1c7a3477b23a35f0]::util::run_in_thread_pool_with_globals<rustc_interface[1c7a3477b23a35f0]::interface::run_compiler<(), rustc_driver_impl[b1a9b9b37b2b3640]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  33:     0x7c568d506634 - <<std[4b0371f87181aae0]::thread::Builder>::spawn_unchecked_<rustc_interface[1c7a3477b23a35f0]::util::run_in_thread_with_globals<rustc_interface[1c7a3477b23a35f0]::util::run_in_thread_pool_with_globals<rustc_interface[1c7a3477b23a35f0]::interface::run_compiler<(), rustc_driver_impl[b1a9b9b37b2b3640]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[f73f0748c8878a8d]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  34:     0x7c568d506fef - std::sys::pal::unix::thread::Thread::new::thread_start::he4ac71ae11e77a0d
  35:     0x7c568785e70a - <unknown>
  36:     0x7c56878e2aac - <unknown>
  37:                0x0 - <unknown>

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: rustc 1.87.0-nightly (28b83ee59 2025-02-20) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [mir_borrowck] borrow-checking `Trait::wrap`
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 4 previous errors

Some errors have detailed explanations: E0107, E0601, E0658.
For more information about an error, try `rustc --explain E0107`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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