rust/library
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
..
2021-04-25 13:48:03 -07:00
2021-04-09 15:33:43 +02:00
2021-05-02 17:46:00 -06:00
2021-05-24 11:07:48 -04:00
2021-05-24 23:34:12 +01:00