Skip to content

Commit ada5754

Browse files
committed
Add error annotations to all test files
1 parent 345fc07 commit ada5754

File tree

1,174 files changed

+12849
-7994
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,174 files changed

+12849
-7994
lines changed

tests/ui-toml/absolute_paths/absolute_paths.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ pub mod a {
3737

3838
fn main() {
3939
f32::max(1.0, 2.0);
40-
std::f32::MAX;
41-
core::f32::MAX;
42-
::core::f32::MAX;
43-
crate::a::b::c::C;
44-
crate::a::b::c::d::e::f::F;
45-
crate::a::A;
46-
crate::a::b::B;
47-
crate::a::b::c::C::ZERO;
48-
helper::b::c::d::e::f();
49-
::helper::b::c::d::e::f();
40+
std::f32::MAX; //~ absolute_paths
41+
core::f32::MAX; //~ absolute_paths
42+
::core::f32::MAX; //~ absolute_paths
43+
crate::a::b::c::C; //~[disallow_crates] absolute_paths
44+
crate::a::b::c::d::e::f::F; //~[disallow_crates] absolute_paths
45+
crate::a::A; //~[disallow_crates] absolute_paths
46+
crate::a::b::B; //~[disallow_crates] absolute_paths
47+
crate::a::b::c::C::ZERO; //~[disallow_crates] absolute_paths
48+
helper::b::c::d::e::f(); //~[disallow_crates] absolute_paths
49+
::helper::b::c::d::e::f(); //~[disallow_crates] absolute_paths
5050
fn b() -> a::b::B {
5151
todo!()
5252
}
@@ -55,7 +55,7 @@ fn main() {
5555
std::ptr::addr_of!(x);
5656
// Test we handle max segments with `PathRoot` properly; this has 4 segments but we should say it
5757
// has 3
58-
::std::f32::MAX;
58+
::std::f32::MAX; //~ absolute_paths
5959
// Do not lint due to the above
6060
::helper::a();
6161
// Do not lint

tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.fixed

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ fn main() {
66
let local_f64 = 2.0;
77
let local_opt: Option<i32> = Some(3);
88

9-
println!("val='{local_i32}'");
9+
println!("val='{local_i32}'"); //~ uninlined_format_args
1010
println!("Hello x is {local_f64:.local_i32$}");
11+
//~^ uninlined_format_args
12+
//~| print_literal
1113
println!("Hello {local_i32} is {local_f64:.*}", 5);
14+
//~^ uninlined_format_args
1215
println!("Hello {local_i32} is {local_f64:.*}", 5);
16+
//~^ uninlined_format_args
1317
println!("{local_i32}, {}", local_opt.unwrap());
18+
//~^ uninlined_format_args
1419
}

tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ fn main() {
66
let local_f64 = 2.0;
77
let local_opt: Option<i32> = Some(3);
88

9-
println!("val='{}'", local_i32);
9+
println!("val='{}'", local_i32); //~ uninlined_format_args
1010
println!("Hello {} is {:.*}", "x", local_i32, local_f64);
11+
//~^ uninlined_format_args
12+
//~| print_literal
1113
println!("Hello {} is {:.*}", local_i32, 5, local_f64);
14+
//~^ uninlined_format_args
1215
println!("Hello {} is {2:.*}", local_i32, 5, local_f64);
16+
//~^ uninlined_format_args
1317
println!("{}, {}", local_i32, local_opt.unwrap());
18+
//~^ uninlined_format_args
1419
}

tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ LL + println!("Hello x is {:.*}", local_i32, local_f64);
3939
|
4040

4141
error: variables can be used directly in the `format!` string
42-
--> $DIR/allow_mixed_uninlined_format_args/uninlined_format_args.rs:11:5
42+
--> $DIR/allow_mixed_uninlined_format_args/uninlined_format_args.rs:13:5
4343
|
4444
LL | println!("Hello {} is {:.*}", local_i32, 5, local_f64);
4545
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -51,7 +51,7 @@ LL + println!("Hello {local_i32} is {local_f64:.*}", 5);
5151
|
5252

5353
error: variables can be used directly in the `format!` string
54-
--> $DIR/allow_mixed_uninlined_format_args/uninlined_format_args.rs:12:5
54+
--> $DIR/allow_mixed_uninlined_format_args/uninlined_format_args.rs:15:5
5555
|
5656
LL | println!("Hello {} is {2:.*}", local_i32, 5, local_f64);
5757
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -63,7 +63,7 @@ LL + println!("Hello {local_i32} is {local_f64:.*}", 5);
6363
|
6464

6565
error: variables can be used directly in the `format!` string
66-
--> $DIR/allow_mixed_uninlined_format_args/uninlined_format_args.rs:13:5
66+
--> $DIR/allow_mixed_uninlined_format_args/uninlined_format_args.rs:17:5
6767
|
6868
LL | println!("{}, {}", local_i32, local_opt.unwrap());
6969
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui-toml/arithmetic_side_effects_allowed/arithmetic_side_effects_allowed.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn lhs_and_rhs_are_equal() {
6666
// is implicitly on the list
6767
let _ = Bar + Bar;
6868
// not on the list
69-
let _ = Baz + Baz;
69+
let _ = Baz + Baz; //~ arithmetic_side_effects
7070
}
7171

7272
fn lhs_is_different() {
@@ -77,14 +77,14 @@ fn lhs_is_different() {
7777
// is implicitly on the list
7878
let _ = 1i32 + Bar;
7979
// not on the list
80-
let _ = 1i32 + Baz;
80+
let _ = 1i32 + Baz; //~ arithmetic_side_effects
8181

8282
// not on the list
83-
let _ = 1i64 + Foo;
83+
let _ = 1i64 + Foo; //~ arithmetic_side_effects
8484
// is implicitly on the list
8585
let _ = 1i64 + Bar;
8686
// not on the list
87-
let _ = 1i64 + Baz;
87+
let _ = 1i64 + Baz; //~ arithmetic_side_effects
8888
}
8989

9090
fn rhs_is_different() {
@@ -95,14 +95,14 @@ fn rhs_is_different() {
9595
// is implicitly on the list
9696
let _ = Bar + 1i32;
9797
// not on the list
98-
let _ = Baz + 1i32;
98+
let _ = Baz + 1i32; //~ arithmetic_side_effects
9999

100100
// not on the list
101-
let _ = Foo + 1i64;
101+
let _ = Foo + 1i64; //~ arithmetic_side_effects
102102
// is implicitly on the list
103103
let _ = Bar + 1i64;
104104
// not on the list
105-
let _ = Baz + 1i64;
105+
let _ = Baz + 1i64; //~ arithmetic_side_effects
106106
}
107107

108108
fn unary() {
@@ -111,9 +111,9 @@ fn unary() {
111111
// is explicitly on the list
112112
let _ = -Foo;
113113
// not on the list
114-
let _ = -Bar;
114+
let _ = -Bar; //~ arithmetic_side_effects
115115
// not on the list
116-
let _ = -Baz;
116+
let _ = -Baz; //~ arithmetic_side_effects
117117
}
118118

119119
fn main() {}

tests/ui-toml/array_size_threshold/array_size_threshold.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
#![warn(clippy::large_const_arrays, clippy::large_stack_arrays)]
33
//@no-rustfix
44
const ABOVE: [u8; 11] = [0; 11];
5+
//~^ large_const_arrays
6+
//~| large_stack_arrays
57
const BELOW: [u8; 10] = [0; 10];
68

79
fn main() {
8-
let above = [0u8; 11];
10+
let above = [0u8; 11]; //~ large_stack_arrays
911
let below = [0u8; 10];
1012
}

tests/ui-toml/array_size_threshold/array_size_threshold.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ LL | const ABOVE: [u8; 11] = [0; 11];
2020
= help: to override `-D warnings` add `#[allow(clippy::large_stack_arrays)]`
2121

2222
error: allocating a local array larger than 10 bytes
23-
--> $DIR/array_size_threshold/array_size_threshold.rs:8:17
23+
--> $DIR/array_size_threshold/array_size_threshold.rs:10:17
2424
|
2525
LL | let above = [0u8; 11];
2626
| ^^^^^^^^^

tests/ui-toml/await_holding_invalid_type/await_holding_invalid_type.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
use std::net::Ipv4Addr;
33

44
async fn bad() -> u32 {
5-
let _x = String::from("hello");
5+
let _x = String::from("hello"); //~ await_holding_invalid_type
66
baz().await
77
}
88

99
async fn bad_reason() -> u32 {
1010
let x = Ipv4Addr::new(127, 0, 0, 1);
11+
//~^ await_holding_invalid_type
1112
let y = baz().await;
1213
let _x = x;
1314
y
@@ -30,7 +31,7 @@ async fn baz() -> u32 {
3031
#[allow(clippy::manual_async_fn)]
3132
fn block_bad() -> impl std::future::Future<Output = u32> {
3233
async move {
33-
let _x = String::from("hi!");
34+
let _x = String::from("hi!"); //~ await_holding_invalid_type
3435
baz().await
3536
}
3637
}

tests/ui-toml/await_holding_invalid_type/await_holding_invalid_type.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ LL | let x = Ipv4Addr::new(127, 0, 0, 1);
1515
| ^
1616

1717
error: `std::string::String` may not be held across an `await` point per `clippy.toml`
18-
--> $DIR/await_holding_invalid_type/await_holding_invalid_type.rs:33:13
18+
--> $DIR/await_holding_invalid_type/await_holding_invalid_type.rs:34:13
1919
|
2020
LL | let _x = String::from("hi!");
2121
| ^^

tests/ui-toml/conf_deprecated_key/conf_deprecated_key.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
fn main() {}
44

55
#[warn(clippy::cognitive_complexity)]
6+
//~v cognitive_complexity
67
fn cognitive_complexity() {
78
let x = vec![1, 2, 3];
89
for i in x {

0 commit comments

Comments
 (0)