Open Naserume opened 1 week ago
searched nightlies: from nightly-2022-02-19 to nightly-2024-06-25 regressed nightly: nightly-2024-03-08 searched commit range: https://github.com/rust-lang/rust/compare/7d3702e472b99be0f5de6608dd87af1df8f99428...9c3ad802d9b9633d60d3a74668eb1be819212d34 regressed commit: https://github.com/rust-lang/rust/commit/8c9a75b3238b66592779d6b240dbf78eacefebb8 (#121154)
Minimized:
struct Thing;
pub trait Every {
type Assoc;
}
impl<T: ?Sized> Every for Thing {
type Assoc = T;
}
static I: <Thing as Every>::Assoc = 3;
Variant with a different ICE (index out of bounds: the len is 0 but the index is 0
)
struct Thing;
pub trait Every {
type Assoc;
}
impl<T: ?Sized> Every for Thing {
type Assoc = T;
}
fn foo(_: <Thing as Every>::Assoc) {}
Removing the ?Sized
makes the ICE go away for some reason.
Code
Meta
rustc --version --verbose
:Error output
Backtrace
``` error: internal compiler error: compiler/rustc_ty_utils/src/layout.rs:674:13: Layout::compute: unexpected type `_` thread 'rustc' panicked at compiler/rustc_ty_utils/src/layout.rs:674:13: Box
stack backtrace:
0: 0x10cae6b43 - ::fmt::he71f7af0ddafc64d
1: 0x10cb3225b - core::fmt::write::h30d0e266faff29b6
2: 0x10cadcace - std::io::Write::write_fmt::he666ca78eb4b8406
3: 0x10cae6931 - std::sys::backtrace::print::h22721f9ab9a2749a
4: 0x10cae9709 - std::panicking::default_hook::{{closure}}::h145e29ed875d8021
5: 0x10cae948a - std::panicking::default_hook::h5d437c7e6bf0e3b5
6: 0x115d8147c - std[8efa578c02603ef9]::panicking::update_hook::>::{closure#0}
7: 0x10caea326 - std::panicking::rust_panic_with_hook::h6889093a56e48d04
8: 0x115df0337 - std[8efa578c02603ef9]::panicking::begin_panic::::{closure#0}
9: 0x115ddc949 - std[8efa578c02603ef9]::sys::backtrace::__rust_end_short_backtrace::::{closure#0}, !>
10: 0x11a7e2f09 - std[8efa578c02603ef9]::panicking::begin_panic::
11: 0x115e02276 - ::emit_producing_guarantee
12: 0x116a9c95e - rustc_middle[4384e439927f71dd]::util::bug::opt_span_bug_fmt::::{closure#0}
13: 0x116a522b7 - rustc_middle[4384e439927f71dd]::ty::context::tls::with_opt::::{closure#0}, !>::{closure#0}
14: 0x116a51d75 - rustc_middle[4384e439927f71dd]::ty::context::tls::with_context_opt::::{closure#0}, !>::{closure#0}, !>
15: 0x11a8a57eb - rustc_middle[4384e439927f71dd]::util::bug::bug_fmt
16: 0x117bc12e7 - rustc_ty_utils[a4413d16294df763]::layout::layout_of_uncached
17: 0x117bd4076 - rustc_ty_utils[a4413d16294df763]::layout::layout_of
18: 0x117423276 - rustc_query_impl[a24e9023943e74ab]::plumbing::__rust_begin_short_backtrace::>
19: 0x1173f2f4e - )>>::call_once
20: 0x11720a655 - rustc_query_system[30bd0146b5104221]::query::plumbing::try_execute_query::, rustc_middle[4384e439927f71dd]::query::erase::Erased<[u8; 16usize]>>, false, true, false>, rustc_query_impl[a24e9023943e74ab]::plumbing::QueryCtxt, false>
21: 0x1174613f4 - rustc_query_impl[a24e9023943e74ab]::query_impl::layout_of::get_query_non_incr::__rust_end_short_backtrace
22: 0x117b59d59 - rustc_middle[4384e439927f71dd]::query::plumbing::query_get_at::, rustc_middle[4384e439927f71dd]::query::erase::Erased<[u8; 16usize]>>>
23: 0x117bd4051 - rustc_ty_utils[a4413d16294df763]::layout::layout_of
24: 0x117423276 - rustc_query_impl[a24e9023943e74ab]::plumbing::__rust_begin_short_backtrace::>
25: 0x1173f2f4e - )>>::call_once
26: 0x11720a655 - rustc_query_system[30bd0146b5104221]::query::plumbing::try_execute_query::, rustc_middle[4384e439927f71dd]::query::erase::Erased<[u8; 16usize]>>, false, true, false>, rustc_query_impl[a24e9023943e74ab]::plumbing::QueryCtxt, false>
27: 0x1174613f4 - rustc_query_impl[a24e9023943e74ab]::query_impl::layout_of::get_query_non_incr::__rust_end_short_backtrace
28: 0x115fac0a6 - rustc_middle[4384e439927f71dd]::query::plumbing::query_get_at::, rustc_middle[4384e439927f71dd]::query::erase::Erased<[u8; 16usize]>>>
29: 0x11607bd51 - rustc_hir_analysis[8e62bc6471a04889]::check::check::check_static_inhabited
30: 0x11607f85d - rustc_hir_analysis[8e62bc6471a04889]::check::check::check_item_type
31: 0x1160b64ae - rustc_hir_analysis[8e62bc6471a04889]::check::wfcheck::check_well_formed
32: 0x11741e86c - rustc_query_impl[a24e9023943e74ab]::plumbing::__rust_begin_short_backtrace::>
33: 0x11729701f - rustc_query_system[30bd0146b5104221]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[a24e9023943e74ab]::plumbing::QueryCtxt, false>
34: 0x117468280 - rustc_query_impl[a24e9023943e74ab]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
35: 0x115facba2 - rustc_middle[4384e439927f71dd]::query::plumbing::query_ensure_error_guaranteed::>, ()>
36: 0x1160c4de1 - rustc_hir_analysis[8e62bc6471a04889]::check::wfcheck::check_mod_type_wf
37: 0x11741e83c - rustc_query_impl[a24e9023943e74ab]::plumbing::__rust_begin_short_backtrace::>
38: 0x11724db79 - rustc_query_system[30bd0146b5104221]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[a24e9023943e74ab]::plumbing::QueryCtxt, false>
39: 0x117444ed0 - rustc_query_impl[a24e9023943e74ab]::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
40: 0x11614024c - rustc_hir_analysis[8e62bc6471a04889]::check_crate
41: 0x1166da6cb - rustc_interface[73216d77aad0c3a5]::passes::run_required_analyses
42: 0x1166dccb3 - rustc_interface[73216d77aad0c3a5]::passes::analysis
43: 0x117422dec - rustc_query_impl[a24e9023943e74ab]::plumbing::__rust_begin_short_backtrace::>
44: 0x11720249e - rustc_query_system[30bd0146b5104221]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[a24e9023943e74ab]::plumbing::QueryCtxt, false>
45: 0x11742d307 - rustc_query_impl[a24e9023943e74ab]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
46: 0x115d258d7 - >::enter::, rustc_driver_impl[63f2171535a6fe49]::run_compiler::{closure#0}::{closure#1}::{closure#3}>
47: 0x115d7fc94 - rustc_interface[73216d77aad0c3a5]::interface::run_compiler::, rustc_driver_impl[63f2171535a6fe49]::run_compiler::{closure#0}>::{closure#1}
48: 0x115d6ec91 - std[8efa578c02603ef9]::sys::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[63f2171535a6fe49]::run_compiler::{closure#0}>::{closure#1}, core[9412a59d758dca42]::result::Result<(), rustc_span[aed5394308446158]::ErrorGuaranteed>>::{closure#0}, core[9412a59d758dca42]::result::Result<(), rustc_span[aed5394308446158]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[9412a59d758dca42]::result::Result<(), rustc_span[aed5394308446158]::ErrorGuaranteed>>
49: 0x115d8a3a6 - <::spawn_unchecked_, rustc_driver_impl[63f2171535a6fe49]::run_compiler::{closure#0}>::{closure#1}, core[9412a59d758dca42]::result::Result<(), rustc_span[aed5394308446158]::ErrorGuaranteed>>::{closure#0}, core[9412a59d758dca42]::result::Result<(), rustc_span[aed5394308446158]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[9412a59d758dca42]::result::Result<(), rustc_span[aed5394308446158]::ErrorGuaranteed>>::{closure#2} as core[9412a59d758dca42]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
50: 0x10caf352b - std::sys::pal::unix::thread::Thread::new::thread_start::h68d49fa26efc1659
51: 0x7ff801f5318b - __pthread_start
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: please attach the file at `/Users/Documents/240624-56257.txt` to your bug report
query stack during panic:
panicked at /rustc/bcf94dec5ba6838e435902120c0384c360126a26/compiler/rustc_type_ir/src/ty_kind.rs:889:17:
thread panicked while processing panic. aborting.
zsh: abort rustc ./6EC19.rs
```
Similar Issue
Issue #124207 has same ice message with similar backtrace, but this require
#![feature(transmutability)]
and#![feature(type_alias_impl_trait)]
because it usesBikeshedIntrinsicsFrom
so I decided to report mine.