1
Fork 0
rust/compiler/rustc_hir_analysis
Jubilee f256f9ef22
Rollup merge of #135228 - compiler-errors:normalizes-ur-dispatch, r=BoxyUwU
Improve `DispatchFromDyn` and `CoerceUnsized` impl validation

* Disallow arbitrary 1-ZST fields in `DispatchFromDyn` -- only `PhantomData`, and 1-ZSTs that mention no params (which is needed to support, e.g., the `Global` alloctor in `Box<T, U = Global>`).
* Don't allow coercing between non-ZSTs to ZSTs (since the previous check wasn't actually checking the field tys were the same before checking the layout...)
* Normalize the field before checking it's `PhantomData`.

Fixes #135215
Fixes #135214
Fixes #135220

r? ```@BoxyUwU``` or reassign
2025-01-14 19:56:30 -08:00
..
src Rollup merge of #135228 - compiler-errors:normalizes-ur-dispatch, r=BoxyUwU 2025-01-14 19:56:30 -08:00
Cargo.toml rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structures 2024-12-16 19:08:19 +01:00
messages.ftl Don't allow transmuting ZSTs in dispatch_from_dyn impl 2025-01-08 00:28:47 +00:00
README.md

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