Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 351686b

Browse files
committedMar 1, 2025
Auto merge of #137752 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update ? `@Manishearth` Cargo.lock change because of Clippy version bump and rustc_tool_utils new release. Fixes #137640 Would be nice, if we could this merged before nightly is being build, so that this ICE is fixed tomorrow.
2 parents 8c39296 + 7bfea66 commit 351686b

File tree

2,649 files changed

+34676
-15397
lines changed

Some content is hidden

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

2,649 files changed

+34676
-15397
lines changed
 

‎src/tools/clippy/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clippy"
33
# begin autogenerated version
4-
version = "0.1.86"
4+
version = "0.1.87"
55
# end autogenerated version
66
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
77
repository = "https://github.com/rust-lang/rust-clippy"
@@ -25,7 +25,7 @@ path = "src/driver.rs"
2525
[dependencies]
2626
clippy_config = { path = "clippy_config" }
2727
clippy_lints = { path = "clippy_lints" }
28-
rustc_tools_util = "0.4.0"
28+
rustc_tools_util = { path = "rustc_tools_util", version = "0.4.2" }
2929
tempfile = { version = "3.3", optional = true }
3030
termize = "0.1"
3131
color-print = "0.3.4"
@@ -54,7 +54,7 @@ parking_lot = "0.12"
5454
tokio = { version = "1", features = ["io-util"] }
5555

5656
[build-dependencies]
57-
rustc_tools_util = "0.4.0"
57+
rustc_tools_util = { path = "rustc_tools_util", version = "0.4.2" }
5858

5959
[features]
6060
integration = ["tempfile"]

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

+15-18
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ from the lint to the code of the test file and compare that to the contents of a
169169
Use `cargo bless` to automatically generate the `.fixed` file while running
170170
the tests.
171171

172-
[rustfix]: https://github.com/rust-lang/rustfix
172+
[rustfix]: https://github.com/rust-lang/cargo/tree/master/crates/rustfix
173173

174174
## Testing manually
175175

@@ -460,7 +460,7 @@ pub struct ManualStrip {
460460

461461
impl ManualStrip {
462462
pub fn new(conf: &'static Conf) -> Self {
463-
Self { msrv: conf.msrv.clone() }
463+
Self { msrv: conf.msrv }
464464
}
465465
}
466466
```
@@ -469,24 +469,13 @@ The project's MSRV can then be matched against the feature MSRV in the LintPass
469469
using the `Msrv::meets` method.
470470

471471
``` rust
472-
if !self.msrv.meets(msrvs::STR_STRIP_PREFIX) {
472+
if !self.msrv.meets(cx, msrvs::STR_STRIP_PREFIX) {
473473
return;
474474
}
475475
```
476476

477-
The project's MSRV can also be specified as an attribute, which overrides
478-
the value from `clippy.toml`. This can be accounted for using the
479-
`extract_msrv_attr!(LintContext)` macro and passing
480-
`LateContext`/`EarlyContext`.
481-
482-
```rust,ignore
483-
impl<'tcx> LateLintPass<'tcx> for ManualStrip {
484-
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
485-
...
486-
}
487-
extract_msrv_attr!(LateContext);
488-
}
489-
```
477+
Early lint passes should instead use `MsrvStack` coupled with
478+
`extract_msrv_attr!()`
490479

491480
Once the `msrv` is added to the lint, a relevant test case should be added to
492481
the lint's test file, `tests/ui/manual_strip.rs` in this example. It should
@@ -512,8 +501,16 @@ in `clippy_config/src/conf.rs`:
512501

513502
```rust
514503
define_Conf! {
515-
/// Lint: LIST, OF, LINTS, <THE_NEWLY_ADDED_LINT>. The minimum rust version that the project supports
516-
(msrv: Option<String> = None),
504+
#[lints(
505+
allow_attributes,
506+
allow_attributes_without_reason,
507+
..
508+
<the newly added lint name>,
509+
..
510+
unused_trait_names,
511+
use_self,
512+
)]
513+
msrv: Msrv = Msrv::default(),
517514
...
518515
}
519516
```

‎src/tools/clippy/book/src/development/basics.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ or if you modify a test file to add a test case.
7575
> _Note:_ This command may update more files than you intended. In that case
7676
> only commit the files you wanted to update.
7777
78-
[UI test]: https://rustc-dev-guide.rust-lang.org/tests/adding.html#guide-to-the-ui-tests
78+
[UI test]: https://rustc-dev-guide.rust-lang.org/tests/adding.html#ui-test-walkthrough
7979

8080
## `cargo dev`
8181

‎src/tools/clippy/book/src/development/writing_tests.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ We'll talk about suggestions more in depth in a [later chapter](emitting_lints.m
203203
Use `cargo bless` to automatically generate the `.fixed` file after running
204204
the tests.
205205

206-
[`rustfix`]: https://github.com/rust-lang/rustfix
206+
[`rustfix`]: https://github.com/rust-lang/cargo/tree/master/crates/rustfix
207207
[`span_lint_and_sugg`]: https://doc.rust-lang.org/beta/nightly-rustc/clippy_utils/diagnostics/fn.span_lint_and_sugg.html
208208

209209
## Testing Manually
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.