-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Clippy subtree update #124123
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 #124123
Conversation
Removed the `from_expansion` guard clause for cast lints, so that these warnings can be generated for internal macros.
Clippy no longer adds unnecessary parentheses in suggestion when the expression is a part of a tuple.
…age, r=Jarcho Reword `arc_with_non_send_sync` note and help messages Addresses rust-lang/rust-clippy#12608 (comment) Makes the note more concise and reframes the `Rc` suggestion around whether it crosses threads currently due to a manual `Send`/`Sync` impl or may do in the future changelog: none
type certainty: clear `DefId` when an expression's type changes to non-adt Fixes rust-lang#12585 The root cause of the ICE in the linked issue was in the expression `one.x`, in the array literal. The type of `one` is the `One` struct: an adt with a DefId, so its certainty is `Certain(def_id_of_one)`. However, the field access `.x` can then change the type (to `i32` here) and that should update that `DefId` accordingly. It does do that correctly when `one.x` would be another adt with a DefId: https://github.com/rust-lang/rust-clippy/blob/97ba291d5aa026353ad93e48cf00e06f08c73830/clippy_utils/src/ty/type_certainty/mod.rs#L90-L91 but when it *isn't* an adt and there is no def id (which is the case in the linked issue: `one.x` is an i32), it keeps the `DefId` of `One`, even though that's the wrong type (which would then lead to a contradiction later when joining `Certainty`s): https://github.com/rust-lang/rust-clippy/blob/97ba291d5aa026353ad93e48cf00e06f08c73830/clippy_utils/src/ty/type_certainty/mod.rs#L92-L93 In particular, in the linked issue, `from_array([one.x, two.x])` would try to join the `Certainty` of the two array elements, which *should* have been `[Certain(None), Certain(None)]`, because `i32`s have no `DefId`, but instead it was `[Certain(One), Certain(Two)]`, because the DefId wasn't cleared from when it was visiting `one` and `two`. This is the "contradiction" that could be seen in the ICE message ... so this changes it to clear the `DefId` when it isn't an adt. cc `@smoelius` you implemented this initially in rust-lang#11135, does this change make sense to you? changelog: none
Allow `cast` lints in macros closes: rust-lang#11738 Removed the `from_expansion` guard clause for cast lints, so that these warnings can be generated for internal macros. changelog: allow `cast` lints in macros
fix ice reporting in lintcheck Fixes rust-lang/rust-clippy#12185 This PR fixes the lack of reported ICEs within lintcheck by modifying the way in which data is collected from each crate being linted. Instead of lintcheck only reading `stdout` for warnings, it now also reads `stderr` for any potential ICE (although admittedly, it is not the cleanest method of doing so). If it is detected, it parses the ICE into its message and backtrace separately, and then adds them to the list of outputs via clippy. Once all outputs are collected, the formatter then proceeds to generate the file as normal. Note that this PR also has a couple of side effects: - When clippy fails to process a package, but said failure is not an ICE, the `stderr` will be sent to the console; - Instead of `ClippyWarning` being the primary struct for everything reported, there is now `ClippyCheckOutput`, an enum which splits the outputs into warnings and ICEs. changelog: none
…thiaskrgr Prevent PR assignments to `@matthiaskrgr`, `@giraffate`, and `@Centri3` When commenting r? clippy, rustbot takes a random member from the team. I'm setting you kings and queen to be on vacation, so that rustbot doesn't target you. --- changelog: none cc: `@matthiaskrgr` `@giraffate` and `@Centri3`
…-12564, r=dswij [`manual_unwrap_or_default`]: Check for Default trait implementation in initial condition when linting and use `IfLetOrMatch` Fixes rust-lang#12564 changelog: Fix [`manual_unwrap_or_default`] false positive when initial `match`/`if let` condition doesn't implement `Default` but the return type does.
…cation, r=blyxyas fix incorrect suggestion for `!(a as type >= b)` fixes rust-lang#12625 The expression `!(a as type >= b)` got simplified to `a as type < b`, but because of rust's parsing rules that `<` is interpreted as a start of generic arguments for `type`. This is fixed by recognizing this case and adding extra parens around the left-hand side of the comparison. changelog: [`nonminimal_bool`]: fix incorrect suggestion for `!(a as type >= b)`
While they have many convenient APIs, it is better to expose dedicated functions for them
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
@bors r+ p=1 |
…nishearth Clippy subtree update r? `@Manishearth`
☀️ Test successful - checks-actions |
👀 Test was successful, but fast-forwarding failed: 422 Update is not a fast forward |
@bors retry what |
…nishearth Clippy subtree update r? `@Manishearth`
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
Finished benchmarking commit (ce6f209): comparison URL. Overall result: ❌✅ regressions and 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: 677.567s -> 678.527s (0.14%) |
@bors retry |
☀️ Test successful - checks-actions |
1 similar comment
☀️ Test successful - checks-actions |
Finished benchmarking commit (c4f112a): 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)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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 672.871s -> 671.432s (-0.21%) |
r? @Manishearth