rust/library/alloc
bors ea78d1edf3 Auto merge of #85737 - scottmcm:vec-calloc-option-nonzero, r=m-ou-se
Enable Vec's calloc optimization for Option<NonZero>

Someone on discord noticed that `vec![None::<NonZeroU32>; N]` wasn't getting the optimization, so here's a PR 🙃

We can certainly do this in the standard library because we know for sure this is ok, but I think it's also a necessary consequence of documented guarantees like those in https://doc.rust-lang.org/std/option/#representation and https://doc.rust-lang.org/core/num/struct.NonZeroU32.html

It feels weird to do this without adding a test, but I wasn't sure where that would belong.  Is it worth adding codegen tests for these?
2021-05-27 13:05:57 +00:00
..
benches remove InPlaceIterable marker from Peekable due to unsoundness 2021-05-19 01:41:09 +02:00
src Auto merge of #85737 - scottmcm:vec-calloc-option-nonzero, r=m-ou-se 2021-05-27 13:05:57 +00:00
tests Rollup merge of #85625 - SkiFire13:fix-85613-vec-dedup-drop-panics, r=nagisa 2021-05-26 13:32:06 +02:00
Cargo.toml Add support for const operands and options to global_asm! 2021-05-13 22:31:57 +01:00