Skip to content

Commit 66df92a

Browse files
committed
Auto merge of #4739 - flip1995:rustup, r=flip1995
Rustup to #65773 changelog: none
2 parents e402ddd + 4a52dd6 commit 66df92a

22 files changed

+108
-0
lines changed

tests/ui/assign_ops2.stderr

+8
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ error: variable appears on both sides of an assignment operation
1919
|
2020
LL | a += 1 + a;
2121
| ^^^^^^^^^^
22+
|
2223
help: Did you mean a = a + 1 or a = a + 1 + a? Consider replacing it with
2324
|
2425
LL | a += 1;
@@ -33,6 +34,7 @@ error: variable appears on both sides of an assignment operation
3334
|
3435
LL | a -= a - 1;
3536
| ^^^^^^^^^^
37+
|
3638
help: Did you mean a = a - 1 or a = a - (a - 1)? Consider replacing it with
3739
|
3840
LL | a -= 1;
@@ -47,6 +49,7 @@ error: variable appears on both sides of an assignment operation
4749
|
4850
LL | a *= a * 99;
4951
| ^^^^^^^^^^^
52+
|
5053
help: Did you mean a = a * 99 or a = a * a * 99? Consider replacing it with
5154
|
5255
LL | a *= 99;
@@ -61,6 +64,7 @@ error: variable appears on both sides of an assignment operation
6164
|
6265
LL | a *= 42 * a;
6366
| ^^^^^^^^^^^
67+
|
6468
help: Did you mean a = a * 42 or a = a * 42 * a? Consider replacing it with
6569
|
6670
LL | a *= 42;
@@ -75,6 +79,7 @@ error: variable appears on both sides of an assignment operation
7579
|
7680
LL | a /= a / 2;
7781
| ^^^^^^^^^^
82+
|
7883
help: Did you mean a = a / 2 or a = a / (a / 2)? Consider replacing it with
7984
|
8085
LL | a /= 2;
@@ -89,6 +94,7 @@ error: variable appears on both sides of an assignment operation
8994
|
9095
LL | a %= a % 5;
9196
| ^^^^^^^^^^
97+
|
9298
help: Did you mean a = a % 5 or a = a % (a % 5)? Consider replacing it with
9399
|
94100
LL | a %= 5;
@@ -103,6 +109,7 @@ error: variable appears on both sides of an assignment operation
103109
|
104110
LL | a &= a & 1;
105111
| ^^^^^^^^^^
112+
|
106113
help: Did you mean a = a & 1 or a = a & a & 1? Consider replacing it with
107114
|
108115
LL | a &= 1;
@@ -117,6 +124,7 @@ error: variable appears on both sides of an assignment operation
117124
|
118125
LL | a *= a * a;
119126
| ^^^^^^^^^^
127+
|
120128
help: Did you mean a = a * a or a = a * a * a? Consider replacing it with
121129
|
122130
LL | a *= a;

tests/ui/booleans.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ error: this boolean expression can be simplified
7272
|
7373
LL | let _ = a == b && c == 5 && a == b;
7474
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
75+
|
7576
help: try
7677
|
7778
LL | let _ = a == b && c == 5;
@@ -84,6 +85,7 @@ error: this boolean expression can be simplified
8485
|
8586
LL | let _ = a == b && c == 5 && b == a;
8687
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
88+
|
8789
help: try
8890
|
8991
LL | let _ = a == b && c == 5;
@@ -120,6 +122,7 @@ error: this boolean expression can be simplified
120122
|
121123
LL | let _ = a != b || !(a != b || c == d);
122124
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
125+
|
123126
help: try
124127
|
125128
LL | let _ = c != d || a != b;

tests/ui/collapsible_if.stderr

