rust/compiler/rustc_hir_analysis
Jonathan Brouwer cbab2f0237
Rollup merge of #151495 - enthropy7:fix-simd-zero-length-extern-static, r=JonathanBrouwer
Fix ICE when using zero-length SIMD type in extern static

before my fix using a zero-length SIMD type in an extern static would cause an internal compiler error. now it properly shows a diagnostic error instead of panicking. it was because `LayoutError::InvalidSimd` wasn't handled in `check_static_inhabited` and fell through to a generic `delayed_bug`.

i added handling for `InvalidSimd` in `check_static_inhabited` (similar to `SizeOverflow`): when a SIMD type has an invalid layout, we call `emit_err` with `Spanned` to emit a normal error instead of an ICE. compiler now emits a clear error `"the SIMD type Simd<u8, 0> has zero elements"` with the correct span on the type, matching expected compiler behavior.

fixes rust-lang/rust#151451
2026-01-22 20:42:11 +01:00
..
src Rollup merge of #151495 - enthropy7:fix-simd-zero-length-extern-static, r=JonathanBrouwer 2026-01-22 20:42:11 +01:00
Cargo.toml Move attribute lints to rustc_lint 2025-12-05 14:22:52 +01:00
messages.ftl Reject const projections behind trait aliases that mention Self 2026-01-21 12:53:47 +01:00
README.md Update links in compiler/rustc_hir_analysis/README.md for type checking 2025-12-26 16:34:49 +09:00

For high-level intro to how type checking works in rustc, see the hir typeck chapter of the rustc dev guide.