Skip to content

Commit 1f94d55

Browse files
Fix new tests updates
1 parent 8a2dae6 commit 1f94d55

File tree

1,025 files changed

+5989
-7822
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,025 files changed

+5989
-7822
lines changed

tests/ui/as_pointer_underscore.fixed

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ struct S;
77
fn f(s: &S) -> usize {
88
&s as *const &S as usize
99
//~^ as_pointer_underscore
10-
1110
}
1211

1312
fn g(s: &mut S) -> usize {
1413
s as *mut S as usize
1514
//~^ as_pointer_underscore
16-
1715
}

tests/ui/as_pointer_underscore.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ struct S;
77
fn f(s: &S) -> usize {
88
&s as *const _ as usize
99
//~^ as_pointer_underscore
10-
1110
}
1211

1312
fn g(s: &mut S) -> usize {
1413
s as *mut _ as usize
1514
//~^ as_pointer_underscore
16-
1715
}

tests/ui/as_pointer_underscore.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | &s as *const _ as usize
88
= help: to override `-D warnings` add `#[allow(clippy::as_pointer_underscore)]`
99

1010
error: using inferred pointer cast
11-
--> tests/ui/as_pointer_underscore.rs:14:10
11+
--> tests/ui/as_pointer_underscore.rs:13:10
1212
|
1313
LL | s as *mut _ as usize
1414
| ^^^^^^ help: use explicit type: `*mut S`

tests/ui/as_ptr_cast_mut.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ fn main() {
2222
let _ = string.as_ptr() as *mut u8;
2323
//~^ as_ptr_cast_mut
2424

25-
2625
let _: *mut i8 = string.as_ptr() as *mut _;
2726
//~^ as_ptr_cast_mut
2827

tests/ui/as_ptr_cast_mut.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | let _ = string.as_ptr() as *mut u8;
88
= help: to override `-D warnings` add `#[allow(clippy::as_ptr_cast_mut)]`
99

1010
error: casting the result of `as_ptr` to *mut i8
11-
--> tests/ui/as_ptr_cast_mut.rs:26:22
11+
--> tests/ui/as_ptr_cast_mut.rs:25:22
1212
|
1313
LL | let _: *mut i8 = string.as_ptr() as *mut _;
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `string.as_mut_ptr()`

tests/ui/asm_syntax_x86.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,12 @@ mod warn_att {
4040

4141
asm!("", options(nostack, att_syntax));
4242
//~^ inline_asm_x86_att_syntax
43-
4443
}
4544

4645
global_asm!("");
4746
global_asm!("", options());
4847
global_asm!("", options(att_syntax));
4948
//~^ inline_asm_x86_att_syntax
50-
5149
}
5250

