]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #78305 - ChrisDenton:const-layout, r=oli-obk
authorMara Bos <m-ou.se@m-ou.se>
Sun, 22 Nov 2020 22:00:56 +0000 (23:00 +0100)
committerGitHub <noreply@github.com>
Sun, 22 Nov 2020 22:00:56 +0000 (23:00 +0100)
commit186ec64947a0207fef811bfefb19453068e3d87d
tree1303c42a48d9e4b786c28d153c096dfb428c64a5
parent4407049fcbdc8fce56573a4271b90384a269abbc
parent9050d12714e65ed135833b9dfd1b9619c6188ca4
Rollup merge of #78305 - ChrisDenton:const-layout, r=oli-obk

Stabilize alloc::Layout const functions

Stabilizes #67521. In particular the following stable methods are stabilized as `const fn`:

* `size`
* `align`
* `from_size_align`

Stabilizing `size` and `align` should not be controversial as they are simple (usize and NonZeroUsize) fields and I don't think there's any reason to make them not const compatible in the future. That being true, the other methods are trivially `const`. The only other issue being returning a `Result` from a `const fn` but this has been made more usable by recent stabilizations.