about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/back/write.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-10-31 09:20:27 +0100
committerGitHub <noreply@github.com>2021-10-31 09:20:27 +0100
commitff6d8ecd6482587368ab0a6287009460eac536b3 (patch)
treee89ccb94dd1d71a655d22668e2308b5c3e56c322 /compiler/rustc_codegen_llvm/src/back/write.rs
parentd4bdcdb1ec1c166c5ba67459511e471c4ad2a0ab (diff)
parent42e0282d5201dc825307582fbb48f05144d78ee0 (diff)
downloadrust-ff6d8ecd6482587368ab0a6287009460eac536b3.tar.gz
rust-ff6d8ecd6482587368ab0a6287009460eac536b3.zip
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`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/back/write.rs')
0 files changed, 0 insertions, 0 deletions