rust/library
bors 1e978a3627 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
2022-08-28 01:34:47 +00:00
..
alloc Rollup merge of #95005 - ssomers:btree_static_assert, r=thomcc 2022-08-26 14:08:43 +02:00
backtrace@4e5a3f7292 update libbacktrace 2022-05-20 09:30:26 +02:00
core Auto merge of #96946 - WaffleLapkin:ptr_mask, r=scottmcm 2022-08-28 01:34:47 +00:00
panic_abort Replace most uses of pointer::offset with add and sub 2022-08-21 02:21:41 +04:00
panic_unwind Use renamed atomic intrinsics in panic_unwind 2022-08-23 16:24:59 +02:00
portable-simd Sync core::simd up to rust-lang/portable-simd@2e081db92a 2022-07-20 17:57:56 -07:00
proc_macro proc_macro: use crossbeam channels for the proc_macro cross-thread bridge 2022-07-29 17:38:12 -04:00
profiler_builtins Fully stabilize NLL 2022-06-03 17:16:41 -04:00
rtstartup
rustc-std-workspace-alloc Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00
rustc-std-workspace-core Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00
rustc-std-workspace-std Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00
std Adjust backtrace stabilization version to CURRENT_RUSTC_VERSION 2022-08-27 17:08:53 +02:00
stdarch@42df7394d3 Update stdarch submodule 2022-08-23 16:24:59 +02:00
test test: skip terminfo parsing in Miri 2022-08-07 11:56:12 -04:00
unwind unwind: don't build dependency when building for Miri 2022-08-15 12:54:12 -04:00