bors 4787e97475 Auto merge of #66256 - CAD97:patch-2, r=RalfJung
Layout::pad_to_align is infallible

As per [this comment](https://github.com/rust-lang/rust/issues/55724#issuecomment-441421651) (cc @glandium).

> Per https://github.com/rust-lang/rust/blob/eb981a1/src/libcore/alloc.rs#L63-L65, `layout.size()` is always <= `usize::MAX - (layout.align() - 1)`.
>
> Which means:
>
> * The maximum value `layout.size()` can have is already aligned for `layout.align()` (`layout.align()` being a power of two, `usize::MAX - (layout.align() - 1)` is a multiple of `layout.align()`)
> * Incidentally, any value smaller than that maximum value will align at most to that maximum value.
>
> IOW, `pad_to_align` can not return `Err(LayoutErr)`, except for the layout not respecting its invariants, but we shouldn't care about that.

This PR makes `pad_to_align` return `Layout` directly, representing the fact that it cannot fail.
2019-12-03 01:50:33 +00:00
..
2019-11-27 10:27:30 +01:00
2019-11-23 07:06:27 +01:00
2019-11-26 23:02:11 -08:00
2019-11-26 23:02:11 -08:00
2019-11-26 23:02:11 -08:00
2019-11-26 23:02:11 -08:00
2019-11-26 23:02:11 -08:00
2019-11-26 23:02:11 -08:00
2019-11-26 23:02:11 -08:00
2019-11-26 23:02:11 -08:00
2019-11-26 23:02:11 -08:00
2019-11-29 20:47:16 +02:00
2019-11-26 23:02:11 -08:00
2019-11-13 09:31:08 +01:00
2019-11-26 23:02:11 -08:00
2019-11-26 23:02:11 -08:00
2019-11-26 23:02:11 -08:00
2019-11-26 23:02:11 -08:00
2019-11-26 22:19:54 -05:00
2019-11-21 14:55:32 +01:00
2019-11-21 14:55:32 +01:00
2019-11-26 23:02:11 -08:00
2019-11-26 09:24:39 +01:00
2019-11-25 23:55:54 +01:00
2019-11-26 23:02:11 -08:00
2019-11-26 23:02:11 -08:00
2019-11-26 23:02:11 -08:00
2019-11-26 23:02:11 -08:00