Matthias Krüger
fbc121fdfd
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 🤷
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();
```
2023-03-11 15:43:11 +01:00
..
2023-02-22 10:18:01 -08:00
2023-01-30 20:12:19 +00:00
2023-03-03 17:47:48 +00:00
2023-02-23 10:27:06 -07:00
2023-02-23 10:27:06 -07:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-02-22 08:40:47 -07:00
2023-02-22 08:40:47 -07:00
2023-02-22 08:40:47 -07:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-02-14 20:22:10 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-19 21:09:25 +01:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-02-09 10:26:49 +00:00
2023-01-30 21:51:33 +00:00
2023-02-22 08:40:47 -07:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-11 14:40:02 -08:00
2023-01-11 14:40:02 -08:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-02-14 20:22:10 +00:00
2023-02-09 15:15:15 +08:00
2023-02-22 08:40:47 -07:00
2023-02-23 10:27:06 -07:00
2023-02-23 10:27:06 -07:00
2023-02-22 08:40:47 -07:00
2023-01-30 20:12:19 +00:00
2023-01-20 02:26:12 -05:00
2023-01-20 02:26:12 -05:00
2023-01-20 02:26:12 -05:00
2023-01-30 20:12:21 +00:00
2023-01-30 20:12:19 +00:00
2023-02-22 08:40:47 -07:00
2023-02-22 08:40:47 -07:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-02-22 08:40:47 -07:00
2023-01-11 21:30:10 +00:00
2023-01-30 20:12:21 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-02-21 13:13:09 +00:00
2023-02-21 13:13:09 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-03-08 00:00:18 +00:00
2023-03-08 00:00:18 +00:00
2023-01-30 20:12:21 +00:00
2023-02-22 09:44:26 +08:00
2023-02-22 09:44:26 +08:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 21:51:33 +00:00
2023-01-30 21:51:33 +00:00
2023-01-15 19:46:20 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-15 19:46:20 +00:00
2023-01-15 19:46:20 +00:00
2023-01-15 19:46:20 +00:00
2023-02-22 21:52:26 +00:00
2023-02-22 08:40:47 -07:00
2023-02-03 18:53:27 +00:00
2023-02-03 18:53:27 +00:00
2023-01-30 20:12:19 +00:00
2023-01-17 02:52:43 +00:00
2023-02-23 10:27:06 -07:00
2023-02-23 10:27:06 -07:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:21 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-12 22:04:30 +00:00
2023-01-30 20:12:19 +00:00
2023-02-21 05:21:07 +00:00
2023-02-23 10:27:06 -07:00
2023-02-23 10:27:06 -07:00
2023-01-30 20:12:19 +00:00
2023-01-12 20:44:47 +00:00
2023-02-22 08:40:47 -07:00
2023-02-22 08:40:47 -07:00
2023-01-20 00:36:20 +08:00
2023-03-09 17:24:07 +00:00
2023-03-09 17:24:07 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-02-22 08:40:47 -07:00
2023-02-21 05:21:07 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2023-01-12 22:04:30 +00:00
2023-01-11 21:30:10 +00:00
2023-01-12 22:04:30 +00:00
2023-02-06 15:34:47 +01:00
2023-02-06 15:34:47 +01:00
2023-02-06 15:34:47 +01:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:21 +00:00
2023-03-06 21:05:35 +08:00
2023-03-06 21:05:35 +08:00