Skip to content

Commit ebf5799

Browse files
committed
Merge commit 'd822110d3b5625b9dc80ccc442e06fc3cc851d76' into clippyup
2 parents 9c0bc30 + d822110 commit ebf5799

File tree

237 files changed

+4245
-1914
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

237 files changed

+4245
-1914
lines changed

src/tools/clippy/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -4188,6 +4188,7 @@ Released 2018-09-13
41884188
[`misaligned_transmute`]: https://rust-lang.github.io/rust-clippy/master/index.html#misaligned_transmute
41894189
[`mismatched_target_os`]: https://rust-lang.github.io/rust-clippy/master/index.html#mismatched_target_os
41904190
[`mismatching_type_param_order`]: https://rust-lang.github.io/rust-clippy/master/index.html#mismatching_type_param_order
4191+
[`misnamed_getters`]: https://rust-lang.github.io/rust-clippy/master/index.html#misnamed_getters
41914192
[`misrefactored_assign_op`]: https://rust-lang.github.io/rust-clippy/master/index.html#misrefactored_assign_op
41924193
[`missing_const_for_fn`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
41934194
[`missing_docs_in_private_items`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
@@ -4450,6 +4451,7 @@ Released 2018-09-13
44504451
[`unnecessary_mut_passed`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed
44514452
[`unnecessary_operation`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation
44524453
[`unnecessary_owned_empty_strings`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_owned_empty_strings
4454+
[`unnecessary_safety_comment`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_safety_comment
44534455
[`unnecessary_safety_doc`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_safety_doc
44544456
[`unnecessary_self_imports`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_self_imports
44554457
[`unnecessary_sort_by`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by

src/tools/clippy/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ disallowed-names = ["toto", "tata", "titi"]
197197
cognitive-complexity-threshold = 30
198198
```
199199

200-
See the [list of lints](https://rust-lang.github.io/rust-clippy/master/index.html) for more information about which
201-
lints can be configured and the meaning of the variables.
200+
See the [list of configurable lints](https://rust-lang.github.io/rust-clippy/master/index.html#Configuration),
201+
the lint descriptions contain the names and meanings of these configuration variables.
202202

203203
> **Note**
204204
>
@@ -224,7 +224,7 @@ in the `Cargo.toml` can be used.
224224
rust-version = "1.30"
225225
```
226226

227-
The MSRV can also be specified as an inner attribute, like below.
227+
The MSRV can also be specified as an attribute, like below.
228228

229229
```rust
230230
#![feature(custom_inner_attributes)]

src/tools/clippy/book/src/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@
2121
- [The Clippy Book](development/infrastructure/book.md)
2222
- [Proposals](development/proposals/README.md)
2323
- [Roadmap 2021](development/proposals/roadmap-2021.md)
24+
- [Syntax Tree Patterns](development/proposals/syntax-tree-patterns.md)

src/tools/clippy/book/src/configuration.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ disallowed-names = ["toto", "tata", "titi"]
1111
cognitive-complexity-threshold = 30
1212
```
1313

14-
See the [list of lints](https://rust-lang.github.io/rust-clippy/master/index.html) for more information about which
15-
lints can be configured and the meaning of the variables.
14+
See the [list of configurable lints](https://rust-lang.github.io/rust-clippy/master/index.html#Configuration),
15+
the lint descriptions contain the names and meanings of these configuration variables.
1616

1717
To deactivate the "for further information visit *lint-link*" message you can define the `CLIPPY_DISABLE_DOCS_LINKS`
1818
environment variable.
@@ -72,7 +72,7 @@ minimum supported Rust version (MSRV) in the clippy configuration file.
7272
msrv = "1.30.0"
7373
```
7474

75-
The MSRV can also be specified as an inner attribute, like below.
75+
The MSRV can also be specified as an attribute, like below.
7676

7777
```rust
7878
#![feature(custom_inner_attributes)]

src/tools/clippy/book/src/development/adding_lints.md

+7-11
Original file line numberDiff line numberDiff line change
@@ -443,27 +443,27 @@ value is passed to the constructor in `clippy_lints/lib.rs`.
443443

444444
```rust
445445
pub struct ManualStrip {
446-
msrv: Option<RustcVersion>,
446+
msrv: Msrv,
447447
}
448448

449449
impl ManualStrip {
450450
#[must_use]
451-
pub fn new(msrv: Option<RustcVersion>) -> Self {
451+
pub fn new(msrv: Msrv) -> Self {
452452
Self { msrv }
453453
}
454454
}
455455
```
456456

457457
The project's MSRV can then be matched against the feature MSRV in the LintPass
458-
using the `meets_msrv` utility function.
458+
using the `Msrv::meets` method.
459459

460460
``` rust
461-
if !meets_msrv(self.msrv, msrvs::STR_STRIP_PREFIX) {
461+
if !self.msrv.meets(msrvs::STR_STRIP_PREFIX) {
462462
return;
463463
}
464464
```
465465

466-
The project's MSRV can also be specified as an inner attribute, which overrides
466+
The project's MSRV can also be specified as an attribute, which overrides
467467
the value from `clippy.toml`. This can be accounted for using the
468468
`extract_msrv_attr!(LintContext)` macro and passing
469469
`LateContext`/`EarlyContext`.
@@ -483,19 +483,15 @@ have a case for the version below the MSRV and one with the same contents but
483483
for the MSRV version itself.
484484

485485
```rust
486-
#![feature(custom_inner_attributes)]
487-
488486
...
489487

488+
#[clippy::msrv = "1.44"]
490489
fn msrv_1_44() {
491-
#![clippy::msrv = "1.44"]
492-
493490
/* something that would trigger the lint */
494491
}
495492

493+
#[clippy::msrv = "1.45"]
496494
fn msrv_1_45() {
497-
#![clippy::msrv = "1.45"]
498-
499495
/* something that would trigger the lint */
500496
}
501497
```

0 commit comments

Comments
 (0)