Skip to content

Commit 2c55f1e

Browse files
committed
Attributes cleanup in tests [15/20]
1 parent 2e7220f commit 2c55f1e

94 files changed

Lines changed: 472 additions & 534 deletions

File tree

Some content is hidden

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

tests/ui/ptr_offset_by_literal.fixed

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![warn(clippy::ptr_offset_by_literal)]
2-
#![allow(clippy::inconsistent_digit_grouping, clippy::byte_char_slices)]
2+
#![allow(clippy::inconsistent_digit_grouping)]
3+
#![expect(clippy::byte_char_slices)]
34

45
fn main() {
56
let arr = [b'a', b'b', b'c'];

tests/ui/ptr_offset_by_literal.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![warn(clippy::ptr_offset_by_literal)]
2-
#![allow(clippy::inconsistent_digit_grouping, clippy::byte_char_slices)]
2+
#![allow(clippy::inconsistent_digit_grouping)]
3+
#![expect(clippy::byte_char_slices)]
34

45
fn main() {
56
let arr = [b'a', b'b', b'c'];

tests/ui/ptr_offset_by_literal.stderr

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: use of `offset` with zero
2-
--> tests/ui/ptr_offset_by_literal.rs:12:17
2+
--> tests/ui/ptr_offset_by_literal.rs:13:17
33
|
44
LL | let _ = ptr.offset(0);
55
| ^^^----------
@@ -10,15 +10,15 @@ LL | let _ = ptr.offset(0);
1010
= help: to override `-D warnings` add `#[allow(clippy::ptr_offset_by_literal)]`
1111

1212
error: use of `offset` with zero
13-
--> tests/ui/ptr_offset_by_literal.rs:14:17
13+
--> tests/ui/ptr_offset_by_literal.rs:15:17
1414
|
1515
LL | let _ = ptr.offset(-0);
1616
| ^^^-----------
1717
| |
1818
| help: remove the call to `offset`
1919

2020
error: use of `offset` with a literal
21-
--> tests/ui/ptr_offset_by_literal.rs:17:17
21+
--> tests/ui/ptr_offset_by_literal.rs:18:17
2222
|
2323
LL | let _ = ptr.offset(5);
2424
| ^^^^^^^^^^^^^
@@ -30,7 +30,7 @@ LL + let _ = ptr.add(5);
3030
|
3131

3232
error: use of `offset` with a literal
33-
--> tests/ui/ptr_offset_by_literal.rs:19:17
33+
--> tests/ui/ptr_offset_by_literal.rs:20:17
3434
|
3535
LL | let _ = ptr.offset(-5);
3636
| ^^^^^^^^^^^^^^
@@ -42,7 +42,7 @@ LL + let _ = ptr.sub(5);
4242
|
4343

4444
error: use of `wrapping_offset` with a literal
45-
--> tests/ui/ptr_offset_by_literal.rs:25:17
45+
--> tests/ui/ptr_offset_by_literal.rs:26:17
4646
|
4747
LL | let _ = ptr.wrapping_offset(5isize);
4848
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -54,7 +54,7 @@ LL + let _ = ptr.wrapping_add(5);
5454
|
5555

5656
error: use of `wrapping_offset` with a literal
57-
--> tests/ui/ptr_offset_by_literal.rs:27:17
57+
--> tests/ui/ptr_offset_by_literal.rs:28:17
5858
|
5959
LL | let _ = ptr.wrapping_offset(-5isize);
6060
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -66,7 +66,7 @@ LL + let _ = ptr.wrapping_sub(5);
6666
|
6767

6868
error: use of `offset` with a literal
69-
--> tests/ui/ptr_offset_by_literal.rs:30:17
69+
--> tests/ui/ptr_offset_by_literal.rs:31:17
7070
|
7171
LL | let _ = ptr.offset(-(5));
7272
| ^^^^^^^^^^^^^^^^
@@ -78,7 +78,7 @@ LL + let _ = ptr.sub(5);
7878
|
7979

8080
error: use of `wrapping_offset` with a literal
81-
--> tests/ui/ptr_offset_by_literal.rs:32:17
81+
--> tests/ui/ptr_offset_by_literal.rs:33:17
8282
|
8383
LL | let _ = ptr.wrapping_offset(-(5));
8484
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -90,7 +90,7 @@ LL + let _ = ptr.wrapping_sub(5);
9090
|
9191

9292
error: use of `offset` with a literal
93-
--> tests/ui/ptr_offset_by_literal.rs:36:17
93+
--> tests/ui/ptr_offset_by_literal.rs:37:17
9494
|
9595
LL | let _ = ptr.offset(2_147_483_647isize);
9696
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -102,7 +102,7 @@ LL + let _ = ptr.add(2_147_483_647);
102102
|
103103

104104
error: use of `offset` with a literal
105-
--> tests/ui/ptr_offset_by_literal.rs:38:17
105+
--> tests/ui/ptr_offset_by_literal.rs:39:17
106106
|
107107
LL | let _ = ptr.offset(-2_147_483_648isize);
108108
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -114,7 +114,7 @@ LL + let _ = ptr.sub(2_147_483_648);
114114
|
115115

116116
error: use of `offset` with a literal
117-
--> tests/ui/ptr_offset_by_literal.rs:41:17
117+
--> tests/ui/ptr_offset_by_literal.rs:42:17
118118
|
119119
LL | let _ = ptr.offset(5_0__isize);
120120
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -126,7 +126,7 @@ LL + let _ = ptr.add(5_0);
126126
|
127127

128128
error: use of `offset` with a literal
129-
--> tests/ui/ptr_offset_by_literal.rs:43:17
129+
--> tests/ui/ptr_offset_by_literal.rs:44:17
130130
|
131131
LL | let _ = ptr.offset(-5_0__isize);
132132
| ^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/ptr_offset_with_cast.fixed

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#![expect(clippy::unnecessary_cast, clippy::useless_vec, clippy::needless_borrow)]
1+
#![warn(clippy::ptr_offset_with_cast)]
2+
#![expect(clippy::needless_borrow, clippy::unnecessary_cast, clippy::useless_vec)]
23

34
fn main() {
45
let vec = vec![b'a', b'b', b'c'];

tests/ui/ptr_offset_with_cast.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#![expect(clippy::unnecessary_cast, clippy::useless_vec, clippy::needless_borrow)]
1+
#![warn(clippy::ptr_offset_with_cast)]
2+
#![expect(clippy::needless_borrow, clippy::unnecessary_cast, clippy::useless_vec)]
23

34
fn main() {
45
let vec = vec![b'a', b'b', b'c'];

tests/ui/ptr_offset_with_cast.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: use of `offset` with a `usize` casted to an `isize`
2-
--> tests/ui/ptr_offset_with_cast.rs:12:17
2+
--> tests/ui/ptr_offset_with_cast.rs:13:17
33
|
44
LL | let _ = ptr.offset(offset_usize as isize);
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -13,7 +13,7 @@ LL + let _ = ptr.add(offset_usize);
1313
|
1414

1515
error: use of `wrapping_offset` with a `usize` casted to an `isize`
16-
--> tests/ui/ptr_offset_with_cast.rs:17:17
16+
--> tests/ui/ptr_offset_with_cast.rs:18:17
1717
|
1818
LL | let _ = ptr.wrapping_offset(offset_usize as isize);
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -25,7 +25,7 @@ LL + let _ = ptr.wrapping_add(offset_usize);
2525
|
2626

2727
error: use of `offset` with a `usize` casted to an `isize`
28-
--> tests/ui/ptr_offset_with_cast.rs:25:17
28+
--> tests/ui/ptr_offset_with_cast.rs:26:17
2929
|
3030
LL | let _ = (&ptr).offset(offset_usize as isize);
3131
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -37,7 +37,7 @@ LL + let _ = (&ptr).add(offset_usize);
3737
|
3838

3939
error: use of `wrapping_offset` with a `usize` casted to an `isize`
40-
--> tests/ui/ptr_offset_with_cast.rs:27:17
40+
--> tests/ui/ptr_offset_with_cast.rs:28:17
4141
|
4242
LL | let _ = (&ptr).wrapping_offset(offset_usize as isize);
4343
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/pub_use.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![warn(clippy::pub_use)]
2-
#![allow(unused_imports)]
32
#![no_main]
43

54
pub mod outer {

tests/ui/pub_use.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: using `pub use`
2-
--> tests/ui/pub_use.rs:10:5
2+
--> tests/ui/pub_use.rs:9:5
33
|
44
LL | pub use inner::Test;
55
| ^^^^^^^^^^^^^^^^^^^^

tests/ui/pub_with_shorthand.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
//@aux-build:proc_macros.rs
33
#![feature(custom_inner_attributes)]
4-
#![allow(clippy::needless_pub_self, unused)]
54
#![warn(clippy::pub_with_shorthand)]
5+
#![expect(clippy::needless_pub_self)]
66
#![no_main]
77
#![rustfmt::skip] // rustfmt will remove `in`, understandable
88
// but very annoying for our purposes!

tests/ui/pub_with_shorthand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
//@aux-build:proc_macros.rs
33
#![feature(custom_inner_attributes)]
4-
#![allow(clippy::needless_pub_self, unused)]
54
#![warn(clippy::pub_with_shorthand)]
5+
#![expect(clippy::needless_pub_self)]
66
#![no_main]
77
#![rustfmt::skip] // rustfmt will remove `in`, understandable
88
// but very annoying for our purposes!

0 commit comments

Comments
 (0)