diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-03-11 15:43:11 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-11 15:43:11 +0100 |
| commit | fbc121fdfd30daad5b99bae1aac4d6bd4d42ba02 (patch) | |
| tree | 20a69adee2d22412e2e043ff363156dde11ef4f5 /compiler/rustc_codegen_gcc | |
| parent | e350fe4e608b653da47e8012d13ef701613e717b (diff) | |
| parent | a90abd64fbb0764007d93d60823161f05f564259 (diff) | |
| download | rust-fbc121fdfd30daad5b99bae1aac4d6bd4d42ba02.tar.gz rust-fbc121fdfd30daad5b99bae1aac4d6bd4d42ba02.zip | |
Rollup merge of #104363 - WaffleLapkin:bonk_box_new, r=Nilstrieb
Make `unused_allocation` lint against `Box::new` too Previously it only linted against `box` syntax, which likely won't ever be stabilized, which is pretty useless. Even now I'm not sure if it's a meaningful lint, but it's at least something :shrug: This means that code like the following will be linted against: ```rust Box::new([1, 2, 3]).len(); f(&Box::new(1)); // where f : &i32 -> () ``` The lint works by checking if a `Box::new` (or `box`) expression has an a borrow adjustment, meaning that the code that first stores the box in a variable won't be linted against: ```rust let boxed = Box::new([1, 2, 3]); // no lint boxed.len(); ```
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions
