Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#90427 - jkugelman:must-use-alloc-leak, r=jo…
…shtriplett Add #[must_use] to alloc functions that would leak memory As [requested](rust-lang#89899 (comment)) 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: rust-lang#89692 r? `@joshtriplett`
- Loading branch information