Skip to content

[ICE]: rvalue.rs:685:26: impossible case reached #160062

Description

@WannaCry1LoL

Code

use std::mem::MaybeUninit;

fn main() {
    let value: u8 = unsafe { MaybeUninit::uninit().assume_init() };
    if value == 0 { std::hint::black_box(()); }
}

Meta

rustc --version --verbose:

rustc 1.99.0-nightly (09ee43b2d 2026-07-27)
binary: rustc
commit-hash: 09ee43b2d6055539771bee8ac30a6e56eb4db773
commit-date: 2026-07-27
host: x86_64-pc-windows-msvc
release: 1.99.0-nightly
LLVM version: 22.1.8

Error output

> rustc +nightly .\main.rs -O
...
error: internal compiler error: /rustc-dev/09ee43b2d6055539771bee8ac30a6e56eb4db773/compiler\rustc_codegen_ssa\src\mir\rvalue.rs:685:26: impossible case reached
Backtrace

thread 'rustc' panicked at /rustc-dev/09ee43b2d6055539771bee8ac30a6e56eb4db773/compiler\rustc_codegen_ssa\src\mir\rvalue.rs:685:26:
Box<dyn Any>
stack backtrace:
   0:     0x7ffb5d9fd9be - std::backtrace_rs::backtrace::win64::trace
                               at /rustc/09ee43b2d6055539771bee8ac30a6e56eb4db773/library\std\src\..\..\backtrace\src\backtrace\win64.rs:85
   1:     0x7ffb5d9fd9be - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/09ee43b2d6055539771bee8ac30a6e56eb4db773/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ffb5d9fd9be - std::backtrace::Backtrace::create
                               at /rustc/09ee43b2d6055539771bee8ac30a6e56eb4db773/library\std\src\backtrace.rs:331
   3:     0x7ffb5d9fd8fa - std::backtrace::Backtrace::force_capture
                               at /rustc/09ee43b2d6055539771bee8ac30a6e56eb4db773/library\std\src\backtrace.rs:312
   4:     0x7ffb5f455d55 - core[f7563d98feae0cbf]::slice::sort::unstable::heapsort::heapsort::<((rustc_lint_defs[1d5e624918b6ff94]::Level, &str), usize), <((rustc_lint_defs[1d5e624918b6ff94]::Level, &str), usize) as core[f7563d98feae0cbf]::cmp::PartialOrd>::lt>
   5:     0x7ffb5da12074 - std::panicking::panic_with_hook
                               at /rustc/09ee43b2d6055539771bee8ac30a6e56eb4db773/library\std\src\panicking.rs:823
   6:     0x7ffb61d954b5 - core[f7563d98feae0cbf]::slice::sort::stable::quicksort::quicksort::<rustc_errors[9fafd020d8c41cc9]::annotate_snippet_emitter_writer::Annotation, <[rustc_errors[9fafd020d8c41cc9]::annotate_snippet_emitter_writer::Annotation]>::sort_by_key<usize, rustc_errors[9fafd020d8c41cc9]::annotate_snippet_emitter_writer::collect_annotations::{closure#2}>::{closure#0}>
   7:     0x7ffb61d8da19 - std[153d1d20faea458f]::sys::backtrace::__rust_end_short_backtrace::<std[153d1d20faea458f]::panicking::begin_panic<rustc_errors[9fafd020d8c41cc9]::ExplicitBug>::{closure#0}, !>
   8:     0x7ffb61d8b2e4 - std[153d1d20faea458f]::panicking::begin_panic::<rustc_errors[9fafd020d8c41cc9]::ExplicitBug>
   9:     0x7ffb61da2eb5 - <rustc_errors[9fafd020d8c41cc9]::diagnostic::BugAbort as rustc_errors[9fafd020d8c41cc9]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  10:     0x7ffb61ad1d17 - <rustc_data_structures[1c15b0e44a536d44]::profiling::SelfProfilerRef>::exec::cold_call::<<rustc_data_structures[1c15b0e44a536d44]::profiling::SelfProfilerRef>::incr_result_hashing::{closure#0}>
  11:     0x7ffb61ad1da5 - <rustc_data_structures[1c15b0e44a536d44]::profiling::SelfProfilerRef>::exec::cold_call::<<rustc_data_structures[1c15b0e44a536d44]::profiling::SelfProfilerRef>::incr_result_hashing::{closure#0}>
  12:     0x7ffb61ab9f16 - rustc_middle[f73356697f97db93]::util::bug::span_bug_fmt::<rustc_span[af9c99177ea2024c]::span_encoding::Span>
  13:     0x7ffb61b1b946 - rustc_middle[f73356697f97db93]::util::bug::bug_fmt
  14:     0x7ffb5dafdac0 - <hashbrown[9f8edc6eabc9a234]::raw::RawTable<((&rustc_codegen_llvm[f22b8a1baad38069]::llvm::ffi::Metadata, usize), &rustc_codegen_llvm[f22b8a1baad38069]::llvm::ffi::Metadata)>>::reserve_rehash::<hashbrown[9f8edc6eabc9a234]::map::make_hasher<(&rustc_codegen_llvm[f22b8a1baad38069]::llvm::ffi::Metadata, usize), &rustc_codegen_llvm[f22b8a1baad38069]::llvm::ffi::Metadata, rustc_hash[7e75b047cc5a9690]::FxBuildHasher>::{closure#0}>
  15:     0x7ffb5dabf70b - <hashbrown[9f8edc6eabc9a234]::raw::RawTable<((&rustc_codegen_llvm[f22b8a1baad38069]::llvm::ffi::Metadata, usize), &rustc_codegen_llvm[f22b8a1baad38069]::llvm::ffi::Metadata)>>::reserve_rehash::<hashbrown[9f8edc6eabc9a234]::map::make_hasher<(&rustc_codegen_llvm[f22b8a1baad38069]::llvm::ffi::Metadata, usize), &rustc_codegen_llvm[f22b8a1baad38069]::llvm::ffi::Metadata, rustc_hash[7e75b047cc5a9690]::FxBuildHasher>::{closure#0}>
  16:     0x7ffb5db4cc52 - <alloc[c563826c2f21b3f2]::raw_vec::RawVec<&rustc_codegen_llvm[f22b8a1baad38069]::llvm::ffi::Type>>::grow_one
  17:     0x7ffb5ae35c57 - <rustc_codegen_llvm[f22b8a1baad38069]::LlvmCodegenBackend as rustc_codegen_ssa[b0a6a5e0bd142828]::traits::backend::ExtraBackendMethods>::compile_codegen_unit
  18:     0x7ffb5add13af - <rustc_interface[1932a6f36dcf48ba]::passes::LintStoreExpandImpl as rustc_expand[b761550495eee9dc]::base::LintStoreExpand>::pre_expansion_lint
  19:     0x7ffb5ae3fa13 - <rustc_codegen_llvm[f22b8a1baad38069]::LlvmCodegenBackend as rustc_codegen_ssa[b0a6a5e0bd142828]::traits::backend::CodegenBackend>::codegen_crate
  20:     0x7ffb5adafb15 - <rustc_interface[1932a6f36dcf48ba]::queries::Linker>::codegen_and_build_linker
  21:     0x7ffb5ad81058 - std[153d1d20faea458f]::sys::backtrace::__rust_begin_short_backtrace::<std[153d1d20faea458f]::thread::lifecycle::spawn_unchecked<ctrlc[d3de6c8bf81503a0]::set_handler_inner<rustc_driver_impl[7c6fdf98db1f435e]::install_ctrlc_handler::{closure#0}>::{closure#0}, ()>::{closure#1}::{closure#0}::{closure#0}, ()>
  22:     0x7ffb5ad7ad15 - RINvNtNtCs1P3iEg5RBhP_3std3sys9backtrace28___rust_begin_short_backtraceNCNCINvNtCs2a7UyML0gNG_15rustc_interface4util26run_in_thread_with_globalsNCINvB1e_31run_in_thread_pool_with_globalsNCINvNtB1g_9interface12run_compileruNCNvCsaGngv8LbxXS_17rustc_driver_i
  23:     0x7ffb5ad85797 - std[153d1d20faea458f]::sys::backtrace::__rust_begin_short_backtrace::<std[153d1d20faea458f]::thread::lifecycle::spawn_unchecked<ctrlc[d3de6c8bf81503a0]::set_handler_inner<rustc_driver_impl[7c6fdf98db1f435e]::install_ctrlc_handler::{closure#0}>::{closure#0}, ()>::{closure#1}::{closure#0}::{closure#0}, ()>
  24:     0x7ffb5da1c9a3 - std::sys::thread::windows::impl$0::new::thread_start
                               at /rustc/09ee43b2d6055539771bee8ac30a6e56eb4db773/library\std\src\sys\thread\windows.rs:58
  25:     0x7ffc9e0ee957 - BaseThreadInitThunk
  26:     0x7ffc9e58ad6c - RtlUserThreadStart


rustc version: 1.99.0-nightly (09ee43b2d 2026-07-27)
platform: x86_64-pc-windows-msvc

query stack during panic:
end of query stack

Metadata

Metadata

Assignees

No one assigned

    Labels

    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.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions