Skip to content

Commit 2bcb00d

Browse files
committed
Fix tests
1 parent 207b545 commit 2bcb00d

File tree

3 files changed

+17
-19
lines changed

3 files changed

+17
-19
lines changed

tests/ui/assigning_clones.fixed

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// run-rustfix
21
#![allow(unused)]
32
#![allow(clippy::redundant_clone)]
43
#![allow(clippy::ptr_arg)] // https://github.com/rust-lang/rust-clippy/issues/10612

tests/ui/assigning_clones.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// run-rustfix
21
#![allow(unused)]
32
#![allow(clippy::redundant_clone)]
43
#![allow(clippy::ptr_arg)] // https://github.com/rust-lang/rust-clippy/issues/10612

tests/ui/assigning_clones.stderr

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: assigning the result of `Clone::clone()` may be inefficient
2-
--> $DIR/assigning_clones.rs:25:5
2+
--> $DIR/assigning_clones.rs:24:5
33
|
44
LL | *mut_thing = value_thing.clone();
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `mut_thing.clone_from(&value_thing)`
@@ -8,97 +8,97 @@ LL | *mut_thing = value_thing.clone();
88
= help: to override `-D warnings` add `#[allow(clippy::assigning_clones)]`
99

1010
error: assigning the result of `Clone::clone()` may be inefficient
11-
--> $DIR/assigning_clones.rs:29:5
11+
--> $DIR/assigning_clones.rs:28:5
1212
|
1313
LL | *mut_thing = ref_thing.clone();
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `mut_thing.clone_from(ref_thing)`
1515

1616
error: assigning the result of `Clone::clone()` may be inefficient
17-
--> $DIR/assigning_clones.rs:33:5
17+
--> $DIR/assigning_clones.rs:32:5
1818
|
1919
LL | mut_thing = ref_thing.clone();
2020
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `mut_thing.clone_from(ref_thing)`
2121

2222
error: assigning the result of `Clone::clone()` may be inefficient
23-
--> $DIR/assigning_clones.rs:37:5
23+
--> $DIR/assigning_clones.rs:36:5
2424
|
2525
LL | *mut_thing = Clone::clone(ref_thing);
2626
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `Clone::clone_from(mut_thing, ref_thing)`
2727

2828
error: assigning the result of `Clone::clone()` may be inefficient
29-
--> $DIR/assigning_clones.rs:41:5
29+
--> $DIR/assigning_clones.rs:40:5
3030
|
3131
LL | mut_thing = Clone::clone(ref_thing);
3232
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `Clone::clone_from(&mut mut_thing, ref_thing)`
3333

3434
error: assigning the result of `Clone::clone()` may be inefficient
35-
--> $DIR/assigning_clones.rs:45:5
35+
--> $DIR/assigning_clones.rs:44:5
3636
|
3737
LL | *mut_thing = Clone::clone(ref_thing);
3838
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `Clone::clone_from(mut_thing, ref_thing)`
3939

4040
error: assigning the result of `Clone::clone()` may be inefficient
41-
--> $DIR/assigning_clones.rs:49:5
41+
--> $DIR/assigning_clones.rs:48:5
4242
|
4343
LL | *mut_thing = HasCloneFrom::clone(ref_thing);
4444
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `Clone::clone_from(mut_thing, ref_thing)`
4545

4646
error: assigning the result of `Clone::clone()` may be inefficient
47-
--> $DIR/assigning_clones.rs:53:5
47+
--> $DIR/assigning_clones.rs:52:5
4848
|
4949
LL | *mut_thing = <HasCloneFrom as Clone>::clone(ref_thing);
5050
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `Clone::clone_from(mut_thing, ref_thing)`
5151

5252
error: assigning the result of `Clone::clone()` may be inefficient
53-
--> $DIR/assigning_clones.rs:58:5
53+
--> $DIR/assigning_clones.rs:57:5
5454
|
5555
LL | *(mut_thing + &mut HasCloneFrom) = ref_thing.clone();
5656
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `(mut_thing + &mut HasCloneFrom).clone_from(ref_thing)`
5757

5858
error: assigning the result of `Clone::clone()` may be inefficient
59-
--> $DIR/assigning_clones.rs:63:5
59+
--> $DIR/assigning_clones.rs:62:5
6060
|
6161
LL | *mut_thing = (ref_thing + ref_thing).clone();
6262
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `mut_thing.clone_from(ref_thing + ref_thing)`
6363

6464
error: assigning the result of `Clone::clone()` may be inefficient
65-
--> $DIR/assigning_clones.rs:69:9
65+
--> $DIR/assigning_clones.rs:68:9
6666
|
6767
LL | a = b.clone();
6868
| ^^^^^^^^^^^^^ help: use `clone_from()`: `a.clone_from(&b)`
6969

7070
error: assigning the result of `ToOwned::to_owned()` may be inefficient
71-
--> $DIR/assigning_clones.rs:146:5
71+
--> $DIR/assigning_clones.rs:145:5
7272
|
7373
LL | *mut_string = ref_str.to_owned();
7474
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ref_str.clone_into(mut_string)`
7575

7676
error: assigning the result of `ToOwned::to_owned()` may be inefficient
77-
--> $DIR/assigning_clones.rs:150:5
77+
--> $DIR/assigning_clones.rs:149:5
7878
|
7979
LL | mut_string = ref_str.to_owned();
8080
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ref_str.clone_into(&mut mut_string)`
8181

8282
error: assigning the result of `ToOwned::to_owned()` may be inefficient
83-
--> $DIR/assigning_clones.rs:171:5
83+
--> $DIR/assigning_clones.rs:170:5
8484
|
8585
LL | **mut_box_string = ref_str.to_owned();
8686
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ref_str.clone_into(&mut (*mut_box_string))`
8787

8888
error: assigning the result of `ToOwned::to_owned()` may be inefficient
89-
--> $DIR/assigning_clones.rs:175:5
89+
--> $DIR/assigning_clones.rs:174:5
9090
|
9191
LL | **mut_box_string = ref_str.to_owned();
9292
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ref_str.clone_into(&mut (*mut_box_string))`
9393

9494
error: assigning the result of `ToOwned::to_owned()` may be inefficient
95-
--> $DIR/assigning_clones.rs:179:5
95+
--> $DIR/assigning_clones.rs:178:5
9696
|
9797
LL | *mut_thing = ToOwned::to_owned(ref_str);
9898
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ToOwned::clone_into(ref_str, mut_thing)`
9999

100100
error: assigning the result of `ToOwned::to_owned()` may be inefficient
101-
--> $DIR/assigning_clones.rs:183:5
101+
--> $DIR/assigning_clones.rs:182:5
102102
|
103103
LL | mut_thing = ToOwned::to_owned(ref_str);
104104
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ToOwned::clone_into(ref_str, &mut mut_thing)`

0 commit comments

Comments
 (0)