mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-23 02:27:39 +03:00
58b1130a18
Fix ICE when transmute Assume field is invalid This PR fixes an internal compiler error in `rustc_transmute` where initializing an `Assume` field (like `alignment`) with a non-scalar constant (like a struct) caused a panic. The fix updates `from_const` to use `try_to_scalar()` instead of assuming the value is always a leaf. It now gracefully returns `None` for invalid types, allowing the compiler to report standard "missing field initialiser" errors instead of crashing. Fixes rust-lang/rust#150506