rust/compiler/rustc_mir_build
Matthias Krüger 6059195875
Rollup merge of #141469 - Kivooeo:remove-usnsafegate, r=compiler-errors
Allow `&raw [mut | const]` for union field in safe code

fixes rust-lang/rust#141264

r? ``@Veykril``

Unresolved questions:

- [x] Any edge cases?
- [x] How this works with rust-analyzer (because all I've did is prevent compiler from emitting error in `&raw` context) (rust-lang/rust-analyzer#19867)
- [x] Should we allow `addr_of!` and `addr_of_mut!` as well? In current version they both (`&raw` and `addr_of!`) are allowed (They are the same)
- [x] Is chain of union fields is a safe? (Yes)
2025-09-28 18:13:11 +02:00
..