Skip to content

[ICE]: operand.rs:114:32: OperandValue cannot be a pointer: Uninit #159867

Description

@tmiasko

Code

use std::mem::MaybeUninit;

fn main() {
    let a: Box<[u8; 0]> = unsafe { MaybeUninit::uninit().assume_init() };
    std::hint::black_box(a as Box<[u8]>);
}
$ rustc z.rs -O
...
error: internal compiler error: /rustc-dev/89c61a7545da48b06116675b888398d02a4064c7/compiler/rustc_codegen_ssa/src/mir/operand.rs:114:32: OperandValue cannot be a pointer: Uninit

An additional code path from #157797 (cc @glandium, @oli-obk) that was assumed to be unreachable.

Meta

rustc --version --verbose:

rustc 1.99.0-nightly (89c61a754 2026-07-23)
binary: rustc
commit-hash: 89c61a7545da48b06116675b888398d02a4064c7
commit-date: 2026-07-23
host: x86_64-unknown-linux-gnu
release: 1.99.0-nightly
LLVM version: 22.1.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationC-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