From 9a87d257f85563ed279660ac101419870830c18d Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Thu, 21 May 2026 19:06:48 +0200 Subject: [PATCH] Attributes cleanup in tests [17/20] --- tests/ui/single_char_pattern.fixed | 1 - tests/ui/single_char_pattern.rs | 1 - tests/ui/single_char_pattern.stderr | 70 +++++++++---------- tests/ui/single_component_path_imports.fixed | 3 - tests/ui/single_component_path_imports.rs | 3 - tests/ui/single_component_path_imports.stderr | 4 +- .../ui/single_component_path_imports_macro.rs | 1 - ...gle_component_path_imports_nested_first.rs | 2 - ...component_path_imports_nested_first.stderr | 6 +- ...ingle_component_path_imports_self_after.rs | 1 - ...ngle_component_path_imports_self_before.rs | 1 - tests/ui/single_match.fixed | 9 +-- tests/ui/single_match.rs | 9 +-- tests/ui/single_match.stderr | 62 ++++++++-------- tests/ui/single_match_else.fixed | 2 +- tests/ui/single_match_else.rs | 2 +- .../ui/single_match_else_deref_patterns.fixed | 12 +--- tests/ui/single_match_else_deref_patterns.rs | 12 +--- .../single_match_else_deref_patterns.stderr | 31 ++++---- ...single_range_in_vec_init.new_range.1.fixed | 2 +- ...single_range_in_vec_init.new_range.2.fixed | 2 +- ...single_range_in_vec_init.old_range.1.fixed | 2 +- ...single_range_in_vec_init.old_range.2.fixed | 2 +- tests/ui/single_range_in_vec_init.rs | 2 +- .../size_of_in_element_count/expressions.rs | 1 - .../expressions.stderr | 8 +-- .../ui/size_of_in_element_count/functions.rs | 2 +- tests/ui/size_of_ref.rs | 1 - tests/ui/size_of_ref.stderr | 6 +- tests/ui/skip_while_next.rs | 2 +- tests/ui/sliced_string_as_bytes.fixed | 1 - tests/ui/sliced_string_as_bytes.rs | 1 - tests/ui/sliced_string_as_bytes.stderr | 6 +- tests/ui/slow_vector_initialization.fixed | 4 +- tests/ui/slow_vector_initialization.rs | 4 +- tests/ui/slow_vector_initialization.stderr | 26 +++---- tests/ui/some_filter.fixed | 2 +- tests/ui/some_filter.rs | 2 +- tests/ui/stable_sort_primitive.fixed | 2 +- tests/ui/stable_sort_primitive.rs | 2 +- tests/ui/starts_ends_with.fixed | 2 +- tests/ui/starts_ends_with.rs | 2 +- tests/ui/std_instead_of_core.fixed | 3 +- tests/ui/std_instead_of_core.rs | 3 +- tests/ui/std_instead_of_core.stderr | 8 +-- tests/ui/std_instead_of_core_unfixable.rs | 4 +- tests/ui/std_instead_of_core_unfixable.stderr | 10 +-- tests/ui/string_lit_as_bytes.fixed | 2 +- tests/ui/string_lit_as_bytes.rs | 2 +- tests/ui/string_lit_chars_any.fixed | 2 +- tests/ui/string_lit_chars_any.rs | 2 +- tests/ui/string_slice.rs | 2 +- tests/ui/strlen_on_c_strings.fixed | 2 +- tests/ui/strlen_on_c_strings.rs | 2 +- tests/ui/struct_fields.rs | 1 - tests/ui/struct_fields.stderr | 52 +++++++------- tests/ui/suspicious_arithmetic_impl.rs | 2 +- tests/ui/suspicious_command_arg_space.fixed | 3 +- tests/ui/suspicious_command_arg_space.rs | 3 +- tests/ui/suspicious_command_arg_space.stderr | 4 +- tests/ui/suspicious_doc_comments.fixed | 1 - tests/ui/suspicious_doc_comments.rs | 1 - tests/ui/suspicious_doc_comments.stderr | 18 ++--- tests/ui/suspicious_doc_comments_unfixable.rs | 2 +- tests/ui/suspicious_else_formatting.rs | 8 +-- tests/ui/suspicious_map.rs | 2 +- tests/ui/suspicious_operation_groupings.fixed | 2 +- tests/ui/suspicious_operation_groupings.rs | 2 +- tests/ui/suspicious_splitn.rs | 1 - tests/ui/suspicious_splitn.stderr | 18 ++--- tests/ui/suspicious_to_owned.1.fixed | 5 +- tests/ui/suspicious_to_owned.2.fixed | 5 +- tests/ui/suspicious_to_owned.rs | 5 +- tests/ui/suspicious_to_owned.stderr | 12 ++-- tests/ui/suspicious_unary_op_formatting.rs | 2 +- tests/ui/suspicious_xor_used_as_pow.rs | 3 +- tests/ui/suspicious_xor_used_as_pow.stderr | 14 ++-- tests/ui/swap.fixed | 9 ++- tests/ui/swap.rs | 9 ++- tests/ui/swap.stderr | 39 ++++++----- 80 files changed, 264 insertions(+), 317 deletions(-) diff --git a/tests/ui/single_char_pattern.fixed b/tests/ui/single_char_pattern.fixed index 9bf9d6630441..2b1f403b1f2c 100644 --- a/tests/ui/single_char_pattern.fixed +++ b/tests/ui/single_char_pattern.fixed @@ -1,4 +1,3 @@ -#![allow(clippy::needless_raw_strings, clippy::needless_raw_string_hashes, unused_must_use)] #![warn(clippy::single_char_pattern)] use std::collections::HashSet; diff --git a/tests/ui/single_char_pattern.rs b/tests/ui/single_char_pattern.rs index 0560a848fe9d..a933e73edc10 100644 --- a/tests/ui/single_char_pattern.rs +++ b/tests/ui/single_char_pattern.rs @@ -1,4 +1,3 @@ -#![allow(clippy::needless_raw_strings, clippy::needless_raw_string_hashes, unused_must_use)] #![warn(clippy::single_char_pattern)] use std::collections::HashSet; diff --git a/tests/ui/single_char_pattern.stderr b/tests/ui/single_char_pattern.stderr index aa4ba28884a8..bf8bac0b00be 100644 --- a/tests/ui/single_char_pattern.stderr +++ b/tests/ui/single_char_pattern.stderr @@ -1,5 +1,5 @@ error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:7:13 + --> tests/ui/single_char_pattern.rs:6:13 | LL | x.split("x"); | ^^^ help: consider using a `char`: `'x'` @@ -8,205 +8,205 @@ LL | x.split("x"); = help: to override `-D warnings` add `#[allow(clippy::single_char_pattern)]` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:19:23 + --> tests/ui/single_char_pattern.rs:18:23 | LL | x.split_inclusive("x"); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:21:16 + --> tests/ui/single_char_pattern.rs:20:16 | LL | x.contains("x"); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:23:19 + --> tests/ui/single_char_pattern.rs:22:19 | LL | x.starts_with("x"); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:25:17 + --> tests/ui/single_char_pattern.rs:24:17 | LL | x.ends_with("x"); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:27:12 + --> tests/ui/single_char_pattern.rs:26:12 | LL | x.find("x"); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:29:13 + --> tests/ui/single_char_pattern.rs:28:13 | LL | x.rfind("x"); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:31:14 + --> tests/ui/single_char_pattern.rs:30:14 | LL | x.rsplit("x"); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:33:24 + --> tests/ui/single_char_pattern.rs:32:24 | LL | x.split_terminator("x"); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:35:25 + --> tests/ui/single_char_pattern.rs:34:25 | LL | x.rsplit_terminator("x"); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:37:17 + --> tests/ui/single_char_pattern.rs:36:17 | LL | x.splitn(2, "x"); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:39:18 + --> tests/ui/single_char_pattern.rs:38:18 | LL | x.rsplitn(2, "x"); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:41:18 + --> tests/ui/single_char_pattern.rs:40:18 | LL | x.split_once("x"); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:43:19 + --> tests/ui/single_char_pattern.rs:42:19 | LL | x.rsplit_once("x"); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:45:15 + --> tests/ui/single_char_pattern.rs:44:15 | LL | x.matches("x"); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:47:16 + --> tests/ui/single_char_pattern.rs:46:16 | LL | x.rmatches("x"); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:49:21 + --> tests/ui/single_char_pattern.rs:48:21 | LL | x.match_indices("x"); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:51:22 + --> tests/ui/single_char_pattern.rs:50:22 | LL | x.rmatch_indices("x"); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:53:26 + --> tests/ui/single_char_pattern.rs:52:26 | LL | x.trim_start_matches("x"); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:55:24 + --> tests/ui/single_char_pattern.rs:54:24 | LL | x.trim_end_matches("x"); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:57:15 + --> tests/ui/single_char_pattern.rs:56:15 | LL | x.replace("x", "y"); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:59:16 + --> tests/ui/single_char_pattern.rs:58:16 | LL | x.replacen("x", "y", 3); | ^^^ help: consider using a `char`: `'x'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:62:13 + --> tests/ui/single_char_pattern.rs:61:13 | LL | x.split("\n"); | ^^^^ help: consider using a `char`: `'\n'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:64:13 + --> tests/ui/single_char_pattern.rs:63:13 | LL | x.split("'"); | ^^^ help: consider using a `char`: `'\''` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:66:13 + --> tests/ui/single_char_pattern.rs:65:13 | LL | x.split("\'"); | ^^^^ help: consider using a `char`: `'\''` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:69:13 + --> tests/ui/single_char_pattern.rs:68:13 | LL | x.split("\""); | ^^^^ help: consider using a `char`: `'"'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:75:31 + --> tests/ui/single_char_pattern.rs:74:31 | LL | x.replace(';', ",").split(","); // issue #2978 | ^^^ help: consider using a `char`: `','` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:78:19 + --> tests/ui/single_char_pattern.rs:77:19 | LL | x.starts_with("\x03"); // issue #2996 | ^^^^^^ help: consider using a `char`: `'\x03'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:87:13 + --> tests/ui/single_char_pattern.rs:86:13 | LL | x.split(r"a"); | ^^^^ help: consider using a `char`: `'a'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:89:13 + --> tests/ui/single_char_pattern.rs:88:13 | LL | x.split(r#"a"#); | ^^^^^^ help: consider using a `char`: `'a'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:91:13 + --> tests/ui/single_char_pattern.rs:90:13 | LL | x.split(r###"a"###); | ^^^^^^^^^^ help: consider using a `char`: `'a'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:93:13 + --> tests/ui/single_char_pattern.rs:92:13 | LL | x.split(r###"'"###); | ^^^^^^^^^^ help: consider using a `char`: `'\''` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:95:13 + --> tests/ui/single_char_pattern.rs:94:13 | LL | x.split(r###"#"###); | ^^^^^^^^^^ help: consider using a `char`: `'#'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:98:13 + --> tests/ui/single_char_pattern.rs:97:13 | LL | x.split(r#"\"#); | ^^^^^^ help: consider using a `char`: `'\\'` error: single-character string constant used as pattern - --> tests/ui/single_char_pattern.rs:100:13 + --> tests/ui/single_char_pattern.rs:99:13 | LL | x.split(r"\"); | ^^^^ help: consider using a `char`: `'\\'` diff --git a/tests/ui/single_component_path_imports.fixed b/tests/ui/single_component_path_imports.fixed index 180a55813b19..02a3d575e5b9 100644 --- a/tests/ui/single_component_path_imports.fixed +++ b/tests/ui/single_component_path_imports.fixed @@ -1,5 +1,4 @@ #![warn(clippy::single_component_path_imports)] -#![allow(unused_imports)] use core; @@ -31,13 +30,11 @@ fn main() { mod hello_mod { //~^ single_component_path_imports - #[allow(dead_code)] fn hello_mod() {} } mod hi_mod { use self::regex::{Regex, RegexSet}; use regex; - #[allow(dead_code)] fn hi_mod() {} } diff --git a/tests/ui/single_component_path_imports.rs b/tests/ui/single_component_path_imports.rs index 888c533c534c..efd425abc4bf 100644 --- a/tests/ui/single_component_path_imports.rs +++ b/tests/ui/single_component_path_imports.rs @@ -1,5 +1,4 @@ #![warn(clippy::single_component_path_imports)] -#![allow(unused_imports)] use core; @@ -32,13 +31,11 @@ fn main() { mod hello_mod { use regex; //~^ single_component_path_imports - #[allow(dead_code)] fn hello_mod() {} } mod hi_mod { use self::regex::{Regex, RegexSet}; use regex; - #[allow(dead_code)] fn hi_mod() {} } diff --git a/tests/ui/single_component_path_imports.stderr b/tests/ui/single_component_path_imports.stderr index f1c56b14358f..d0c950c96660 100644 --- a/tests/ui/single_component_path_imports.stderr +++ b/tests/ui/single_component_path_imports.stderr @@ -1,5 +1,5 @@ error: this import is redundant - --> tests/ui/single_component_path_imports.rs:6:1 + --> tests/ui/single_component_path_imports.rs:5:1 | LL | use regex; | ^^^^^^^^^^ help: remove it entirely @@ -8,7 +8,7 @@ LL | use regex; = help: to override `-D warnings` add `#[allow(clippy::single_component_path_imports)]` error: this import is redundant - --> tests/ui/single_component_path_imports.rs:33:5 + --> tests/ui/single_component_path_imports.rs:32:5 | LL | use regex; | ^^^^^^^^^^ help: remove it entirely diff --git a/tests/ui/single_component_path_imports_macro.rs b/tests/ui/single_component_path_imports_macro.rs index f655ea482d1c..991fcfbe8a3d 100644 --- a/tests/ui/single_component_path_imports_macro.rs +++ b/tests/ui/single_component_path_imports_macro.rs @@ -1,7 +1,6 @@ //@ check-pass #![warn(clippy::single_component_path_imports)] -#![allow(unused_imports)] // #7106: use statements exporting a macro within a crate should not trigger lint // #7923: normal `use` statements of macros should also not trigger the lint diff --git a/tests/ui/single_component_path_imports_nested_first.rs b/tests/ui/single_component_path_imports_nested_first.rs index 77213bc482c3..32043bacc240 100644 --- a/tests/ui/single_component_path_imports_nested_first.rs +++ b/tests/ui/single_component_path_imports_nested_first.rs @@ -1,5 +1,4 @@ #![warn(clippy::single_component_path_imports)] -#![allow(unused_imports)] //@no-rustfix use regex; //~^ single_component_path_imports @@ -18,6 +17,5 @@ mod root_nested_use_mod { //~^ single_component_path_imports //~| single_component_path_imports - #[allow(dead_code)] fn root_nested_use_mod() {} } diff --git a/tests/ui/single_component_path_imports_nested_first.stderr b/tests/ui/single_component_path_imports_nested_first.stderr index 8eec877860e7..59663f5a1e71 100644 --- a/tests/ui/single_component_path_imports_nested_first.stderr +++ b/tests/ui/single_component_path_imports_nested_first.stderr @@ -1,5 +1,5 @@ error: this import is redundant - --> tests/ui/single_component_path_imports_nested_first.rs:4:1 + --> tests/ui/single_component_path_imports_nested_first.rs:3:1 | LL | use regex; | ^^^^^^^^^^ help: remove it entirely @@ -8,7 +8,7 @@ LL | use regex; = help: to override `-D warnings` add `#[allow(clippy::single_component_path_imports)]` error: this import is redundant - --> tests/ui/single_component_path_imports_nested_first.rs:17:10 + --> tests/ui/single_component_path_imports_nested_first.rs:16:10 | LL | use {regex, serde}; | ^^^^^ @@ -16,7 +16,7 @@ LL | use {regex, serde}; = help: remove this import error: this import is redundant - --> tests/ui/single_component_path_imports_nested_first.rs:17:17 + --> tests/ui/single_component_path_imports_nested_first.rs:16:17 | LL | use {regex, serde}; | ^^^^^ diff --git a/tests/ui/single_component_path_imports_self_after.rs b/tests/ui/single_component_path_imports_self_after.rs index a0f2cf690809..f9e85555a262 100644 --- a/tests/ui/single_component_path_imports_self_after.rs +++ b/tests/ui/single_component_path_imports_self_after.rs @@ -1,7 +1,6 @@ //@ check-pass #![warn(clippy::single_component_path_imports)] -#![allow(unused_imports)] use self::regex::{Regex as xeger, RegexSet as tesxeger}; #[rustfmt::skip] diff --git a/tests/ui/single_component_path_imports_self_before.rs b/tests/ui/single_component_path_imports_self_before.rs index b80580da10c3..753fc67cdb29 100644 --- a/tests/ui/single_component_path_imports_self_before.rs +++ b/tests/ui/single_component_path_imports_self_before.rs @@ -1,7 +1,6 @@ //@ check-pass #![warn(clippy::single_component_path_imports)] -#![allow(unused_imports)] use regex; diff --git a/tests/ui/single_match.fixed b/tests/ui/single_match.fixed index fe28674ec18e..653c88c0f860 100644 --- a/tests/ui/single_match.fixed +++ b/tests/ui/single_match.fixed @@ -1,13 +1,6 @@ //@require-annotations-for-level: WARN #![warn(clippy::single_match)] -#![allow( - unused, - clippy::uninlined_format_args, - clippy::needless_ifs, - clippy::redundant_guards, - clippy::redundant_pattern_matching, - clippy::manual_unwrap_or_default -)] +#![allow(clippy::redundant_pattern_matching)] fn dummy() {} fn single_match() { diff --git a/tests/ui/single_match.rs b/tests/ui/single_match.rs index 0f558cb5f786..2b627781b9d0 100644 --- a/tests/ui/single_match.rs +++ b/tests/ui/single_match.rs @@ -1,13 +1,6 @@ //@require-annotations-for-level: WARN #![warn(clippy::single_match)] -#![allow( - unused, - clippy::uninlined_format_args, - clippy::needless_ifs, - clippy::redundant_guards, - clippy::redundant_pattern_matching, - clippy::manual_unwrap_or_default -)] +#![allow(clippy::redundant_pattern_matching)] fn dummy() {} fn single_match() { diff --git a/tests/ui/single_match.stderr b/tests/ui/single_match.stderr index ba8bc5af5a60..2cd9777a1ba9 100644 --- a/tests/ui/single_match.stderr +++ b/tests/ui/single_match.stderr @@ -1,5 +1,5 @@ error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:16:5 + --> tests/ui/single_match.rs:9:5 | LL | / match x { LL | | Some(y) => { @@ -19,7 +19,7 @@ LL ~ }; | error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:25:5 + --> tests/ui/single_match.rs:18:5 | LL | / match x { ... | @@ -30,7 +30,7 @@ LL | | } = note: you might want to preserve the comments from inside the `match` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:36:5 + --> tests/ui/single_match.rs:29:5 | LL | / match z { LL | | (2..=3, 7..=9) => dummy(), @@ -39,7 +39,7 @@ LL | | }; | |_____^ help: try: `if let (2..=3, 7..=9) = z { dummy() }` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:66:5 + --> tests/ui/single_match.rs:59:5 | LL | / match x { LL | | Some(y) => dummy(), @@ -48,7 +48,7 @@ LL | | }; | |_____^ help: try: `if let Some(y) = x { dummy() }` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:72:5 + --> tests/ui/single_match.rs:65:5 | LL | / match y { LL | | Ok(y) => dummy(), @@ -57,7 +57,7 @@ LL | | }; | |_____^ help: try: `if let Ok(y) = y { dummy() }` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:80:5 + --> tests/ui/single_match.rs:73:5 | LL | / match c { LL | | Cow::Borrowed(..) => dummy(), @@ -66,7 +66,7 @@ LL | | }; | |_____^ help: try: `if let Cow::Borrowed(..) = c { dummy() }` error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match.rs:102:5 + --> tests/ui/single_match.rs:95:5 | LL | / match x { LL | | "test" => println!(), @@ -75,7 +75,7 @@ LL | | } | |_____^ help: try: `if x == "test" { println!() }` error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match.rs:116:5 + --> tests/ui/single_match.rs:109:5 | LL | / match x { LL | | Foo::A => println!(), @@ -84,7 +84,7 @@ LL | | } | |_____^ help: try: `if x == Foo::A { println!() }` error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match.rs:123:5 + --> tests/ui/single_match.rs:116:5 | LL | / match x { LL | | FOO_C => println!(), @@ -93,7 +93,7 @@ LL | | } | |_____^ help: try: `if x == FOO_C { println!() }` error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match.rs:129:5 + --> tests/ui/single_match.rs:122:5 | LL | / match &&x { LL | | Foo::A => println!(), @@ -102,7 +102,7 @@ LL | | } | |_____^ help: try: `if x == Foo::A { println!() }` error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match.rs:136:5 + --> tests/ui/single_match.rs:129:5 | LL | / match &x { LL | | Foo::A => println!(), @@ -111,7 +111,7 @@ LL | | } | |_____^ help: try: `if x == &Foo::A { println!() }` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:154:5 + --> tests/ui/single_match.rs:147:5 | LL | / match x { LL | | Bar::A => println!(), @@ -120,7 +120,7 @@ LL | | } | |_____^ help: try: `if let Bar::A = x { println!() }` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:163:5 + --> tests/ui/single_match.rs:156:5 | LL | / match x { LL | | None => println!(), @@ -129,7 +129,7 @@ LL | | }; | |_____^ help: try: `if let None = x { println!() }` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:186:5 + --> tests/ui/single_match.rs:179:5 | LL | / match x { LL | | (Some(_), _) => {}, @@ -138,7 +138,7 @@ LL | | } | |_____^ help: try: `if let (Some(_), _) = x {}` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:193:5 + --> tests/ui/single_match.rs:186:5 | LL | / match x { LL | | (Some(E::V), _) => todo!(), @@ -147,7 +147,7 @@ LL | | } | |_____^ help: try: `if let (Some(E::V), _) = x { todo!() }` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:200:5 + --> tests/ui/single_match.rs:193:5 | LL | / match (Some(42), Some(E::V), Some(42)) { LL | | (.., Some(E::V), _) => {}, @@ -156,7 +156,7 @@ LL | | } | |_____^ help: try: `if let (.., Some(E::V), _) = (Some(42), Some(E::V), Some(42)) {}` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:273:5 + --> tests/ui/single_match.rs:266:5 | LL | / match bar { LL | | Some(v) => unsafe { @@ -176,7 +176,7 @@ LL + } } | error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:282:5 + --> tests/ui/single_match.rs:275:5 | LL | / match bar { LL | | #[rustfmt::skip] @@ -198,7 +198,7 @@ LL + } | error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:363:5 + --> tests/ui/single_match.rs:356:5 | LL | / match Ok::<_, u32>(Some(A)) { LL | | Ok(Some(A)) => println!(), @@ -207,7 +207,7 @@ LL | | } | |_____^ help: try: `if let Ok(Some(A)) = Ok::<_, u32>(Some(A)) { println!() }` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:379:5 + --> tests/ui/single_match.rs:372:5 | LL | / match &Some(A) { LL | | Some(A | B) => println!(), @@ -216,7 +216,7 @@ LL | | } | |_____^ help: try: `if let Some(A | B) = &Some(A) { println!() }` error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match.rs:387:5 + --> tests/ui/single_match.rs:380:5 | LL | / match &s[0..3] { LL | | b"foo" => println!(), @@ -225,7 +225,7 @@ LL | | } | |_____^ help: try: `if &s[0..3] == b"foo" { println!() }` error: this pattern is irrefutable, `match` is useless - --> tests/ui/single_match.rs:402:5 + --> tests/ui/single_match.rs:395:5 | LL | / match DATA { LL | | DATA => println!(), @@ -234,7 +234,7 @@ LL | | } | |_____^ help: try: `println!();` error: this pattern is irrefutable, `match` is useless - --> tests/ui/single_match.rs:408:5 + --> tests/ui/single_match.rs:401:5 | LL | / match CONST_I32 { LL | | CONST_I32 => println!(), @@ -243,7 +243,7 @@ LL | | } | |_____^ help: try: `println!();` error: this pattern is irrefutable, `match` is useless - --> tests/ui/single_match.rs:415:5 + --> tests/ui/single_match.rs:408:5 | LL | / match i { LL | | i => { @@ -263,7 +263,7 @@ LL + } | error: this pattern is irrefutable, `match` is useless - --> tests/ui/single_match.rs:424:5 + --> tests/ui/single_match.rs:417:5 | LL | / match i { LL | | i => {}, @@ -272,7 +272,7 @@ LL | | } | |_____^ help: `match` expression can be removed error: this pattern is irrefutable, `match` is useless - --> tests/ui/single_match.rs:430:5 + --> tests/ui/single_match.rs:423:5 | LL | / match i { LL | | i => (), @@ -281,7 +281,7 @@ LL | | } | |_____^ help: `match` expression can be removed error: this pattern is irrefutable, `match` is useless - --> tests/ui/single_match.rs:436:5 + --> tests/ui/single_match.rs:429:5 | LL | / match CONST_I32 { LL | | CONST_I32 => println!(), @@ -290,7 +290,7 @@ LL | | } | |_____^ help: try: `println!();` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:444:5 + --> tests/ui/single_match.rs:437:5 | LL | / match x.pop() { LL | | // bla @@ -302,7 +302,7 @@ LL | | } = note: you might want to preserve the comments from inside the `match` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:453:5 + --> tests/ui/single_match.rs:446:5 | LL | / match x.pop() { LL | | // bla @@ -322,7 +322,7 @@ LL + } | error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` - --> tests/ui/single_match.rs:479:5 + --> tests/ui/single_match.rs:472:5 | LL | / match mac!(some) { LL | | Some(u) => println!("{u}"), @@ -331,7 +331,7 @@ LL | | } | |_____^ help: try: `if let Some(u) = mac!(some) { println!("{u}") }` error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match.rs:487:5 + --> tests/ui/single_match.rs:480:5 | LL | / match mac!(str) { LL | | "foo" => println!("eq"), diff --git a/tests/ui/single_match_else.fixed b/tests/ui/single_match_else.fixed index fde13fb90dbb..db14fdc097d3 100644 --- a/tests/ui/single_match_else.fixed +++ b/tests/ui/single_match_else.fixed @@ -2,7 +2,7 @@ //@require-annotations-for-level: WARN #![warn(clippy::single_match_else)] -#![allow(unused, clippy::needless_return, clippy::no_effect, clippy::uninlined_format_args)] +#![expect(clippy::needless_return)] extern crate proc_macros; use proc_macros::with_span; diff --git a/tests/ui/single_match_else.rs b/tests/ui/single_match_else.rs index ca282200067c..45225e260ae7 100644 --- a/tests/ui/single_match_else.rs +++ b/tests/ui/single_match_else.rs @@ -2,7 +2,7 @@ //@require-annotations-for-level: WARN #![warn(clippy::single_match_else)] -#![allow(unused, clippy::needless_return, clippy::no_effect, clippy::uninlined_format_args)] +#![expect(clippy::needless_return)] extern crate proc_macros; use proc_macros::with_span; diff --git a/tests/ui/single_match_else_deref_patterns.fixed b/tests/ui/single_match_else_deref_patterns.fixed index 1743ae6bf5a7..381a9efd7c1c 100644 --- a/tests/ui/single_match_else_deref_patterns.fixed +++ b/tests/ui/single_match_else_deref_patterns.fixed @@ -1,13 +1,7 @@ #![feature(deref_patterns)] -#![allow( - incomplete_features, - clippy::eq_op, - clippy::op_ref, - clippy::deref_addrof, - clippy::borrow_deref_ref, - clippy::needless_ifs -)] -#![deny(clippy::single_match_else)] +#![warn(clippy::single_match_else)] +#![allow(clippy::eq_op, clippy::needless_ifs, clippy::op_ref)] +#![expect(clippy::borrow_deref_ref, clippy::deref_addrof)] fn string() { if *"" == *"" {} diff --git a/tests/ui/single_match_else_deref_patterns.rs b/tests/ui/single_match_else_deref_patterns.rs index d5cb8a24a609..dbed5d38a6a3 100644 --- a/tests/ui/single_match_else_deref_patterns.rs +++ b/tests/ui/single_match_else_deref_patterns.rs @@ -1,13 +1,7 @@ #![feature(deref_patterns)] -#![allow( - incomplete_features, - clippy::eq_op, - clippy::op_ref, - clippy::deref_addrof, - clippy::borrow_deref_ref, - clippy::needless_ifs -)] -#![deny(clippy::single_match_else)] +#![warn(clippy::single_match_else)] +#![allow(clippy::eq_op, clippy::needless_ifs, clippy::op_ref)] +#![expect(clippy::borrow_deref_ref, clippy::deref_addrof)] fn string() { match *"" { diff --git a/tests/ui/single_match_else_deref_patterns.stderr b/tests/ui/single_match_else_deref_patterns.stderr index a47df55459be..b55f57681f57 100644 --- a/tests/ui/single_match_else_deref_patterns.stderr +++ b/tests/ui/single_match_else_deref_patterns.stderr @@ -1,5 +1,5 @@ error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match_else_deref_patterns.rs:13:5 + --> tests/ui/single_match_else_deref_patterns.rs:7:5 | LL | / match *"" { LL | | @@ -13,7 +13,7 @@ LL | | } = help: to override `-D warnings` add `#[allow(clippy::single_match)]` error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match_else_deref_patterns.rs:19:5 + --> tests/ui/single_match_else_deref_patterns.rs:13:5 | LL | / match *&*&*&*"" { LL | | @@ -25,7 +25,7 @@ LL | | } = note: you might want to preserve the comments from inside the `match` error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match_else_deref_patterns.rs:25:5 + --> tests/ui/single_match_else_deref_patterns.rs:19:5 | LL | / match ***&&"" { LL | | @@ -37,7 +37,7 @@ LL | | } = note: you might want to preserve the comments from inside the `match` error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match_else_deref_patterns.rs:31:5 + --> tests/ui/single_match_else_deref_patterns.rs:25:5 | LL | / match *&*&*"" { LL | | @@ -49,7 +49,7 @@ LL | | } = note: you might want to preserve the comments from inside the `match` error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match_else_deref_patterns.rs:37:5 + --> tests/ui/single_match_else_deref_patterns.rs:31:5 | LL | / match **&&*"" { LL | | @@ -61,7 +61,7 @@ LL | | } = note: you might want to preserve the comments from inside the `match` error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match_else_deref_patterns.rs:45:5 + --> tests/ui/single_match_else_deref_patterns.rs:39:5 | LL | / match &&&1 { LL | | &&&2 => unreachable!(), @@ -70,11 +70,8 @@ LL | | _ => { LL | | } | |_____^ | -note: the lint level is defined here - --> tests/ui/single_match_else_deref_patterns.rs:10:9 - | -LL | #![deny(clippy::single_match_else)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: `-D clippy::single-match-else` implied by `-D warnings` + = help: to override `-D warnings` add `#[allow(clippy::single_match_else)]` help: try | LL ~ if &&&1 == &&&2 { unreachable!() } else { @@ -83,7 +80,7 @@ LL + } | error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match_else_deref_patterns.rs:52:5 + --> tests/ui/single_match_else_deref_patterns.rs:46:5 | LL | / match &&&1 { LL | | &&2 => unreachable!(), @@ -100,7 +97,7 @@ LL + } | error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match_else_deref_patterns.rs:59:5 + --> tests/ui/single_match_else_deref_patterns.rs:53:5 | LL | / match &&1 { LL | | &&2 => unreachable!(), @@ -117,7 +114,7 @@ LL + } | error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match_else_deref_patterns.rs:66:5 + --> tests/ui/single_match_else_deref_patterns.rs:60:5 | LL | / match &&&1 { LL | | &2 => unreachable!(), @@ -134,7 +131,7 @@ LL + } | error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match_else_deref_patterns.rs:73:5 + --> tests/ui/single_match_else_deref_patterns.rs:67:5 | LL | / match &&1 { LL | | &2 => unreachable!(), @@ -151,7 +148,7 @@ LL + } | error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match_else_deref_patterns.rs:80:5 + --> tests/ui/single_match_else_deref_patterns.rs:74:5 | LL | / match &&&1 { LL | | 2 => unreachable!(), @@ -168,7 +165,7 @@ LL + } | error: you seem to be trying to use `match` for an equality check. Consider using `if` - --> tests/ui/single_match_else_deref_patterns.rs:87:5 + --> tests/ui/single_match_else_deref_patterns.rs:81:5 | LL | / match &&1 { LL | | 2 => unreachable!(), diff --git a/tests/ui/single_range_in_vec_init.new_range.1.fixed b/tests/ui/single_range_in_vec_init.new_range.1.fixed index 02a91e654a5c..c154b6d416ef 100644 --- a/tests/ui/single_range_in_vec_init.new_range.1.fixed +++ b/tests/ui/single_range_in_vec_init.new_range.1.fixed @@ -5,8 +5,8 @@ // When feature(new_range) stabilizes, this should be converted to testing // old and new editions instead. #![cfg_attr(new_range, feature(new_range))] -#![allow(clippy::no_effect, clippy::unnecessary_operation, clippy::useless_vec, unused)] #![warn(clippy::single_range_in_vec_init)] +#![expect(clippy::no_effect, clippy::useless_vec)] #[macro_use] extern crate proc_macros; diff --git a/tests/ui/single_range_in_vec_init.new_range.2.fixed b/tests/ui/single_range_in_vec_init.new_range.2.fixed index afd183ab87ac..bc9cc4eb4dfe 100644 --- a/tests/ui/single_range_in_vec_init.new_range.2.fixed +++ b/tests/ui/single_range_in_vec_init.new_range.2.fixed @@ -5,8 +5,8 @@ // When feature(new_range) stabilizes, this should be converted to testing // old and new editions instead. #![cfg_attr(new_range, feature(new_range))] -#![allow(clippy::no_effect, clippy::unnecessary_operation, clippy::useless_vec, unused)] #![warn(clippy::single_range_in_vec_init)] +#![expect(clippy::no_effect, clippy::useless_vec)] #[macro_use] extern crate proc_macros; diff --git a/tests/ui/single_range_in_vec_init.old_range.1.fixed b/tests/ui/single_range_in_vec_init.old_range.1.fixed index 2e082cb7d7a9..60f113736202 100644 --- a/tests/ui/single_range_in_vec_init.old_range.1.fixed +++ b/tests/ui/single_range_in_vec_init.old_range.1.fixed @@ -5,8 +5,8 @@ // When feature(new_range) stabilizes, this should be converted to testing // old and new editions instead. #![cfg_attr(new_range, feature(new_range))] -#![allow(clippy::no_effect, clippy::unnecessary_operation, clippy::useless_vec, unused)] #![warn(clippy::single_range_in_vec_init)] +#![expect(clippy::no_effect, clippy::useless_vec)] #[macro_use] extern crate proc_macros; diff --git a/tests/ui/single_range_in_vec_init.old_range.2.fixed b/tests/ui/single_range_in_vec_init.old_range.2.fixed index ab297ccfa819..d338dd87bc77 100644 --- a/tests/ui/single_range_in_vec_init.old_range.2.fixed +++ b/tests/ui/single_range_in_vec_init.old_range.2.fixed @@ -5,8 +5,8 @@ // When feature(new_range) stabilizes, this should be converted to testing // old and new editions instead. #![cfg_attr(new_range, feature(new_range))] -#![allow(clippy::no_effect, clippy::unnecessary_operation, clippy::useless_vec, unused)] #![warn(clippy::single_range_in_vec_init)] +#![expect(clippy::no_effect, clippy::useless_vec)] #[macro_use] extern crate proc_macros; diff --git a/tests/ui/single_range_in_vec_init.rs b/tests/ui/single_range_in_vec_init.rs index 8fdeac1fc9a0..2bd15af26a93 100644 --- a/tests/ui/single_range_in_vec_init.rs +++ b/tests/ui/single_range_in_vec_init.rs @@ -5,8 +5,8 @@ // When feature(new_range) stabilizes, this should be converted to testing // old and new editions instead. #![cfg_attr(new_range, feature(new_range))] -#![allow(clippy::no_effect, clippy::unnecessary_operation, clippy::useless_vec, unused)] #![warn(clippy::single_range_in_vec_init)] +#![expect(clippy::no_effect, clippy::useless_vec)] #[macro_use] extern crate proc_macros; diff --git a/tests/ui/size_of_in_element_count/expressions.rs b/tests/ui/size_of_in_element_count/expressions.rs index 3fe4d923441d..9d4fa69ed90b 100644 --- a/tests/ui/size_of_in_element_count/expressions.rs +++ b/tests/ui/size_of_in_element_count/expressions.rs @@ -1,5 +1,4 @@ #![warn(clippy::size_of_in_element_count)] -#![allow(clippy::ptr_offset_with_cast)] use std::mem::{size_of, size_of_val}; use std::ptr::{copy, copy_nonoverlapping, write_bytes}; diff --git a/tests/ui/size_of_in_element_count/expressions.stderr b/tests/ui/size_of_in_element_count/expressions.stderr index 74be0d7773df..c85c818679f2 100644 --- a/tests/ui/size_of_in_element_count/expressions.stderr +++ b/tests/ui/size_of_in_element_count/expressions.stderr @@ -1,5 +1,5 @@ error: found a count of bytes instead of a count of elements of `T` - --> tests/ui/size_of_in_element_count/expressions.rs:15:62 + --> tests/ui/size_of_in_element_count/expressions.rs:14:62 | LL | unsafe { copy_nonoverlapping(x.as_ptr(), y.as_mut_ptr(), size_of::() * SIZE) }; | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -9,7 +9,7 @@ LL | unsafe { copy_nonoverlapping(x.as_ptr(), y.as_mut_ptr(), size_of:: = help: to override `-D warnings` add `#[allow(clippy::size_of_in_element_count)]` error: found a count of bytes instead of a count of elements of `T` - --> tests/ui/size_of_in_element_count/expressions.rs:19:62 + --> tests/ui/size_of_in_element_count/expressions.rs:18:62 | LL | unsafe { copy_nonoverlapping(x.as_ptr(), y.as_mut_ptr(), HALF_SIZE * size_of_val(&x[0]) * 2) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -17,7 +17,7 @@ LL | unsafe { copy_nonoverlapping(x.as_ptr(), y.as_mut_ptr(), HALF_SIZE * si = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type error: found a count of bytes instead of a count of elements of `T` - --> tests/ui/size_of_in_element_count/expressions.rs:23:47 + --> tests/ui/size_of_in_element_count/expressions.rs:22:47 | LL | unsafe { copy(x.as_ptr(), y.as_mut_ptr(), DOUBLE_SIZE * size_of::() / 2) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -25,7 +25,7 @@ LL | unsafe { copy(x.as_ptr(), y.as_mut_ptr(), DOUBLE_SIZE * size_of::( = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type error: found a count of bytes instead of a count of elements of `T` - --> tests/ui/size_of_in_element_count/expressions.rs:33:47 + --> tests/ui/size_of_in_element_count/expressions.rs:32:47 | LL | unsafe { copy(x.as_ptr(), y.as_mut_ptr(), DOUBLE_SIZE / (2 / size_of::())) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/size_of_in_element_count/functions.rs b/tests/ui/size_of_in_element_count/functions.rs index afd12edec1ed..a8be9af099f3 100644 --- a/tests/ui/size_of_in_element_count/functions.rs +++ b/tests/ui/size_of_in_element_count/functions.rs @@ -1,5 +1,5 @@ #![warn(clippy::size_of_in_element_count)] -#![allow(clippy::ptr_offset_with_cast)] +#![expect(clippy::ptr_offset_with_cast)] use std::mem::{size_of, size_of_val}; use std::ptr::{ diff --git a/tests/ui/size_of_ref.rs b/tests/ui/size_of_ref.rs index 9a6a9419f681..068f3bd51439 100644 --- a/tests/ui/size_of_ref.rs +++ b/tests/ui/size_of_ref.rs @@ -1,4 +1,3 @@ -#![allow(unused)] #![warn(clippy::size_of_ref)] use std::mem::size_of_val; diff --git a/tests/ui/size_of_ref.stderr b/tests/ui/size_of_ref.stderr index 46af9f55deaf..79b0ec837e2f 100644 --- a/tests/ui/size_of_ref.stderr +++ b/tests/ui/size_of_ref.stderr @@ -1,5 +1,5 @@ error: argument to `size_of_val()` is a reference to a reference - --> tests/ui/size_of_ref.rs:13:5 + --> tests/ui/size_of_ref.rs:12:5 | LL | size_of_val(&&x); | ^^^^^^^^^^^^^^^^ @@ -9,7 +9,7 @@ LL | size_of_val(&&x); = help: to override `-D warnings` add `#[allow(clippy::size_of_ref)]` error: argument to `size_of_val()` is a reference to a reference - --> tests/ui/size_of_ref.rs:16:5 + --> tests/ui/size_of_ref.rs:15:5 | LL | size_of_val(&y); | ^^^^^^^^^^^^^^^ @@ -17,7 +17,7 @@ LL | size_of_val(&y); = help: dereference the argument to `size_of_val()` to get the size of the value instead of the size of the reference-type error: argument to `size_of_val()` is a reference to a reference - --> tests/ui/size_of_ref.rs:28:9 + --> tests/ui/size_of_ref.rs:27:9 | LL | std::mem::size_of_val(&self) + (std::mem::size_of::() * self.data.capacity()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/skip_while_next.rs b/tests/ui/skip_while_next.rs index 6dbb6a2ebb9a..7a176edaef10 100644 --- a/tests/ui/skip_while_next.rs +++ b/tests/ui/skip_while_next.rs @@ -1,7 +1,7 @@ //@aux-build:option_helpers.rs #![warn(clippy::skip_while_next)] -#![allow(clippy::disallowed_names, clippy::useless_vec)] +#![expect(clippy::disallowed_names, clippy::useless_vec)] extern crate option_helpers; use option_helpers::IteratorFalsePositives; diff --git a/tests/ui/sliced_string_as_bytes.fixed b/tests/ui/sliced_string_as_bytes.fixed index b5576188b83f..69347ea299cb 100644 --- a/tests/ui/sliced_string_as_bytes.fixed +++ b/tests/ui/sliced_string_as_bytes.fixed @@ -1,4 +1,3 @@ -#![allow(unused)] #![warn(clippy::sliced_string_as_bytes)] use std::ops::{Index, Range}; diff --git a/tests/ui/sliced_string_as_bytes.rs b/tests/ui/sliced_string_as_bytes.rs index 58b8d9290294..15e5fd575c71 100644 --- a/tests/ui/sliced_string_as_bytes.rs +++ b/tests/ui/sliced_string_as_bytes.rs @@ -1,4 +1,3 @@ -#![allow(unused)] #![warn(clippy::sliced_string_as_bytes)] use std::ops::{Index, Range}; diff --git a/tests/ui/sliced_string_as_bytes.stderr b/tests/ui/sliced_string_as_bytes.stderr index ae7f02781f4b..3e4989ceae83 100644 --- a/tests/ui/sliced_string_as_bytes.stderr +++ b/tests/ui/sliced_string_as_bytes.stderr @@ -1,5 +1,5 @@ error: calling `as_bytes` after slicing a string - --> tests/ui/sliced_string_as_bytes.rs:28:17 + --> tests/ui/sliced_string_as_bytes.rs:27:17 | LL | let bytes = s[1..5].as_bytes(); | ^^^^^^^^^^^^^^^^^^ help: try: `&s.as_bytes()[1..5]` @@ -8,13 +8,13 @@ LL | let bytes = s[1..5].as_bytes(); = help: to override `-D warnings` add `#[allow(clippy::sliced_string_as_bytes)]` error: calling `as_bytes` after slicing a string - --> tests/ui/sliced_string_as_bytes.rs:30:17 + --> tests/ui/sliced_string_as_bytes.rs:29:17 | LL | let bytes = string[1..].as_bytes(); | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&string.as_bytes()[1..]` error: calling `as_bytes` after slicing a string - --> tests/ui/sliced_string_as_bytes.rs:32:17 + --> tests/ui/sliced_string_as_bytes.rs:31:17 | LL | let bytes = "consectetur adipiscing"[..=5].as_bytes(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&"consectetur adipiscing".as_bytes()[..=5]` diff --git a/tests/ui/slow_vector_initialization.fixed b/tests/ui/slow_vector_initialization.fixed index a13be693e4ec..8ef967882b65 100644 --- a/tests/ui/slow_vector_initialization.fixed +++ b/tests/ui/slow_vector_initialization.fixed @@ -1,4 +1,6 @@ -#![allow(clippy::useless_vec, clippy::manual_repeat_n)] +#![warn(clippy::slow_vector_initialization)] +#![allow(clippy::useless_vec)] +#![expect(clippy::manual_repeat_n)] use std::iter::repeat; diff --git a/tests/ui/slow_vector_initialization.rs b/tests/ui/slow_vector_initialization.rs index eda96d0a0f82..637bbe09d684 100644 --- a/tests/ui/slow_vector_initialization.rs +++ b/tests/ui/slow_vector_initialization.rs @@ -1,4 +1,6 @@ -#![allow(clippy::useless_vec, clippy::manual_repeat_n)] +#![warn(clippy::slow_vector_initialization)] +#![allow(clippy::useless_vec)] +#![expect(clippy::manual_repeat_n)] use std::iter::repeat; diff --git a/tests/ui/slow_vector_initialization.stderr b/tests/ui/slow_vector_initialization.stderr index 320f2cacf61b..2876c6e1e534 100644 --- a/tests/ui/slow_vector_initialization.stderr +++ b/tests/ui/slow_vector_initialization.stderr @@ -1,5 +1,5 @@ error: slow zero-filling initialization - --> tests/ui/slow_vector_initialization.rs:10:20 + --> tests/ui/slow_vector_initialization.rs:12:20 | LL | let mut vec1 = Vec::with_capacity(len); | ____________________^ @@ -11,7 +11,7 @@ LL | | vec1.extend(repeat(0).take(len)); = help: to override `-D warnings` add `#[allow(clippy::slow_vector_initialization)]` error: slow zero-filling initialization - --> tests/ui/slow_vector_initialization.rs:16:20 + --> tests/ui/slow_vector_initialization.rs:18:20 | LL | let mut vec2 = Vec::with_capacity(len - 10); | ____________________^ @@ -20,7 +20,7 @@ LL | | vec2.extend(repeat(0).take(len - 10)); | |_________________________________________^ help: consider replacing this with: `vec![0; len - 10]` error: slow zero-filling initialization - --> tests/ui/slow_vector_initialization.rs:25:20 + --> tests/ui/slow_vector_initialization.rs:27:20 | LL | let mut vec4 = Vec::with_capacity(len); | ____________________^ @@ -29,7 +29,7 @@ LL | | vec4.extend(repeat(0).take(vec4.capacity())); | |________________________________________________^ help: consider replacing this with: `vec![0; len]` error: slow zero-filling initialization - --> tests/ui/slow_vector_initialization.rs:37:27 + --> tests/ui/slow_vector_initialization.rs:39:27 | LL | let mut resized_vec = Vec::with_capacity(30); | ___________________________^ @@ -38,7 +38,7 @@ LL | | resized_vec.resize(30, 0); | |_____________________________^ help: consider replacing this with: `vec![0; 30]` error: slow zero-filling initialization - --> tests/ui/slow_vector_initialization.rs:42:26 + --> tests/ui/slow_vector_initialization.rs:44:26 | LL | let mut extend_vec = Vec::with_capacity(30); | __________________________^ @@ -47,7 +47,7 @@ LL | | extend_vec.extend(repeat(0).take(30)); | |_________________________________________^ help: consider replacing this with: `vec![0; 30]` error: slow zero-filling initialization - --> tests/ui/slow_vector_initialization.rs:51:20 + --> tests/ui/slow_vector_initialization.rs:53:20 | LL | let mut vec1 = Vec::with_capacity(len); | ____________________^ @@ -56,7 +56,7 @@ LL | | vec1.resize(len, 0); | |_______________________^ help: consider replacing this with: `vec![0; len]` error: slow zero-filling initialization - --> tests/ui/slow_vector_initialization.rs:61:20 + --> tests/ui/slow_vector_initialization.rs:63:20 | LL | let mut vec3 = Vec::with_capacity(len - 10); | ____________________^ @@ -65,7 +65,7 @@ LL | | vec3.resize(len - 10, 0); | |____________________________^ help: consider replacing this with: `vec![0; len - 10]` error: slow zero-filling initialization - --> tests/ui/slow_vector_initialization.rs:66:20 + --> tests/ui/slow_vector_initialization.rs:68:20 | LL | let mut vec4 = Vec::with_capacity(len); | ____________________^ @@ -74,7 +74,7 @@ LL | | vec4.resize(vec4.capacity(), 0); | |___________________________________^ help: consider replacing this with: `vec![0; len]` error: slow zero-filling initialization - --> tests/ui/slow_vector_initialization.rs:72:12 + --> tests/ui/slow_vector_initialization.rs:74:12 | LL | vec1 = Vec::with_capacity(10); | ____________^ @@ -83,7 +83,7 @@ LL | | vec1.resize(10, 0); | |______________________^ help: consider replacing this with: `vec![0; 10]` error: slow zero-filling initialization - --> tests/ui/slow_vector_initialization.rs:81:20 + --> tests/ui/slow_vector_initialization.rs:83:20 | LL | let mut vec1 = Vec::new(); | ____________________^ @@ -92,7 +92,7 @@ LL | | vec1.resize(len, 0); | |_______________________^ help: consider replacing this with: `vec![0; len]` error: slow zero-filling initialization - --> tests/ui/slow_vector_initialization.rs:87:20 + --> tests/ui/slow_vector_initialization.rs:89:20 | LL | let mut vec3 = Vec::new(); | ____________________^ @@ -101,7 +101,7 @@ LL | | vec3.resize(len - 10, 0); | |____________________________^ help: consider replacing this with: `vec![0; len - 10]` error: slow zero-filling initialization - --> tests/ui/slow_vector_initialization.rs:93:12 + --> tests/ui/slow_vector_initialization.rs:95:12 | LL | vec1 = Vec::new(); | ____________^ @@ -110,7 +110,7 @@ LL | | vec1.resize(10, 0); | |______________________^ help: consider replacing this with: `vec![0; 10]` error: slow zero-filling initialization - --> tests/ui/slow_vector_initialization.rs:98:12 + --> tests/ui/slow_vector_initialization.rs:100:12 | LL | vec1 = vec![]; | ____________^ diff --git a/tests/ui/some_filter.fixed b/tests/ui/some_filter.fixed index a214dec920d4..938dc8514e2e 100644 --- a/tests/ui/some_filter.fixed +++ b/tests/ui/some_filter.fixed @@ -1,5 +1,5 @@ #![warn(clippy::some_filter)] -#![allow(clippy::const_is_empty)] +#![expect(clippy::const_is_empty)] macro_rules! unchanged { ($result:expr) => { diff --git a/tests/ui/some_filter.rs b/tests/ui/some_filter.rs index eec797536a8f..a12141735666 100644 --- a/tests/ui/some_filter.rs +++ b/tests/ui/some_filter.rs @@ -1,5 +1,5 @@ #![warn(clippy::some_filter)] -#![allow(clippy::const_is_empty)] +#![expect(clippy::const_is_empty)] macro_rules! unchanged { ($result:expr) => { diff --git a/tests/ui/stable_sort_primitive.fixed b/tests/ui/stable_sort_primitive.fixed index b4870ebad2b3..a29bc8e7c360 100644 --- a/tests/ui/stable_sort_primitive.fixed +++ b/tests/ui/stable_sort_primitive.fixed @@ -1,5 +1,5 @@ #![warn(clippy::stable_sort_primitive)] -#![allow(clippy::useless_vec)] +#![expect(clippy::useless_vec)] fn main() { // positive examples diff --git a/tests/ui/stable_sort_primitive.rs b/tests/ui/stable_sort_primitive.rs index b3fe64efd620..848898c56e0b 100644 --- a/tests/ui/stable_sort_primitive.rs +++ b/tests/ui/stable_sort_primitive.rs @@ -1,5 +1,5 @@ #![warn(clippy::stable_sort_primitive)] -#![allow(clippy::useless_vec)] +#![expect(clippy::useless_vec)] fn main() { // positive examples diff --git a/tests/ui/starts_ends_with.fixed b/tests/ui/starts_ends_with.fixed index f2fab9217604..88f422ed2122 100644 --- a/tests/ui/starts_ends_with.fixed +++ b/tests/ui/starts_ends_with.fixed @@ -1,4 +1,4 @@ -#![allow(clippy::needless_ifs, dead_code, unused_must_use, clippy::double_ended_iterator_last)] +#![warn(clippy::chars_last_cmp, clippy::chars_next_cmp)] fn main() {} diff --git a/tests/ui/starts_ends_with.rs b/tests/ui/starts_ends_with.rs index 1460d77a094d..db4789244783 100644 --- a/tests/ui/starts_ends_with.rs +++ b/tests/ui/starts_ends_with.rs @@ -1,4 +1,4 @@ -#![allow(clippy::needless_ifs, dead_code, unused_must_use, clippy::double_ended_iterator_last)] +#![warn(clippy::chars_last_cmp, clippy::chars_next_cmp)] fn main() {} diff --git a/tests/ui/std_instead_of_core.fixed b/tests/ui/std_instead_of_core.fixed index 3020ed5c6f39..63d0e204d72f 100644 --- a/tests/ui/std_instead_of_core.fixed +++ b/tests/ui/std_instead_of_core.fixed @@ -1,7 +1,7 @@ //@aux-build:proc_macro_derive.rs #![warn(clippy::std_instead_of_core)] -#![allow(unused_imports, deprecated)] +#![expect(deprecated)] extern crate alloc; @@ -69,7 +69,6 @@ fn alloc_instead_of_core() { mod std_in_proc_macro_derive { #[warn(clippy::alloc_instead_of_core)] - #[allow(unused)] #[derive(ImplStructWithStdDisplay)] struct B {} } diff --git a/tests/ui/std_instead_of_core.rs b/tests/ui/std_instead_of_core.rs index 49b4218aa898..e5cde188bedd 100644 --- a/tests/ui/std_instead_of_core.rs +++ b/tests/ui/std_instead_of_core.rs @@ -1,7 +1,7 @@ //@aux-build:proc_macro_derive.rs #![warn(clippy::std_instead_of_core)] -#![allow(unused_imports, deprecated)] +#![expect(deprecated)] extern crate alloc; @@ -69,7 +69,6 @@ fn alloc_instead_of_core() { mod std_in_proc_macro_derive { #[warn(clippy::alloc_instead_of_core)] - #[allow(unused)] #[derive(ImplStructWithStdDisplay)] struct B {} } diff --git a/tests/ui/std_instead_of_core.stderr b/tests/ui/std_instead_of_core.stderr index 0363852cf8d4..7045d4448211 100644 --- a/tests/ui/std_instead_of_core.stderr +++ b/tests/ui/std_instead_of_core.stderr @@ -86,25 +86,25 @@ LL | use alloc::slice::from_ref; = help: to override `-D warnings` add `#[allow(clippy::alloc_instead_of_core)]` error: used import from `std` instead of `core` - --> tests/ui/std_instead_of_core.rs:81:9 + --> tests/ui/std_instead_of_core.rs:80:9 | LL | std::intrinsics::copy(a, b, 1); | ^^^ help: consider importing the item from `core`: `core` error: used import from `std` instead of `core` - --> tests/ui/std_instead_of_core.rs:90:17 + --> tests/ui/std_instead_of_core.rs:89:17 | LL | fn msrv_1_77(_: std::net::IpAddr) {} | ^^^ help: consider importing the item from `core`: `core` error: used import from `std` instead of `core` - --> tests/ui/std_instead_of_core.rs:110:33 + --> tests/ui/std_instead_of_core.rs:109:33 | LL | fn issue13158_msrv_1_41(_: &dyn std::panic::UnwindSafe) {} | ^^^ help: consider importing the item from `core`: `core` error: used import from `std` instead of `core` - --> tests/ui/std_instead_of_core.rs:117:33 + --> tests/ui/std_instead_of_core.rs:116:33 | LL | fn issue13158_msrv_1_81(_: &dyn std::error::Error) {} | ^^^ help: consider importing the item from `core`: `core` diff --git a/tests/ui/std_instead_of_core_unfixable.rs b/tests/ui/std_instead_of_core_unfixable.rs index 66d834b5e427..459db5e8944a 100644 --- a/tests/ui/std_instead_of_core_unfixable.rs +++ b/tests/ui/std_instead_of_core_unfixable.rs @@ -1,6 +1,4 @@ -#![warn(clippy::std_instead_of_core)] -#![warn(clippy::std_instead_of_alloc)] -#![allow(unused_imports)] +#![warn(clippy::std_instead_of_alloc, clippy::std_instead_of_core)] #[rustfmt::skip] fn issue14982() { diff --git a/tests/ui/std_instead_of_core_unfixable.stderr b/tests/ui/std_instead_of_core_unfixable.stderr index 6fa8f47a4d6f..c79b3e48cad3 100644 --- a/tests/ui/std_instead_of_core_unfixable.stderr +++ b/tests/ui/std_instead_of_core_unfixable.stderr @@ -1,5 +1,5 @@ error: used import from `std` instead of `core` - --> tests/ui/std_instead_of_core_unfixable.rs:7:43 + --> tests/ui/std_instead_of_core_unfixable.rs:5:43 | LL | use std::{collections::HashMap, hash::Hash}; | ^^^^ @@ -9,7 +9,7 @@ LL | use std::{collections::HashMap, hash::Hash}; = help: to override `-D warnings` add `#[allow(clippy::std_instead_of_core)]` error: used import from `std` instead of `core` - --> tests/ui/std_instead_of_core_unfixable.rs:13:22 + --> tests/ui/std_instead_of_core_unfixable.rs:11:22 | LL | use std::{error::Error, vec::Vec, fs::File}; | ^^^^^ @@ -17,7 +17,7 @@ LL | use std::{error::Error, vec::Vec, fs::File}; = help: consider importing the item from `core` error: used import from `std` instead of `alloc` - --> tests/ui/std_instead_of_core_unfixable.rs:13:34 + --> tests/ui/std_instead_of_core_unfixable.rs:11:34 | LL | use std::{error::Error, vec::Vec, fs::File}; | ^^^ @@ -27,7 +27,7 @@ LL | use std::{error::Error, vec::Vec, fs::File}; = help: to override `-D warnings` add `#[allow(clippy::std_instead_of_alloc)]` error: used import from `std` instead of `alloc` - --> tests/ui/std_instead_of_core_unfixable.rs:21:17 + --> tests/ui/std_instead_of_core_unfixable.rs:19:17 | LL | borrow::Cow, | ^^^ @@ -35,7 +35,7 @@ LL | borrow::Cow, = help: consider importing the item from `alloc` error: used import from `std` instead of `alloc` - --> tests/ui/std_instead_of_core_unfixable.rs:23:22 + --> tests/ui/std_instead_of_core_unfixable.rs:21:22 | LL | collections::BTreeSet, | ^^^^^^^^ diff --git a/tests/ui/string_lit_as_bytes.fixed b/tests/ui/string_lit_as_bytes.fixed index 2a86dffbc762..a913951961ba 100644 --- a/tests/ui/string_lit_as_bytes.fixed +++ b/tests/ui/string_lit_as_bytes.fixed @@ -1,7 +1,7 @@ //@aux-build:macro_rules.rs -#![allow(clippy::needless_raw_string_hashes, dead_code, unused_variables)] #![warn(clippy::string_lit_as_bytes)] +#![expect(clippy::needless_raw_string_hashes)] #[macro_use] extern crate macro_rules; diff --git a/tests/ui/string_lit_as_bytes.rs b/tests/ui/string_lit_as_bytes.rs index 785d8f1e0f6b..2e7f47dfcf65 100644 --- a/tests/ui/string_lit_as_bytes.rs +++ b/tests/ui/string_lit_as_bytes.rs @@ -1,7 +1,7 @@ //@aux-build:macro_rules.rs -#![allow(clippy::needless_raw_string_hashes, dead_code, unused_variables)] #![warn(clippy::string_lit_as_bytes)] +#![expect(clippy::needless_raw_string_hashes)] #[macro_use] extern crate macro_rules; diff --git a/tests/ui/string_lit_chars_any.fixed b/tests/ui/string_lit_chars_any.fixed index cf05a2c2e835..e1dd36df5ec6 100644 --- a/tests/ui/string_lit_chars_any.fixed +++ b/tests/ui/string_lit_chars_any.fixed @@ -1,6 +1,6 @@ //@aux-build:proc_macros.rs -#![allow(clippy::eq_op, clippy::needless_raw_string_hashes, clippy::no_effect, unused)] #![warn(clippy::string_lit_chars_any)] +#![expect(clippy::eq_op, clippy::no_effect)] #[macro_use] extern crate proc_macros; diff --git a/tests/ui/string_lit_chars_any.rs b/tests/ui/string_lit_chars_any.rs index 22cfb784ed7d..43197a438fa2 100644 --- a/tests/ui/string_lit_chars_any.rs +++ b/tests/ui/string_lit_chars_any.rs @@ -1,6 +1,6 @@ //@aux-build:proc_macros.rs -#![allow(clippy::eq_op, clippy::needless_raw_string_hashes, clippy::no_effect, unused)] #![warn(clippy::string_lit_chars_any)] +#![expect(clippy::eq_op, clippy::no_effect)] #[macro_use] extern crate proc_macros; diff --git a/tests/ui/string_slice.rs b/tests/ui/string_slice.rs index 0acc48c1f412..b67d84bbea89 100644 --- a/tests/ui/string_slice.rs +++ b/tests/ui/string_slice.rs @@ -1,5 +1,5 @@ #![warn(clippy::string_slice)] -#![allow(clippy::no_effect)] +#![expect(clippy::no_effect)] use std::borrow::Cow; diff --git a/tests/ui/strlen_on_c_strings.fixed b/tests/ui/strlen_on_c_strings.fixed index 6604da70874d..3f88a7373d15 100644 --- a/tests/ui/strlen_on_c_strings.fixed +++ b/tests/ui/strlen_on_c_strings.fixed @@ -1,5 +1,5 @@ #![warn(clippy::strlen_on_c_strings)] -#![allow(clippy::manual_c_str_literals, clippy::boxed_local)] +#![expect(clippy::boxed_local, clippy::manual_c_str_literals)] use libc::strlen; use std::ffi::{CStr, CString}; diff --git a/tests/ui/strlen_on_c_strings.rs b/tests/ui/strlen_on_c_strings.rs index 11fbdf585064..e20d985d6465 100644 --- a/tests/ui/strlen_on_c_strings.rs +++ b/tests/ui/strlen_on_c_strings.rs @@ -1,5 +1,5 @@ #![warn(clippy::strlen_on_c_strings)] -#![allow(clippy::manual_c_str_literals, clippy::boxed_local)] +#![expect(clippy::boxed_local, clippy::manual_c_str_literals)] use libc::strlen; use std::ffi::{CStr, CString}; diff --git a/tests/ui/struct_fields.rs b/tests/ui/struct_fields.rs index e7ff2e6573b2..be26e69ac7e4 100644 --- a/tests/ui/struct_fields.rs +++ b/tests/ui/struct_fields.rs @@ -1,7 +1,6 @@ //@aux-build:proc_macros.rs #![warn(clippy::struct_field_names)] -#![allow(unused)] #[macro_use] extern crate proc_macros; diff --git a/tests/ui/struct_fields.stderr b/tests/ui/struct_fields.stderr index a5ff1b125907..254498ad2eeb 100644 --- a/tests/ui/struct_fields.stderr +++ b/tests/ui/struct_fields.stderr @@ -1,5 +1,5 @@ error: field name ends with the struct's name - --> tests/ui/struct_fields.rs:10:5 + --> tests/ui/struct_fields.rs:9:5 | LL | field_data1: u8, | ^^^^^^^^^^^^^^^ @@ -8,13 +8,13 @@ LL | field_data1: u8, = help: to override `-D warnings` add `#[allow(clippy::struct_field_names)]` error: field name starts with the struct's name - --> tests/ui/struct_fields.rs:20:5 + --> tests/ui/struct_fields.rs:19:5 | LL | data2_field: u8, | ^^^^^^^^^^^^^^^ error: all fields have the same postfix: `data` - --> tests/ui/struct_fields.rs:25:1 + --> tests/ui/struct_fields.rs:24:1 | LL | / struct StructData { LL | | @@ -27,7 +27,7 @@ LL | | } = help: remove the postfixes error: all fields have the same prefix: `data` - --> tests/ui/struct_fields.rs:32:1 + --> tests/ui/struct_fields.rs:31:1 | LL | / struct DataStruct { LL | | @@ -40,7 +40,7 @@ LL | | } = help: remove the prefixes error: all fields have the same prefix: `some_data` - --> tests/ui/struct_fields.rs:39:1 + --> tests/ui/struct_fields.rs:38:1 | LL | / struct DoublePrefix { LL | | @@ -53,7 +53,7 @@ LL | | } = help: remove the prefixes error: all fields have the same postfix: `some_data` - --> tests/ui/struct_fields.rs:46:1 + --> tests/ui/struct_fields.rs:45:1 | LL | / struct DoublePostfix { LL | | @@ -66,7 +66,7 @@ LL | | } = help: remove the postfixes error: all fields have the same postfix: `someData` - --> tests/ui/struct_fields.rs:54:1 + --> tests/ui/struct_fields.rs:53:1 | LL | / struct NotSnakeCase { LL | | @@ -79,7 +79,7 @@ LL | | } = help: remove the postfixes error: all fields have the same prefix: `someData` - --> tests/ui/struct_fields.rs:61:1 + --> tests/ui/struct_fields.rs:60:1 | LL | / struct NotSnakeCase2 { LL | | @@ -92,7 +92,7 @@ LL | | } = help: remove the prefixes error: all fields have the same prefix: `prefix` - --> tests/ui/struct_fields.rs:74:1 + --> tests/ui/struct_fields.rs:73:1 | LL | / struct NonCaps { LL | | @@ -105,7 +105,7 @@ LL | | } = help: remove the prefixes error: all fields have the same prefix: `_type` - --> tests/ui/struct_fields.rs:124:5 + --> tests/ui/struct_fields.rs:123:5 | LL | / struct DoLint { LL | | @@ -119,7 +119,7 @@ LL | | } = help: remove the prefixes error: all fields have the same prefix: `__type` - --> tests/ui/struct_fields.rs:132:5 + --> tests/ui/struct_fields.rs:131:5 | LL | / struct DoLint2 { LL | | @@ -133,7 +133,7 @@ LL | | } = help: remove the prefixes error: all fields have the same prefix: `___type` - --> tests/ui/struct_fields.rs:140:5 + --> tests/ui/struct_fields.rs:139:5 | LL | / struct DoLint3 { LL | | @@ -147,7 +147,7 @@ LL | | } = help: remove the prefixes error: all fields have the same postfix: `_` - --> tests/ui/struct_fields.rs:148:5 + --> tests/ui/struct_fields.rs:147:5 | LL | / struct DoLint4 { LL | | @@ -161,7 +161,7 @@ LL | | } = help: remove the postfixes error: all fields have the same postfix: `__` - --> tests/ui/struct_fields.rs:156:5 + --> tests/ui/struct_fields.rs:155:5 | LL | / struct DoLint5 { LL | | @@ -175,7 +175,7 @@ LL | | } = help: remove the postfixes error: all fields have the same postfix: `___` - --> tests/ui/struct_fields.rs:164:5 + --> tests/ui/struct_fields.rs:163:5 | LL | / struct DoLint6 { LL | | @@ -189,7 +189,7 @@ LL | | } = help: remove the postfixes error: all fields have the same postfix: `type` - --> tests/ui/struct_fields.rs:172:5 + --> tests/ui/struct_fields.rs:171:5 | LL | / struct DoLintToo { LL | | @@ -202,13 +202,13 @@ LL | | } = help: remove the postfixes error: field name starts with the struct's name - --> tests/ui/struct_fields.rs:210:5 + --> tests/ui/struct_fields.rs:209:5 | LL | proxy: i32, | ^^^^^^^^^^ error: all fields have the same prefix: `some` - --> tests/ui/struct_fields.rs:226:13 + --> tests/ui/struct_fields.rs:225:13 | LL | / struct MacroStruct { LL | | @@ -225,7 +225,7 @@ LL | mk_struct!(); = note: this error originates in the macro `mk_struct` (in Nightly builds, run with -Z macro-backtrace for more info) error: field name starts with the struct's name - --> tests/ui/struct_fields.rs:239:17 + --> tests/ui/struct_fields.rs:238:17 | LL | macrobaz_a: i32, | ^^^^^^^^^^^^^^^ @@ -236,7 +236,7 @@ LL | mk_struct2!(); = note: this error originates in the macro `mk_struct2` (in Nightly builds, run with -Z macro-backtrace for more info) error: field name starts with the struct's name - --> tests/ui/struct_fields.rs:251:17 + --> tests/ui/struct_fields.rs:250:17 | LL | $field: i32, | ^^^^^^^^^^^ @@ -247,7 +247,7 @@ LL | mk_struct_with_names!(Foo, foo); = note: this error originates in the macro `mk_struct_with_names` (in Nightly builds, run with -Z macro-backtrace for more info) error: all fields have the same prefix: `some` - --> tests/ui/struct_fields.rs:291:13 + --> tests/ui/struct_fields.rs:290:13 | LL | / struct $struct_name { LL | | @@ -264,31 +264,31 @@ LL | mk_struct_full_def!(PrefixData, some_data, some_meta, some_other); = note: this error originates in the macro `mk_struct_full_def` (in Nightly builds, run with -Z macro-backtrace for more info) error: field name starts with the struct's name - --> tests/ui/struct_fields.rs:339:5 + --> tests/ui/struct_fields.rs:338:5 | LL | use_foo: bool, | ^^^^^^^^^^^^^ error: field name starts with the struct's name - --> tests/ui/struct_fields.rs:341:5 + --> tests/ui/struct_fields.rs:340:5 | LL | use_bar: bool, | ^^^^^^^^^^^^^ error: field name starts with the struct's name - --> tests/ui/struct_fields.rs:343:5 + --> tests/ui/struct_fields.rs:342:5 | LL | use_baz: bool, | ^^^^^^^^^^^^^ error: field name starts with the struct's name - --> tests/ui/struct_fields.rs:349:5 + --> tests/ui/struct_fields.rs:348:5 | LL | pub_struct_field_named_after_struct: bool, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: all fields have the same prefix: `field` - --> tests/ui/struct_fields.rs:354:1 + --> tests/ui/struct_fields.rs:353:1 | LL | / pub struct PubStructFieldPrefix { LL | | diff --git a/tests/ui/suspicious_arithmetic_impl.rs b/tests/ui/suspicious_arithmetic_impl.rs index 9798d2049c62..f6a7a20f4848 100644 --- a/tests/ui/suspicious_arithmetic_impl.rs +++ b/tests/ui/suspicious_arithmetic_impl.rs @@ -1,5 +1,5 @@ -#![allow(clippy::legacy_numeric_constants)] #![warn(clippy::suspicious_arithmetic_impl)] +#![expect(clippy::legacy_numeric_constants)] use std::ops::{ Add, AddAssign, BitAnd, BitOr, BitOrAssign, BitXor, Div, DivAssign, Mul, MulAssign, Rem, Shl, Shr, Sub, }; diff --git a/tests/ui/suspicious_command_arg_space.fixed b/tests/ui/suspicious_command_arg_space.fixed index 0a0d90f75e57..5eae8e80add3 100644 --- a/tests/ui/suspicious_command_arg_space.fixed +++ b/tests/ui/suspicious_command_arg_space.fixed @@ -1,4 +1,5 @@ -#![allow(clippy::zombie_processes)] +#![warn(clippy::suspicious_command_arg_space)] +#![expect(clippy::zombie_processes)] fn main() { // Things it should warn about: std::process::Command::new("echo").args(["-n", "hello"]).spawn().unwrap(); diff --git a/tests/ui/suspicious_command_arg_space.rs b/tests/ui/suspicious_command_arg_space.rs index 78bdfbdf0cb6..70547336773b 100644 --- a/tests/ui/suspicious_command_arg_space.rs +++ b/tests/ui/suspicious_command_arg_space.rs @@ -1,4 +1,5 @@ -#![allow(clippy::zombie_processes)] +#![warn(clippy::suspicious_command_arg_space)] +#![expect(clippy::zombie_processes)] fn main() { // Things it should warn about: std::process::Command::new("echo").arg("-n hello").spawn().unwrap(); diff --git a/tests/ui/suspicious_command_arg_space.stderr b/tests/ui/suspicious_command_arg_space.stderr index 8952a3ffe4b8..0509a7854803 100644 --- a/tests/ui/suspicious_command_arg_space.stderr +++ b/tests/ui/suspicious_command_arg_space.stderr @@ -1,5 +1,5 @@ error: single argument that looks like it should be multiple arguments - --> tests/ui/suspicious_command_arg_space.rs:4:44 + --> tests/ui/suspicious_command_arg_space.rs:5:44 | LL | std::process::Command::new("echo").arg("-n hello").spawn().unwrap(); | ^^^^^^^^^^ @@ -13,7 +13,7 @@ LL + std::process::Command::new("echo").args(["-n", "hello"]).spawn().unwrap | error: single argument that looks like it should be multiple arguments - --> tests/ui/suspicious_command_arg_space.rs:7:43 + --> tests/ui/suspicious_command_arg_space.rs:8:43 | LL | std::process::Command::new("cat").arg("--number file").spawn().unwrap(); | ^^^^^^^^^^^^^^^ diff --git a/tests/ui/suspicious_doc_comments.fixed b/tests/ui/suspicious_doc_comments.fixed index 3faa4b21ee41..c7d288095db3 100644 --- a/tests/ui/suspicious_doc_comments.fixed +++ b/tests/ui/suspicious_doc_comments.fixed @@ -1,4 +1,3 @@ -#![allow(unused)] #![warn(clippy::suspicious_doc_comments)] #![allow(clippy::empty_line_after_doc_comments)] diff --git a/tests/ui/suspicious_doc_comments.rs b/tests/ui/suspicious_doc_comments.rs index 4af6ed850c2b..fdd93bae8f84 100644 --- a/tests/ui/suspicious_doc_comments.rs +++ b/tests/ui/suspicious_doc_comments.rs @@ -1,4 +1,3 @@ -#![allow(unused)] #![warn(clippy::suspicious_doc_comments)] #![allow(clippy::empty_line_after_doc_comments)] diff --git a/tests/ui/suspicious_doc_comments.stderr b/tests/ui/suspicious_doc_comments.stderr index df04d08537c9..bd04f5d23f3f 100644 --- a/tests/ui/suspicious_doc_comments.stderr +++ b/tests/ui/suspicious_doc_comments.stderr @@ -1,5 +1,5 @@ error: this is an outer doc comment and does not apply to the parent module or crate - --> tests/ui/suspicious_doc_comments.rs:6:1 + --> tests/ui/suspicious_doc_comments.rs:5:1 | LL | ///! Fake module documentation. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -13,7 +13,7 @@ LL + //! Fake module documentation. | error: this is an outer doc comment and does not apply to the parent module or crate - --> tests/ui/suspicious_doc_comments.rs:11:5 + --> tests/ui/suspicious_doc_comments.rs:10:5 | LL | ///! This module contains useful functions. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -25,7 +25,7 @@ LL + //! This module contains useful functions. | error: this is an outer doc comment and does not apply to the parent module or crate - --> tests/ui/suspicious_doc_comments.rs:24:5 + --> tests/ui/suspicious_doc_comments.rs:23:5 | LL | / /**! This module contains useful functions. LL | | */ @@ -38,7 +38,7 @@ LL + */ | error: this is an outer doc comment and does not apply to the parent module or crate - --> tests/ui/suspicious_doc_comments.rs:39:5 + --> tests/ui/suspicious_doc_comments.rs:38:5 | LL | / ///! This module LL | | @@ -55,7 +55,7 @@ LL ~ //! useful functions. | error: this is an outer doc comment and does not apply to the parent module or crate - --> tests/ui/suspicious_doc_comments.rs:48:5 + --> tests/ui/suspicious_doc_comments.rs:47:5 | LL | / ///! a LL | | @@ -70,7 +70,7 @@ LL ~ //! b | error: this is an outer doc comment and does not apply to the parent module or crate - --> tests/ui/suspicious_doc_comments.rs:57:5 + --> tests/ui/suspicious_doc_comments.rs:56:5 | LL | ///! a | ^^^^^^ @@ -82,7 +82,7 @@ LL + //! a | error: this is an outer doc comment and does not apply to the parent module or crate - --> tests/ui/suspicious_doc_comments.rs:64:5 + --> tests/ui/suspicious_doc_comments.rs:63:5 | LL | / ///! a ... | @@ -98,7 +98,7 @@ LL ~ //! b | error: this is an outer doc comment and does not apply to the parent module or crate - --> tests/ui/suspicious_doc_comments.rs:77:5 + --> tests/ui/suspicious_doc_comments.rs:76:5 | LL | ///! Very cool macro | ^^^^^^^^^^^^^^^^^^^^ @@ -110,7 +110,7 @@ LL + //! Very cool macro | error: this is an outer doc comment and does not apply to the parent module or crate - --> tests/ui/suspicious_doc_comments.rs:85:5 + --> tests/ui/suspicious_doc_comments.rs:84:5 | LL | ///! Huh. | ^^^^^^^^^ diff --git a/tests/ui/suspicious_doc_comments_unfixable.rs b/tests/ui/suspicious_doc_comments_unfixable.rs index 17c7cc15b170..aa75c079692c 100644 --- a/tests/ui/suspicious_doc_comments_unfixable.rs +++ b/tests/ui/suspicious_doc_comments_unfixable.rs @@ -1,5 +1,5 @@ -#![allow(unused, clippy::empty_line_after_doc_comments)] #![warn(clippy::suspicious_doc_comments)] +#![expect(clippy::empty_line_after_doc_comments)] //@no-rustfix ///! a //~^ suspicious_doc_comments diff --git a/tests/ui/suspicious_else_formatting.rs b/tests/ui/suspicious_else_formatting.rs index 8574cf1c20a1..71fd9aac5fda 100644 --- a/tests/ui/suspicious_else_formatting.rs +++ b/tests/ui/suspicious_else_formatting.rs @@ -1,11 +1,11 @@ //@aux-build:proc_macro_suspicious_else_formatting.rs -#![warn(clippy::suspicious_else_formatting, clippy::possible_missing_else)] -#![allow( +#![warn(clippy::possible_missing_else, clippy::suspicious_else_formatting)] +#![expect( clippy::if_same_then_else, clippy::let_unit_value, - clippy::needless_ifs, - clippy::needless_else + clippy::needless_else, + clippy::needless_ifs )] extern crate proc_macro_suspicious_else_formatting; diff --git a/tests/ui/suspicious_map.rs b/tests/ui/suspicious_map.rs index 86e48e29bb9e..46bb3da56785 100644 --- a/tests/ui/suspicious_map.rs +++ b/tests/ui/suspicious_map.rs @@ -1,5 +1,5 @@ -#![allow(clippy::map_with_unused_argument_over_ranges)] #![warn(clippy::suspicious_map)] +#![expect(clippy::map_with_unused_argument_over_ranges)] fn main() { let _ = (0..3).map(|x| x + 2).count(); diff --git a/tests/ui/suspicious_operation_groupings.fixed b/tests/ui/suspicious_operation_groupings.fixed index fa680e537d30..4c4daf561cf3 100644 --- a/tests/ui/suspicious_operation_groupings.fixed +++ b/tests/ui/suspicious_operation_groupings.fixed @@ -1,7 +1,7 @@ //@compile-flags: -Zdeduplicate-diagnostics=yes #![warn(clippy::suspicious_operation_groupings)] -#![allow(dead_code, unused_parens, clippy::eq_op, clippy::manual_midpoint)] +#![expect(clippy::eq_op, clippy::manual_midpoint)] struct Vec3 { x: f64, diff --git a/tests/ui/suspicious_operation_groupings.rs b/tests/ui/suspicious_operation_groupings.rs index 4ffee640e8bd..f153972a3064 100644 --- a/tests/ui/suspicious_operation_groupings.rs +++ b/tests/ui/suspicious_operation_groupings.rs @@ -1,7 +1,7 @@ //@compile-flags: -Zdeduplicate-diagnostics=yes #![warn(clippy::suspicious_operation_groupings)] -#![allow(dead_code, unused_parens, clippy::eq_op, clippy::manual_midpoint)] +#![expect(clippy::eq_op, clippy::manual_midpoint)] struct Vec3 { x: f64, diff --git a/tests/ui/suspicious_splitn.rs b/tests/ui/suspicious_splitn.rs index 535f62c6bede..4eab716bd882 100644 --- a/tests/ui/suspicious_splitn.rs +++ b/tests/ui/suspicious_splitn.rs @@ -1,5 +1,4 @@ #![warn(clippy::suspicious_splitn)] -#![allow(clippy::needless_splitn)] fn main() { let _ = "a,b,c".splitn(3, ','); diff --git a/tests/ui/suspicious_splitn.stderr b/tests/ui/suspicious_splitn.stderr index 910c905bc990..6ae19520673e 100644 --- a/tests/ui/suspicious_splitn.stderr +++ b/tests/ui/suspicious_splitn.stderr @@ -1,5 +1,5 @@ error: `splitn` called with `0` splits - --> tests/ui/suspicious_splitn.rs:10:13 + --> tests/ui/suspicious_splitn.rs:9:13 | LL | let _ = "a,b".splitn(0, ','); | ^^^^^^^^^^^^^^^^^^^^ @@ -9,7 +9,7 @@ LL | let _ = "a,b".splitn(0, ','); = help: to override `-D warnings` add `#[allow(clippy::suspicious_splitn)]` error: `rsplitn` called with `0` splits - --> tests/ui/suspicious_splitn.rs:13:13 + --> tests/ui/suspicious_splitn.rs:12:13 | LL | let _ = "a,b".rsplitn(0, ','); | ^^^^^^^^^^^^^^^^^^^^^ @@ -17,7 +17,7 @@ LL | let _ = "a,b".rsplitn(0, ','); = note: the resulting iterator will always return `None` error: `splitn` called with `1` split - --> tests/ui/suspicious_splitn.rs:16:13 + --> tests/ui/suspicious_splitn.rs:15:13 | LL | let _ = "a,b".splitn(1, ','); | ^^^^^^^^^^^^^^^^^^^^ @@ -25,7 +25,7 @@ LL | let _ = "a,b".splitn(1, ','); = note: the resulting iterator will always return the entire string followed by `None` error: `splitn` called with `0` splits - --> tests/ui/suspicious_splitn.rs:19:13 + --> tests/ui/suspicious_splitn.rs:18:13 | LL | let _ = [0, 1, 2].splitn(0, |&x| x == 1); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -33,7 +33,7 @@ LL | let _ = [0, 1, 2].splitn(0, |&x| x == 1); = note: the resulting iterator will always return `None` error: `splitn_mut` called with `0` splits - --> tests/ui/suspicious_splitn.rs:22:13 + --> tests/ui/suspicious_splitn.rs:21:13 | LL | let _ = [0, 1, 2].splitn_mut(0, |&x| x == 1); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -41,7 +41,7 @@ LL | let _ = [0, 1, 2].splitn_mut(0, |&x| x == 1); = note: the resulting iterator will always return `None` error: `splitn` called with `1` split - --> tests/ui/suspicious_splitn.rs:25:13 + --> tests/ui/suspicious_splitn.rs:24:13 | LL | let _ = [0, 1, 2].splitn(1, |&x| x == 1); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -49,7 +49,7 @@ LL | let _ = [0, 1, 2].splitn(1, |&x| x == 1); = note: the resulting iterator will always return the entire slice followed by `None` error: `rsplitn_mut` called with `1` split - --> tests/ui/suspicious_splitn.rs:28:13 + --> tests/ui/suspicious_splitn.rs:27:13 | LL | let _ = [0, 1, 2].rsplitn_mut(1, |&x| x == 1); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -57,7 +57,7 @@ LL | let _ = [0, 1, 2].rsplitn_mut(1, |&x| x == 1); = note: the resulting iterator will always return the entire slice followed by `None` error: `splitn` called with `1` split - --> tests/ui/suspicious_splitn.rs:32:13 + --> tests/ui/suspicious_splitn.rs:31:13 | LL | let _ = "a,b".splitn(X + 1, ','); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -65,7 +65,7 @@ LL | let _ = "a,b".splitn(X + 1, ','); = note: the resulting iterator will always return the entire string followed by `None` error: `splitn` called with `0` splits - --> tests/ui/suspicious_splitn.rs:35:13 + --> tests/ui/suspicious_splitn.rs:34:13 | LL | let _ = "a,b".splitn(X, ','); | ^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/suspicious_to_owned.1.fixed b/tests/ui/suspicious_to_owned.1.fixed index 6fd536a38ed1..0b025e618894 100644 --- a/tests/ui/suspicious_to_owned.1.fixed +++ b/tests/ui/suspicious_to_owned.1.fixed @@ -1,6 +1,5 @@ -#![warn(clippy::suspicious_to_owned)] -#![warn(clippy::implicit_clone)] -#![allow(clippy::redundant_clone)] +#![warn(clippy::implicit_clone, clippy::suspicious_to_owned)] +#![expect(clippy::redundant_clone)] use std::borrow::Cow; use std::ffi::{CStr, c_char}; diff --git a/tests/ui/suspicious_to_owned.2.fixed b/tests/ui/suspicious_to_owned.2.fixed index 841adf8ea274..203a6368d798 100644 --- a/tests/ui/suspicious_to_owned.2.fixed +++ b/tests/ui/suspicious_to_owned.2.fixed @@ -1,6 +1,5 @@ -#![warn(clippy::suspicious_to_owned)] -#![warn(clippy::implicit_clone)] -#![allow(clippy::redundant_clone)] +#![warn(clippy::implicit_clone, clippy::suspicious_to_owned)] +#![expect(clippy::redundant_clone)] use std::borrow::Cow; use std::ffi::{CStr, c_char}; diff --git a/tests/ui/suspicious_to_owned.rs b/tests/ui/suspicious_to_owned.rs index f59b3fd6ed0c..c843ff6514b6 100644 --- a/tests/ui/suspicious_to_owned.rs +++ b/tests/ui/suspicious_to_owned.rs @@ -1,6 +1,5 @@ -#![warn(clippy::suspicious_to_owned)] -#![warn(clippy::implicit_clone)] -#![allow(clippy::redundant_clone)] +#![warn(clippy::implicit_clone, clippy::suspicious_to_owned)] +#![expect(clippy::redundant_clone)] use std::borrow::Cow; use std::ffi::{CStr, c_char}; diff --git a/tests/ui/suspicious_to_owned.stderr b/tests/ui/suspicious_to_owned.stderr index 5fda1ed1cc9c..ae6cbfeb94dd 100644 --- a/tests/ui/suspicious_to_owned.stderr +++ b/tests/ui/suspicious_to_owned.stderr @@ -1,5 +1,5 @@ error: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned - --> tests/ui/suspicious_to_owned.rs:16:13 + --> tests/ui/suspicious_to_owned.rs:15:13 | LL | let _ = cow.to_owned(); | ^^^^^^^^^^^^^^ @@ -17,7 +17,7 @@ LL + let _ = cow.clone(); | error: this `to_owned` call clones the `Cow<'_, [char; 3]>` itself and does not cause its contents to become owned - --> tests/ui/suspicious_to_owned.rs:28:13 + --> tests/ui/suspicious_to_owned.rs:27:13 | LL | let _ = cow.to_owned(); | ^^^^^^^^^^^^^^ @@ -33,7 +33,7 @@ LL + let _ = cow.clone(); | error: this `to_owned` call clones the `Cow<'_, Vec>` itself and does not cause its contents to become owned - --> tests/ui/suspicious_to_owned.rs:40:13 + --> tests/ui/suspicious_to_owned.rs:39:13 | LL | let _ = cow.to_owned(); | ^^^^^^^^^^^^^^ @@ -49,7 +49,7 @@ LL + let _ = cow.clone(); | error: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned - --> tests/ui/suspicious_to_owned.rs:52:13 + --> tests/ui/suspicious_to_owned.rs:51:13 | LL | let _ = cow.to_owned(); | ^^^^^^^^^^^^^^ @@ -65,7 +65,7 @@ LL + let _ = cow.clone(); | error: implicitly cloning a `String` by calling `to_owned` on its dereferenced type - --> tests/ui/suspicious_to_owned.rs:68:13 + --> tests/ui/suspicious_to_owned.rs:67:13 | LL | let _ = String::from(moo).to_owned(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `String::from(moo).clone()` @@ -74,7 +74,7 @@ LL | let _ = String::from(moo).to_owned(); = help: to override `-D warnings` add `#[allow(clippy::implicit_clone)]` error: implicitly cloning a `Vec` by calling `to_owned` on its dereferenced type - --> tests/ui/suspicious_to_owned.rs:71:13 + --> tests/ui/suspicious_to_owned.rs:70:13 | LL | let _ = moos_vec.to_owned(); | ^^^^^^^^^^^^^^^^^^^ help: consider using: `moos_vec.clone()` diff --git a/tests/ui/suspicious_unary_op_formatting.rs b/tests/ui/suspicious_unary_op_formatting.rs index 19f8b231925b..7a5d710c1459 100644 --- a/tests/ui/suspicious_unary_op_formatting.rs +++ b/tests/ui/suspicious_unary_op_formatting.rs @@ -1,5 +1,5 @@ #![warn(clippy::suspicious_unary_op_formatting)] -#![allow(clippy::needless_ifs)] +#![expect(clippy::needless_ifs)] #[rustfmt::skip] fn main() { diff --git a/tests/ui/suspicious_xor_used_as_pow.rs b/tests/ui/suspicious_xor_used_as_pow.rs index 40a8d8c366ba..55ca85480b55 100644 --- a/tests/ui/suspicious_xor_used_as_pow.rs +++ b/tests/ui/suspicious_xor_used_as_pow.rs @@ -1,6 +1,5 @@ -#![allow(unused)] #![warn(clippy::suspicious_xor_used_as_pow)] -#![allow(clippy::eq_op)] +#![expect(clippy::eq_op)] //@no-rustfix macro_rules! macro_test { () => { diff --git a/tests/ui/suspicious_xor_used_as_pow.stderr b/tests/ui/suspicious_xor_used_as_pow.stderr index efeafdb94acb..2b6570bb0adf 100644 --- a/tests/ui/suspicious_xor_used_as_pow.stderr +++ b/tests/ui/suspicious_xor_used_as_pow.stderr @@ -1,5 +1,5 @@ error: `^` is not the exponentiation operator - --> tests/ui/suspicious_xor_used_as_pow.rs:21:13 + --> tests/ui/suspicious_xor_used_as_pow.rs:20:13 | LL | let _ = 2 ^ 5; | ^^^^^ @@ -13,7 +13,7 @@ LL + let _ = 2.pow(5); | error: `^` is not the exponentiation operator - --> tests/ui/suspicious_xor_used_as_pow.rs:24:13 + --> tests/ui/suspicious_xor_used_as_pow.rs:23:13 | LL | let _ = 2i32 ^ 9i32; | ^^^^^^^^^^^ @@ -25,7 +25,7 @@ LL + let _ = 2i32.pow(9i32); | error: `^` is not the exponentiation operator - --> tests/ui/suspicious_xor_used_as_pow.rs:27:13 + --> tests/ui/suspicious_xor_used_as_pow.rs:26:13 | LL | let _ = 2i32 ^ 2i32; | ^^^^^^^^^^^ @@ -37,7 +37,7 @@ LL + let _ = 2i32.pow(2i32); | error: `^` is not the exponentiation operator - --> tests/ui/suspicious_xor_used_as_pow.rs:30:13 + --> tests/ui/suspicious_xor_used_as_pow.rs:29:13 | LL | let _ = 50i32 ^ 3i32; | ^^^^^^^^^^^^ @@ -49,7 +49,7 @@ LL + let _ = 50i32.pow(3i32); | error: `^` is not the exponentiation operator - --> tests/ui/suspicious_xor_used_as_pow.rs:33:13 + --> tests/ui/suspicious_xor_used_as_pow.rs:32:13 | LL | let _ = 5i32 ^ 8i32; | ^^^^^^^^^^^ @@ -61,7 +61,7 @@ LL + let _ = 5i32.pow(8i32); | error: `^` is not the exponentiation operator - --> tests/ui/suspicious_xor_used_as_pow.rs:36:13 + --> tests/ui/suspicious_xor_used_as_pow.rs:35:13 | LL | let _ = 2i32 ^ 32i32; | ^^^^^^^^^^^^ @@ -73,7 +73,7 @@ LL + let _ = 2i32.pow(32i32); | error: `^` is not the exponentiation operator - --> tests/ui/suspicious_xor_used_as_pow.rs:13:9 + --> tests/ui/suspicious_xor_used_as_pow.rs:12:9 | LL | 1 ^ 2 // should warn even if inside macro | ^^^^^ diff --git a/tests/ui/swap.fixed b/tests/ui/swap.fixed index 0d968e96ff79..98f2d0c74603 100644 --- a/tests/ui/swap.fixed +++ b/tests/ui/swap.fixed @@ -1,12 +1,11 @@ //@aux-build: macro_rules.rs -#![allow( +#![warn(clippy::almost_swapped, clippy::manual_swap)] +#![expect( clippy::disallowed_names, - clippy::no_effect, - clippy::redundant_clone, clippy::let_and_return, - clippy::useless_vec, - clippy::redundant_locals + clippy::redundant_locals, + clippy::useless_vec )] struct Foo(u32); diff --git a/tests/ui/swap.rs b/tests/ui/swap.rs index c78c320332fb..a37753a00794 100644 --- a/tests/ui/swap.rs +++ b/tests/ui/swap.rs @@ -1,12 +1,11 @@ //@aux-build: macro_rules.rs -#![allow( +#![warn(clippy::almost_swapped, clippy::manual_swap)] +#![expect( clippy::disallowed_names, - clippy::no_effect, - clippy::redundant_clone, clippy::let_and_return, - clippy::useless_vec, - clippy::redundant_locals + clippy::redundant_locals, + clippy::useless_vec )] struct Foo(u32); diff --git a/tests/ui/swap.stderr b/tests/ui/swap.stderr index e730be40e349..1fd1737d7aaf 100644 --- a/tests/ui/swap.stderr +++ b/tests/ui/swap.stderr @@ -1,5 +1,5 @@ error: this looks like you are swapping `bar.a` and `bar.b` manually - --> tests/ui/swap.rs:23:5 + --> tests/ui/swap.rs:22:5 | LL | / let temp = bar.a; LL | | @@ -12,7 +12,7 @@ LL | | bar.b = temp; = help: to override `-D warnings` add `#[allow(clippy::manual_swap)]` error: this looks like you are swapping elements of `foo` manually - --> tests/ui/swap.rs:36:5 + --> tests/ui/swap.rs:35:5 | LL | / let temp = foo[0]; LL | | @@ -21,7 +21,7 @@ LL | | foo[1] = temp; | |__________________^ help: try: `foo.swap(0, 1);` error: this looks like you are swapping elements of `foo` manually - --> tests/ui/swap.rs:46:5 + --> tests/ui/swap.rs:45:5 | LL | / let temp = foo[0]; LL | | @@ -30,7 +30,7 @@ LL | | foo[1] = temp; | |__________________^ help: try: `foo.swap(0, 1);` error: this looks like you are swapping elements of `foo` manually - --> tests/ui/swap.rs:66:5 + --> tests/ui/swap.rs:65:5 | LL | / let temp = foo[0]; LL | | @@ -39,7 +39,7 @@ LL | | foo[1] = temp; | |__________________^ help: try: `foo.swap(0, 1);` error: this looks like you are swapping `a` and `b` manually - --> tests/ui/swap.rs:78:5 + --> tests/ui/swap.rs:77:5 | LL | / a ^= b; LL | | @@ -48,7 +48,7 @@ LL | | a ^= b; | |___________^ help: try: `std::mem::swap(&mut a, &mut b);` error: this looks like you are swapping `bar.a` and `bar.b` manually - --> tests/ui/swap.rs:87:5 + --> tests/ui/swap.rs:86:5 | LL | / bar.a ^= bar.b; LL | | @@ -57,7 +57,7 @@ LL | | bar.a ^= bar.b; | |___________________^ help: try: `std::mem::swap(&mut bar.a, &mut bar.b);` error: this looks like you are swapping elements of `foo` manually - --> tests/ui/swap.rs:96:5 + --> tests/ui/swap.rs:95:5 | LL | / foo[0] ^= foo[1]; LL | | @@ -66,7 +66,7 @@ LL | | foo[0] ^= foo[1]; | |_____________________^ help: try: `foo.swap(0, 1);` error: this looks like you are swapping `foo[0][1]` and `bar[1][0]` manually - --> tests/ui/swap.rs:126:5 + --> tests/ui/swap.rs:125:5 | LL | / let temp = foo[0][1]; LL | | @@ -77,7 +77,7 @@ LL | | bar[1][0] = temp; = note: or maybe you should use `std::mem::replace`? error: this looks like you are swapping `a` and `b` manually - --> tests/ui/swap.rs:142:7 + --> tests/ui/swap.rs:141:7 | LL | ; let t = a; | _______^ @@ -89,7 +89,7 @@ LL | | b = t; = note: or maybe you should use `std::mem::replace`? error: this looks like you are swapping `c.0` and `a` manually - --> tests/ui/swap.rs:153:7 + --> tests/ui/swap.rs:152:7 | LL | ; let t = c.0; | _______^ @@ -101,7 +101,7 @@ LL | | a = t; = note: or maybe you should use `std::mem::replace`? error: this looks like you are swapping `b` and `a` manually - --> tests/ui/swap.rs:183:5 + --> tests/ui/swap.rs:182:5 | LL | / let t = b; LL | | @@ -112,7 +112,7 @@ LL | | a = t; = note: or maybe you should use `std::mem::replace`? error: this looks like you are trying to swap `a` and `b` - --> tests/ui/swap.rs:138:5 + --> tests/ui/swap.rs:137:5 | LL | / a = b; LL | | @@ -120,10 +120,11 @@ LL | | b = a; | |_________^ help: try: `std::mem::swap(&mut a, &mut b)` | = note: or maybe you should use `std::mem::replace`? - = note: `#[deny(clippy::almost_swapped)]` on by default + = note: `-D clippy::almost-swapped` implied by `-D warnings` + = help: to override `-D warnings` add `#[allow(clippy::almost_swapped)]` error: this looks like you are trying to swap `c.0` and `a` - --> tests/ui/swap.rs:149:5 + --> tests/ui/swap.rs:148:5 | LL | / c.0 = a; LL | | @@ -133,7 +134,7 @@ LL | | a = c.0; = note: or maybe you should use `std::mem::replace`? error: this looks like you are trying to swap `a` and `b` - --> tests/ui/swap.rs:158:5 + --> tests/ui/swap.rs:157:5 | LL | / let a = b; LL | | @@ -143,7 +144,7 @@ LL | | let b = a; = note: or maybe you should use `std::mem::replace`? error: this looks like you are trying to swap `d` and `c` - --> tests/ui/swap.rs:164:5 + --> tests/ui/swap.rs:163:5 | LL | / d = c; LL | | @@ -153,7 +154,7 @@ LL | | c = d; = note: or maybe you should use `std::mem::replace`? error: this looks like you are trying to swap `a` and `b` - --> tests/ui/swap.rs:169:5 + --> tests/ui/swap.rs:168:5 | LL | / let a = b; LL | | @@ -163,7 +164,7 @@ LL | | b = a; = note: or maybe you should use `std::mem::replace`? error: this looks like you are swapping `s.0.x` and `s.0.y` manually - --> tests/ui/swap.rs:219:5 + --> tests/ui/swap.rs:218:5 | LL | / let t = s.0.x; LL | | @@ -174,7 +175,7 @@ LL | | s.0.y = t; = note: or maybe you should use `std::mem::replace`? error: this looks like you are swapping elements of `test_slice!(foo)` manually - --> tests/ui/swap.rs:253:5 + --> tests/ui/swap.rs:252:5 | LL | / let temp = test_slice!(foo)[0]; LL | |