+13
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ LL | | println!("Hello world!");
2525
LL | | }
2626
LL | | }
2727
| |_____^
28+
|
2829
help: try
2930
|
3031
LL | if (x == "hello" || x == "world") && (y == "world" || y == "hello") {
@@ -41,6 +42,7 @@ LL | | println!("Hello world!");
4142
LL | | }
4243
LL | | }
4344
| |_____^
45+
|
4446
help: try
4547
|
4648
LL | if x == "hello" && x == "world" && (y == "world" || y == "hello") {
@@ -57,6 +59,7 @@ LL | | println!("Hello world!");
5759
LL | | }
5860
LL | | }
5961
| |_____^
62+
|
6063
help: try
6164
|
6265
LL | if (x == "hello" || x == "world") && y == "world" && y == "hello" {
@@ -73,6 +76,7 @@ LL | | println!("Hello world!");
7376
LL | | }
7477
LL | | }
7578
| |_____^
79+
|
7680
help: try
7781
|
7882
LL | if x == "hello" && x == "world" && y == "world" && y == "hello" {
@@ -89,6 +93,7 @@ LL | | println!("world!")
8993
LL | | }
9094
LL | | }
9195
| |_____^
96+
|
9297
help: try
9398
|
9499
LL | if 42 == 1337 && 'a' != 'A' {
@@ -106,6 +111,7 @@ LL | | println!("world!")
106111
LL | | }
107112
LL | | }
108113
| |_____^
114+
|
109115
help: try
110116
|
111117
LL | } else if y == "world" {
@@ -123,6 +129,7 @@ LL | | println!("world!")
123129
LL | | }
124130
LL | | }
125131
| |_____^
132+
|
126133
help: try
127134
|
128135
LL | } else if let Some(42) = Some(42) {
@@ -142,6 +149,7 @@ LL | | }
142149
LL | | }
143150
LL | | }
144151
| |_____^
152+
|
145153
help: try
146154
|
147155
LL | } else if y == "world" {
@@ -164,6 +172,7 @@ LL | | }
164172
LL | | }
165173
LL | | }
166174
| |_____^
175+
|
167176
help: try
168177
|
169178
LL | } else if let Some(42) = Some(42) {
@@ -186,6 +195,7 @@ LL | | }
186195
LL | | }
187196
LL | | }
188197
| |_____^
198+
|
189199
help: try
190200
|
191201
LL | } else if let Some(42) = Some(42) {
@@ -208,6 +218,7 @@ LL | | }
208218
LL | | }
209219
LL | | }
210220
| |_____^
221+
|
211222
help: try
212223
|
213224
LL | } else if x == "hello" {
@@ -230,6 +241,7 @@ LL | | }
230241
LL | | }
231242
LL | | }
232243
| |_____^
244+
|
233245
help: try
234246
|
235247
LL | } else if let Some(42) = Some(42) {
@@ -249,6 +261,7 @@ LL | | println!("Hello world!");
249261
LL | | }
250262
LL | | }
251263
| |_____^
264+
|
252265
help: try
253266
|
254267
LL | if x == "hello" && y == "world" { // Collapsible

tests/ui/dbg_macro.stderr

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ error: `dbg!` macro is intended as a debugging tool
1515
|
1616
LL | if dbg!(n <= 1) {
1717
| ^^^^^^^^^^^^
18+
|
1819
help: ensure to avoid having uses of it in version control
1920
|
2021
LL | if n <= 1 {
@@ -25,6 +26,7 @@ error: `dbg!` macro is intended as a debugging tool
2526
|
2627
LL | dbg!(1)
2728
| ^^^^^^^
29+
|
2830
help: ensure to avoid having uses of it in version control
2931
|
3032
LL | 1
@@ -35,6 +37,7 @@ error: `dbg!` macro is intended as a debugging tool
3537
|
3638
LL | dbg!(n * factorial(n - 1))
3739
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
40+
|
3841
help: ensure to avoid having uses of it in version control
3942
|
4043
LL | n * factorial(n - 1)
@@ -45,6 +48,7 @@ error: `dbg!` macro is intended as a debugging tool
4548
|
4649
LL | dbg!(42);
4750
| ^^^^^^^^
51+
|
4852
help: ensure to avoid having uses of it in version control
4953
|
5054
LL | 42;
@@ -55,6 +59,7 @@ error: `dbg!` macro is intended as a debugging tool
5559
|
5660
LL | dbg!(dbg!(dbg!(42)));
5761
| ^^^^^^^^^^^^^^^^^^^^
62+
|
5863
help: ensure to avoid having uses of it in version control
5964
|
6065
LL | dbg!(dbg!(42));
@@ -65,6 +70,7 @@ error: `dbg!` macro is intended as a debugging tool
6570
|
6671
LL | foo(3) + dbg!(factorial(4));
6772
| ^^^^^^^^^^^^^^^^^^
73+
|
6874
help: ensure to avoid having uses of it in version control
6975
|
7076
LL | foo(3) + factorial(4);

tests/ui/for_kv_map.stderr

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ error: you seem to want to iterate on a map's values
1515
|
1616
LL | for (_, v) in &*m {
1717
| ^^^
18+
|
1819
help: use the corresponding method
1920
|
2021
LL | for v in (*m).values() {
@@ -25,6 +26,7 @@ error: you seem to want to iterate on a map's values
2526
|
2627
LL | for (_, v) in &mut m {
2728
| ^^^^^^
29+
|
2830
help: use the corresponding method
2931
|
3032
LL | for v in m.values_mut() {
@@ -35,6 +37,7 @@ error: you seem to want to iterate on a map's values
3537
|
3638
LL | for (_, v) in &mut *m {
3739
| ^^^^^^^
40+
|
3841
help: use the corresponding method
3942
|
4043
LL | for v in (*m).values_mut() {
@@ -45,6 +48,7 @@ error: you seem to want to iterate on a map's keys
4548
|
4649
LL | for (k, _value) in rm {
4750
| ^^
51+
|
4852
help: use the corresponding method
4953
|
5054
LL | for k in rm.keys() {

tests/ui/for_loop_fixable.stderr

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ error: this range is empty so this for loop will never run
1515
|
1616
LL | for i in 10..=0 {
1717
| ^^^^^^
18+
|
1819
help: consider using the following if you are attempting to iterate over this range in reverse
1920
|
2021
LL | for i in (0..=10).rev() {
@@ -25,6 +26,7 @@ error: this range is empty so this for loop will never run
2526
|
2627
LL | for i in MAX_LEN..0 {
2728
| ^^^^^^^^^^
29+
|
2830
help: consider using the following if you are attempting to iterate over this range in reverse
2931
|
3032
LL | for i in (0..MAX_LEN).rev() {
@@ -35,6 +37,7 @@ error: this range is empty so this for loop will never run
3537
|
3638
LL | for i in 10..5 + 4 {
3739
| ^^^^^^^^^
40+
|
3841
help: consider using the following if you are attempting to iterate over this range in reverse
3942
|
4043
LL | for i in (5 + 4..10).rev() {
@@ -45,6 +48,7 @@ error: this range is empty so this for loop will never run
4548
|
4649
LL | for i in (5 + 2)..(3 - 1) {
4750
| ^^^^^^^^^^^^^^^^
51+
|
4852
help: consider using the following if you are attempting to iterate over this range in reverse
4953
|
5054
LL | for i in ((3 - 1)..(5 + 2)).rev() {

tests/ui/implicit_hasher.stderr

+9
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ error: impl for `HashMap` should be generalized over different hashers
1919
|
2020
LL | impl<K: Hash + Eq, V> Foo<i8> for (HashMap<K, V>,) {
2121
| ^^^^^^^^^^^^^
22+
|
2223
help: consider adding a type parameter
2324
|
2425
LL | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<i8> for (HashMap<K, V, S>,) {
@@ -33,6 +34,7 @@ error: impl for `HashMap` should be generalized over different hashers
3334
|
3435
LL | impl Foo<i16> for HashMap<String, String> {
3536
| ^^^^^^^^^^^^^^^^^^^^^^^
37+
|
3638
help: consider adding a type parameter
3739
|
3840
LL | impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashMap<String, String, S> {
@@ -47,6 +49,7 @@ error: impl for `HashSet` should be generalized over different hashers
4749
|
4850
LL | impl<T: Hash + Eq> Foo<i8> for HashSet<T> {
4951
| ^^^^^^^^^^
52+
|
5053
help: consider adding a type parameter
5154
|
5255
LL | impl<T: Hash + Eq, S: ::std::hash::BuildHasher + Default> Foo<i8> for HashSet<T, S> {
@@ -61,6 +64,7 @@ error: impl for `HashSet` should be generalized over different hashers
6164
|
6265
LL | impl Foo<i16> for HashSet<String> {
6366
| ^^^^^^^^^^^^^^^
67+
|
6468
help: consider adding a type parameter
6569
|
6670
LL | impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashSet<String, S> {
@@ -75,6 +79,7 @@ error: parameter of type `HashMap` should be generalized over different hashers
7579
|
7680
LL | pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
7781
| ^^^^^^^^^^^^^^^^^
82+
|
7883
help: consider adding a type parameter
7984
|
8085
LL | pub fn foo<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {}
@@ -85,6 +90,7 @@ error: parameter of type `HashSet` should be generalized over different hashers
8590
|
8691
LL | pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
8792
| ^^^^^^^^^^^^
93+
|
8894
help: consider adding a type parameter
8995
|
9096
LL | pub fn foo<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32, S>) {}
@@ -98,6 +104,7 @@ LL | impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {
98104
...
99105
LL | gen!(impl);
100106
| ----------- in this macro invocation
107+
|
101108
help: consider adding a type parameter
102109
|
103110
LL | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> {
@@ -115,6 +122,7 @@ LL | pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>)
115122
...
116123
LL | gen!(fn bar);
117124
| ------------- in this macro invocation
125+
|
118126
help: consider adding a type parameter
119127
|
120128
LL | pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {}
@@ -128,6 +136,7 @@ LL | pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>)
128136
...
129137
LL | gen!(fn bar);
130138
| ------------- in this macro invocation
139+
|
131140
help: consider adding a type parameter
132141
|
133142
LL | pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32, S>) {}

tests/ui/large_enum_variant.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ error: large size difference between variants
2727
|
2828
LL | ContainingLargeEnum(LargeEnum),
2929
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30+
|
3031
help: consider boxing the large fields to reduce the total size of the enum
3132
|
3233
LL | ContainingLargeEnum(Box<LargeEnum>),
@@ -61,6 +62,7 @@ error: large size difference between variants
6162
|
6263
LL | StructLikeLarge2 { x: [i32; 8000] },
6364
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
65+
|
6466
help: consider boxing the large fields to reduce the total size of the enum
6567
|
6668
LL | StructLikeLarge2 { x: Box<[i32; 8000]> },

tests/ui/let_return.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ LL | let x = 5;
2020
| ---------- unnecessary let binding
2121
LL | x
2222
| ^
23+
|
2324
help: return the expression directly
2425
|
2526
LL |

0 commit comments

Comments
 (0)