mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
ff6d8ecd64
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` |
||
---|---|---|
.. | ||
benches | ||
src | ||
tests | ||
Cargo.toml |