Skip to content

Conversation

@rynewang
Copy link
Owner

@rynewang rynewang commented Feb 7, 2026

Summary

Fix ICE when ABI computation fails for monomorphized instances that never reach codegen.

Problem

#![feature(portable_simd)]
fn main() {
    if false {
        let _ = core::simd::Simd::<u8, 256>::splat(0);
    }
}

ICEs because check_instance_abi uses delayed_bug, assuming codegen will report the error. But unreachable code is monomorphized without reaching codegen.

Fix

Replace delayed_bug with emit_err to report the ABI/layout error directly.

Includes regression test.

Fixes rust-lang#152204
Fixes rust-lang#149156

@rynewang rynewang force-pushed the fix/ice-152204-abi-check-unreachable branch 5 times, most recently from 4e2469c to 8fb5312 Compare February 7, 2026 22:18
Replace delayed_bug with direct error emission in check_instance_abi,
since codegen may never process the instance (dead code or -Zno-codegen).
@rynewang rynewang force-pushed the fix/ice-152204-abi-check-unreachable branch from 8fb5312 to 84a3c4b Compare February 7, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ICE] when constructing Simd<u8, 256> in unreachable code ICE: -Zno-codegen: ABI computation failure should lead to compilation failure

1 participant