rust-lang / rust-lang/rust

[ICE]: `invalid pointer unsizing &i32 -> i32`

Open
#151,310 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug F-coerce_unsized I-ICE T-compiler WG-trait-system-refactor
Dominant language
Rust
Stars
119k
Forks
16.2k
PR merge metrics
PR metrics pending

Description

auto-reduced (treereduce-rust):

//@compile-flags: -Znext-solver=globally
#![feature(coerce_unsized)]
impl<A> std::ops::CoerceUnsized<A> for A {}
pub fn f() {
    [0; {
        let mut c = &0;
        c = &0;
        0
    }]
}

original:

#![feature(feature)]
#![crate_type = "lib"]
impl<A> std::ops::CoerceUnsized<A> for A {}
pub fn f() {
    [0; {
        let mut c = &0;
        c = &0;
        0
    }]
}

Version information

rustc 1.95.0-nightly (621d76794 2026-01-18)
binary: rustc
commit-hash: 621d76794c76fc21c0a6151fbc090120e0230a91
commit-date: 2026-01-18
host: x86_64-unknown-linux-gnu
release: 1.95.0-nightly
LLVM version: 21.1.8

Possibly related line of code:
https://github.com/rust-lang/rust/blob/621d76794c76fc21c0a6151fbc090120e0230a91/compiler/rustc_const_eval/src/interpret/cast.rs#L445-L457

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Znext-solver=globally

Program output

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

error[E0658]: use of unstable library feature `coerce_unsized`
 --> /tmp/icemaker_global_tempdir.knP2pWc932nn/rustc_testrunner_tmpdir_reporting.wByzSCkn0iNO/mvce.rs:1:9
  |
1 | impl<A> std::ops::CoerceUnsized<A> for A {}
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #18598 <https://github.com/rust-lang/rust/issues/18598> for more information
  = help: add `#![feature(coerce_unsized)]` to the crate attributes to enable
  = note: this compiler was built on 2026-01-18; consider upgrading it if it is out of date

error[E0210]: type parameter `A` must be used as the type parameter for some local type (e.g., `MyStruct<A>`)
 --> /tmp/icemaker_global_tempdir.knP2pWc932nn/rustc_testrunner_tmpdir_reporting.wByzSCkn0iNO/mvce.rs:1:6
  |
1 | impl<A> std::ops::CoerceUnsized<A> for A {}
  |      ^ type parameter `A` must be used as the type parameter for some local type
  |
  = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
  = note: only traits defined in the current crate can be implemented for a type parameter

error[E0377]: the trait `CoerceUnsized` may only be implemented for a coercion between structures
 --> /tmp/icemaker_global_tempdir.knP2pWc932nn/rustc_testrunner_tmpdir_reporting.wByzSCkn0iNO/mvce.rs:1:1
  |
1 | impl<A> std::ops::CoerceUnsized<A> for A {}
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: variable `c` is assigned to, but never used
 --> /tmp/icemaker_global_tempdir.knP2pWc932nn/rustc_testrunner_tmpdir_reporting.wByzSCkn0iNO/mvce.rs:4:13
  |
4 |         let mut c = &0;
  |             ^^^^^
  |
  = note: consider using `_c` instead
  = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default

warning: value assigned to `c` is never read
 --> /tmp/icemaker_global_tempdir.knP2pWc932nn/rustc_testrunner_tmpdir_reporting.wByzSCkn0iNO/mvce.rs:5:9
  |
5 |         c = &0;
  |         ^^^^^^
  |
  = help: maybe it is overwritten before being read?
  = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default

error: internal compiler error: /rustc-dev/621d76794c76fc21c0a6151fbc090120e0230a91/compiler/rustc_const_eval/src/interpret/cast.rs:451:17: invalid pointer unsizing &i32 -> i32
 --> /tmp/icemaker_global_tempdir.knP2pWc932nn/rustc_testrunner_tmpdir_reporting.wByzSCkn0iNO/mvce.rs:5:9
  |
5 |         c = &0;
  |         ^^^^^^


