Skip to content

Commit d2f1b2c

Browse files
committed
Auto merge of rust-lang#10638 - bluthej:standardize-lint-formulation, r=Alexendoo
Standardize lint formulation Fixes rust-lang#10631 changelog: Standardize a very frequent lint formulation which had variations
2 parents 0d06001 + 6409556 commit d2f1b2c

16 files changed

+39
-39
lines changed

clippy_lints/src/allow_attributes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rustc_lint::{LateContext, LateLintPass};
66
use rustc_session::{declare_lint_pass, declare_tool_lint};
77

88
declare_clippy_lint! {
9-
/// Detects uses of the `#[allow]` attribute and suggests replacing it with
9+
/// Checks for usage of the `#[allow]` attribute and suggests replacing it with
1010
/// the `#[expect]` (See [RFC 2383](https://rust-lang.github.io/rfcs/2383-lint-reasons.html))
1111
///
1212
/// The expect attribute is still unstable and requires the `lint_reasons`

clippy_lints/src/casts/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ declare_clippy_lint! {
506506

507507
declare_clippy_lint! {
508508
/// ### What it does
509-
/// Checks for uses of the `abs()` method that cast the result to unsigned.
509+
/// Checks for usage of the `abs()` method that cast the result to unsigned.
510510
///
511511
/// ### Why is this bad?
512512
/// The `unsigned_abs()` method avoids panic when called on the MIN value.

clippy_lints/src/crate_in_macro_def.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_span::{symbol::sym, Span};
99

1010
declare_clippy_lint! {
1111
/// ### What it does
12-
/// Checks for use of `crate` as opposed to `$crate` in a macro definition.
12+
/// Checks for usage of `crate` as opposed to `$crate` in a macro definition.
1313
///
1414
/// ### Why is this bad?
1515
/// `crate` refers to the macro call's crate, whereas `$crate` refers to the macro definition's

clippy_lints/src/entry.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use rustc_span::{Span, SyntaxContext, DUMMY_SP};
1919

2020
declare_clippy_lint! {
2121
/// ### What it does
22-
/// Checks for uses of `contains_key` + `insert` on `HashMap`
22+
/// Checks for usage of `contains_key` + `insert` on `HashMap`
2323
/// or `BTreeMap`.
2424
///
2525
/// ### Why is this bad?

clippy_lints/src/format_impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ declare_clippy_lint! {
5151

5252
declare_clippy_lint! {
5353
/// ### What it does
54-
/// Checks for use of `println`, `print`, `eprintln` or `eprint` in an
54+
/// Checks for usage of `println`, `print`, `eprintln` or `eprint` in an
5555
/// implementation of a formatting trait.
5656
///
5757
/// ### Why is this bad?

clippy_lints/src/formatting.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_span::source_map::Span;
1010

1111
declare_clippy_lint! {
1212
/// ### What it does
13-
/// Checks for use of the non-existent `=*`, `=!` and `=-`
13+
/// Checks for usage of the non-existent `=*`, `=!` and `=-`
1414
/// operators.
1515
///
1616
/// ### Why is this bad?

clippy_lints/src/lines_filter_map_ok.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_span::sym;
1010

1111
declare_clippy_lint! {
1212
/// ### What it does
13-
/// Detect uses of `lines.filter_map(Result::ok)` or `lines.flat_map(Result::ok)`
13+
/// Checks for usage of `lines.filter_map(Result::ok)` or `lines.flat_map(Result::ok)`
1414
/// when `lines` has type `std::io::Lines`.
1515
///
1616
/// ### Why is this bad?

clippy_lints/src/manual_bits.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_span::sym;
1313

1414
declare_clippy_lint! {
1515
/// ### What it does
16-
/// Checks for uses of `std::mem::size_of::<T>() * 8` when
16+
/// Checks for usage of `std::mem::size_of::<T>() * 8` when
1717
/// `T::BITS` is available.
1818
///
1919
/// ### Why is this bad?

clippy_lints/src/matches/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ declare_clippy_lint! {
843843

844844
declare_clippy_lint! {
845845
/// ### What it does
846-
/// Checks for usages of `Err(x)?`.
846+
/// Checks for usage of `Err(x)?`.
847847
///
848848
/// ### Why is this bad?
849849
/// The `?` operator is designed to allow calls that
@@ -878,7 +878,7 @@ declare_clippy_lint! {
878878

879879
declare_clippy_lint! {
880880
/// ### What it does
881-
/// Checks for usages of `match` which could be implemented using `map`
881+
/// Checks for usage of `match` which could be implemented using `map`
882882
///
883883
/// ### Why is this bad?
884884
/// Using the `map` method is clearer and more concise.
@@ -902,7 +902,7 @@ declare_clippy_lint! {
902902

903903
declare_clippy_lint! {
904904
/// ### What it does
905-
/// Checks for usages of `match` which could be implemented using `filter`
905+
/// Checks for usage of `match` which could be implemented using `filter`
906906
///
907907
/// ### Why is this bad?
908908
/// Using the `filter` method is clearer and more concise.

clippy_lints/src/methods/mod.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ use rustc_span::{sym, Span};
121121

122122
declare_clippy_lint! {
123123
/// ### What it does
124-
/// Checks for usages of `cloned()` on an `Iterator` or `Option` where
124+
/// Checks for usage of `cloned()` on an `Iterator` or `Option` where
125125
/// `copied()` could be used instead.
126126
///
127127
/// ### Why is this bad?
@@ -201,7 +201,7 @@ declare_clippy_lint! {
201201

202202
declare_clippy_lint! {
203203
/// ### What it does
204-
/// Checks for usages of `Iterator::flat_map()` where `filter_map()` could be
204+
/// Checks for usage of `Iterator::flat_map()` where `filter_map()` could be
205205
/// used instead.
206206
///
207207
/// ### Why is this bad?
@@ -441,7 +441,7 @@ declare_clippy_lint! {
441441

442442
declare_clippy_lint! {
443443
/// ### What it does
444-
/// Checks for usages of `_.unwrap_or_else(Default::default)` on `Option` and
444+
/// Checks for usage of `_.unwrap_or_else(Default::default)` on `Option` and
445445
/// `Result` values.
446446
///
447447
/// ### Why is this bad?
@@ -1194,7 +1194,7 @@ declare_clippy_lint! {
11941194

11951195
declare_clippy_lint! {
11961196
/// ### What it does
1197-
/// Checks for use of `.iter().nth()` (and the related
1197+
/// Checks for usage of `.iter().nth()` (and the related
11981198
/// `.iter_mut().nth()`) on standard library types with *O*(1) element access.
11991199
///
12001200
/// ### Why is this bad?
@@ -1221,7 +1221,7 @@ declare_clippy_lint! {
12211221

12221222
declare_clippy_lint! {
12231223
/// ### What it does
1224-
/// Checks for use of `.skip(x).next()` on iterators.
1224+
/// Checks for usage of `.skip(x).next()` on iterators.
12251225
///
12261226
/// ### Why is this bad?
12271227
/// `.nth(x)` is cleaner
@@ -1246,7 +1246,7 @@ declare_clippy_lint! {
12461246

12471247
declare_clippy_lint! {
12481248
/// ### What it does
1249-
/// Checks for use of `.drain(..)` on `Vec` and `VecDeque` for iteration.
1249+
/// Checks for usage of `.drain(..)` on `Vec` and `VecDeque` for iteration.
12501250
///
12511251
/// ### Why is this bad?
12521252
/// `.into_iter()` is simpler with better performance.
@@ -1271,7 +1271,7 @@ declare_clippy_lint! {
12711271

12721272
declare_clippy_lint! {
12731273
/// ### What it does
1274-
/// Checks for using `x.get(x.len() - 1)` instead of
1274+
/// Checks for usage of `x.get(x.len() - 1)` instead of
12751275
/// `x.last()`.
12761276
///
12771277
/// ### Why is this bad?
@@ -1304,7 +1304,7 @@ declare_clippy_lint! {
13041304

13051305
declare_clippy_lint! {
13061306
/// ### What it does
1307-
/// Checks for use of `.get().unwrap()` (or
1307+
/// Checks for usage of `.get().unwrap()` (or
13081308
/// `.get_mut().unwrap`) on a standard library type which implements `Index`
13091309
///
13101310
/// ### Why is this bad?
@@ -1475,7 +1475,7 @@ declare_clippy_lint! {
14751475

14761476
declare_clippy_lint! {
14771477
/// ### What it does
1478-
/// Checks for using `fold` when a more succinct alternative exists.
1478+
/// Checks for usage of `fold` when a more succinct alternative exists.
14791479
/// Specifically, this checks for `fold`s which could be replaced by `any`, `all`,
14801480
/// `sum` or `product`.
14811481
///
@@ -2161,7 +2161,7 @@ declare_clippy_lint! {
21612161

21622162
declare_clippy_lint! {
21632163
/// ### What it does
2164-
/// Checks for usages of `str::splitn(2, _)`
2164+
/// Checks for usage of `str::splitn(2, _)`
21652165
///
21662166
/// ### Why is this bad?
21672167
/// `split_once` is both clearer in intent and slightly more efficient.
@@ -2197,7 +2197,7 @@ declare_clippy_lint! {
21972197

21982198
declare_clippy_lint! {
21992199
/// ### What it does
2200-
/// Checks for usages of `str::splitn` (or `str::rsplitn`) where using `str::split` would be the same.
2200+
/// Checks for usage of `str::splitn` (or `str::rsplitn`) where using `str::split` would be the same.
22012201
/// ### Why is this bad?
22022202
/// The function `split` is simpler and there is no performance difference in these cases, considering
22032203
/// that both functions return a lazy iterator.
@@ -2251,7 +2251,7 @@ declare_clippy_lint! {
22512251

22522252
declare_clippy_lint! {
22532253
/// ### What it does
2254-
/// Checks for use of `.collect::<Vec<String>>().join("")` on iterators.
2254+
/// Checks for usage of `.collect::<Vec<String>>().join("")` on iterators.
22552255
///
22562256
/// ### Why is this bad?
22572257
/// `.collect::<String>()` is more concise and might be more performant
@@ -2377,7 +2377,7 @@ declare_clippy_lint! {
23772377

23782378
declare_clippy_lint! {
23792379
/// ### What it does
2380-
/// Checks for usages of `.then_some(..).unwrap_or(..)`
2380+
/// Checks for usage of `.then_some(..).unwrap_or(..)`
23812381
///
23822382
/// ### Why is this bad?
23832383
/// This can be written more clearly with `if .. else ..`
@@ -2553,7 +2553,7 @@ declare_clippy_lint! {
25532553

25542554
declare_clippy_lint! {
25552555
/// ### What it does
2556-
/// Checks for using `x.get(0)` instead of
2556+
/// Checks for usage of `x.get(0)` instead of
25572557
/// `x.first()`.
25582558
///
25592559
/// ### Why is this bad?
@@ -2957,7 +2957,7 @@ declare_clippy_lint! {
29572957

29582958
declare_clippy_lint! {
29592959
/// ### What it does
2960-
/// Detects uses of `Vec::sort_by` passing in a closure
2960+
/// Checks for usage of `Vec::sort_by` passing in a closure
29612961
/// which compares the two arguments, either directly or indirectly.
29622962
///
29632963
/// ### Why is this bad?
@@ -3013,7 +3013,7 @@ declare_clippy_lint! {
30133013

30143014
declare_clippy_lint! {
30153015
/// ### What it does
3016-
/// Checks for use of File::read_to_end and File::read_to_string.
3016+
/// Checks for usage of File::read_to_end and File::read_to_string.
30173017
///
30183018
/// ### Why is this bad?
30193019
/// `fs::{read, read_to_string}` provide the same functionality when `buf` is empty with fewer imports and no intermediate values.

clippy_lints/src/mutex_atomic.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Checks for uses of mutex where an atomic value could be used
1+
//! Checks for usage of mutex where an atomic value could be used
22
//!
33
//! This lint is **allow** by default
44
@@ -12,7 +12,7 @@ use rustc_span::sym;
1212

1313
declare_clippy_lint! {
1414
/// ### What it does
15-
/// Checks for usages of `Mutex<X>` where an atomic will do.
15+
/// Checks for usage of `Mutex<X>` where an atomic will do.
1616
///
1717
/// ### Why is this bad?
1818
/// Using a mutex just to make access to a plain bool or
@@ -49,7 +49,7 @@ declare_clippy_lint! {
4949

5050
declare_clippy_lint! {
5151
/// ### What it does
52-
/// Checks for usages of `Mutex<X>` where `X` is an integral
52+
/// Checks for usage of `Mutex<X>` where `X` is an integral
5353
/// type.
5454
///
5555
/// ### Why is this bad?

clippy_lints/src/non_copy_const.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Checks for uses of const which the type is not `Freeze` (`Cell`-free).
1+
//! Checks for usage of const which the type is not `Freeze` (`Cell`-free).
22
//!
33
//! This lint is **warn** by default.
44

clippy_lints/src/operators/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ declare_clippy_lint! {
685685

686686
declare_clippy_lint! {
687687
/// ### What it does
688-
/// Checks for uses of bitwise and/or operators between booleans, where performance may be improved by using
688+
/// Checks for usage of bitwise and/or operators between booleans, where performance may be improved by using
689689
/// a lazy and.
690690
///
691691
/// ### Why is this bad?

clippy_lints/src/types/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use rustc_span::source_map::Span;
2222

2323
declare_clippy_lint! {
2424
/// ### What it does
25-
/// Checks for use of `Box<T>` where T is a collection such as Vec anywhere in the code.
25+
/// Checks for usage of `Box<T>` where T is a collection such as Vec anywhere in the code.
2626
/// Check the [Box documentation](https://doc.rust-lang.org/std/boxed/index.html) for more information.
2727
///
2828
/// ### Why is this bad?
@@ -52,7 +52,7 @@ declare_clippy_lint! {
5252

5353
declare_clippy_lint! {
5454
/// ### What it does
55-
/// Checks for use of `Vec<Box<T>>` where T: Sized anywhere in the code.
55+
/// Checks for usage of `Vec<Box<T>>` where T: Sized anywhere in the code.
5656
/// Check the [Box documentation](https://doc.rust-lang.org/std/boxed/index.html) for more information.
5757
///
5858
/// ### Why is this bad?
@@ -85,7 +85,7 @@ declare_clippy_lint! {
8585

8686
declare_clippy_lint! {
8787
/// ### What it does
88-
/// Checks for use of `Option<Option<_>>` in function signatures and type
88+
/// Checks for usage of `Option<Option<_>>` in function signatures and type
8989
/// definitions
9090
///
9191
/// ### Why is this bad?
@@ -164,7 +164,7 @@ declare_clippy_lint! {
164164

165165
declare_clippy_lint! {
166166
/// ### What it does
167-
/// Checks for use of `&Box<T>` anywhere in the code.
167+
/// Checks for usage of `&Box<T>` anywhere in the code.
168168
/// Check the [Box documentation](https://doc.rust-lang.org/std/boxed/index.html) for more information.
169169
///
170170
/// ### Why is this bad?
@@ -190,7 +190,7 @@ declare_clippy_lint! {
190190

191191
declare_clippy_lint! {
192192
/// ### What it does
193-
/// Checks for use of redundant allocations anywhere in the code.
193+
/// Checks for usage of redundant allocations anywhere in the code.
194194
///
195195
/// ### Why is this bad?
196196
/// Expressions such as `Rc<&T>`, `Rc<Rc<T>>`, `Rc<Arc<T>>`, `Rc<Box<T>>`, `Arc<&T>`, `Arc<Rc<T>>`,

clippy_lints/src/utils/internal_lints/unnecessary_def_path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::str;
2020

2121
declare_clippy_lint! {
2222
/// ### What it does
23-
/// Checks for usages of def paths when a diagnostic item or a `LangItem` could be used.
23+
/// Checks for usage of def paths when a diagnostic item or a `LangItem` could be used.
2424
///
2525
/// ### Why is this bad?
2626
/// The path for an item is subject to change and is less efficient to look up than a

clippy_lints/src/write.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ declare_clippy_lint! {
104104

105105
declare_clippy_lint! {
106106
/// ### What it does
107-
/// Checks for use of `Debug` formatting. The purpose of this
107+
/// Checks for usage of `Debug` formatting. The purpose of this
108108
/// lint is to catch debugging remnants.
109109
///
110110
/// ### Why is this bad?

0 commit comments

Comments
 (0)