Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions tests/ui-toml/conf_deprecated_key/conf_deprecated_key.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(clippy::uninlined_format_args)]

fn main() {}

#[warn(clippy::cognitive_complexity)]
Expand All @@ -8,7 +6,7 @@ fn cognitive_complexity() {
let x = vec![1, 2, 3];
for i in x {
if i == 1 {
println!("{}", i);
println!("{i}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ LL | blacklisted-names = [ "..", "wibble" ]
| ^^^^^^^^^^^^^^^^^

error: the function has a cognitive complexity of (3/2)
--> tests/ui-toml/conf_deprecated_key/conf_deprecated_key.rs:6:4
--> tests/ui-toml/conf_deprecated_key/conf_deprecated_key.rs:4:4
|
LL | fn cognitive_complexity() {
| ^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(clippy::uninlined_format_args)]
#![deny(clippy::index_refutable_slice)]

fn below_limit() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(clippy::uninlined_format_args)]
#![deny(clippy::index_refutable_slice)]

fn below_limit() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error: this binding can be a slice pattern to avoid indexing
--> tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs:6:17
--> tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs:5:17
|
LL | if let Some(slice) = slice {
| ^^^^^
|
note: the lint level is defined here
--> tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs:2:9
--> tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs:1:9
|
LL | #![deny(clippy::index_refutable_slice)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
1 change: 0 additions & 1 deletion tests/ui/bind_instead_of_map.fixed
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![deny(clippy::bind_instead_of_map)]
#![allow(clippy::uninlined_format_args)]

// need a main anyway, use it get rid of unused warnings too
pub fn main() {
Expand Down
1 change: 0 additions & 1 deletion tests/ui/bind_instead_of_map.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![deny(clippy::bind_instead_of_map)]
#![allow(clippy::uninlined_format_args)]

// need a main anyway, use it get rid of unused warnings too
pub fn main() {
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/bind_instead_of_map.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: using `Option.and_then(Some)`, which is a no-op
--> tests/ui/bind_instead_of_map.rs:8:13
--> tests/ui/bind_instead_of_map.rs:7:13
|
LL | let _ = x.and_then(Some);
| ^^^^^^^^^^^^^^^^ help: use the expression directly: `x`
Expand All @@ -11,13 +11,13 @@ LL | #![deny(clippy::bind_instead_of_map)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
--> tests/ui/bind_instead_of_map.rs:10:13
--> tests/ui/bind_instead_of_map.rs:9:13
|
LL | let _ = x.and_then(|o| Some(o + 1));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.map(|o| o + 1)`

error: using `Result.and_then(Ok)`, which is a no-op
--> tests/ui/bind_instead_of_map.rs:17:13
--> tests/ui/bind_instead_of_map.rs:16:13
|
LL | let _ = x.and_then(Ok);
| ^^^^^^^^^^^^^^ help: use the expression directly: `x`
Expand Down
5 changes: 2 additions & 3 deletions tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![deny(clippy::branches_sharing_code, clippy::if_same_then_else)]
#![allow(dead_code)]
#![allow(clippy::uninlined_format_args)]
//@no-rustfix
// branches_sharing_code at the top and bottom of the if blocks

Expand Down Expand Up @@ -70,7 +69,7 @@ fn complexer_example() {
let b = 0xffff00ff;
let e_id = gen_id(a, b);

println!("From the a `{}` to the b `{}`", a, b);
println!("From the a `{a}` to the b `{b}`");

let pack = DataPack {
id: e_id,
Expand All @@ -83,7 +82,7 @@ fn complexer_example() {
let b = 0xffff00ff;
let e_id = gen_id(a, b);

println!("The new ID is '{}'", e_id);
println!("The new ID is '{e_id}'");

let pack = DataPack {
id: e_id,
Expand Down
24 changes: 12 additions & 12 deletions tests/ui/branches_sharing_code/shared_at_top_and_bottom.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: all if blocks contain the same code at both the start and the end
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:17:5
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:16:5
|
LL | / if x == 7 {
LL | |
Expand All @@ -10,7 +10,7 @@ LL | | let _overlap_end = 2 * t;
| |_________________________________^
|
note: this code is shared at the end
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:31:5
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:30:5
|
LL | / let _u = 9;
LL | | }
Expand All @@ -34,7 +34,7 @@ LL + let _u = 9;
|

error: all if blocks contain the same code at both the start and the end
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:35:5
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:34:5
|
LL | / if x == 99 {
LL | |
Expand All @@ -45,7 +45,7 @@ LL | | let _overlap_middle = r * r;
| |____________________________________^
|
note: this code is shared at the end
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:48:5
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:47:5
|
LL | / let _overlap_end = r * r * r;
LL | | let z = "end";
Expand All @@ -67,7 +67,7 @@ LL + let z = "end";
|

error: all if blocks contain the same code at both the start and the end
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:66:5
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:65:5
|
LL | / if (x > 7 && y < 13) || (x + y) % 2 == 1 {
LL | |
Expand All @@ -78,7 +78,7 @@ LL | | let e_id = gen_id(a, b);
| |________________________________^
|
note: this code is shared at the end
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:88:5
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:87:5
|
LL | / let pack = DataPack {
LL | | id: e_id,
Expand Down Expand Up @@ -108,15 +108,15 @@ LL + process_data(pack);
|

error: all if blocks contain the same code at both the start and the end
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:101:5
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:100:5
|
LL | / let _ = if x == 7 {
... |
LL | | let _ = 19;
| |___________________^
|
note: this code is shared at the end
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:112:5
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:111:5
|
LL | / x << 2
LL | | };
Expand All @@ -134,15 +134,15 @@ LL ~ x << 2;
|

error: all if blocks contain the same code at both the start and the end
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:115:5
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:114:5
|
LL | / if x == 9 {
... |
LL | | let _ = 17;
| |___________________^
|
note: this code is shared at the end
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:126:5
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:125:5
|
LL | / x * 4
LL | | }
Expand All @@ -160,15 +160,15 @@ LL + x * 4
|

error: all if blocks contain the same code at both the start and the end
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:158:9
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:157:9
|
LL | / if false {
LL | |
LL | | let x = 1;
| |______________________^
|
note: this code is shared at the end
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:166:9
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:165:9
|
LL | / let y = 1;
LL | | }
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/cast_abs_to_unsigned.fixed
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#![warn(clippy::cast_abs_to_unsigned)]
#![allow(clippy::uninlined_format_args, unused)]
#![allow(unused)]

fn main() {
let x: i32 = -42;
let y: u32 = x.unsigned_abs();
//~^ cast_abs_to_unsigned
println!("The absolute value of {} is {}", x, y);
println!("The absolute value of {x} is {y}");

let a: i32 = -3;
let _: usize = a.unsigned_abs() as usize;
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/cast_abs_to_unsigned.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#![warn(clippy::cast_abs_to_unsigned)]
#![allow(clippy::uninlined_format_args, unused)]
#![allow(unused)]

fn main() {
let x: i32 = -42;
let y: u32 = x.abs() as u32;
//~^ cast_abs_to_unsigned
println!("The absolute value of {} is {}", x, y);
println!("The absolute value of {x} is {y}");

let a: i32 = -3;
let _: usize = a.abs() as usize;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/crashes/ice-4775.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub struct ArrayWrapper<const N: usize>([usize; N]);
impl<const N: usize> ArrayWrapper<{ N }> {
pub fn ice(&self) {
for i in self.0.iter() {
println!("{}", i);
println!("{i}");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/default_trait_access.fixed
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@aux-build: proc_macros.rs
#![deny(clippy::default_trait_access)]
#![allow(dead_code, unused_imports)]
#![allow(clippy::uninlined_format_args)]

extern crate proc_macros;

Expand Down Expand Up @@ -63,6 +62,7 @@ fn main() {

let _s21: String = with_span!(s Default::default());

#[expect(clippy::uninlined_format_args)]
println!(
"[{}] [{}] [{}] [{}] [{}] [{}] [{}] [{}] [{}] [{:?}] [{:?}] [{:?}] [{:?}] [{:?}] [{:?}] [{:?}] [{:?}] [{:?}] [{:?}] [{:?}]",
s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17, s18, s19, s20,
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/default_trait_access.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@aux-build: proc_macros.rs
#![deny(clippy::default_trait_access)]
#![allow(dead_code, unused_imports)]
#![allow(clippy::uninlined_format_args)]

extern crate proc_macros;

Expand Down Expand Up @@ -63,6 +62,7 @@ fn main() {

let _s21: String = with_span!(s Default::default());

#[expect(clippy::uninlined_format_args)]
println!(
"[{}] [{}] [{}] [{}] [{}] [{}] [{}] [{}] [{}] [{:?}] [{:?}] [{:?}] [{:?}] [{:?}] [{:?}] [{:?}] [{:?}] [{:?}] [{:?}] [{:?}]",
s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17, s18, s19, s20,
Expand Down
16 changes: 8 additions & 8 deletions tests/ui/default_trait_access.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: calling `String::default()` is more clear than this expression
--> tests/ui/default_trait_access.rs:13:22
--> tests/ui/default_trait_access.rs:12:22
|
LL | let s1: String = Default::default();
| ^^^^^^^^^^^^^^^^^^ help: try: `String::default()`
Expand All @@ -11,43 +11,43 @@ LL | #![deny(clippy::default_trait_access)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: calling `String::default()` is more clear than this expression
--> tests/ui/default_trait_access.rs:18:22
--> tests/ui/default_trait_access.rs:17:22
|
LL | let s3: String = D2::default();
| ^^^^^^^^^^^^^ help: try: `String::default()`

error: calling `String::default()` is more clear than this expression
--> tests/ui/default_trait_access.rs:21:22
--> tests/ui/default_trait_access.rs:20:22
|
LL | let s4: String = std::default::Default::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `String::default()`

error: calling `String::default()` is more clear than this expression
--> tests/ui/default_trait_access.rs:26:22
--> tests/ui/default_trait_access.rs:25:22
|
LL | let s6: String = default::Default::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `String::default()`

error: calling `GenericDerivedDefault::default()` is more clear than this expression
--> tests/ui/default_trait_access.rs:37:46
--> tests/ui/default_trait_access.rs:36:46
|
LL | let s11: GenericDerivedDefault<String> = Default::default();
| ^^^^^^^^^^^^^^^^^^ help: try: `GenericDerivedDefault::default()`

error: calling `TupleDerivedDefault::default()` is more clear than this expression
--> tests/ui/default_trait_access.rs:44:36
--> tests/ui/default_trait_access.rs:43:36
|
LL | let s14: TupleDerivedDefault = Default::default();
| ^^^^^^^^^^^^^^^^^^ help: try: `TupleDerivedDefault::default()`

error: calling `ArrayDerivedDefault::default()` is more clear than this expression
--> tests/ui/default_trait_access.rs:47:36
--> tests/ui/default_trait_access.rs:46:36
|
LL | let s15: ArrayDerivedDefault = Default::default();
| ^^^^^^^^^^^^^^^^^^ help: try: `ArrayDerivedDefault::default()`

error: calling `TupleStructDerivedDefault::default()` is more clear than this expression
--> tests/ui/default_trait_access.rs:52:42
--> tests/ui/default_trait_access.rs:51:42
|
LL | let s17: TupleStructDerivedDefault = Default::default();
| ^^^^^^^^^^^^^^^^^^ help: try: `TupleStructDerivedDefault::default()`
Expand Down
Loading