Skip to content

[ICE]: expected wide pointer extra data (e.g. slice length or trait object vtable) (missing lifetime) #152682

@matthiaskrgr

Description

@matthiaskrgr

auto-reduced (treereduce-rust):

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

original:

struct Foo<'a>(<& /*'a*/ [fn()] as core::ops::Deref>::Target); // adding the lifetime solves the ice
const _: *const Foo = 0 as _;
fn main() {}

Version information

rustc 1.95.0-nightly (873b4beb0 2026-02-15)
binary: rustc
commit-hash: 873b4beb0cc726493b94c8ef21f68795c04fbbc1
commit-date: 2026-02-15
host: x86_64-unknown-linux-gnu
release: 1.95.0-nightly
LLVM version: 22.1.0

Possibly related line of code:

impl<Prov: Provenance> MemPlaceMeta<Prov> {
#[cfg_attr(debug_assertions, track_caller)] // only in debug builds due to perf (see #98980)
pub fn unwrap_meta(self) -> Scalar<Prov> {
match self {
Self::Meta(s) => s,
Self::None => {
bug!("expected wide pointer extra data (e.g. slice length or trait object vtable)")
}
}
}
#[inline(always)]
pub fn has_meta(self) -> bool {

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

Program output

error[E0106]: missing lifetime specifier
 --> /tmp/icemaker_global_tempdir.XN1NnxVeArva/rustc_testrunner_tmpdir_reporting.1K5TD6vPH58s/mvce.rs:1:17
  |
1 | struct Foo<'a>(<& /*'a*/ [fn()] as core::ops::Deref>::Target);
  |                 ^ expected named lifetime parameter
  |
help: consider using the `'a` lifetime
  |
1 | struct Foo<'a>(<&'a  /*'a*/ [fn()] as core::ops::Deref>::Target);
  |                  ++

error[E0601]: `main` function not found in crate `mvce`
 --> /tmp/icemaker_global_tempdir.XN1NnxVeArva/rustc_testrunner_tmpdir_reporting.1K5TD6vPH58s/mvce.rs:2:30
  |
