rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
96.91k stars 12.52k forks source link

ICE: `expected wide pointer extra data (e.g. slice length or trait object vtable)` #124262

Closed matthiaskrgr closed 2 months ago

matthiaskrgr commented 5 months ago

snippet:

struct Foo(<&[fn()] as ::core::ops::Deref>::Target);
const _: *const Foo = 0 as _;

Version information

rustc 1.79.0-nightly (290d79241 2024-04-22)
binary: rustc
commit-hash: 290d792411566c94273e5d1a980a1ab91f1d950b
commit-date: 2024-04-22
host: x86_64-unknown-linux-gnu
release: 1.79.0-nightly
LLVM version: 18.1.4

Command: /home/matthias/.rustup/toolchains/master/bin/rustc --edition=2021

Program output

``` error[E0106]: missing lifetime specifier --> /tmp/icemaker_global_tempdir.1nBNEtZmd8hU/rustc_testrunner_tmpdir_reporting.YScR49rloxcZ/mvce.rs:1:13 | 1 | struct Foo(<&[fn()] as ::core::ops::Deref>::Target); | ^ expected named lifetime parameter | help: consider introducing a named lifetime parameter | 1 | struct Foo<'a>(<&'a [fn()] as ::core::ops::Deref>::Target); | ++++ ++ error[E0601]: `main` function not found in crate `mvce` --> /tmp/icemaker_global_tempdir.1nBNEtZmd8hU/rustc_testrunner_tmpdir_reporting.YScR49rloxcZ/mvce.rs:2:30 | 2 | const _: *const Foo = 0 as _; | ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.1nBNEtZmd8hU/rustc_testrunner_tmpdir_reporting.YScR49rloxcZ/mvce.rs` error: internal compiler error: compiler/rustc_const_eval/src/interpret/place.rs:37:17: expected wide pointer extra data (e.g. slice length or trait object vtable) thread 'rustc' panicked at compiler/rustc_const_eval/src/interpret/place.rs:37:17: Box stack backtrace: 0: 0x7d2e63191935 - std::backtrace_rs::backtrace::libunwind::trace::h26e1fa40e8cb8736 at /rustc/290d792411566c94273e5d1a980a1ab91f1d950b/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5 1: 0x7d2e63191935 - std::backtrace_rs::backtrace::trace_unsynchronized::h859af531c2f619a1 at /rustc/290d792411566c94273e5d1a980a1ab91f1d950b/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x7d2e63191935 - std::sys_common::backtrace::_print_fmt::h770ada6f33df9a23 at /rustc/290d792411566c94273e5d1a980a1ab91f1d950b/library/std/src/sys_common/backtrace.rs:68:5 3: 0x7d2e63191935 - ::fmt::h1202620471ff2013 at /rustc/290d792411566c94273e5d1a980a1ab91f1d950b/library/std/src/sys_common/backtrace.rs:44:22 4: 0x7d2e631e0a6b - core::fmt::rt::Argument::fmt::h1d7f69a8f0bb037c at /rustc/290d792411566c94273e5d1a980a1ab91f1d950b/library/core/src/fmt/rt.rs:165:63 5: 0x7d2e631e0a6b - core::fmt::write::h2cfd50c1c61a678b at /rustc/290d792411566c94273e5d1a980a1ab91f1d950b/library/core/src/fmt/mod.rs:1157:21 6: 0x7d2e631864bf - std::io::Write::write_fmt::h68244818dfe9446a at /rustc/290d792411566c94273e5d1a980a1ab91f1d950b/library/std/src/io/mod.rs:1832:15 7: 0x7d2e6319170e - std::sys_common::backtrace::_print::hb0df927864ffa3c4 at /rustc/290d792411566c94273e5d1a980a1ab91f1d950b/library/std/src/sys_common/backtrace.rs:47:5 8: 0x7d2e6319170e - std::sys_common::backtrace::print::hb29ea7496634044b at /rustc/290d792411566c94273e5d1a980a1ab91f1d950b/library/std/src/sys_common/backtrace.rs:34:9 9: 0x7d2e63194079 - std::panicking::default_hook::{{closure}}::hcfcc8ff96a30a9c7 10: 0x7d2e63193dbd - std::panicking::default_hook::h8bb790ee0d607409 at /rustc/290d792411566c94273e5d1a980a1ab91f1d950b/library/std/src/panicking.rs:298:9 11: 0x7d2e5fa3227c - std[37c8ccdab8a3c0d8]::panicking::update_hook::>::{closure#0} 12: 0x7d2e63194776 - as core::ops::function::Fn>::call::h11842aeeeb09579f at /rustc/290d792411566c94273e5d1a980a1ab91f1d950b/library/alloc/src/boxed.rs:2036:9 13: 0x7d2e63194776 - std::panicking::rust_panic_with_hook::h2039ccc53629d416 at /rustc/290d792411566c94273e5d1a980a1ab91f1d950b/library/std/src/panicking.rs:799:13 14: 0x7d2e5fa62584 - std[37c8ccdab8a3c0d8]::panicking::begin_panic::::{closure#0} 15: 0x7d2e5fa5ef36 - std[37c8ccdab8a3c0d8]::sys_common::backtrace::__rust_end_short_backtrace::::{closure#0}, !> 16: 0x7d2e5fa5a506 - std[37c8ccdab8a3c0d8]::panicking::begin_panic:: 17: 0x7d2e5fa6b801 - ::emit_producing_guarantee 18: 0x7d2e5ff1155c - rustc_middle[d30f97e255128713]::util::bug::opt_span_bug_fmt::::{closure#0} 19: 0x7d2e5fef982a - rustc_middle[d30f97e255128713]::ty::context::tls::with_opt::::{closure#0}, !>::{closure#0} 20: 0x7d2e5fef96cb - rustc_middle[d30f97e255128713]::ty::context::tls::with_context_opt::::{closure#0}, !>::{closure#0}, !> 21: 0x7d2e5e28fe70 - rustc_middle[d30f97e255128713]::util::bug::bug_fmt 22: 0x7d2e5f9ef2ec - >::check_wide_ptr_meta 23: 0x7d2e60e6ecdd - as rustc_const_eval[6d96b92d4bade795]::interpret::visitor::ValueVisitor>::visit_value 24: 0x7d2e5ef85621 - rustc_const_eval[6d96b92d4bade795]::const_eval::eval_queries::eval_to_allocation_raw_provider 25: 0x7d2e616b56b6 - rustc_query_impl[4316bc259f8ef16e]::plumbing::__rust_begin_short_backtrace::> 26: 0x7d2e616b4ed6 - rustc_query_system[8cff448a052401bd]::query::plumbing::try_execute_query::, rustc_middle[d30f97e255128713]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[4316bc259f8ef16e]::plumbing::QueryCtxt, false> 27: 0x7d2e616b4aac - rustc_query_impl[4316bc259f8ef16e]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace 28: 0x7d2e616b460c - rustc_middle[d30f97e255128713]::query::plumbing::query_get_at::, rustc_middle[d30f97e255128713]::query::erase::Erased<[u8; 24usize]>>> 29: 0x7d2e616b2afc - rustc_const_eval[6d96b92d4bade795]::const_eval::eval_queries::eval_to_const_value_raw_provider 30: 0x7d2e616b2a76 - rustc_query_impl[4316bc259f8ef16e]::plumbing::__rust_begin_short_backtrace::> 31: 0x7d2e616b4e99 - rustc_query_system[8cff448a052401bd]::query::plumbing::try_execute_query::, rustc_middle[d30f97e255128713]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[4316bc259f8ef16e]::plumbing::QueryCtxt, false> 32: 0x7d2e616b49ac - rustc_query_impl[4316bc259f8ef16e]::query_impl::eval_to_const_value_raw::get_query_non_incr::__rust_end_short_backtrace 33: 0x7d2e61043e10 - ::par_body_owners::::{closure#0} 34: 0x7d2e6104243c - rustc_hir_analysis[6f20a5ebf44cea1c]::check_crate 35: 0x7d2e613163ba - rustc_interface[ffee9ea60ef965c3]::passes::analysis 36: 0x7d2e61315f15 - rustc_query_impl[4316bc259f8ef16e]::plumbing::__rust_begin_short_backtrace::> 37: 0x7d2e61b8dca5 - rustc_query_system[8cff448a052401bd]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[4316bc259f8ef16e]::plumbing::QueryCtxt, false> 38: 0x7d2e61b8da09 - rustc_query_impl[4316bc259f8ef16e]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace 39: 0x7d2e619ea753 - rustc_interface[ffee9ea60ef965c3]::interface::run_compiler::, rustc_driver_impl[480b09937bfb0708]::run_compiler::{closure#0}>::{closure#1} 40: 0x7d2e619d8627 - std[37c8ccdab8a3c0d8]::sys_common::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[480b09937bfb0708]::run_compiler::{closure#0}>::{closure#1}, core[d851a872a27282f9]::result::Result<(), rustc_span[128fa906eb8a1c67]::ErrorGuaranteed>>::{closure#0}, core[d851a872a27282f9]::result::Result<(), rustc_span[128fa906eb8a1c67]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d851a872a27282f9]::result::Result<(), rustc_span[128fa906eb8a1c67]::ErrorGuaranteed>> 41: 0x7d2e619d83ea - <::spawn_unchecked_, rustc_driver_impl[480b09937bfb0708]::run_compiler::{closure#0}>::{closure#1}, core[d851a872a27282f9]::result::Result<(), rustc_span[128fa906eb8a1c67]::ErrorGuaranteed>>::{closure#0}, core[d851a872a27282f9]::result::Result<(), rustc_span[128fa906eb8a1c67]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d851a872a27282f9]::result::Result<(), rustc_span[128fa906eb8a1c67]::ErrorGuaranteed>>::{closure#2} as core[d851a872a27282f9]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 42: 0x7d2e6319e60b - as core::ops::function::FnOnce>::call_once::h8fcfbedcc7bc1020 at /rustc/290d792411566c94273e5d1a980a1ab91f1d950b/library/alloc/src/boxed.rs:2022:9 43: 0x7d2e6319e60b - as core::ops::function::FnOnce>::call_once::hb725f441e1474916 at /rustc/290d792411566c94273e5d1a980a1ab91f1d950b/library/alloc/src/boxed.rs:2022:9 44: 0x7d2e6319e60b - std::sys::pal::unix::thread::Thread::new::thread_start::h34c8a550ac2bc24c at /rustc/290d792411566c94273e5d1a980a1ab91f1d950b/library/std/src/sys/pal/unix/thread.rs:108:17 45: 0x7d2e62f3c55a - 46: 0x7d2e62fb9a3c - 47: 0x0 - 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.79.0-nightly (290d79241 2024-04-22) running on x86_64-unknown-linux-gnu note: compiler flags: -Z dump-mir-dir=dir query stack during panic: #0 [eval_to_allocation_raw] const-evaluating + checking `_` #1 [eval_to_const_value_raw] simplifying constant for the type system `_` #2 [analysis] running analysis passes on this crate end of query stack error: aborting due to 3 previous errors Some errors have detailed explanations: E0106, E0601. For more information about an error, try `rustc --explain E0106`. ```

matthiaskrgr commented 5 months ago

bisects to #122749