5351
fn main() {

tests/ui/asm_syntax_x86.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ LL | asm!("", options(nostack, att_syntax));
5959
= help: use Intel x86 assembly syntax
6060

6161
error: AT&T x86 assembly syntax used
62-
--> tests/ui/asm_syntax_x86.rs:48:5
62+
--> tests/ui/asm_syntax_x86.rs:47:5
6363
|
6464
LL | global_asm!("", options(att_syntax));
6565
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/assertions_on_constants.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,21 @@ fn main() {
1919
assert!(false, "false message");
2020
//~^ assertions_on_constants
2121

22-
2322
let msg = "panic message";
2423
assert!(false, "{}", msg.to_uppercase());
2524
//~^ assertions_on_constants
2625

27-
2826
const B: bool = true;
2927
assert!(B);
3028
//~^ assertions_on_constants
3129

32-
3330
const C: bool = false;
3431
assert!(C);
3532
//~^ assertions_on_constants
3633

3734
assert!(C, "C message");
3835
//~^ assertions_on_constants
3936

40-
4137
debug_assert!(true);
4238
//~^ assertions_on_constants
4339

@@ -58,11 +54,9 @@ fn main() {
5854
const _: () = assert!(true);
5955
//~^ assertions_on_constants
6056

61-
6257
assert!(8 == (7 + 1));
6358
//~^ assertions_on_constants
6459

65-
6660
// Don't lint if the value is dependent on a defined constant:
6761
const N: usize = 1024;
6862
const _: () = assert!(N.is_power_of_two());

tests/ui/assertions_on_constants.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,63 +33,63 @@ LL | assert!(false, "false message");
3333
= help: use `panic!(..)` or `unreachable!(..)`
3434

3535
error: `assert!(false, ..)` should probably be replaced
36-
--> tests/ui/assertions_on_constants.rs:24:5
36+
--> tests/ui/assertions_on_constants.rs:23:5
3737
|
3838
LL | assert!(false, "{}", msg.to_uppercase());
3939
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4040
|
4141
= help: use `panic!(..)` or `unreachable!(..)`
4242

4343
error: `assert!(true)` will be optimized out by the compiler
44-
--> tests/ui/assertions_on_constants.rs:29:5
44+
--> tests/ui/assertions_on_constants.rs:27:5
4545
|
4646
LL | assert!(B);
4747
| ^^^^^^^^^^
4848
|
4949
= help: remove it
5050

5151
error: `assert!(false)` should probably be replaced
52-
--> tests/ui/assertions_on_constants.rs:34:5
52+
--> tests/ui/assertions_on_constants.rs:31:5
5353
|
5454
LL | assert!(C);
5555
| ^^^^^^^^^^
5656
|
5757
= help: use `panic!()` or `unreachable!()`
5858

5959
error: `assert!(false, ..)` should probably be replaced
60-
--> tests/ui/assertions_on_constants.rs:37:5
60+
--> tests/ui/assertions_on_constants.rs:34:5
6161
|
6262
LL | assert!(C, "C message");
6363
| ^^^^^^^^^^^^^^^^^^^^^^^
6464
|
6565
= help: use `panic!(..)` or `unreachable!(..)`
6666

6767
error: `debug_assert!(true)` will be optimized out by the compiler
68-
--> tests/ui/assertions_on_constants.rs:41:5
68+
--> tests/ui/assertions_on_constants.rs:37:5
6969
|
7070
LL | debug_assert!(true);
7171
| ^^^^^^^^^^^^^^^^^^^
7272
|
7373
= help: remove it
7474

7575
error: `assert!(true)` will be optimized out by the compiler
76-
--> tests/ui/assertions_on_constants.rs:58:19
76+
--> tests/ui/assertions_on_constants.rs:54:19
7777
|
7878
LL | const _: () = assert!(true);
7979
| ^^^^^^^^^^^^^
8080
|
8181
= help: remove it
8282

8383
error: `assert!(true)` will be optimized out by the compiler
84-
--> tests/ui/assertions_on_constants.rs:62:5
84+
--> tests/ui/assertions_on_constants.rs:57:5
8585
|
8686
LL | assert!(8 == (7 + 1));
8787
| ^^^^^^^^^^^^^^^^^^^^^
8888
|
8989
= help: remove it
9090

9191
error: `assert!(true)` will be optimized out by the compiler
92-
--> tests/ui/assertions_on_constants.rs:72:5
92+
--> tests/ui/assertions_on_constants.rs:66:5
9393
|
9494
LL | assert!(true);
9595
| ^^^^^^^^^^^^^

tests/ui/assign_ops2.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ fn main() {
88
a += a + 1;
99
//~^ misrefactored_assign_op
1010

11-
1211
a += 1 + a;
1312
//~^ misrefactored_assign_op
1413

@@ -72,8 +71,6 @@ fn cow_add_assign() {
7271
buf = buf + cows.clone();
7372
//~^ assign_op_pattern
7473

75-
76-
7774
// this should not as cow<str> Add is not commutative
7875
buf = cows + buf;
7976
println!("{}", buf);

tests/ui/assign_ops2.stderr

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ LL | a = a + a + 1;
1616
| ~~~~~~~~~~~~~
1717

1818
error: variable appears on both sides of an assignment operation
19-
--> tests/ui/assign_ops2.rs:12:5
19+
--> tests/ui/assign_ops2.rs:11:5
2020
|
2121
LL | a += 1 + a;
2222
| ^^^^^^^^^^
@@ -31,7 +31,7 @@ LL | a = a + 1 + a;
3131
| ~~~~~~~~~~~~~
3232

3333
error: variable appears on both sides of an assignment operation
34-
--> tests/ui/assign_ops2.rs:15:5
34+
--> tests/ui/assign_ops2.rs:14:5
3535
|
3636
LL | a -= a - 1;
3737
| ^^^^^^^^^^
@@ -46,7 +46,7 @@ LL | a = a - (a - 1);
4646
| ~~~~~~~~~~~~~~~
4747

4848
error: variable appears on both sides of an assignment operation
49-
--> tests/ui/assign_ops2.rs:18:5
49+
--> tests/ui/assign_ops2.rs:17:5
5050
|
5151
LL | a *= a * 99;
5252
| ^^^^^^^^^^^
@@ -61,7 +61,7 @@ LL | a = a * a * 99;
6161
| ~~~~~~~~~~~~~~
6262

6363
error: variable appears on both sides of an assignment operation
64-
--> tests/ui/assign_ops2.rs:21:5
64+
--> tests/ui/assign_ops2.rs:20:5
6565
|
6666
LL | a *= 42 * a;
6767
| ^^^^^^^^^^^
@@ -76,7 +76,7 @@ LL | a = a * 42 * a;
7676
| ~~~~~~~~~~~~~~
7777

7878
error: variable appears on both sides of an assignment operation
79-
--> tests/ui/assign_ops2.rs:24:5
79+
--> tests/ui/assign_ops2.rs:23:5
8080
|
8181
LL | a /= a / 2;
8282
| ^^^^^^^^^^
@@ -91,7 +91,7 @@ LL | a = a / (a / 2);
9191
| ~~~~~~~~~~~~~~~
9292

9393
error: variable appears on both sides of an assignment operation
94-
--> tests/ui/assign_ops2.rs:27:5
94+
--> tests/ui/assign_ops2.rs:26:5
9595
|
9696
LL | a %= a % 5;
9797
| ^^^^^^^^^^
@@ -106,7 +106,7 @@ LL | a = a % (a % 5);
106106
| ~~~~~~~~~~~~~~~
107107

108108
error: variable appears on both sides of an assignment operation
109-
--> tests/ui/assign_ops2.rs:30:5
109+
--> tests/ui/assign_ops2.rs:29:5
110110
|
111111
LL | a &= a & 1;
112112
| ^^^^^^^^^^
@@ -121,7 +121,7 @@ LL | a = a & a & 1;
121121
| ~~~~~~~~~~~~~
122122

123123
error: variable appears on both sides of an assignment operation
124-
--> tests/ui/assign_ops2.rs:33:5
124+
--> tests/ui/assign_ops2.rs:32:5
125125
|
126126
LL | a *= a * a;
127127
| ^^^^^^^^^^
@@ -136,7 +136,7 @@ LL | a = a * a * a;
136136
| ~~~~~~~~~~~~~
137137

138138
error: manual implementation of an assign operation
139-
--> tests/ui/assign_ops2.rs:72:5
139+
--> tests/ui/assign_ops2.rs:71:5
140140
|
141141
LL | buf = buf + cows.clone();
142142
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `buf += cows.clone()`

tests/ui/attrs.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#[inline(always)]
66
//~^ inline_always
77

8-
98
fn test_attr_lint() {
109
assert!(true)
1110
}
@@ -28,7 +27,6 @@ fn empty_and_false_positive_stmt() {
2827
#[deprecated(since = "forever")]
2928
//~^ deprecated_semver
3029

31-
3230
pub const SOME_CONST: u8 = 42;
3331

3432
#[deprecated(since = "1")]

tests/ui/attrs.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: the since field must contain a semver-compliant version
2-
--> tests/ui/attrs.rs:28:14
2+
--> tests/ui/attrs.rs:27:14
33
|
44
LL | #[deprecated(since = "forever")]
55
| ^^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | #[deprecated(since = "forever")]
88
= help: to override `-D warnings` add `#[allow(clippy::deprecated_semver)]`
99

1010
error: the since field must contain a semver-compliant version
11-
--> tests/ui/attrs.rs:34:14
11+
--> tests/ui/attrs.rs:32:14
1212
|
1313
LL | #[deprecated(since = "1")]
1414
| ^^^^^^^^^^^

tests/ui/await_holding_refcell_ref.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ async fn also_bad(x: &RefCell<u32>) -> u32 {
3636
let b = x.borrow_mut();
3737
//~^ await_holding_refcell_ref
3838

39-
4039
let second = baz().await;
4140

4241
let third = baz().await;
@@ -50,7 +49,6 @@ async fn less_bad(x: &RefCell<u32>) -> u32 {
5049
let b = x.borrow_mut();
5150
//~^ await_holding_refcell_ref
5251

53-
5452
let second = baz().await;
5553

5654
drop(b);

tests/ui/await_holding_refcell_ref.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ LL | let b = x.borrow_mut();
3434
|
3535
= help: ensure the reference is dropped before calling `await`
3636
note: these are all the await points this reference is held through
37-
--> tests/ui/await_holding_refcell_ref.rs:40:24
37+
--> tests/ui/await_holding_refcell_ref.rs:39:24
3838
|
3939
LL | let second = baz().await;
4040
| ^^^^^
@@ -43,40 +43,40 @@ LL | let third = baz().await;
4343
| ^^^^^
4444

4545
error: this `RefCell` reference is held across an await point
46-
--> tests/ui/await_holding_refcell_ref.rs:50:9
46+
--> tests/ui/await_holding_refcell_ref.rs:49:9
4747
|
4848
LL | let b = x.borrow_mut();
4949
| ^
5050
|
5151
= help: ensure the reference is dropped before calling `await`
5252
note: these are all the await points this reference is held through
53-
--> tests/ui/await_holding_refcell_ref.rs:54:24
53+
--> tests/ui/await_holding_refcell_ref.rs:52:24
5454
|
5555
LL | let second = baz().await;
5656
| ^^^^^
5757

5858
error: this `RefCell` reference is held across an await point
59-
--> tests/ui/await_holding_refcell_ref.rs:67:13
59+
--> tests/ui/await_holding_refcell_ref.rs:65:13
6060
|
6161
LL | let b = x.borrow_mut();
6262
| ^
6363
|
6464
= help: ensure the reference is dropped before calling `await`
6565
note: these are all the await points this reference is held through
66-
--> tests/ui/await_holding_refcell_ref.rs:70:15
66+
--> tests/ui/await_holding_refcell_ref.rs:68:15
6767
|
6868
LL | baz().await
6969
| ^^^^^
7070

7171
error: this `RefCell` reference is held across an await point
72-
--> tests/ui/await_holding_refcell_ref.rs:81:13
72+
--> tests/ui/await_holding_refcell_ref.rs:79:13
7373
|
7474
LL | let b = x.borrow_mut();
7575
| ^
7676
|
7777
= help: ensure the reference is dropped before calling `await`
7878
note: these are all the await points this reference is held through
79-
--> tests/ui/await_holding_refcell_ref.rs:84:15
79+
--> tests/ui/await_holding_refcell_ref.rs:82:15
8080
|
8181
LL | baz().await
8282
| ^^^^^

tests/ui/bind_instead_of_map_multipart.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub fn main() {
2020

2121
fn hard_example() {
2222
Some("42").map(|s| {
23-
//~^ bind_instead_of_map
23+
//~^ bind_instead_of_map
2424
if {
2525
if s == "43" {
2626
return 43;

0 commit comments

Comments
 (0)