rust/library/alloc
Matthias Krüger ff6d8ecd64
Rollup merge of #90427 - jkugelman:must-use-alloc-leak, r=joshtriplett
Add #[must_use] to alloc functions that would leak memory

As [requested](https://github.com/rust-lang/rust/pull/89899#issuecomment-955600779) by `@joshtriplett.`

> Please do go ahead and add the ones whose only legitimate use for ignoring the return value is leaking memory. (In a separate PR please.) I think it's sufficiently error-prone to call something like alloc and ignore the result that it's legitimate to require `let _ =` for that.

I added `realloc` myself. Clippy ignored it because of its `mut` argument.

```rust
alloc/src/alloc.rs:123:1   alloc   unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8;
```

Parent issue: #89692

r? `@joshtriplett`
2021-10-31 09:20:27 +01:00
..
benches Add #[must_use] to remaining alloc functions 2021-10-15 11:46:49 -04:00
src Rollup merge of #90427 - jkugelman:must-use-alloc-leak, r=joshtriplett 2021-10-31 09:20:27 +01:00
tests Add #[must_use] to remaining core functions 2021-10-30 18:21:29 -04:00
Cargo.toml rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00