2 | const _: *const Foo = 0 as _;
  |                              ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.XN1NnxVeArva/rustc_testrunner_tmpdir_reporting.1K5TD6vPH58s/mvce.rs`

error: internal compiler error: /rustc-dev/873b4beb0cc726493b94c8ef21f68795c04fbbc1/compiler/rustc_const_eval/src/interpret/place.rs:36:17: expected wide pointer extra data (e.g. slice length or trait object vtable)


thread 'rustc' (626195) panicked at /rustc-dev/873b4beb0cc726493b94c8ef21f68795c04fbbc1/compiler/rustc_const_eval/src/interpret/place.rs:36:17:
Box<dyn Any>
stack backtrace:
   0:     0x7fbaf8bd449b - <<std[e84040df3bd3b365]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[6c6f0f72ed298c38]::fmt::Display>::fmt
   1:     0x7fbaf92110e0 - core[6c6f0f72ed298c38]::fmt::write
   2:     0x7fbaf8beb716 - <std[e84040df3bd3b365]::sys::stdio::unix::Stderr as std[e84040df3bd3b365]::io::Write>::write_fmt
   3:     0x7fbaf8baa548 - std[e84040df3bd3b365]::panicking::default_hook::{closure#0}
   4:     0x7fbaf8bc7903 - std[e84040df3bd3b365]::panicking::default_hook
   5:     0x7fbaf7b90f8f - std[e84040df3bd3b365]::panicking::update_hook::<alloc[d9717d1773e7bcdb]::boxed::Box<rustc_driver_impl[1d3373f79f63c38d]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7fbaf8bc7be2 - std[e84040df3bd3b365]::panicking::panic_with_hook
   7:     0x7fbaf7bc4ef1 - std[e84040df3bd3b365]::panicking::begin_panic::<rustc_errors[aa9f523260d7f0cb]::ExplicitBug>::{closure#0}
   8:     0x7fbaf7bbdda6 - std[e84040df3bd3b365]::sys::backtrace::__rust_end_short_backtrace::<std[e84040df3bd3b365]::panicking::begin_panic<rustc_errors[aa9f523260d7f0cb]::ExplicitBug>::{closure#0}, !>
   9:     0x7fbaf7bbdb0b - std[e84040df3bd3b365]::panicking::begin_panic::<rustc_errors[aa9f523260d7f0cb]::ExplicitBug>
  10:     0x7fbaf7bd0481 - <rustc_errors[aa9f523260d7f0cb]::diagnostic::BugAbort as rustc_errors[aa9f523260d7f0cb]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  11:     0x7fbaf819c439 - rustc_middle[11be9ef6dd95cb79]::util::bug::opt_span_bug_fmt::<rustc_span[8943e0009ed5ffe4]::span_encoding::Span>::{closure#0}
  12:     0x7fbaf819c5c2 - rustc_middle[11be9ef6dd95cb79]::ty::context::tls::with_opt::<rustc_middle[11be9ef6dd95cb79]::util::bug::opt_span_bug_fmt<rustc_span[8943e0009ed5ffe4]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  13:     0x7fbaf818d41b - rustc_middle[11be9ef6dd95cb79]::ty::context::tls::with_context_opt::<rustc_middle[11be9ef6dd95cb79]::ty::context::tls::with_opt<rustc_middle[11be9ef6dd95cb79]::util::bug::opt_span_bug_fmt<rustc_span[8943e0009ed5ffe4]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  14:     0x7fbaf575fd94 - rustc_middle[11be9ef6dd95cb79]::util::bug::bug_fmt
  15:     0x7fbaf953f187 - <rustc_const_eval[30dfd147fcfea0c]::interpret::validity::ValidityVisitor<rustc_const_eval[30dfd147fcfea0c]::const_eval::machine::CompileTimeMachine>>::try_visit_primitive
  16:     0x7fbaf953f767 - <rustc_const_eval[30dfd147fcfea0c]::interpret::validity::ValidityVisitor<rustc_const_eval[30dfd147fcfea0c]::const_eval::machine::CompileTimeMachine> as rustc_const_eval[30dfd147fcfea0c]::interpret::visitor::ValueVisitor<rustc_const_eval[30dfd147fcfea0c]::const_eval::machine::CompileTimeMachine>>::visit_value
  17:     0x7fbaf953d319 - rustc_const_eval[30dfd147fcfea0c]::const_eval::eval_queries::intern_and_validate::<rustc_middle[11be9ef6dd95cb79]::mir::consts::ConstAlloc>
  18:     0x7fbafa287d42 - rustc_const_eval[30dfd147fcfea0c]::const_eval::eval_queries::eval_to_allocation_raw_provider
  19:     0x7fbafa285556 - rustc_query_impl[761ff2116f6b567]::query_impl::eval_to_allocation_raw::invoke_provider_fn::__rust_begin_short_backtrace
  20:     0x7fbafa284d21 - rustc_query_impl[761ff2116f6b567]::execution::try_execute_query::<rustc_middle[11be9ef6dd95cb79]::query::caches::DefaultCache<rustc_middle[11be9ef6dd95cb79]::ty::PseudoCanonicalInput<rustc_middle[11be9ef6dd95cb79]::mir::interpret::GlobalId>, rustc_middle[11be9ef6dd95cb79]::query::erase::ErasedData<[u8; 24usize]>>, {rustc_query_impl[761ff2116f6b567]::QueryFlags { is_anon: false, is_depth_limit: false, is_feedable: false }}, false>
  21:     0x7fbafa2848f3 - rustc_query_impl[761ff2116f6b567]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
  22:     0x7fbafa2808f2 - rustc_const_eval[30dfd147fcfea0c]::const_eval::eval_queries::eval_to_const_value_raw_provider
  23:     0x7fbafa280466 - rustc_query_impl[761ff2116f6b567]::query_impl::eval_to_const_value_raw::invoke_provider_fn::__rust_begin_short_backtrace
  24:     0x7fbafa27f3ff - rustc_query_impl[761ff2116f6b567]::execution::try_execute_query::<rustc_middle[11be9ef6dd95cb79]::query::caches::DefaultCache<rustc_middle[11be9ef6dd95cb79]::ty::PseudoCanonicalInput<rustc_middle[11be9ef6dd95cb79]::mir::interpret::GlobalId>, rustc_middle[11be9ef6dd95cb79]::query::erase::ErasedData<[u8; 24usize]>>, {rustc_query_impl[761ff2116f6b567]::QueryFlags { is_anon: false, is_depth_limit: true, is_feedable: false }}, false>
  25:     0x7fbafa27efb3 - rustc_query_impl[761ff2116f6b567]::query_impl::eval_to_const_value_raw::get_query_non_incr::__rust_end_short_backtrace
  26:     0x7fbaf9c3ea08 - <rustc_middle[11be9ef6dd95cb79]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_hir_analysis[21cab81ddb5349c4]::check_crate::{closure#2}>::{closure#0}
  27:     0x7fbaf9c3e02e - rustc_hir_analysis[21cab81ddb5349c4]::check_crate
  28:     0x7fbaf9c41c96 - rustc_interface[ffa26b8aee337d6b]::passes::analysis
  29:     0x7fbafa469a19 - rustc_query_impl[761ff2116f6b567]::execution::try_execute_query::<rustc_middle[11be9ef6dd95cb79]::query::caches::SingleCache<rustc_middle[11be9ef6dd95cb79]::query::erase::ErasedData<[u8; 0usize]>>, {rustc_query_impl[761ff2116f6b567]::QueryFlags { is_anon: false, is_depth_limit: false, is_feedable: false }}, false>
  30:     0x7fbafa469754 - rustc_query_impl[761ff2116f6b567]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  31:     0x7fbafa53a667 - <rustc_interface[ffa26b8aee337d6b]::passes::create_and_enter_global_ctxt<core[6c6f0f72ed298c38]::option::Option<rustc_interface[ffa26b8aee337d6b]::queries::Linker>, rustc_driver_impl[1d3373f79f63c38d]::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core[6c6f0f72ed298c38]::ops::function::FnOnce<(&rustc_session[e077b3088d2cab4d]::session::Session, rustc_middle[11be9ef6dd95cb79]::ty::context::CurrentGcx, alloc[d9717d1773e7bcdb]::sync::Arc<rustc_data_structures[be2354717932db16]::jobserver::Proxy>, &std[e84040df3bd3b365]::sync::once_lock::OnceLock<rustc_middle[11be9ef6dd95cb79]::ty::context::GlobalCtxt>, &rustc_data_structures[be2354717932db16]::sync::worker_local::WorkerLocal<rustc_middle[11be9ef6dd95cb79]::arena::Arena>, &rustc_data_structures[be2354717932db16]::sync::worker_local::WorkerLocal<rustc_hir[e6f1d3e8b67d381c]::Arena>, rustc_driver_impl[1d3373f79f63c38d]::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  32:     0x7fbafa447ad0 - rustc_interface[ffa26b8aee337d6b]::interface::run_compiler::<(), rustc_driver_impl[1d3373f79f63c38d]::run_compiler::{closure#0}>::{closure#1}
  33:     0x7fbafa4307be - std[e84040df3bd3b365]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[ffa26b8aee337d6b]::util::run_in_thread_with_globals<rustc_interface[ffa26b8aee337d6b]::util::run_in_thread_pool_with_globals<rustc_interface[ffa26b8aee337d6b]::interface::run_compiler<(), rustc_driver_impl[1d3373f79f63c38d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  34:     0x7fbafa430ea0 - <std[e84040df3bd3b365]::thread::lifecycle::spawn_unchecked<rustc_interface[ffa26b8aee337d6b]::util::run_in_thread_with_globals<rustc_interface[ffa26b8aee337d6b]::util::run_in_thread_pool_with_globals<rustc_interface[ffa26b8aee337d6b]::interface::run_compiler<(), rustc_driver_impl[1d3373f79f63c38d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[6c6f0f72ed298c38]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  35:     0x7fbafa431d2c - <std[e84040df3bd3b365]::sys::thread::unix::Thread>::new::thread_start
  36:     0x7fbafbce198b - <unknown>
  37:     0x7fbafbd65a0c - <unknown>
  38:                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.95.0-nightly (873b4beb0 2026-02-15) running on x86_64-unknown-linux-gnu

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 crate `mvce`
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`.

Metadata

Metadata

Assignees

Labels

A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)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.WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)fixed-by-next-solverFixed by the next-generation trait solver, `-Znext-solver`.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions