Skip to content

Commit 78a53c2

Browse files
committed
Update UI test
1 parent 6c30186 commit 78a53c2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/ui/default_box_assignments.fixed

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#![warn(clippy::default_box_assignments)]
22

33
fn with_default<T: Default>(b: &mut Box<T>) {
4-
*(*b) = T::default();
4+
**b = T::default();
55
//~^ default_box_assignments
66
}
77

88
fn with_sized<T>(b: &mut Box<T>, t: T) {
9-
*(*b) = t;
9+
**b = t;
1010
//~^ default_box_assignments
1111
}
1212

tests/ui/default_box_assignments.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error: creating a new box
22
--> tests/ui/default_box_assignments.rs:4:5
33
|
44
LL | *b = Box::new(T::default());
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `*(*b) = T::default()`
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `**b = T::default()`
66
|
77
= note: this creates a needless allocation
88
= note: `-D clippy::default-box-assignments` implied by `-D warnings`
@@ -12,7 +12,7 @@ error: creating a new box
1212
--> tests/ui/default_box_assignments.rs:9:5
1313
|
1414
LL | *b = Box::new(t);
15-
| ^^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `*(*b) = t`
15+
| ^^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `**b = t`
1616
|
1717
= note: this creates a needless allocation
1818

0 commit comments

Comments
 (0)