@@ -67,47 +67,59 @@ error: assigning the result of `Clone::clone()` may be inefficient
6767LL | a = b.clone();
6868 | ^^^^^^^^^^^^^ help: use `clone_from()`: `a.clone_from(&b)`
6969
70+ error: assigning the result of `Clone::clone()` may be inefficient
71+ --> tests/ui/assigning_clones.rs:133:5
72+ |
73+ LL | a = b.clone();
74+ | ^^^^^^^^^^^^^ help: use `clone_from()`: `a.clone_from(&b)`
75+
76+ error: assigning the result of `Clone::clone()` may be inefficient
77+ --> tests/ui/assigning_clones.rs:140:5
78+ |
79+ LL | a = b.clone();
80+ | ^^^^^^^^^^^^^ help: use `clone_from()`: `a.clone_from(&b)`
81+
7082error: assigning the result of `ToOwned::to_owned()` may be inefficient
71- --> tests/ui/assigning_clones.rs:139 :5
83+ --> tests/ui/assigning_clones.rs:141 :5
7284 |
73- LL | a = b .to_owned();
74- | ^^^^^^^^^^^^^^^^ help: use `clone_into()`: `b .clone_into(&mut a)`
85+ LL | a = c .to_owned();
86+ | ^^^^^^^^^^^^^^^^ help: use `clone_into()`: `c .clone_into(&mut a)`
7587
7688error: assigning the result of `ToOwned::to_owned()` may be inefficient
77- --> tests/ui/assigning_clones.rs:156 :5
89+ --> tests/ui/assigning_clones.rs:158 :5
7890 |
7991LL | *mut_string = ref_str.to_owned();
8092 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ref_str.clone_into(mut_string)`
8193
8294error: assigning the result of `ToOwned::to_owned()` may be inefficient
83- --> tests/ui/assigning_clones.rs:160 :5
95+ --> tests/ui/assigning_clones.rs:162 :5
8496 |
8597LL | mut_string = ref_str.to_owned();
8698 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ref_str.clone_into(&mut mut_string)`
8799
88100error: assigning the result of `ToOwned::to_owned()` may be inefficient
89- --> tests/ui/assigning_clones.rs:181 :5
101+ --> tests/ui/assigning_clones.rs:183 :5
90102 |
91103LL | **mut_box_string = ref_str.to_owned();
92104 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ref_str.clone_into(&mut (*mut_box_string))`
93105
94106error: assigning the result of `ToOwned::to_owned()` may be inefficient
95- --> tests/ui/assigning_clones.rs:185 :5
107+ --> tests/ui/assigning_clones.rs:187 :5
96108 |
97109LL | **mut_box_string = ref_str.to_owned();
98110 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ref_str.clone_into(&mut (*mut_box_string))`
99111
100112error: assigning the result of `ToOwned::to_owned()` may be inefficient
101- --> tests/ui/assigning_clones.rs:189 :5
113+ --> tests/ui/assigning_clones.rs:191 :5
102114 |
103115LL | *mut_thing = ToOwned::to_owned(ref_str);
104116 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ToOwned::clone_into(ref_str, mut_thing)`
105117
106118error: assigning the result of `ToOwned::to_owned()` may be inefficient
107- --> tests/ui/assigning_clones.rs:193 :5
119+ --> tests/ui/assigning_clones.rs:195 :5
108120 |
109121LL | mut_thing = ToOwned::to_owned(ref_str);
110122 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ToOwned::clone_into(ref_str, &mut mut_thing)`
111123
112- error: aborting due to 18 previous errors
124+ error: aborting due to 20 previous errors
113125
0 commit comments