-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 #119856
Clippy subtree update #119856
Conversation
… that is always positive
This also updates the book's section on CI for the same thing. changelog: none
* Fixes a typo in the name of the lint (`enforce-import-renames` instead of `enforced-import-renames`). * Copyedit “Why” paragraph. * Make the example configuration use a multi-line list, since it is not particularly expected that a real project will have *exactly one* rename to enforce (and the old formatting had unbalanced whitespace).
… r=Jarcho Remove mitigations for incorrect node args This change https://github.com/rust-lang/rust/pull/118420/files#r1419874371 adds a missing `write_args` to properly record node args for lang-item calls. Thus, in the `unnecessary_to_owned` lint, this ensures that the `call_generic_args` extracted by `get_callee_generic_args_and_args` are always correct, and we can remove the mitigation for rust-lang#9504 and rust-lang#10021 since the root cause has been fixed. I'm not sure if there is other now-unnecessary code that can be removed, but this is the one I found when investigating rust-lang/rust-clippy#11965 (comment). changelog: none
- add a new late pass lint, with config options - add ui tests for both variations of config option - update CHANGELOG.md github feedback bump version to 1.77 and run cargo collect-metadata Change `,` to `;` in `conf.rs`
… r=blyxyas feature: add new lint `pub_underscore_fields` fixes: rust-lang#10282 This PR introduces a new lint `pub_underscore_fields` that lints when a user has marked a field of a struct as public, but also prefixed it with an underscore (`_`). This is something users should avoid because the two ideas are contradictory. Prefixing a field with an `_` is inferred as the field being unused, but making a field public infers that it will be used. - \[x] Followed [lint naming conventions][lint_naming] - I believe I followed the naming conventions, more than happy to update the naming if I did not :) - \[x] Added passing UI tests (including committed `.stderr` file) - \[x] `cargo test` passes locally - \[x] Executed `cargo dev update_lints` - \[x] Added lint documentation - \[x] Run `cargo dev fmt` --- changelog: new lint: [`pub_underscore_fields`] [rust-lang#10283](rust-lang/rust-clippy#10283) <!-- changelog_checked -->
…hiaskrgr Clippy subtree update r? `@Manishearth`
- Add a new early pass lint. - Add relevant UI tests.
When `identity_op` identifies a `no_op`, provides a suggestion, it also checks the type of the type of the variable. If the variable is a reference that's been coerced into a value, e.g. ``` let x = &0i32; let _ = x + 0; ``` the suggestion will now use a derefence. This is done by identifying whether the variable is a reference to an integral value, and then whether it gets dereferenced. changelog: false positive: [`identity_op`]: corrected suggestion for reference coerced to value. fixes: rust-lang#12050
add external macro checks to `iter_without_into_iter` and `into_iter_without_iter` Fixes rust-lang#12037 I think it's useful to still lint on local macros, since the user should still be able to add another impl with the `IntoIterator` or `iter` method. I think it's also fairly common to write a macro for generating many impls (e.g. for many similar types), so it'd be nice if we can continue linting in those cases. For that reason I went with `in_external_macro`. I also added a test for `#[allow]`ing the lint while I was at it. changelog: [`iter_without_into_iter`]: don't lint if the `iter` method is defined in an external macro changelog: [`into_iter_without_iter`]: don't lint if the `IntoIterator` impl is defined in an external macro
make [`mutex_atomic`] more type aware fixes: rust-lang#9872 --- changelog: [`mutex_atomic`] now suggests more specific atomic types and skips mutex i128 and u128
…nd method call is `as_ref`.
In rust-lang#119606 I added them and used a `_mv` suffix, but that wasn't great. A `with_` prefix has three different existing uses. - Constructors, e.g. `Vec::with_capacity`. - Wrappers that provide an environment to execute some code, e.g. `with_session_globals`. - Consuming chaining methods, e.g. `Span::with_{lo,hi,ctxt}`. The third case is exactly what we want, so this commit changes `DiagnosticBuilder::foo_mv` to `DiagnosticBuilder::with_foo`. Thanks to @compiler-errors for the suggestion.
… r=llogiq Extend `useless_asref` lint on `map(clone)` If you have code like: ```rust Some(String::new()).as_ref().map(Clone::clone) ``` the `as_ref` call is unneeded. Interestingly enough, this lint and `map_clone` are starting to share a same "space" where both lints warn about different things for the same code. Not sure what's the policy about such cases though... r? `@llogiq` changelog: Extend `useless_asref` lint on `map(clone)`
…eviewer_rotation, r=flip1995 Remove giraffate from the reviewer rotation I've been less active in Clippy recently because I'm so busy that I don't have time for maintaining Clippy in my spare time. So, I remove myself from the reviewer rotation once. I hope to come back again. I'll reassign the PRs later. changelog: none
Rustup r? `@ghost` changelog: none
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
Lemme just... (for a perf experiment) @bors try @rust-timer queue scenario=clippy |
This comment has been minimized.
This comment has been minimized.
Clippy subtree update r? `@Manishearth`
@bors r+ p=1 |
☀️ Test successful - checks-actions |
Finished benchmarking commit (4d31ed4): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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: 665.796s -> 664.291s (-0.23%) |
r? @Manishearth