Skip to content

Commit 86ce182

Browse files
committed
Bump clippy::version for some lints
Also moves `tuple_array_conversions` to `pedantic`, because rust-lang#11171 didn't contain it fsr
1 parent 8494a06 commit 86ce182

8 files changed

+27
-26
lines changed

clippy_lints/src/error_impl_error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ declare_clippy_lint! {
2828
///
2929
/// impl std::error::Error for Error { ... }
3030
/// ```
31-
#[clippy::version = "1.72.0"]
31+
#[clippy::version = "1.73.0"]
3232
pub ERROR_IMPL_ERROR,
3333
restriction,
3434
"exported types named `Error` that implement `Error`"

clippy_lints/src/excessive_nesting.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ declare_clippy_lint! {
5656
/// // lib.rs
5757
/// pub mod a;
5858
/// ```
59-
#[clippy::version = "1.70.0"]
59+
#[clippy::version = "1.72.0"]
6060
pub EXCESSIVE_NESTING,
6161
complexity,
6262
"checks for blocks nested beyond a certain threshold"

clippy_lints/src/four_forward_slashes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ declare_clippy_lint! {
2828
/// // ...
2929
/// }
3030
/// ```
31-
#[clippy::version = "1.72.0"]
31+
#[clippy::version = "1.73.0"]
3232
pub FOUR_FORWARD_SLASHES,
3333
suspicious,
3434
"comments with 4 forward slashes (`////`) likely intended to be doc comments (`///`)"

clippy_lints/src/methods/mod.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -3365,6 +3365,7 @@ declare_clippy_lint! {
33653365
}
33663366

33673367
declare_clippy_lint! {
3368+
/// ### What it does
33683369
/// Looks for calls to [`Stdin::read_line`] to read a line from the standard input
33693370
/// into a string, then later attempting to parse this string into a type without first trimming it, which will
33703371
/// always fail because the string has a trailing newline in it.
@@ -3415,7 +3416,7 @@ declare_clippy_lint! {
34153416
/// # let c = 'c';
34163417
/// matches!(c, '\\' | '.' | '+' | '*' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~');
34173418
/// ```
3418-
#[clippy::version = "1.72.0"]
3419+
#[clippy::version = "1.73.0"]
34193420
pub STRING_LIT_CHARS_ANY,
34203421
restriction,
34213422
"checks for `<string_lit>.chars().any(|i| i == c)`"
@@ -3450,7 +3451,7 @@ declare_clippy_lint! {
34503451
/// })
34513452
/// }
34523453
/// ```
3453-
#[clippy::version = "1.72.0"]
3454+
#[clippy::version = "1.73.0"]
34543455
pub FORMAT_COLLECT,
34553456
perf,
34563457
"`format!`ing every element in a collection, then collecting the strings into a new `String`"
@@ -3471,7 +3472,7 @@ declare_clippy_lint! {
34713472
/// let y = v.iter().collect::<Vec<_>>();
34723473
/// assert_eq!(x, y);
34733474
/// ```
3474-
#[clippy::version = "1.72.0"]
3475+
#[clippy::version = "1.73.0"]
34753476
pub ITER_SKIP_ZERO,
34763477
correctness,
34773478
"disallows `.skip(0)`"

clippy_lints/src/needless_pass_by_ref_mut.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByRefMut<'tcx> {
214214
diag.warn("changing this function will impact semver compatibility");
215215
}
216216
if *is_cfged {
217-
diag.note("this is cfg-gated and may require further changes");
217+
diag.note("this is `cfg`-gated and may require further changes");
218218
}
219219
},
220220
);

clippy_lints/src/tuple_array_conversions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ declare_clippy_lint! {
3737
/// ```
3838
#[clippy::version = "1.72.0"]
3939
pub TUPLE_ARRAY_CONVERSIONS,
40-
nursery,
40+
pedantic,
4141
"checks for tuple<=>array conversions that are not done with `.into()`"
4242
}
4343
impl_lint_pass!(TupleArrayConversions => [TUPLE_ARRAY_CONVERSIONS]);

tests/ui/needless_pass_by_ref_mut.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use std::ptr::NonNull;
55

66
fn foo(s: &mut Vec<u32>, b: &u32, x: &mut u32) {
7-
//~^ ERROR: this argument is a mutable reference, but not used mutably
7+
//~^ ERROR: this argument is a mutable reference, but never used mutably
88
*x += *b + s.len() as u32;
99
}
1010

@@ -29,7 +29,7 @@ fn foo5(s: &mut Vec<u32>) {
2929
}
3030

3131
fn foo6(s: &mut Vec<u32>) {
32-
//~^ ERROR: this argument is a mutable reference, but not used mutably
32+
//~^ ERROR: this argument is a mutable reference, but never used mutably
3333
non_mut_ref(s);
3434
}
3535

@@ -42,12 +42,12 @@ impl Bar {
4242
fn bar(&mut self) {}
4343

4444
fn mushroom(&self, vec: &mut Vec<i32>) -> usize {
45-
//~^ ERROR: this argument is a mutable reference, but not used mutably
45+
//~^ ERROR: this argument is a mutable reference, but never used mutably
4646
vec.len()
4747
}
4848

4949
fn badger(&mut self, vec: &mut Vec<i32>) -> usize {
50-
//~^ ERROR: this argument is a mutable reference, but not used mutably
50+
//~^ ERROR: this argument is a mutable reference, but never used mutably
5151
vec.len()
5252
}
5353
}
@@ -124,35 +124,35 @@ async fn f7(x: &mut i32, y: i32, z: &mut i32, a: i32) {
124124
}
125125

126126
async fn a1(x: &mut i32) {
127-
//~^ ERROR: this argument is a mutable reference, but not used mutably
127+
//~^ ERROR: this argument is a mutable reference, but never used mutably
128128
println!("{:?}", x);
129129
}
130130
async fn a2(x: &mut i32, y: String) {
131-
//~^ ERROR: this argument is a mutable reference, but not used mutably
131+
//~^ ERROR: this argument is a mutable reference, but never used mutably
132132
println!("{:?}", x);
133133
}
134134
async fn a3(x: &mut i32, y: String, z: String) {
135-
//~^ ERROR: this argument is a mutable reference, but not used mutably
135+
//~^ ERROR: this argument is a mutable reference, but never used mutably
136136
println!("{:?}", x);
137137
}
138138
async fn a4(x: &mut i32, y: i32) {
139-
//~^ ERROR: this argument is a mutable reference, but not used mutably
139+
//~^ ERROR: this argument is a mutable reference, but never used mutably
140140
println!("{:?}", x);
141141
}
142142
async fn a5(x: i32, y: &mut i32) {
143-
//~^ ERROR: this argument is a mutable reference, but not used mutably
143+
//~^ ERROR: this argument is a mutable reference, but never used mutably
144144
println!("{:?}", x);
145145
}
146146
async fn a6(x: i32, y: &mut i32) {
147-
//~^ ERROR: this argument is a mutable reference, but not used mutably
147+
//~^ ERROR: this argument is a mutable reference, but never used mutably
148148
println!("{:?}", x);
149149
}
150150
async fn a7(x: i32, y: i32, z: &mut i32) {
151-
//~^ ERROR: this argument is a mutable reference, but not used mutably
151+
//~^ ERROR: this argument is a mutable reference, but never used mutably
152152
println!("{:?}", z);
153153
}
154154
async fn a8(x: i32, a: &mut i32, y: i32, z: &mut i32) {
155-
//~^ ERROR: this argument is a mutable reference, but not used mutably
155+
//~^ ERROR: this argument is a mutable reference, but never used mutably
156156
println!("{:?}", z);
157157
}
158158

@@ -186,14 +186,14 @@ fn lint_attr(s: &mut u32) {}
186186

187187
#[cfg(not(feature = "a"))]
188188
fn cfg_warn(s: &mut u32) {}
189-
//~^ ERROR: this argument is a mutable reference, but not used mutably
190-
//~| NOTE: this is cfg-gated and may require further changes
189+
//~^ ERROR: this argument is a mutable reference, but never used mutably
190+
//~| NOTE: this is `cfg`-gated and may require further changes
191191

192192
#[cfg(not(feature = "a"))]
193193
mod foo {
194194
fn cfg_warn(s: &mut u32) {}
195-
//~^ ERROR: this argument is a mutable reference, but not used mutably
196-
//~| NOTE: this is cfg-gated and may require further changes
195+
//~^ ERROR: this argument is a mutable reference, but never used mutably
196+
//~| NOTE: this is `cfg`-gated and may require further changes
197197
}
198198

199199
fn main() {

tests/ui/needless_pass_by_ref_mut.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ error: this argument is a mutable reference, but never used mutably
8484
LL | fn cfg_warn(s: &mut u32) {}
8585
| ^^^^^^^^ help: consider using an immutable reference instead: `&u32`
8686
|
87-
= note: this is cfg-gated and may require further changes
87+
= note: this is `cfg`-gated and may require further changes
8888

8989
error: this argument is a mutable reference, but never used mutably
9090
--> $DIR/needless_pass_by_ref_mut.rs:194:20
9191
|
9292
LL | fn cfg_warn(s: &mut u32) {}
9393
| ^^^^^^^^ help: consider using an immutable reference instead: `&u32`
9494
|
95-
= note: this is cfg-gated and may require further changes
95+
= note: this is `cfg`-gated and may require further changes
9696

9797
error: aborting due to 15 previous errors
9898

0 commit comments

Comments
 (0)