-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Clippy subtree update #141044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clippy subtree update #141044
Conversation
The lint becomes part of stable in 1.87, not in 1.84
Supersedes rust-lang/rust-clippy#12550 `layout_of` no longer contains a `delay_bug` so there's no need for this anymore. changelog: None
I'm working on rust-lang/rust-clippy#14542 and I decided to name the lint `unnecessary_map` originally. However when I ran the command, I got: ``` thread 'main' panicked at clippy_dev/src/new_lint.rs:450:5: Lint `unnecessary_map` already defined in `/home/imperio/rust/clippy/clippy_lints/src/methods/mod.rs` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` It's because there is already a `unnecessary_map_or`, which matches the `.contains()` call. This PR strengthens this check. changelog: Fix `new_lint` clippy command r? @flip1995
Closes rust-lang/rust-clippy#14685 changelog: [`manual_slice_fill`] fix FP on `IndexMut` overload
add allow_unused config to missing_docs_in_private_items for underscored field
Fixes rust-lang/rust-clippy#14397 (comment) r? @samueltardieu changelog: Don't warn about clippy.toml disallowed paths for crates that were not loaded
Closes rust-lang/rust-clippy#14704 changelog: [`unused_async`] fix FP on default impl
Simplifies the implementation a bit, also makes the message an error annotation changelog: none
r? ghost changelog: none
Closes rust-lang/rust-clippy#14716 changelog: [`manual_unwrap_or_default`] fix FP on ref binding
The `&[&str]` path based `clippy_utils` have been removed and replace with a new type `PathLookup`: - [`match_trait_method`](https://doc.rust-lang.org/nightly/nightly-rustc/clippy_utils/fn.match_trait_method.html) - [`match_qpath`](https://doc.rust-lang.org/nightly/nightly-rustc/clippy_utils/fn.match_qpath.html) - [`match_path`](https://doc.rust-lang.org/nightly/nightly-rustc/clippy_utils/fn.match_path.html) - [`match_any_def_paths`](https://doc.rust-lang.org/nightly/nightly-rustc/clippy_utils/fn.match_any_def_paths.html) - [`match_def_path`](https://doc.rust-lang.org/nightly/nightly-rustc/clippy_utils/fn.match_def_path.html) - [`match_type`](https://doc.rust-lang.org/nightly/nightly-rustc/clippy_utils/ty/fn.match_type.html) - [`get_trait_def_id`](https://doc.rust-lang.org/nightly/nightly-rustc/clippy_utils/fn.get_trait_def_id.html) Internally `PathLookup` is a lazy call to `lookup_path` (the new name for [`def_path_res`](https://doc.rust-lang.org/nightly/nightly-rustc/clippy_utils/fn.def_path_res.html) to distinguish it from [`path_res`](https://doc.rust-lang.org/nightly/nightly-rustc/clippy_utils/fn.path_res.html)) The `invalid_paths` internal lint is removed, it could be reimplemented but it feels redundant since every path should be covered by a test anyway ### User facing changes - `manual_saturating_arithmetic` now checks for `u32::MAX/MIN` instead of only detecting the legacy numeric consts (`std::u32::MAX/MIN`), `clippy::legacy_numeric_constants` will redirect usages of the legacy versions to the new one - `allow-invalid = true` now suppresses all invalid path warnings, currently you can run into a warning that can't be ignored in some situations, e.g. with `serde` without the `derive` feature ``` warning: expected a macro, found a trait --> /home/gh-Alexendoo/temp/clippy.toml:2:5 | 2 | { path = "serde::Serialize", allow-invalid = true }, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` - Re-exports of primitives types like `std::primitive::*` no longer work in `disallowed-types`, this seems acceptable since it would be unusual to deny a primitive this way rather than writing e.g. `usize`. Type aliases such as `c_char` are unaffected - A similar slight performance improvement to rust-lang/rust-clippy#14650 ```bash $ hyperfine -w 2 -p 'touch src/cargo/lib.rs' 'cargo +master clippy' 'cargo +lazy-paths clippy' ``` ``` Benchmark 1: cargo +master clippy Time (mean ± σ): 6.829 s ± 0.064 s [User: 6.079 s, System: 0.673 s] Range (min … max): 6.705 s … 6.907 s 10 runs Benchmark 2: cargo +lazy-paths clippy Time (mean ± σ): 6.765 s ± 0.064 s [User: 5.984 s, System: 0.698 s] Range (min … max): 6.636 s … 6.834 s 10 runs Summary cargo +lazy-paths clippy ran 1.01 ± 0.01 times faster than cargo +master clippy ``` changelog: none
…ang#14740) When a `non_std_lazy_statics` warning is generated about an item type which can be replaced by a standard library one, ensure that the lint happens on the item HIR node so that it can be expected. changelog: [`non_std_lazy_statics`]: generate the warning onto the right node Fixes rust-lang/rust-clippy#14729 Note that this doesn't change anything on lints generated for the `lazy_static::lazy_static` macro because the `expect` attribute cannot be applied to a macro.
…tions` lint (rust-lang#14261) changelog: [`module_name_repetitions`]: new configuration option `allow_exact_repetitions`, enabled by default Closes rust-lang#14226
Based on rust-lang/rust-clippy#13223 Various refactoring on `clippy_dev` before upgrading rename and splitting `clippy_lints` into multiple crates. Some improvements: * The working directory is set to the root clippy directory. Running from a subdirectory was kind of supported before sometimes. Now it just works. * File won't be written unless they're actually updated. Most of the time they weren't written, but a few cases slipped through. * Buffers are reused more for the negligible speed boost. changelog: None
r? @ghost changelog: none
Some changes occurred in src/tools/clippy cc @rust-lang/clippy These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
This comment has been minimized.
This comment has been minimized.
@bors r+ p=2 rollup=never |
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing c79bbfa (parent) -> 1b9efcd (this PR) Test differencesNo test diffs found Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 1b9efcd18f1cb95348c3ffadd4db47bfa15292e5 --output-dir test-dashboard And then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
Finished benchmarking commit (1b9efcd): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (secondary -3.9%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary 1.6%, secondary 2.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 772.547s -> 771.756s (-0.10%) |
r? @Manishearth
Cargo.lock update due to Clippy version bump.