Repository navigation
[ICE]: assertion failed: !parts.is_empty() #165052
Copy link
Copy link
Open
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingregression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Description
auto-reduced (treereduce-rust):
trait Reference: 'static {
type Ref<'a>;
}
struct SliceRef<'a, T: ?Sized + 'static> {
inner: &'static T,
}
impl<SR: 'static> Reference for Vec<SR> {
type Ref<'a> = SliceRef<'a, [SR]>;
fn get_ref(&self) -> Self::Ref<'_> {
SliceRef { inner: self }
}
}original:
trait Reference: 'static {
type Ref<'a>;
fn get_ref(&self) -> Self::Ref<'_>;
}
struct SliceRef<'a, T: ?Sized + 'static> {
inner: &'static T,
}
impl<SR: 'static> Reference for Vec<SR> {
type Ref<'a> = SliceRef<'a, [SR]>;
fn get_ref(&self) -> Self::Ref<'_> {
SliceRef { inner: self }
}
}
fn main() {}Version information
rustc 1.101.0-nightly (16d1ffac1 2026-10-26)
binary: rustc
commit-hash: 16d1ffac17ad8b739e32483ac2e65fe7e1804977
commit-date: 2026-10-26
host: x86_64-unknown-linux-gnu
release: 1.101.0-nightly
LLVM version: 23.1.4
Possibly related line of code:
rust/compiler/rustc_errors/src/diagnostic.rs
Lines 789 to 801 in 16d1ffa
| let parts = suggestion | |
| .into_iter() | |
| .map(|(span, snippet)| SubstitutionPart { snippet, span }) | |
| .collect::<Vec<_>>(); | |
| assert!(!parts.is_empty()); | |
| debug_assert_eq!( | |
| parts.iter().find(|part| part.span.is_empty() && part.snippet.is_empty()), | |
| None, | |
| "Span must not be empty and have no suggestion", | |
| ); | |
| debug_assert_eq!( |
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc
Program output
`--edition` is unspecified, defaulting to `2015` while the latest is `2024`; it must be one of: <2015|2018|2021|2024|future>
error[E0407]: method `get_ref` is not a member of trait `Reference`
--> /tmp/icemaker_global_tempdir.O89QqsIytXhi/rustc_testrunner_tmpdir_reporting.ax0HfJtwB3vR/mvce.rs:12:5
|
12 | / fn get_ref(&self) -> Self::Ref<'_> {
13 | | SliceRef { inner: self }
14 | | }
| |_____^ not a member of trait `Reference`
error[E0601]: `main` function not found in crate `mvce`
--> /tmp/icemaker_global_tempdir.O89QqsIytXhi/rustc_testrunner_tmpdir_reporting.ax0HfJtwB3vR/mvce.rs:15:2
|
15 | }
| ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.O89QqsIytXhi/rustc_testrunner_tmpdir_reporting.ax0HfJtwB3vR/mvce.rs`
error[E0392]: lifetime parameter `'a` is never used
--> /tmp/icemaker_global_tempdir.O89QqsIytXhi/rustc_testrunner_tmpdir_reporting.ax0HfJtwB3vR/mvce.rs:5:17
|
5 | struct SliceRef<'a, T: ?Sized + 'static> {
| ^^ unused lifetime parameter
|
= help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
thread 'rustc' (146452) panicked at /rustc-dev/16d1ffac17ad8b739e32483ac2e65fe7e1804977/compiler/rustc_errors/src/diagnostic.rs:795:9:
assertion failed: !parts.is_empty()
stack backtrace:
0: 0x7f1aafc1bc66 - <<std[330264cedda0dde7]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[c3c47457b203f732]::fmt::Display>::fmt
1: 0x7f1ab020bf69 - core[c3c47457b203f732]::fmt::write
2: 0x7f1aafc31d4c - <std[330264cedda0dde7]::sys::stdio::unix::Stderr as core[c3c47457b203f732]::io::write::Write>::write_fmt
3: 0x7f1aafbecdaa - std[330264cedda0dde7]::panicking::default_hook::{closure#0}
4: 0x7f1aafc0f5b3 - std[330264cedda0dde7]::panicking::default_hook
5: 0x7f1aae9d7dd9 - std[330264cedda0dde7]::panicking::update_hook::<alloc[af84d0cd032748a3]::boxed::Box<rustc_driver_impl[854d066a38aab513]::install_ice_hook::{closure#1}>>::{closure#0}
6: 0x7f1aafc0fa52 - std[330264cedda0dde7]::panicking::panic_with_hook
7: 0x7f1aafbece94 - std[330264cedda0dde7]::panicking::panic_handler::{closure#0}
8: 0x7f1aafbe3509 - std[330264cedda0dde7]::sys::backtrace::__rust_end_short_backtrace::<std[330264cedda0dde7]::panicking::panic_handler::{closure#0}, !>
9: 0x7f1aafbeebbd - __rustc[a38ff76b5c4f9c0]::rust_begin_unwind
10: 0x7f1aac4eb5dc - core[c3c47457b203f732]::panicking::panic_fmt
11: 0x7f1aacf512d2 - core[c3c47457b203f732]::panicking::panic
12: 0x7f1aae58b6d1 - <rustc_errors[9ab7b5d3ce2cdd56]::diagnostic::Diag>::multipart_suggestion_with_style::<&str>
13: 0x7f1aae677631 - <rustc_borrowck[e1fd4d0d9c3617a1]::MirBorrowckCtxt>::report_general_error
14: 0x7f1aae66fdd2 - <rustc_borrowck[e1fd4d0d9c3617a1]::MirBorrowckCtxt>::report_region_error
15: 0x7f1aae67885c - <rustc_borrowck[e1fd4d0d9c3617a1]::MirBorrowckCtxt>::report_region_errors
16: 0x7f1ab15d31d5 - rustc_borrowck[e1fd4d0d9c3617a1]::borrowck_check_region_constraints
17: 0x7f1ab15a7e5b - <rustc_borrowck[e1fd4d0d9c3617a1]::root_cx::BorrowCheckRootCtxt>::do_mir_borrowck
18: 0x7f1ab05741d5 - rustc_borrowck[e1fd4d0d9c3617a1]::mir_borrowck
19: 0x7f1ab0573ef9 - rustc_query_impl[41e30d1e9fe6e894]::query_vtables::mir_borrowck::invoke_provider_fn::__rust_begin_short_backtrace
20: 0x7f1ab057290e - rustc_query_impl[41e30d1e9fe6e894]::execution::try_execute_query::<rustc_data_structures[f4d1bc18c8885aa4]::vec_cache::VecCache<rustc_span[fd67e99fbaac7070]::def_id::LocalDefId, rustc_middle[3fdf4e28e066cfea]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[3fdf4e28e066cfea]::dep_graph::graph::DepNodeIndex>, false>
21: 0x7f1ab0572475 - rustc_query_impl[41e30d1e9fe6e894]::query_vtables::mir_borrowck::execute_query_non_incr::__rust_end_short_backtrace
22: 0x7f1ab05704e9 - <rustc_middle[3fdf4e28e066cfea]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface[330c1f918d396dc7]::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}
23: 0x7f1ab056f7b1 - rustc_interface[330c1f918d396dc7]::passes::analysis
24: 0x7f1ab13aff87 - rustc_query_impl[41e30d1e9fe6e894]::execution::try_execute_query::<rustc_middle[3fdf4e28e066cfea]::query::caches::SingleCache<rustc_middle[3fdf4e28e066cfea]::query::erase::ErasedData<[u8; 0usize]>>, false>
25: 0x7f1ab13afd6b - rustc_query_impl[41e30d1e9fe6e894]::query_vtables::analysis::execute_query_non_incr::__rust_end_short_backtrace
26: 0x7f1ab14e3e05 - rustc_interface[330c1f918d396dc7]::interface::run_compiler::<(), rustc_driver_impl[854d066a38aab513]::compiler_entrypoint::{closure#0}>::{closure#2}
27: 0x7f1ab15637c1 - std[330264cedda0dde7]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[330c1f918d396dc7]::util::run_in_thread_with_globals<rustc_interface[330c1f918d396dc7]::util::run_in_thread_pool_with_globals<rustc_interface[330c1f918d396dc7]::interface::run_compiler<(), rustc_driver_impl[854d066a38aab513]::compiler_entrypoint::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
28: 0x7f1ab156356d - <std[330264cedda0dde7]::thread::lifecycle::spawn_unchecked<rustc_interface[330c1f918d396dc7]::util::run_in_thread_with_globals<rustc_interface[330c1f918d396dc7]::util::run_in_thread_pool_with_globals<rustc_interface[330c1f918d396dc7]::interface::run_compiler<(), rustc_driver_impl[854d066a38aab513]::compiler_entrypoint::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[c3c47457b203f732]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
29: 0x7f1ab142e82d - <std[330264cedda0dde7]::sys::thread::unix::Thread>::new::thread_start
30: 0x7f1aaa4980a2 - <unknown>
31: 0x7f1aaa52080c - <unknown>
32: 0x0 - <unknown>
error: the compiler unexpectedly panicked. This is a bug
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.101.0-nightly (16d1ffac1 2026-10-26) running on x86_64-unknown-linux-gnu
query stack during panic:
#0 [mir_borrowck] borrow-checking `<impl at /tmp/icemaker_global_tempdir.O89QqsIytXhi/rustc_testrunner_tmpdir_reporting.ax0HfJtwB3vR/mvce.rs:9:1: 9:40>::get_ref`
#1 [analysis] running analysis passes on crate `mvce`
end of query stack
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0392, E0407, E0601.
For more information about an error, try `rustc --explain E0392`.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingregression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Activity
cushionbadak commentedon Oct 28, 2026
Regression in
nightly-2026-10-27.searched nightlies: from nightly-2026-01-01 to nightly-2026-10-28
regressed nightly: nightly-2026-10-27
searched commit range: 76456a6...16d1ffa
regressed commit: 16d1ffa
bisected with cargo-bisect-rustc v0.6.12
Host triple: x86_64-apple-darwin
Reproduce with:
matthiaskrgr commentedon Oct 29, 2026
simpler:
matthiaskrgr commentedon Oct 29, 2026
Let's also mark this as a regression, going from pass -> ice by just misnaming a single lifetime is a bit bad 😅
matthiaskrgr commentedon Oct 29, 2026
also available with free
RegionErrorzachs18 commentedon Oct 29, 2026
Regression in e1057ef. Note that if it is a legacy rollup build, it might be available in rust-lang-ci@e1057ef.
The PR introducing the regression in this rollup is #164776: Account for trait object with implicit
'staticlifetime i…cc @estebank
bisected with cargo-bisect-rustc v0.6.12
Host triple: x86_64-unknown-linux-gnu
Reproduce with: