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 | 7006047b2d426d2cff6e02b515aeb9335066584f (patch) | |
| tree | 23bcb6dec7d17e87920be953a80a1a67f1ee0770 /tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff | |
| parent | 1a61b6e919cf60fcdc03ce2e955e53e115e991a2 (diff) | |
| parent | 1acc3b45e3c83423e12154a6c893941b2bb4ef7a (diff) | |
| download | rust-7006047b2d426d2cff6e02b515aeb9335066584f.tar.gz rust-7006047b2d426d2cff6e02b515aeb9335066584f.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_len.NormalizeArrayLen.panic-unwind.diff')
0 files changed, 0 insertions, 0 deletions