thread 'rustc' (1142729) panicked at /rustc-dev/621d76794c76fc21c0a6151fbc090120e0230a91/compiler/rustc_const_eval/src/interpret/cast.rs:451:17:
Box<dyn Any>
stack backtrace:
   0:     0x7fa8ae833fd3 - <<std[287527946f71f0bc]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[7477a31a1a34cc49]::fmt::Display>::fmt
   1:     0x7fa8aee0e2c8 - core[7477a31a1a34cc49]::fmt::write
   2:     0x7fa8ae84a9c6 - <std[287527946f71f0bc]::sys::stdio::unix::Stderr as std[287527946f71f0bc]::io::Write>::write_fmt
   3:     0x7fa8ae80a048 - std[287527946f71f0bc]::panicking::default_hook::{closure#0}
   4:     0x7fa8ae827703 - std[287527946f71f0bc]::panicking::default_hook
   5:     0x7fa8ad7fbb8a - std[287527946f71f0bc]::panicking::update_hook::<alloc[979041e9952e771b]::boxed::Box<rustc_driver_impl[517260a07841a630]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7fa8ae8279e2 - std[287527946f71f0bc]::panicking::panic_with_hook
   7:     0x7fa8ad838bc1 - std[287527946f71f0bc]::panicking::begin_panic::<rustc_errors[26c9ea40265c581b]::ExplicitBug>::{closure#0}
   8:     0x7fa8ad828fe6 - std[287527946f71f0bc]::sys::backtrace::__rust_end_short_backtrace::<std[287527946f71f0bc]::panicking::begin_panic<rustc_errors[26c9ea40265c581b]::ExplicitBug>::{closure#0}, !>
   9:     0x7fa8ad8264b9 - std[287527946f71f0bc]::panicking::begin_panic::<rustc_errors[26c9ea40265c581b]::ExplicitBug>
  10:     0x7fa8ad856901 - <rustc_errors[26c9ea40265c581b]::diagnostic::BugAbort as rustc_errors[26c9ea40265c581b]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  11:     0x7fa8adde492c - <rustc_errors[26c9ea40265c581b]::DiagCtxtHandle>::span_bug::<rustc_span[851f35e07e3c2dd4]::span_encoding::Span, alloc[979041e9952e771b]::string::String>
  12:     0x7fa8ade074d6 - rustc_middle[725063e074f29df]::util::bug::opt_span_bug_fmt::<rustc_span[851f35e07e3c2dd4]::span_encoding::Span>::{closure#0}
  13:     0x7fa8ade07682 - rustc_middle[725063e074f29df]::ty::context::tls::with_opt::<rustc_middle[725063e074f29df]::util::bug::opt_span_bug_fmt<rustc_span[851f35e07e3c2dd4]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  14:     0x7fa8addf8cab - rustc_middle[725063e074f29df]::ty::context::tls::with_context_opt::<rustc_middle[725063e074f29df]::ty::context::tls::with_opt<rustc_middle[725063e074f29df]::util::bug::opt_span_bug_fmt<rustc_span[851f35e07e3c2dd4]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  15:     0x7fa8ab6afa68 - rustc_middle[725063e074f29df]::util::bug::span_bug_fmt::<rustc_span[851f35e07e3c2dd4]::span_encoding::Span>
  16:     0x7fa8af39d5aa - <rustc_const_eval[b948c5b36ae67fb9]::interpret::eval_context::InterpCx<rustc_const_eval[b948c5b36ae67fb9]::const_eval::machine::CompileTimeMachine>>::unsize_into_ptr::<rustc_const_eval[b948c5b36ae67fb9]::interpret::place::PlaceTy>
  17:     0x7fa8aff00904 - <rustc_const_eval[b948c5b36ae67fb9]::interpret::eval_context::InterpCx<rustc_const_eval[b948c5b36ae67fb9]::const_eval::machine::CompileTimeMachine>>::eval_rvalue_into_place
  18:     0x7fa8afeba0cd - rustc_const_eval[b948c5b36ae67fb9]::const_eval::eval_queries::eval_to_allocation_raw_provider
  19:     0x7fa8afeb847e - rustc_query_impl[f20b8284200e680a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f20b8284200e680a]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[725063e074f29df]::query::erase::Erased<[u8; 24usize]>>
  20:     0x7fa8afeb7ba5 - rustc_query_system[b7e73caa2c2ad9a]::query::plumbing::try_execute_query::<rustc_query_impl[f20b8284200e680a]::DynamicConfig<rustc_query_system[b7e73caa2c2ad9a]::query::caches::DefaultCache<rustc_middle[725063e074f29df]::ty::PseudoCanonicalInput<rustc_middle[725063e074f29df]::mir::interpret::GlobalId>, rustc_middle[725063e074f29df]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[f20b8284200e680a]::plumbing::QueryCtxt, false>
  21:     0x7fa8afeb7749 - rustc_query_impl[f20b8284200e680a]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
  22:     0x7fa8afea0a02 - rustc_const_eval[b948c5b36ae67fb9]::const_eval::valtrees::eval_to_valtree
  23:     0x7fa8afea07b6 - <rustc_const_eval[b948c5b36ae67fb9]::provide::{closure#0} as core[7477a31a1a34cc49]::ops::function::FnOnce<(rustc_middle[725063e074f29df]::ty::context::TyCtxt, rustc_middle[725063e074f29df]::ty::PseudoCanonicalInput<rustc_middle[725063e074f29df]::mir::interpret::GlobalId>)>>::call_once
  24:     0x7fa8afea0780 - rustc_query_impl[f20b8284200e680a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f20b8284200e680a]::query_impl::eval_to_valtree::dynamic_query::{closure#2}::{closure#0}, rustc_middle[725063e074f29df]::query::erase::Erased<[u8; 16usize]>>
  25:     0x7fa8afea073b - <rustc_query_impl[f20b8284200e680a]::query_impl::eval_to_valtree::dynamic_query::{closure#2} as core[7477a31a1a34cc49]::ops::function::FnOnce<(rustc_middle[725063e074f29df]::ty::context::TyCtxt, rustc_middle[725063e074f29df]::ty::PseudoCanonicalInput<rustc_middle[725063e074f29df]::mir::interpret::GlobalId>)>>::call_once
  26:     0x7fa8af92f7c6 - rustc_query_system[b7e73caa2c2ad9a]::query::plumbing::try_execute_query::<rustc_query_impl[f20b8284200e680a]::DynamicConfig<rustc_query_system[b7e73caa2c2ad9a]::query::caches::DefaultCache<rustc_middle[725063e074f29df]::ty::PseudoCanonicalInput<rustc_middle[725063e074f29df]::mir::interpret::GlobalId>, rustc_middle[725063e074f29df]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[f20b8284200e680a]::plumbing::QueryCtxt, false>
  27:     0x7fa8af92f3f0 - rustc_query_impl[f20b8284200e680a]::query_impl::eval_to_valtree::get_query_non_incr::__rust_end_short_backtrace
  28:     0x7fa8abb581b9 - <rustc_middle[725063e074f29df]::ty::context::TyCtxt>::const_eval_resolve_for_typeck
  29:     0x7fa8af06d2e4 - rustc_trait_selection[9fee51d8a10a777c]::traits::try_evaluate_const
  30:     0x7fa8b004ab56 - <rustc_trait_selection[9fee51d8a10a777c]::solve::delegate::SolverDelegate as rustc_next_trait_solver[2bc6883c9be4be93]::delegate::SolverDelegate>::evaluate_const
  31:     0x7fa8afd52070 - <rustc_next_trait_solver[2bc6883c9be4be93]::solve::search_graph::SearchGraphDelegate<rustc_trait_selection[9fee51d8a10a777c]::solve::delegate::SolverDelegate> as rustc_type_ir[b93cf349b3a4f34d]::search_graph::Delegate>::compute_goal::{closure#0}
  32:     0x7fa8afd5038f - <rustc_type_ir[b93cf349b3a4f34d]::search_graph::SearchGraph<rustc_next_trait_solver[2bc6883c9be4be93]::solve::search_graph::SearchGraphDelegate<rustc_trait_selection[9fee51d8a10a777c]::solve::delegate::SolverDelegate>, rustc_middle[725063e074f29df]::ty::context::TyCtxt>>::evaluate_goal::{closure#0}::{closure#2}
  33:     0x7fa8afa08b45 - <rustc_next_trait_solver[2bc6883c9be4be93]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[9fee51d8a10a777c]::solve::delegate::SolverDelegate, rustc_middle[725063e074f29df]::ty::context::TyCtxt>>::evaluate_goal_raw
  34:     0x7fa8afa2ce0a - <rustc_next_trait_solver[2bc6883c9be4be93]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[9fee51d8a10a777c]::solve::delegate::SolverDelegate, rustc_middle[725063e074f29df]::ty::context::TyCtxt>>::try_evaluate_added_goals
  35:     0x7fa8afd51674 - <rustc_next_trait_solver[2bc6883c9be4be93]::solve::search_graph::SearchGraphDelegate<rustc_trait_selection[9fee51d8a10a777c]::solve::delegate::SolverDelegate> as rustc_type_ir[b93cf349b3a4f34d]::search_graph::Delegate>::compute_goal::{closure#0}
  36:     0x7fa8afd5038f - <rustc_type_ir[b93cf349b3a4f34d]::search_graph::SearchGraph<rustc_next_trait_solver[2bc6883c9be4be93]::solve::search_graph::SearchGraphDelegate<rustc_trait_selection[9fee51d8a10a777c]::solve::delegate::SolverDelegate>, rustc_middle[725063e074f29df]::ty::context::TyCtxt>>::evaluate_goal::{closure#0}::{closure#2}
  37:     0x7fa8afa08b45 - <rustc_next_trait_solver[2bc6883c9be4be93]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[9fee51d8a10a777c]::solve::delegate::SolverDelegate, rustc_middle[725063e074f29df]::ty::context::TyCtxt>>::evaluate_goal_raw
  38:     0x7fa8afa2ca8d - <rustc_next_trait_solver[2bc6883c9be4be93]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[9fee51d8a10a777c]::solve::delegate::SolverDelegate, rustc_middle[725063e074f29df]::ty::context::TyCtxt>>::try_evaluate_added_goals
  39:     0x7fa8afa171f1 - <rustc_next_trait_solver[2bc6883c9be4be93]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[9fee51d8a10a777c]::solve::delegate::SolverDelegate, rustc_middle[725063e074f29df]::ty::context::TyCtxt>>::evaluate_added_goals_and_make_canonical_response
  40:     0x7fa8afd513b4 - <rustc_next_trait_solver[2bc6883c9be4be93]::solve::search_graph::SearchGraphDelegate<rustc_trait_selection[9fee51d8a10a777c]::solve::delegate::SolverDelegate> as rustc_type_ir[b93cf349b3a4f34d]::search_graph::Delegate>::compute_goal::{closure#0}
  41:     0x7fa8afd5038f - <rustc_type_ir[b93cf349b3a4f34d]::search_graph::SearchGraph<rustc_next_trait_solver[2bc6883c9be4be93]::solve::search_graph::SearchGraphDelegate<rustc_trait_selection[9fee51d8a10a777c]::solve::delegate::SolverDelegate>, rustc_middle[725063e074f29df]::ty::context::TyCtxt>>::evaluate_goal::{closure#0}::{closure#2}
  42:     0x7fa8afa08b45 - <rustc_next_trait_solver[2bc6883c9be4be93]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[9fee51d8a10a777c]::solve::delegate::SolverDelegate, rustc_middle[725063e074f29df]::ty::context::TyCtxt>>::evaluate_goal_raw
  43:     0x7fa8afa29011 - <rustc_trait_selection[9fee51d8a10a777c]::solve::fulfill::FulfillmentCtxt<rustc_trait_selection[9fee51d8a10a777c]::traits::FulfillmentError> as rustc_infer[5a785d1c27494969]::traits::engine::TraitEngine<rustc_trait_selection[9fee51d8a10a777c]::traits::FulfillmentError>>::try_evaluate_obligations
  44:     0x7fa8affae12f - <rustc_infer[5a785d1c27494969]::infer::at::At as rustc_trait_selection[9fee51d8a10a777c]::traits::structural_normalize::StructurallyNormalizeExt>::structurally_normalize_term::<rustc_trait_selection[9fee51d8a10a777c]::traits::FulfillmentError>
  45:     0x7fa8affae9b9 - <rustc_hir_typeck[ed5453188701a25b]::fn_ctxt::FnCtxt>::try_structurally_resolve_const
  46:     0x7fa8affaecb7 - <rustc_hir_typeck[ed5453188701a25b]::fn_ctxt::FnCtxt>::check_expr_repeat
  47:     0x7fa8af21b5d2 - <rustc_hir_typeck[ed5453188701a25b]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  48:     0x7fa8af213dbb - <rustc_hir_typeck[ed5453188701a25b]::fn_ctxt::FnCtxt>::check_expr_block
  49:     0x7fa8af21998b - <rustc_hir_typeck[ed5453188701a25b]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  50:     0x7fa8af1fa1a6 - rustc_hir_typeck[ed5453188701a25b]::check::check_fn
  51:     0x7fa8afbb3d33 - rustc_hir_typeck[ed5453188701a25b]::typeck_with_inspect::{closure#0}
  52:     0x7fa8afbb26b4 - rustc_query_impl[f20b8284200e680a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f20b8284200e680a]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[725063e074f29df]::query::erase::Erased<[u8; 8usize]>>
  53:     0x7fa8aef5522a - rustc_query_system[b7e73caa2c2ad9a]::query::plumbing::try_execute_query::<rustc_query_impl[f20b8284200e680a]::DynamicConfig<rustc_data_structures[e0d8483206daafa2]::vec_cache::VecCache<rustc_span[851f35e07e3c2dd4]::def_id::LocalDefId, rustc_middle[725063e074f29df]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[b7e73caa2c2ad9a]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[f20b8284200e680a]::plumbing::QueryCtxt, false>
  54:     0x7fa8aef54b09 - rustc_query_impl[f20b8284200e680a]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
  55:     0x7fa8af93fdb5 - <rustc_middle[725063e074f29df]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_hir_analysis[1a80394817eddfdd]::check_crate::{closure#2}>::{closure#0}
  56:     0x7fa8af93f7c4 - rustc_hir_analysis[1a80394817eddfdd]::check_crate
  57:     0x7fa8aef493db - rustc_interface[5c48368f5debe80d]::passes::analysis
  58:     0x7fa8aef49035 - rustc_query_impl[f20b8284200e680a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f20b8284200e680a]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[725063e074f29df]::query::erase::Erased<[u8; 0usize]>>
  59:     0x7fa8affa4be3 - rustc_query_system[b7e73caa2c2ad9a]::query::plumbing::try_execute_query::<rustc_query_impl[f20b8284200e680a]::DynamicConfig<rustc_query_system[b7e73caa2c2ad9a]::query::caches::SingleCache<rustc_middle[725063e074f29df]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[f20b8284200e680a]::plumbing::QueryCtxt, false>
  60:     0x7fa8affa49ce - rustc_query_impl[f20b8284200e680a]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  61:     0x7fa8b0182c11 - <rustc_interface[5c48368f5debe80d]::passes::create_and_enter_global_ctxt<core[7477a31a1a34cc49]::option::Option<rustc_interface[5c48368f5debe80d]::queries::Linker>, rustc_driver_impl[517260a07841a630]::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core[7477a31a1a34cc49]::ops::function::FnOnce<(&rustc_session[eb79e6d3104f29ae]::session::Session, rustc_middle[725063e074f29df]::ty::context::CurrentGcx, alloc[979041e9952e771b]::sync::Arc<rustc_data_structures[e0d8483206daafa2]::jobserver::Proxy>, &std[287527946f71f0bc]::sync::once_lock::OnceLock<rustc_middle[725063e074f29df]::ty::context::GlobalCtxt>, &rustc_data_structures[e0d8483206daafa2]::sync::worker_local::WorkerLocal<rustc_middle[725063e074f29df]::arena::Arena>, &rustc_data_structures[e0d8483206daafa2]::sync::worker_local::WorkerLocal<rustc_hir[7eac7792dedc1861]::Arena>, rustc_driver_impl[517260a07841a630]::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  62:     0x7fa8afff5d34 - rustc_interface[5c48368f5debe80d]::interface::run_compiler::<(), rustc_driver_impl[517260a07841a630]::run_compiler::{closure#0}>::{closure#1}
  63:     0x7fa8aff5aa3a - std[287527946f71f0bc]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[5c48368f5debe80d]::util::run_in_thread_with_globals<rustc_interface[5c48368f5debe80d]::util::run_in_thread_pool_with_globals<rustc_interface[5c48368f5debe80d]::interface::run_compiler<(), rustc_driver_impl[517260a07841a630]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  64:     0x7fa8aff5a7fe - <std[287527946f71f0bc]::thread::lifecycle::spawn_unchecked<rustc_interface[5c48368f5debe80d]::util::run_in_thread_with_globals<rustc_interface[5c48368f5debe80d]::util::run_in_thread_pool_with_globals<rustc_interface[5c48368f5debe80d]::interface::run_compiler<(), rustc_driver_impl[517260a07841a630]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[7477a31a1a34cc49]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  65:     0x7fa8aff5c5c4 - <std[287527946f71f0bc]::sys::thread::unix::Thread>::new::thread_start
  66:     0x7fa8a989698b - <unknown>
  67:     0x7fa8a991a9cc - <unknown>
  68:                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 (621d76794 2026-01-18) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z next-solver=globally -Z dump-mir-dir=dir

query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `f::{constant#0}`
#1 [eval_to_valtree] evaluating type-level constant
#2 [typeck] type-checking `f`
#3 [analysis] running analysis passes on crate `mvce`
end of query stack
error: aborting due to 5 previous errors; 2 warnings emitted

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

@rustbot label +F-feature +WG-trait-system-refactor

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reduced Rust example with -Znext-solver=globally, then read compiler/rustc_const_eval/src/interpret/cast.rs around lines 445–457 and follow the unsize_into_ptr path shown in the backtrace. Done means this case no longer triggers the invalid-pointer-unsizing ICE and reports a normal compiler result; the issue does not name a regression test location.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.