rust/library/core
Dylan DPC e4b4bf1535
Rollup merge of - scottmcm:valid-align, r=Mark-Simulacrum
Make non-power-of-two alignments a validity error in `Layout`

Inspired by the zulip conversation about how `Layout` should better enforce `size <= isize::MAX as usize`, this uses an N-variant enum on N-bit platforms to require at the validity level that the existing invariant of "must be a power of two" is upheld.

This was MIRI can catch it, and means there's a more-specific type for `Layout` to store than just `NonZeroUsize`.

It's left as `pub(crate)` here; a future PR could consider giving it a tracking issue for non-internal usage.
2022-04-09 18:26:25 +02:00
..
benches Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
primitive_docs Add primitive documentation to libcore 2021-09-12 02:23:08 +00:00
src Rollup merge of - scottmcm:valid-align, r=Mark-Simulacrum 2022-04-09 18:26:25 +02:00
tests Rollup merge of - scottmcm:valid-align, r=Mark-Simulacrum 2022-04-09 18:26:25 +02:00
Cargo.toml Build libcore as 2021 in a few more places 2022-02-06 15:41:01 -08:00