rust/library/core
bors 21867225a7 Auto merge of #74930 - ecstatic-morse:const-size-align-of-val, r=oli-obk
Make `mem::size_of_val` and `mem::align_of_val` unstably const

Implements #46571 but does not stabilize it. I wanted this while working on something today.

The only reason not to immediately stabilize are concerns around [custom DSTs](https://github.com/rust-lang/rust/issues/46571#issuecomment-387669352). That proposal has made zero progress in the last two years and const eval is rich enough to support pretty much any user-defined `len` function as long as nightly features are allowed (`raw_ptr_deref`).

Currently, this raises a `const_err` lint when passed an `extern type`.

r? @oli-obk

cc @rust-lang/wg-const-eval
2020-07-30 12:52:41 +00:00
..
benches
src Auto merge of #74930 - ecstatic-morse:const-size-align-of-val, r=oli-obk 2020-07-30 12:52:41 +00:00
tests
Cargo.toml