diff options
| author | bors <bors@rust-lang.org> | 2022-08-28 01:34:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-08-28 01:34:47 +0000 |
| commit | f48af912ea9a9726ff851a3e4a809e1d2daeb0ba (patch) | |
| tree | 554e0315662fce79d79de33fc05cb3def7d3392a /tests/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.diff | |
| parent | 1239a022ca6f7696825ca2158a3953fc85819fa4 (diff) | |
| parent | 5f357c2c51e5663f5c75b389c3fb3501753ac3be (diff) | |
| download | rust-f48af912ea9a9726ff851a3e4a809e1d2daeb0ba.tar.gz rust-f48af912ea9a9726ff851a3e4a809e1d2daeb0ba.zip | |
Auto merge of #96946 - WaffleLapkin:ptr_mask, r=scottmcm
Add pointer masking convenience functions
This PR adds the following public API:
```rust
impl<T: ?Sized> *const T {
fn mask(self, mask: usize) -> *const T;
}
impl<T: ?Sized> *mut T {
fn mask(self, mask: usize) -> *const T;
}
// mod intrinsics
fn mask<T>(ptr: *const T, mask: usize) -> *const T
```
This is equivalent to `ptr.map_addr(|a| a & mask)` but also uses a cool llvm intrinsic.
Proposed in https://github.com/rust-lang/rust/pull/95643#issuecomment-1121562352
cc `@Gankra` `@scottmcm` `@RalfJung`
r? rust-lang/libs-api
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.diff')
0 files changed, 0 insertions, 0 deletions
