rust/library/alloc
Guillaume Gomez d7c9693401
Rollup merge of #89726 - jkugelman:must-use-alloc-constructors, r=joshtriplett
Add #[must_use] to alloc constructors

Added `#[must_use]`. to the various forms of `new`, `pin`, and `with_capacity` in the `alloc` crate. No extra explanations given as I couldn't think of anything useful to add.

I figure this deserves extra scrutiny compared to the other PRs I've done so far. In particular:

* The 4 `pin`/`pin_in` methods I touched. Are there legitimate use cases for pinning and not using the result? Pinning's a difficult concept I'm not very comfortable with.
* `Box`'s constructors. Do people ever create boxes just for the side effects... allocating or zeroing out memory?

Parent issue: #89692

r? ``@joshtriplett``
2021-10-11 14:11:42 +02:00
..
benches Rollup merge of #88452 - xu-cheng:vecdeque-from-array, r=m-ou-se 2021-10-04 13:58:08 -07:00
src Rollup merge of #89726 - jkugelman:must-use-alloc-constructors, r=joshtriplett 2021-10-11 14:11:42 +02:00
tests Rollup merge of #87993 - kornelski:try_reserve_stable, r=joshtriplett 2021-10-04 21:12:33 -07:00
Cargo.toml rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00