rust/library/core/src/ptr
bors f68c28b6ce Auto merge of #129845 - scottmcm:redo-layout, r=Noratrieb
Take more advantage of the `isize::MAX` limit in `Layout`

Things like `padding_needed_for` are current implemented being super careful to handle things like `Layout::size` potentially being `usize::MAX`.

But now that #95295 has happened, that's no longer a concern.  It's possible to add two `Layout::size`s together without risking overflow now.

So take advantage of that to remove a bunch of checked math that's not actually needed.  For example, the round-up-and-add-next-size in `extend` doesn't need any overflow checks at all, just the final check for compatibility with the alignment.

(And while I was doing that I made it all unstably const, because there's nothing in `Layout` that's fundamentally runtime-only.)
2024-09-18 07:05:14 +00:00
..
alignment.rs Auto merge of #129845 - scottmcm:redo-layout, r=Noratrieb 2024-09-18 07:05:14 +00:00
const_ptr.rs Rollup merge of #130164 - RalfJung:const_ptr_as_ref, r=dtolnay 2024-09-09 19:20:39 -07:00
metadata.rs Remove needless returns detected by clippy in libraries 2024-09-08 21:51:00 +02:00
mod.rs Rollup merge of #129653 - RalfJung:addr-of-read-only, r=scottmcm 2024-09-05 19:43:47 +02:00
mut_ptr.rs stabilize const_mut_refs 2024-09-15 09:51:32 +02:00
non_null.rs move some const fn out of the const_ptr_as_ref feature 2024-09-09 19:59:16 +02:00
unique.rs PinCoerceUnsized trait into core 2024-07-31 17:10:55 +08:00