rust/library/core
Declan Kelly 2a827635ba Implement provenance preserving method on NonNull
**Description**
 Add the `addr`, `with_addr, `map_addr` methods to the `NonNull` type,
 and map the address type to `NonZeroUsize`.

 **Motiviation**
 The `NonNull` type is useful for implementing pointer types which have
 the 0-niche. It is currently possible to implement these provenance
 preserving functions by calling `NonNull::as_ptr` and `new_unchecked`.
 The addition of these methods simply make it more ergonomic to use.

 **Testing**
 Added a unit test of a nonnull tagged pointer type. This is based on
 some real code I have elsewhere, that currently routes the pointer
 through a `NonZeroUsize` and back out to produce a usable pointer.
2022-04-01 00:23:09 -07:00
..
benches Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
primitive_docs
src Implement provenance preserving method on NonNull 2022-04-01 00:23:09 -07:00
tests Implement provenance preserving method on NonNull 2022-04-01 00:23:09 -07:00
Cargo.toml Build libcore as 2021 in a few more places 2022-02-06 15:41:01 -08:00