rust/compiler/rustc_mir_transform
许杰友 Jieyou Xu (Joe) 2d3b1e014b
Rollup merge of #124251 - scottmcm:unop-ptr-metadata, r=oli-obk
Add an intrinsic for `ptr::metadata`

The follow-up to #123840, so we can remove `PtrComponents` and `PtrRepr` from libcore entirely (well, after a bootstrap update).

As discussed in <https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/.60ptr_metadata.60.20in.20MIR/near/435637808>, this introduces `UnOp::PtrMetadata` taking a raw pointer and returning the associated metadata value.

By no longer going through a `union`, this should also help future PRs better optimize pointer operations.

r? ``@oli-obk``
2024-05-29 03:25:07 +01:00
..
src Rollup merge of #124251 - scottmcm:unop-ptr-metadata, r=oli-obk 2024-05-29 03:25:07 +01:00
Cargo.toml compiler: const_eval/transform/validate.rs -> mir_transform/validate.rs 2024-05-24 09:56:56 -07:00
messages.ftl Remove MIR unsafe check 2024-04-03 08:50:12 +00:00