-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 #128837
Clippy subtree update #128837
Commits on Jun 6, 2024
-
needless_borrows_for_generic_args: Fix for &mut
This commit fixes a bug introduced in rust-lang#12706, where the behavior of the lint has been changed, to avoid suggestions that introduce a move. The motivation in the commit message is quite poor (if the detection for significant drops is not sufficient because it's not transitive, the proper fix would be to make it transitive). However, rust-lang#12454, the linked issue, provides a good reason for the change — if the value being borrowed is bound to a variable, then moving it will only introduce friction into future refactorings. Thus rust-lang#12706 changes the logic so that the lint triggers if the value being borrowed is Copy, or is the result of a function call, simplifying the logic to the point where analysing "is this the only use of this value" isn't necessary. However, said PR also introduces an undocumented carveout, where referents that themselves are mutable references are treated as Copy, to catch some cases that we do want to lint against. However, that is not sound — it's possible to consume a mutable reference by moving it. To avoid emitting false suggestions, this PR reintroduces the referent_used_exactly_once logic and runs that check for referents that are themselves mutable references. Thinking about the code shape of &mut x, where x: &mut T, raises the point that while removing the &mut outright won't work, the extra indirection is still undesirable, and perhaps instead we should suggest reborrowing: &mut *x. That, however, is left as possible future work. Fixes rust-lang#12856
Configuration menu - View commit details
-
Copy full SHA for c6cc160 - Browse repository at this point
Copy the full SHA c6cc160View commit details
Commits on Jul 4, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 37d8462 - Browse repository at this point
Copy the full SHA 37d8462View commit details -
Configuration menu - View commit details
-
Copy full SHA for 26cdeed - Browse repository at this point
Copy the full SHA 26cdeedView commit details
Commits on Jul 10, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 5f3a6e1 - Browse repository at this point
Copy the full SHA 5f3a6e1View commit details
Commits on Jul 16, 2024
-
Configuration menu - View commit details
-
Copy full SHA for fceeb13 - Browse repository at this point
Copy the full SHA fceeb13View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1821def - Browse repository at this point
Copy the full SHA 1821defView commit details
Commits on Jul 17, 2024
-
Remove duplicated peel_middle_ty_refs
TODO: Should we move `ty::peel_mid_ty_refs_is_mutable` to super module too?
Configuration menu - View commit details
-
Copy full SHA for a5fd2c9 - Browse repository at this point
Copy the full SHA a5fd2c9View commit details
Commits on Jul 18, 2024
-
Fix [
redundant_slicing
] when the slice is behind a mutable referenceFixes rust-lang#12751 changelog: Fix [`redundant_slicing`] when the slice is behind a mutable reference
Configuration menu - View commit details
-
Copy full SHA for 58027e2 - Browse repository at this point
Copy the full SHA 58027e2View commit details
Commits on Jul 19, 2024
-
Clean up a few minor refs in `format!` macro, as it has a performance cost. Apparently the compiler is unable to inline `format!("{}", &variable)`, and does a run-time double-reference instead (format macro already does one level referencing). Inlining format args prevents accidental `&` misuse.
Configuration menu - View commit details
-
Copy full SHA for 266abf3 - Browse repository at this point
Copy the full SHA 266abf3View commit details
Commits on Jul 22, 2024
-
Configuration menu - View commit details
-
Copy full SHA for bc8fc6b - Browse repository at this point
Copy the full SHA bc8fc6bView commit details -
Configuration menu - View commit details
-
Copy full SHA for d17f113 - Browse repository at this point
Copy the full SHA d17f113View commit details
Commits on Jul 23, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 0cdf6e1 - Browse repository at this point
Copy the full SHA 0cdf6e1View commit details
Commits on Jul 24, 2024
-
Co-authored-by: Fridtjof Stoldt <xFrednet@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for e63061d - Browse repository at this point
Copy the full SHA e63061dView commit details
Commits on Jul 25, 2024
-
Configuration menu - View commit details
-
Copy full SHA for de1e163 - Browse repository at this point
Copy the full SHA de1e163View commit details -
Rollup merge of rust-lang#121364 - Urgau:unary_precedence, r=compiler…
…-errors Implement lint against ambiguous negative literals This PR implements a lint against ambiguous negative literals with a literal and method calls right after it. ## `ambiguous_negative_literals` (deny-by-default) The `ambiguous_negative_literals` lint checks for cases that are confusing between a negative literal and a negation that's not part of the literal. ### Example ```rust,compile_fail -1i32.abs(); // equals -1, while `(-1i32).abs()` equals 1 ``` ### Explanation Method calls take precedence over unary precedence. Setting the precedence explicitly makes the code clearer and avoid potential bugs. <details> <summary>Old proposed lint</summary> ## `ambiguous_unary_precedence` (deny-by-default) The `ambiguous_unary_precedence` lint checks for use the negative unary operator with a literal and method calls. ### Example ```rust -1i32.abs(); // equals -1, while `(-1i32).abs()` equals 1 ``` ### Explanation Unary operations take precedence on binary operations and method calls take precedence over unary precedence. Setting the precedence explicitly makes the code clearer and avoid potential bugs. </details> ----- Note: This is a strip down version of rust-lang#117161, without the binary op precedence. Fixes rust-lang#117155 `@rustbot` labels +I-lang-nominated cc `@scottmcm` r? compiler
Configuration menu - View commit details
-
Copy full SHA for 36214e9 - Browse repository at this point
Copy the full SHA 36214e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4e6851e - Browse repository at this point
Copy the full SHA 4e6851eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 32dc02a - Browse repository at this point
Copy the full SHA 32dc02aView commit details -
Factor out check_closure function
Also get the receiver T in `T.method(|| f())`.
Configuration menu - View commit details
-
Copy full SHA for e53182a - Browse repository at this point
Copy the full SHA e53182aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0bc9f00 - Browse repository at this point
Copy the full SHA 0bc9f00View commit details -
Auto merge of rust-lang#13156 - y21:for_each_expr_visitor_refactor, r…
…=xFrednet Remove unnecessary `res` field in `for_each_expr` visitors Small refactor in the `for_each_expr*` visitors. This should not change anything functionally. Instead of storing the final value `Option<B>` in the visitor and setting it to `Some` when we get a `ControlFlow::Break(B)` from the closure, we can just directly return it from the visitor itself now that visitors support that. cc rust-lang#12829 and rust-lang/rust-clippy#12830 (comment) changelog: none
Configuration menu - View commit details
-
Copy full SHA for c7cfe7f - Browse repository at this point
Copy the full SHA c7cfe7fView commit details -
Configuration menu - View commit details
-
Copy full SHA for dc49aa3 - Browse repository at this point
Copy the full SHA dc49aa3View commit details -
Auto merge of rust-lang#12892 - meithecatte:needless-borrows-mutrefs,…
… r=xFrednet needless_borrows_for_generic_args: Fix for &mut This commit fixes a bug introduced in rust-lang#12706, where the behavior of the lint has been changed, to avoid suggestions that introduce a move. The motivation in the commit message is quite poor (if the detection for significant drops is not sufficient because it's not transitive, the proper fix would be to make it transitive). However, rust-lang#12454, the linked issue, provides a good reason for the change — if the value being borrowed is bound to a variable, then moving it will only introduce friction into future refactorings. Thus rust-lang#12706 changes the logic so that the lint triggers if the value being borrowed is Copy, or is the result of a function call, simplifying the logic to the point where analysing "is this the only use of this value" isn't necessary. However, said PR also introduces an undocumented carveout, where referents that themselves are mutable references are treated as Copy, to catch some cases that we do want to lint against. However, that is not sound — it's possible to consume a mutable reference by moving it. To avoid emitting false suggestions, this PR reintroduces the referent_used_exactly_once logic and runs that check for referents that are themselves mutable references. Thinking about the code shape of &mut x, where x: &mut T, raises the point that while removing the &mut outright won't work, the extra indirection is still undesirable, and perhaps instead we should suggest reborrowing: &mut *x. That, however, is left as possible future work. Fixes rust-lang#12856 changelog: none
Configuration menu - View commit details
-
Copy full SHA for 062b66d - Browse repository at this point
Copy the full SHA 062b66dView commit details -
Configuration menu - View commit details
-
Copy full SHA for e9852cc - Browse repository at this point
Copy the full SHA e9852ccView commit details -
Auto merge of rust-lang#12473 - Kobzol:assigning-clones-deref, r=Alex…
…endoo Fix handling of `Deref` in `assigning_clones` The `assigning_clones` lint had a special case for producing a bit nicer code for mutable references: ```rust fn clone_function_lhs_mut_ref(mut_thing: &mut HasCloneFrom, ref_thing: &HasCloneFrom) { *mut_thing = Clone::clone(ref_thing); } //v fn clone_function_lhs_mut_ref(mut_thing: &mut HasCloneFrom, ref_thing: &HasCloneFrom) { Clone::clone_from(mut_thing, ref_thing); } ``` However, this could [break](rust-lang/rust-clippy#12437) when combined with `Deref`. This PR removes the special case, so that the generated code should work more generally. Later we can improve the detection of `Deref` and put the special case back in a way that does not break code. Fixes: rust-lang/rust-clippy#12437 r? `@blyxyas` changelog: [`assigning_clones`]: change applicability to `Unspecified` and fix a problem with `Deref`.
Configuration menu - View commit details
-
Copy full SHA for 533c377 - Browse repository at this point
Copy the full SHA 533c377View commit details
Commits on Jul 26, 2024
-
Auto merge of rust-lang#128193 - flip1995:clippy-subtree-update, r=ma…
…tthiaskrgr Clippy subtree update r? `@Manishearth` Updates Cargo.lock due to the Clippy version update and the ui_test bump to v0.24
Configuration menu - View commit details
-
Copy full SHA for 95ee06c - Browse repository at this point
Copy the full SHA 95ee06cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 90c1963 - Browse repository at this point
Copy the full SHA 90c1963View commit details -
Auto merge of rust-lang#13144 - xFrednet:07797-restriction-and-then-w…
…hat, r=y21 Make restriction lint's use `span_lint_and_then` (i -> p) This migrates a few restriction lints to use `span_lint_and_then`. This change is motivated by rust-lang/rust-clippy#7797. I've also cleaned up some lint message. Mostly minor stuff. For example: suggestions with a longer message than `"try"` now use `SuggestionStyle::ShowAlways` --- cc: rust-lang/rust-clippy#7797 brother PR of: rust-lang/rust-clippy#13136 changelog: none
Configuration menu - View commit details
-
Copy full SHA for 345c94c - Browse repository at this point
Copy the full SHA 345c94cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 82b4434 - Browse repository at this point
Copy the full SHA 82b4434View commit details -
Signed-off-by: riyueguang <rustruby@outlook.com>
Configuration menu - View commit details
-
Copy full SHA for 8ca8ed9 - Browse repository at this point
Copy the full SHA 8ca8ed9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 10fb062 - Browse repository at this point
Copy the full SHA 10fb062View commit details -
Auto merge of rust-lang#13164 - flip1995:ui-test-bump, r=Alexendoo
Bump ui_test version -> 0.25 r? `@Alexendoo` cc `@GuillaumeGomez` changelog: none
Configuration menu - View commit details
-
Copy full SHA for 3504145 - Browse repository at this point
Copy the full SHA 3504145View commit details -
Configuration menu - View commit details
-
Copy full SHA for b5fa6e2 - Browse repository at this point
Copy the full SHA b5fa6e2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 84e36e6 - Browse repository at this point
Copy the full SHA 84e36e6View commit details -
Auto merge of rust-lang#13130 - nyurik:ref-lints, r=Centri3
Avoid ref when using format! Clean up a few minor refs in `format!` macro, as it has a performance cost. Apparently the compiler is unable to inline `format!("{}", &variable)`, and does a run-time double-reference instead (format macro already does one level referencing). Inlining format args prevents accidental `&` misuse. See also rust-lang#112156 changelog: none
Configuration menu - View commit details
-
Copy full SHA for 479491e - Browse repository at this point
Copy the full SHA 479491eView commit details -
Auto merge of rust-lang#13165 - riyueguang:master, r=Jarcho
chore: fix some comments fix some comments *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: none
Configuration menu - View commit details
-
Copy full SHA for 6713631 - Browse repository at this point
Copy the full SHA 6713631View commit details -
Auto merge of rust-lang#121676 - Bryanskiy:polarity, r=petrochenkov
Support ?Trait bounds in supertraits and dyn Trait under a feature gate This patch allows `maybe` polarity bounds under a feature gate. The only language change here is that corresponding hard errors are replaced by feature gates. Example: ```rust #![feature(allow_maybe_polarity)] ... trait Trait1 : ?Trait { ... } // ok fn foo(_: Box<(dyn Trait2 + ?Trait)>) {} // ok fn bar<T: ?Sized + ?Trait>(_: &T) {} // ok ``` Maybe bounds still don't do anything (except for `Sized` trait), however this patch will allow us to [experiment with default auto traits](rust-lang#120706 (comment)). This is a part of the [MCP: Low level components for async drop](rust-lang/compiler-team#727)
Configuration menu - View commit details
-
Copy full SHA for 2acbd31 - Browse repository at this point
Copy the full SHA 2acbd31View commit details -
Rollup merge of rust-lang#124941 - Skgland:stabilize-const-int-from-s…
…tr, r=dtolnay Stabilize const `{integer}::from_str_radix` i.e. `const_int_from_str` This PR stabilizes the feature `const_int_from_str`. - ACP Issue: rust-lang/libs-team#74 - Implementation PR: rust-lang#99322 - Part of Tracking Issue: rust-lang#59133 API Change Diff: ```diff impl {integer} { - pub fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError>; + pub const fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError>; } impl ParseIntError { - pub fn kind(&self) -> &IntErrorKind; + pub const fn kind(&self) -> &IntErrorKind; } ``` This makes it easier to parse integers at compile-time, e.g. the example from the Tracking Issue: ```rust env!("SOMETHING").parse::<usize>().unwrap() ``` could now be achived with ```rust match usize::from_str_radix(env!("SOMETHING"), 10) { Ok(val) => val, Err(err) => panic!("Invalid value for SOMETHING environment variable."), } ``` rather than having to depend on a library that implements or manually implement the parsing at compile-time. --- Checklist based on [Libs Stabilization Guide - When there's const involved](https://std-dev-guide.rust-lang.org/development/stabilization.html#when-theres-const-involved) I am treating this as a [partial stabilization](https://std-dev-guide.rust-lang.org/development/stabilization.html#partial-stabilizations) as it shares a tracking issue (and is rather small), so directly opening the partial stabilization PR for the subset (feature `const_int_from_str`) being stabilized. - [x] ping Constant Evaluation WG - [x] no unsafe involved - [x] no `#[allow_internal_unstable]` - [ ] usage of `intrinsic::const_eval_select` rust-lang#124625 in `from_str_radix_assert` to change the error message between compile-time and run-time - [ ] [rust-labg/libs-api FCP](rust-lang#124941 (comment))
Configuration menu - View commit details
-
Copy full SHA for eb2fc42 - Browse repository at this point
Copy the full SHA eb2fc42View commit details
Commits on Jul 27, 2024
-
Add
BTreeSet
to set_contains_or_insert* Detect `BTreeSet::contains` + `BTreeSet::insert` usage in the same way as with the `HashSet`.
Configuration menu - View commit details
-
Copy full SHA for 9964b4e - Browse repository at this point
Copy the full SHA 9964b4eView commit details -
Auto merge of rust-lang#13168 - Alexendoo:std-instead-of-core-msrv, r…
…=Manishearth Make `std_instead_of_core` somewhat MSRV aware For rust-lang#13158, this catches some things e.g. `core::net` and the recently stable `core::error` but not things moved individually like `UnwindSafe`, as far as I can see the version for those isn't easily available Beta nominating since ideally we'd get this change in the same version as `core::error` becomes stable cc `@kpreid` changelog: none
Configuration menu - View commit details
-
Copy full SHA for 1ec5025 - Browse repository at this point
Copy the full SHA 1ec5025View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7de9c20 - Browse repository at this point
Copy the full SHA 7de9c20View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4bf4c47 - Browse repository at this point
Copy the full SHA 4bf4c47View commit details -
Auto merge of rust-lang#13053 - nyurik:rename-set_contains_or_insert,…
… r=llogiq Add `BTreeSet` detection to the `set_contains_or_insert` lint * Detect `BTreeSet::contains` + `BTreeSet::insert` usage in the same way as with the `HashSet`. CC: `@lochetti` `@bitfield` ---- changelog: [`set_contains_or_insert`]: Handle `BTreeSet` in addition to `HashSet`
Configuration menu - View commit details
-
Copy full SHA for 92768ee - Browse repository at this point
Copy the full SHA 92768eeView commit details -
Auto merge of rust-lang#13149 - jusexton:issue-13123, r=dswij
Fix while_let_on_iterator dropping loop label when applying fix. Loop label was not persisted when displaying help and was therefore producing broken rust code when applying fixes. Solution was to store the `ast::Label` when creating a `higher::WhileLet` from an expression and add the label name to the lint suggestion and diagnostics. --- Fixes: rust-lang/rust-clippy#13123 changelog: [`while_let_on_iterator`]: Fix issue dropping loop label when displaying help and applying fixes.
Configuration menu - View commit details
-
Copy full SHA for d20be39 - Browse repository at this point
Copy the full SHA d20be39View commit details -
Auto merge of rust-lang#13159 - Alexendoo:missing-trait-methods-stabl…
…e-order, r=dswij `missing_trait_methods`: lint methods in definition order Lintcheck for rust-lang#13157 showed a bunch of changes for `missing_trait_methods` This is because `values_sorted` was sorting the entries by the key's [`DefPathHash`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/def_id/struct.DefPathHash.html), this is stable for a given compiler but can change across versions changelog: none
Configuration menu - View commit details
-
Copy full SHA for 236c8c7 - Browse repository at this point
Copy the full SHA 236c8c7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0812732 - Browse repository at this point
Copy the full SHA 0812732View commit details -
Configuration menu - View commit details
-
Copy full SHA for a54e313 - Browse repository at this point
Copy the full SHA a54e313View commit details -
Configuration menu - View commit details
-
Copy full SHA for 84dc569 - Browse repository at this point
Copy the full SHA 84dc569View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7a25ead - Browse repository at this point
Copy the full SHA 7a25eadView commit details
Commits on Jul 28, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 7422202 - Browse repository at this point
Copy the full SHA 7422202View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1d06ad5 - Browse repository at this point
Copy the full SHA 1d06ad5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 78a750e - Browse repository at this point
Copy the full SHA 78a750eView commit details -
Auto merge of rust-lang#13166 - GuillaumeGomez:fix-clippy-doc, r=xFre…
…dnet Fix display of configs in clippy doc page Fixes rust-lang/rust-clippy#13051. It was simply some empty lines missing between configs. With this fix it looks like expected: ![image](https://github.com/user-attachments/assets/89c609b4-e24a-4f4a-91c1-3b49fc83584c) r? `@xFrednet` changelog: Fix display of configs in clippy doc page
Configuration menu - View commit details
-
Copy full SHA for 668b659 - Browse repository at this point
Copy the full SHA 668b659View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1a1c978 - Browse repository at this point
Copy the full SHA 1a1c978View commit details -
Configuration menu - View commit details
-
Copy full SHA for 61dcf6c - Browse repository at this point
Copy the full SHA 61dcf6cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5faea65 - Browse repository at this point
Copy the full SHA 5faea65View commit details
Commits on Jul 29, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 38a3462 - Browse repository at this point
Copy the full SHA 38a3462View commit details -
Auto merge of rust-lang#13176 - shenyifu:master, r=Manishearth
Fix fix under loop may dropping loop label when applying fix. changelog: [`explicit_counter_loop`]: fix label drop changelog: [`for_kv_map`]: add label drop test
Configuration menu - View commit details
-
Copy full SHA for f7db895 - Browse repository at this point
Copy the full SHA f7db895View commit details -
Auto merge of rust-lang#13173 - Jarcho:conf_order, r=xFrednet
Misc changes to `clippy_config` Contains part of rust-lang#13084 Changes include: * Sort config list and each configs lint list. * Add default text for the two configs that were missing it. * Switch the lint list in the configs to an attribute. * Make `dev fmt` sort the config list. r? `@xFrednet` changelog: none
Configuration menu - View commit details
-
Copy full SHA for 3b64ca9 - Browse repository at this point
Copy the full SHA 3b64ca9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 712e8f4 - Browse repository at this point
Copy the full SHA 712e8f4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 957a301 - Browse repository at this point
Copy the full SHA 957a301View commit details -
Auto merge of rust-lang#13179 - GuillaumeGomez:clean-up-lints-page-js…
…, r=Alexendoo Clean up clippy lints page JS source code Just a small cleanup for the lints page JS source code. r? `@Alexendoo` changelog: Clean up clippy lints page JS source code
Configuration menu - View commit details
-
Copy full SHA for 5342092 - Browse repository at this point
Copy the full SHA 5342092View commit details -
Configuration menu - View commit details
-
Copy full SHA for 182c268 - Browse repository at this point
Copy the full SHA 182c268View commit details -
Auto merge of rust-lang#13174 - y21:if_let_mutex_multi_mutex, r=llogiq
Emit `if_let_mutex` in presence of other mutexes Currently (master, not nightly nor stable) `if_let_mutex` does not emit a warning here: ```rs let m1 = Mutex::new(10); let m2 = Mutex::new(()); if let 100..=200 = *m1.lock().unwrap() { m2.lock(); } else { m1.lock(); } ``` It currently looks for the first call to `.lock()` on *any* mutex receiver inside of the if/else body, and only later (outside of the visitor) checks that the receiver matches the mutex in the scrutinee. That means that in cases like the above, it finds the `m2.lock()` expression, stops the visitor, fails the check that it's the same mutex (`m2` != `m1`) and then does not look for any other `.lock()` calls. So, just make the receiver check also part of the visitor so that we only stop the visitor when we also find the right receiver. The first commit has the actual changes described here. The sceond one just unnests all the `if let`s ---- changelog: none
Configuration menu - View commit details
-
Copy full SHA for 834b691 - Browse repository at this point
Copy the full SHA 834b691View commit details -
Configuration menu - View commit details
-
Copy full SHA for 79783e9 - Browse repository at this point
Copy the full SHA 79783e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 33b16d3 - Browse repository at this point
Copy the full SHA 33b16d3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6317479 - Browse repository at this point
Copy the full SHA 6317479View commit details -
Configuration menu - View commit details
-
Copy full SHA for 943a8e0 - Browse repository at this point
Copy the full SHA 943a8e0View commit details -
Auto merge of rust-lang#13178 - GuillaumeGomez:clippy-lints-page-impr…
…ovement, r=Alexendoo Add possibility to focus on search input using keyboard This PR adds the possibility to focus on the search input with `S` or `/` like in rustdoc and `mdbook` and `docs.rs` (unification++). Pressing escape will blur it. r? `@Alexendoo` changelog: Add possibility to focus on search input using keyboard
Configuration menu - View commit details
-
Copy full SHA for accf686 - Browse repository at this point
Copy the full SHA accf686View commit details
Commits on Jul 30, 2024
-
Auto merge of rust-lang#13182 - Alexendoo:remove-allows, r=Manishearth
Remove some miscellaneous `#[allow]`s Some were unneeded, others were removed by fixing/removing the thing they allow changelog: none
Configuration menu - View commit details
-
Copy full SHA for 8f3cfb4 - Browse repository at this point
Copy the full SHA 8f3cfb4View commit details -
Auto merge of rust-lang#13181 - Alexendoo:implicit-hasher-suggestion,…
… r=llogiq Use a single multipart suggestion for `implicit_hasher` The second commit individually shows the diagnostic change ---- changelog: none
Configuration menu - View commit details
-
Copy full SHA for c6f45df - Browse repository at this point
Copy the full SHA c6f45dfView commit details
Commits on Jul 31, 2024
-
Auto merge of rust-lang#13177 - GuillaumeGomez:fix-broken-list-lints-…
…config, r=xFrednet Fix broken list for lints config Follow-up of rust-lang#13166. Finally figured out that it was a transformation and not the source that was the problem. It now looks like this: ![Screenshot from 2024-07-29 16-29-10](https://github.com/user-attachments/assets/4b89b3fe-8f85-47b8-8d9a-505badeaeac4) r? `@xFrednet` changelog: none
Configuration menu - View commit details
-
Copy full SHA for ea06fa3 - Browse repository at this point
Copy the full SHA ea06fa3View commit details -
Configuration menu - View commit details
-
Copy full SHA for edca730 - Browse repository at this point
Copy the full SHA edca730View commit details -
Auto merge of rust-lang#13195 - GuillaumeGomez:fix-false-positive-131…
…83, r=Manishearth Fix false positive for `missing_backticks` in footnote references Fixes rust-lang#13183. changelog: Fix false positive for `missing_backticks` in footnote references
Configuration menu - View commit details
-
Copy full SHA for 5542309 - Browse repository at this point
Copy the full SHA 5542309View commit details
Commits on Aug 1, 2024
-
Auto merge of rust-lang#13108 - tesuji:fix_redundant_closure, r=xFrednet
Fix `redundant_closure` false positive with closures has return type contains `'static` Fix rust-lang#13073 . Please enable "ignore white-space change" settings in github UI for easy reviewing. HACK: The third commit contains a hack to check if a type `T: 'static` when `fn() -> U where U: 'static`. I don't have a clean way to check for it. changelog: [`redundant_closure`] Fix false positive with closures has return type contains `'static`
Configuration menu - View commit details
-
Copy full SHA for 2fc74a3 - Browse repository at this point
Copy the full SHA 2fc74a3View commit details -
Do not underline suggestions for code that is already there
When a suggestion part is for already present code, do not highlight it. If after that there are no highlights left, do not show the suggestion at all. Fix clippy lint suggestion incorrectly treated as `span_help`.
Configuration menu - View commit details
-
Copy full SHA for 5ef38a3 - Browse repository at this point
Copy the full SHA 5ef38a3View commit details
Commits on Aug 3, 2024
-
Auto merge of rust-lang#13126 - apoisternex:issue12751, r=dswij
Fix [`redundant_slicing`] when the slice is behind a mutable reference Fixes rust-lang#12751 changelog: Fix [`redundant_slicing`] when the slice is behind a mutable reference and a immutable reference is expected.
Configuration menu - View commit details
-
Copy full SHA for 1aa686b - Browse repository at this point
Copy the full SHA 1aa686bView commit details -
Auto merge of rust-lang#13115 - tesuji:rm-dup-peels, r=dswij
Remove duplicated `peel_middle_ty_refs` TODO: Should we move `ty::peel_mid_ty_refs_is_mutable` to super module too? changelog: none
Configuration menu - View commit details
-
Copy full SHA for 1ea827f - Browse repository at this point
Copy the full SHA 1ea827fView commit details -
Configuration menu - View commit details
-
Copy full SHA for a9d72c7 - Browse repository at this point
Copy the full SHA a9d72c7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0532104 - Browse repository at this point
Copy the full SHA 0532104View commit details -
Auto merge of rust-lang#13107 - yaxum62:i5757, r=xFrednet
Add test for `try_err` lint within try blocks. Fixes rust-lang#5757 Turns out the current `try_err` implementation already skips expressions inside of a try block. When inside of a try block, `Err(_)?` is desugared to a `break` instead of normal `return` . This makes `find_return_type()` function at [this line](https://github.com/rust-lang/rust-clippy/blob/eb4d88e690c431691bc0fd8eaa9f7096ecc2a723/clippy_lints/src/matches/try_err.rs#L29) always returns `None` and skips the check. I just added a test case for try block. changelog: none
Configuration menu - View commit details
-
Copy full SHA for 0347280 - Browse repository at this point
Copy the full SHA 0347280View commit details -
Configuration menu - View commit details
-
Copy full SHA for b2d0631 - Browse repository at this point
Copy the full SHA b2d0631View commit details -
Configuration menu - View commit details
-
Copy full SHA for d18ce7c - Browse repository at this point
Copy the full SHA d18ce7cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 35dcc9b - Browse repository at this point
Copy the full SHA 35dcc9bView commit details -
Auto merge of rust-lang#13208 - alex-semenyuk:fix_doc_from_iter_inste…
…ad_of_collect, r=llogiq Add clarification for from_iter_instead_of_collect Close rust-lang#13147 As mentioned at rust-lang#13147 we should prefer to use collect depends on situation so clarify this at documentation and provide examples this cases. changelog: none
Configuration menu - View commit details
-
Copy full SHA for eb7b676 - Browse repository at this point
Copy the full SHA eb7b676View commit details -
Auto merge of rust-lang#13209 - Alexendoo:nonminimal-bool-limit-ops, …
…r=y21 Limit number of `nonminimal_bool` ops Fixes rust-lang/rust-clippy#11257 Fixes rust-lang/rust-clippy#13206 changelog: none
Configuration menu - View commit details
-
Copy full SHA for 8dd459d - Browse repository at this point
Copy the full SHA 8dd459dView commit details -
Configuration menu - View commit details
-
Copy full SHA for b9716dd - Browse repository at this point
Copy the full SHA b9716ddView commit details -
Auto merge of rust-lang#13194 - sheshnath-at-knoldus:fix-typos, r=Jarcho
fix-typos fixes some typos in lintcheck changelog: None
Configuration menu - View commit details
-
Copy full SHA for 377d72a - Browse repository at this point
Copy the full SHA 377d72aView commit details
Commits on Aug 4, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 1ea7bdd - Browse repository at this point
Copy the full SHA 1ea7bddView commit details -
Auto merge of rust-lang#13213 - Alexendoo:multispan-sugg, r=y21
Remove `multispan_sugg[_with_applicability]` They're thin wrappers over the corresponding diag method so we should just use that instead changelog: none
Configuration menu - View commit details
-
Copy full SHA for 7ac242c - Browse repository at this point
Copy the full SHA 7ac242cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 234ea1f - Browse repository at this point
Copy the full SHA 234ea1fView commit details
Commits on Aug 5, 2024
-
Auto merge of rust-lang#13217 - dtolnay-contrib:toolsutil, r=flip1995
Check exit status of subcommands spawned by rustc_tools_util The git commands `git rev-parse --short HEAD` and `git log -1 --date=short --pretty=format:%cd` that clippy runs from its build script might fail with **"fatal: not a git repository (or any of the parent directories): .git"** if clippy is being built from a source tarball rather than a git repository. That message is written by git to stderr, and nothing is written to stdout. For `clippy-driver --version` this PR wouldn't make a difference because it treats empty stdout and failed spawns (`git` is not installed) identically: https://github.com/rust-lang/rust-clippy/blob/7ac242c3d0d3ee867a6c9cdcbdec986c408ac36f/rustc_tools_util/src/lib.rs#L35-L42 But other users of `rustc_tools_util` should be able to expect that the distinction between Some and None is meaningful. They shouldn't need extra code to handle None vs Some-and-empty vs Some-and-nonempty. --- changelog: none
Configuration menu - View commit details
-
Copy full SHA for e611c8e - Browse repository at this point
Copy the full SHA e611c8eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1672d5d - Browse repository at this point
Copy the full SHA 1672d5dView commit details -
Store deprecated lints as an array of tuples.
Remove legacy deprecations. Remove "View Source" link for deprecated lints.
Configuration menu - View commit details
-
Copy full SHA for 2c34d58 - Browse repository at this point
Copy the full SHA 2c34d58View commit details -
Configuration menu - View commit details
-
Copy full SHA for c2186e1 - Browse repository at this point
Copy the full SHA c2186e1View commit details -
Auto merge of rust-lang#13180 - Jarcho:deprecated_shrink, r=flip1995
Simplify lint deprecation A couple of small changes: * A few deprecations were changed to renames. They all had a message similar to "this lint has been replaced by ..." which is just describing a rename. * The website and warning message are now the same. The website description was usually just a wordier version that contained no extra information. This can be worked around if needed, but I don't think that will happen. * The legacy deprecations have been removed. rustc should handle this since it already suggests adding the `clippy::` for all lints (deprecated or not) when they're used without it. It wouldn't be a problem to add them back in. * The website no longer has a "view source" link for deprecated lints since they're no longer read from the HIR tree. I could store the line number, but the link seems totally useless for these lints. This came up as part of separating the internal lints into their own crate. Both the metadata collector and the lint registration code needs access to the deprecated and renamed lists. This form lets all the deprecations be a separate crate. r? `@flip1995` changelog: none
Configuration menu - View commit details
-
Copy full SHA for e17d254 - Browse repository at this point
Copy the full SHA e17d254View commit details -
Auto merge of rust-lang#13136 - xFrednet:07797-restriction-and-then, …
…r=blyxyas Make restriction lint's use `span_lint_and_then` (a -> e) This migrates a few restriction lints to use `span_lint_and_then`. This change is motivated by rust-lang/rust-clippy#7797. I'm also interested if it will have an impact on performance. With some of these lints, like [`clippy::implicit_return`](https://rust-lang.github.io/rust-clippy/master/index.html#/implicit_return) I expect an impact, as it was previously creating a suggestion **for every implicit return** which is just wild. I've also cleaned up some lint message. Mostly minor stuff. For example: suggestions with a longer message than `"try"` now use `SuggestionStyle::ShowAlways` --- `@blyxyas` Could you benchmark this PR? I want to get all the numbers :3 --- This also crashed our new lintcheck CI with the following message: > Error: $GITHUB_STEP_SUMMARY upload aborted, supports content up to a size of 1024k, got 46731k. For more information see: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-markdown-summary Which is just wild. Like, I've [tested the first 20 lints](https://github.com/xFrednet/rust-clippy/actions/runs/10027528172) and got like four changes and then this. 50 MB of changed lint messages o.O. Looks like I'll create a separate PR to fix that step ^^ --- cc: rust-lang/rust-clippy#7797 changelog: none r? `@blyxyas`
Configuration menu - View commit details
-
Copy full SHA for c082bc2 - Browse repository at this point
Copy the full SHA c082bc2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9f6536c - Browse repository at this point
Copy the full SHA 9f6536cView commit details -
Auto merge of rust-lang#13222 - dtolnay-contrib:deterministic, r=flip…
…1995 Use a deterministic number of digits in rustc_tools_util commit hashes Using `git rev-parse --short` in rustc_tools_util causes nondeterministic compilation of projects that use `setup_version_info!` and `get_version_info!` when built from the exact same source code and git commit. The number of digits printed by `--short` is sensitive to how many other branches and tags in the repository have been fetched so far, what other commits have been worked on in other branches, how recently you had run `git gc`, platform-specific variation in git's default configuration, and platform differences in the sequence of steps performed by the release pipeline. Someone can compile a tool from a particular commit, switch branches to work on a different commit (or simply do a git fetch), go back to the first commit and be unable to reproduce the binary that was built from it previously. Currently, variation in short commit hashes causes Clippy version strings to be out of sync between different targets. On x86_64-unknown-linux-gnu: ```console $ clippy-driver +1.80.0 --version clippy 0.1.80 (0514789 2024-07-21) ``` Whereas on aarch64-apple-darwin: ```console $ clippy-driver +1.80.0 --version clippy 0.1.80 (0514789 2024-07-21) ``` --- changelog: none
Configuration menu - View commit details
-
Copy full SHA for 5f6d07b - Browse repository at this point
Copy the full SHA 5f6d07bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4c6a3f4 - Browse repository at this point
Copy the full SHA 4c6a3f4View commit details
Commits on Aug 6, 2024
-
Auto merge of rust-lang#13145 - xFrednet:07797-restriction-and-then-w…
…hy, r=Jarcho Make restriction lint's use `span_lint_and_then` (q -> w) This migrates a few restriction lints to use `span_lint_and_then`. This change is motivated by rust-lang/rust-clippy#7797. I've also cleaned up some lint message. Mostly minor stuff. For example: suggestions with a longer message than `"try"` now use `SuggestionStyle::ShowAlways` --- cc: rust-lang/rust-clippy#7797 sister PR of: rust-lang/rust-clippy#13136 changelog: none
Configuration menu - View commit details
-
Copy full SHA for cfb3881 - Browse repository at this point
Copy the full SHA cfb3881View commit details -
Auto merge of rust-lang#13210 - Alexendoo:lintcheck-force-warn, r=xFr…
…ednet lintcheck: force warn all lints It occurred to me that like `--filter` we could use `--force-warn` for normal operations, we especially want to see lints that crates decided were too annoying or were false positives Also excludes `clippy::cargo` from the default set as nobody is really writing those and it slows things down r? `@xFrednet` changelog: none
Configuration menu - View commit details
-
Copy full SHA for a411267 - Browse repository at this point
Copy the full SHA a411267View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4e57b2c - Browse repository at this point
Copy the full SHA 4e57b2cView commit details -
Auto merge of rust-lang#13225 - Jarcho:warnings, r=flip1995
Use `-D warnings` instead of `deny-warnings` feature. r? `@flip1995` changelog: none
Configuration menu - View commit details
-
Copy full SHA for 9d9a0dc - Browse repository at this point
Copy the full SHA 9d9a0dcView commit details -
Auto merge of rust-lang#12150 - ithinuel:add_misleading_use_of_ok, r=y21
Add lint for `unused_result_ok` This PR adds a lint to capture the use of `expr.ok();` when the result is not _really_ used. This could be interpreted as the result being checked (like it is with `unwrap()` or `expect`) but it actually only ignores the result. `let _ = expr;` expresses that intent better. This was also mentionned in rust-lang#8994 (although not being the main topic of that issue). changelog: [`misleading_use_of_ok`]: Add new lint to capture `.ok();` when the result is not _really_ used.
Configuration menu - View commit details
-
Copy full SHA for 5ead90f - Browse repository at this point
Copy the full SHA 5ead90fView commit details
Commits on Aug 7, 2024
-
Replace
in_constant
withis_in_const_context
. Use only the state ……in `LateContext` to avoid walking the HIR tree.
Configuration menu - View commit details
-
Copy full SHA for 16633a2 - Browse repository at this point
Copy the full SHA 16633a2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 514824f - Browse repository at this point
Copy the full SHA 514824fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8bcecff - Browse repository at this point
Copy the full SHA 8bcecffView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8225f2a - Browse repository at this point
Copy the full SHA 8225f2aView commit details -
Auto merge of rust-lang#13232 - Alexendoo:path-prefix, r=flip1995
Add path prefixes back when compiling `clippy_dev` and `lintcheck` `cargo dev` and `cargo lintcheck` use `--manifest-path` to select the package to compile, with this Cargo changes the CWD to the package's containing directory meaning paths in diagnostics start from e.g. `src/` instead of `clippy_dev/src/` Lintcheck uses a `--remap-path-prefix` trick when linting crates to re-add the directory name in diagnostics: https://github.com/rust-lang/rust-clippy/blob/5ead90f13ae3e03f0c346aea3198f18298960d83/lintcheck/src/main.rs#L93-L94 https://github.com/rust-lang/rust-clippy/blob/5ead90f13ae3e03f0c346aea3198f18298960d83/lintcheck/src/main.rs#L102-L103 It works well as far as I can tell, when absolute paths appear they stay absolute and do not have the prefix added [`profile-rustflags`](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#profile-rustflags-option) allows us to set per package `RUSTFLAGS` in order to use the same trick on the `clippy_dev` and `lintcheck` packages themselves Now when you run into warnings/errors the filename will be correctly clickable Before ``` error[E0425]: cannot find value `moo` in this scope --> src/lib.rs:41:5 | 41 | moo; | ^^^ not found in this scope ``` After ``` error[E0425]: cannot find value `moo` in this scope --> clippy_dev/src/lib.rs:41:5 | 41 | moo; | ^^^ not found in this scope ``` r? `@flip1995` changelog: none
Configuration menu - View commit details
-
Copy full SHA for f2deab3 - Browse repository at this point
Copy the full SHA f2deab3View commit details
Commits on Aug 8, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 17de8fb - Browse repository at this point
Copy the full SHA 17de8fbView commit details -
Auto merge of rust-lang#13234 - Alexendoo:lintcheck-doc-links, r=xFre…
…dnet lintcheck: disable doc links Removes the `help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#...` line to make the reports more concise r? `@xFrednet` changelog: none
Configuration menu - View commit details
-
Copy full SHA for bfb10f4 - Browse repository at this point
Copy the full SHA bfb10f4View commit details -
Auto merge of rust-lang#11441 - Jarcho:issue_11365, r=xFrednet
`single_match`: fix checking of explicitly matched enums fixes rust-lang#11365 This approach has false-negatives, but fixing them will require a significant amount of additional state tracking. The comment in `add_and_pats` has the explanation. changelog: `single_match`: correct checking if the match explicitly matches all of an enum's variants.
Configuration menu - View commit details
-
Copy full SHA for 5ccf543 - Browse repository at this point
Copy the full SHA 5ccf543View commit details -
Auto merge of rust-lang#13231 - Jarcho:no_tree_walk_in_const, r=Alexe…
…ndoo Don't walk the HIR tree when checking for a const context changelog: none
Configuration menu - View commit details
-
Copy full SHA for ffc391c - Browse repository at this point
Copy the full SHA ffc391cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3779062 - Browse repository at this point
Copy the full SHA 3779062View commit details -
Configuration menu - View commit details
-
Copy full SHA for d2cb227 - Browse repository at this point
Copy the full SHA d2cb227View commit details -
Configuration menu - View commit details
-
Copy full SHA for e4ad36d - Browse repository at this point
Copy the full SHA e4ad36dView commit details -
Auto merge of rust-lang#13200 - Jarcho:constant_no_typeck, r=Alexendoo
Don't use `LateContext` in the constant evaluator This also changes the interface to require explicitly creating the context. `constant` could be added back in, but the others are probably not worth it. A couple of bugs have been fixed. The wrong `TypeckResults` was used once when evaluating a constant, and the wrong `ParamEnv` was used by some callers (there wasn't a way to use the correct one). changelog: none
Configuration menu - View commit details
-
Copy full SHA for b1e8792 - Browse repository at this point
Copy the full SHA b1e8792View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7a73a10 - Browse repository at this point
Copy the full SHA 7a73a10View commit details -
Configuration menu - View commit details
-
Copy full SHA for e608b2f - Browse repository at this point
Copy the full SHA e608b2fView commit details -
Auto merge of rust-lang#13236 - flip1995:rustup, r=flip1995
Rustup r? `@ghost` changelog: ICE fix [`uninit_vec`] through rust-lang#128720
Configuration menu - View commit details
-
Copy full SHA for cb80611 - Browse repository at this point
Copy the full SHA cb80611View commit details -
Configuration menu - View commit details
-
Copy full SHA for b7f07ce - Browse repository at this point
Copy the full SHA b7f07ceView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8be2688 - Browse repository at this point
Copy the full SHA 8be2688View commit details