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);

0 commit comments

Comments
 (0)