|
| 1 | +error: creating a new box |
| 2 | + --> tests/ui/default_box_assignments.rs:4:5 |
| 3 | + | |
| 4 | +LL | *b = Box::new(T::default()); |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `*(*b) = T::default()` |
| 6 | + | |
| 7 | + = note: this creates a needless allocation |
| 8 | + = note: `-D clippy::default-box-assignments` implied by `-D warnings` |
| 9 | + = help: to override `-D warnings` add `#[allow(clippy::default_box_assignments)]` |
| 10 | + |
| 11 | +error: creating a new box |
| 12 | + --> tests/ui/default_box_assignments.rs:9:5 |
| 13 | + | |
| 14 | +LL | *b = Box::new(t); |
| 15 | + | ^^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `*(*b) = t` |
| 16 | + | |
| 17 | + = note: this creates a needless allocation |
| 18 | + |
1 | 19 | error: creating a new box with default content
|
2 |
| - --> tests/ui/default_box_assignments.rs:11:5 |
| 20 | + --> tests/ui/default_box_assignments.rs:26:5 |
3 | 21 | |
|
4 | 22 | LL | b = Default::default();
|
5 | 23 | | ^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with default instead: `*b = Default::default()`
|
6 | 24 | |
|
7 | 25 | = note: this creates a needless allocation
|
8 |
| - = note: `-D clippy::default-box-assignments` implied by `-D warnings` |
9 |
| - = help: to override `-D warnings` add `#[allow(clippy::default_box_assignments)]` |
10 | 26 |
|
11 | 27 | error: creating a new box with default content
|
12 |
| - --> tests/ui/default_box_assignments.rs:13:5 |
| 28 | + --> tests/ui/default_box_assignments.rs:28:5 |
13 | 29 | |
|
14 | 30 | LL | b = Box::default();
|
15 | 31 | | ^^^^^^^^^^^^^^^^^^ help: replace existing content with default instead: `*b = Default::default()`
|
16 | 32 | |
|
17 | 33 | = note: this creates a needless allocation
|
18 | 34 |
|
19 | 35 | error: creating a new box
|
20 |
| - --> tests/ui/default_box_assignments.rs:23:5 |
| 36 | + --> tests/ui/default_box_assignments.rs:38:5 |
21 | 37 | |
|
22 | 38 | LL | b = Box::new(5);
|
23 | 39 | | ^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `*b = 5`
|
24 | 40 | |
|
25 | 41 | = note: this creates a needless allocation
|
26 | 42 |
|
27 |
| -error: aborting due to 3 previous errors |
| 43 | +error: aborting due to 5 previous errors |
28 | 44 |
|
0 commit comments