-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Update Clippy #97730
Update Clippy #97730
Commits on Feb 1, 2022
-
Configuration menu - View commit details
-
Copy full SHA for cb29e3e - Browse repository at this point
Copy the full SHA cb29e3eView commit details
Commits on May 4, 2022
-
Configuration menu - View commit details
-
Copy full SHA for ee8fae3 - Browse repository at this point
Copy the full SHA ee8fae3View commit details
Commits on May 10, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 5ad1b35 - Browse repository at this point
Copy the full SHA 5ad1b35View commit details
Commits on May 19, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 569505c - Browse repository at this point
Copy the full SHA 569505cView commit details
Commits on May 21, 2022
-
Auto merge of rust-lang#96923 - eholk:fix-fake-read, r=nikomatsakis
Drop Tracking: Implement `fake_read` callback This PR updates drop tracking's use of `ExprUseVisitor` so that we treat `fake_read` events as borrows. Without doing this, we were not handling match expressions correctly, which showed up as a breakage in the `addassign-yield.rs` test. We did not previously notice this because we still had rather large temporary scopes that we held borrows for, which changed in rust-lang#94309. This PR also includes a variant of the `addassign-yield.rs` test case to make sure we continue to have correct behavior here with drop tracking. r? `@nikomatsakis`
Configuration menu - View commit details
-
Copy full SHA for 8d04a32 - Browse repository at this point
Copy the full SHA 8d04a32View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4587b66 - Browse repository at this point
Copy the full SHA 4587b66View commit details -
Configuration menu - View commit details
-
Copy full SHA for fc965c7 - Browse repository at this point
Copy the full SHA fc965c7View commit details -
Auto merge of rust-lang#8848 - Serial-ATA:auto-detect-theme, r=xFrednet
Auto-detect preferred colorscheme changelog: none This just sets the theme to coal by default if the user prefers dark color schemes. r? `@xFrednet`
Configuration menu - View commit details
-
Copy full SHA for 91644d1 - Browse repository at this point
Copy the full SHA 91644d1View commit details -
Configuration menu - View commit details
-
Copy full SHA for cbe6607 - Browse repository at this point
Copy the full SHA cbe6607View commit details -
get_last_with_len: lint VecDeque and any deref to slice
previously only vecs were supported
Configuration menu - View commit details
-
Copy full SHA for 8558490 - Browse repository at this point
Copy the full SHA 8558490View commit details -
Configuration menu - View commit details
-
Copy full SHA for a319937 - Browse repository at this point
Copy the full SHA a319937View commit details
Commits on May 22, 2022
-
factor out the rvalue lifetime rule
remove region_scope_tree from RegionCtxt Apply suggestions from code review Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
Configuration menu - View commit details
-
Copy full SHA for e885157 - Browse repository at this point
Copy the full SHA e885157View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5cf07c6 - Browse repository at this point
Copy the full SHA 5cf07c6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0fd03a8 - Browse repository at this point
Copy the full SHA 0fd03a8View commit details
Commits on May 23, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 8ec9e5e - Browse repository at this point
Copy the full SHA 8ec9e5eView commit details -
Rollup merge of rust-lang#97254 - jhpratt:remove-crate-vis, r=cjgillot
Remove feature: `crate` visibility modifier FCP completed in rust-lang#53120.
Configuration menu - View commit details
-
Copy full SHA for 77d2b10 - Browse repository at this point
Copy the full SHA 77d2b10View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9b55ea7 - Browse repository at this point
Copy the full SHA 9b55ea7View commit details -
Configuration menu - View commit details
-
Copy full SHA for a342f52 - Browse repository at this point
Copy the full SHA a342f52View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ad3a0a - Browse repository at this point
Copy the full SHA 0ad3a0aView commit details -
Auto merge of rust-lang#8870 - Serial-ATA:issue-8865, r=xFrednet
Strip `clippy::` prefix from search strings changelog: none closes: rust-lang#8865 r? `@xFrednet`
Configuration menu - View commit details
-
Copy full SHA for 3642e33 - Browse repository at this point
Copy the full SHA 3642e33View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0684d62 - Browse repository at this point
Copy the full SHA 0684d62View commit details
Commits on May 24, 2022
-
Rollup merge of rust-lang#97289 - compiler-errors:tcxify-clippy, r=Ma…
…rk-Simulacrum Lifetime variance fixes for clippy rust-lang#97287 migrates rustc to a `Ty` type that is invariant over its lifetime `'tcx`, so I need to fix a bunch of places that assume that `Ty<'a>` and `Ty<'b>` can be shortened to some common lifetime. This is doable, since everything is already `'tcx`, so all this PR does is be a bit more explicit that elided lifetimes are actually `'tcx`. Split out from rust-lang#97287 so the clippy team can review independently.
Configuration menu - View commit details
-
Copy full SHA for 1f3116f - Browse repository at this point
Copy the full SHA 1f3116fView commit details -
Auto merge of rust-lang#8872 - hellow554:dependency_update, r=llogiq
update dependencies changelog: none Updating some dependencies, but the biggest one is clap to v3, but without using the derive struct thingy.
Configuration menu - View commit details
-
Copy full SHA for 050cdd6 - Browse repository at this point
Copy the full SHA 050cdd6View commit details -
Auto merge of rust-lang#96098 - JakobDegen:always-return-place, r=oli…
…-obk Refactor call terminator to always include destination place In rust-lang#71117 people seemed to agree that call terminators should always have a destination place, even if the call was guaranteed to diverge. This implements that. Unsurprisingly, the diff touches a lot of code, but thankfully I had to do almost nothing interesting. The only interesting thing came up in const prop, where the stack frame having no return place was also used to indicate that the layout could not be computed (or similar). I replaced this with a ZST allocation, which should continue to do the right things. cc `@RalfJung` `@eddyb` who were involved in the original conversation r? rust-lang/mir-opt
Configuration menu - View commit details
-
Copy full SHA for 286b717 - Browse repository at this point
Copy the full SHA 286b717View commit details -
Closes rust-lang#1595 changelog: Add no_effect_replace lint.
Configuration menu - View commit details
-
Copy full SHA for ea62347 - Browse repository at this point
Copy the full SHA ea62347View commit details -
Configuration menu - View commit details
-
Copy full SHA for 22673bc - Browse repository at this point
Copy the full SHA 22673bcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 04297de - Browse repository at this point
Copy the full SHA 04297deView commit details -
Fix imports for "Checking if a type defines a specific method"
The import of `clippy_utils::is_type_diagnostic_item` would cause this error: ``` error[E0432]: unresolved import `clippy_utils::is_type_diagnostic_item ```
Dany Marcoux committedMay 24, 2022 Configuration menu - View commit details
-
Copy full SHA for 21d9493 - Browse repository at this point
Copy the full SHA 21d9493View commit details -
Fix
manual_range_contains
with equal precedenceEvan Typanski committedMay 24, 2022 Configuration menu - View commit details
-
Copy full SHA for 78f7e37 - Browse repository at this point
Copy the full SHA 78f7e37View commit details -
Auto merge of rust-lang#8754 - guerinoni:no_effect_replace, r=llogiq
New lint `no_effect_replace` Closes rust-lang#1595 Signed-off-by: Federico Guerinoni <guerinoni.federico@gmail.com> changelog: Add [`no_effect_replace`] lint.
Configuration menu - View commit details
-
Copy full SHA for fbb9e56 - Browse repository at this point
Copy the full SHA fbb9e56View commit details -
Auto merge of rust-lang#8881 - dmarcoux:update-outdated-doc, r=llogiq
Fix imports for "Checking if a type defines a specific method" The import of `clippy_utils::is_type_diagnostic_item` would cause this error: ``` error[E0432]: unresolved import `clippy_utils::is_type_diagnostic_item ``` changelog: none
Configuration menu - View commit details
-
Copy full SHA for 6269ab1 - Browse repository at this point
Copy the full SHA 6269ab1View commit details -
Fix issue with mismatched parens in suggestion
Evan Typanski committedMay 24, 2022 Configuration menu - View commit details
-
Copy full SHA for 257f097 - Browse repository at this point
Copy the full SHA 257f097View commit details -
Auto merge of rust-lang#8786 - Alexendoo:identity-op-suggestions, r=d…
…swij,xFrednet `identity_op`: add parenthesis to suggestions where required changelog: [`identity_op`]: add parenthesis to suggestions where required Follow up to rust-lang#8730, wraps the cases we can't lint as-is in parenthesis rather than ignoring them Catches a couple new FPs with mixed operator precedences and `as` casts ```rust // such as 0 + { a } * 2; 0 + a as usize; ``` The suggestions are now applied using `span_lint_and_sugg` rather than appearing in just the message and have a `run-rustfix` test
Configuration menu - View commit details
-
Copy full SHA for c41c410 - Browse repository at this point
Copy the full SHA c41c410View commit details -
Auto merge of rust-lang#8880 - hellow554:rustfix_update, r=Manishearth
Add some testcases for recent rustfix update changelog: none This adds a testcase for a bugfix that has been fixed by https://github.com/rust-lang/rustfix/tree/v0.6.1 `rustfix` is pulled in by `compiletest_rs`. So to test that the correct rustfix version is used, I added one (and a half) testcase. I tried to add a testcase for rust-lang#8734 as well, but interesting enough the rustfix is wrong: ```diff fn issue8734() { let _ = [0u8, 1, 2, 3] .into_iter() - .and_then(|n| match n { + .flat_map(|n| match n { + 1 => [n + .saturating_add(1) 1 => [n .saturating_add(1) .saturating_add(1) .saturating_add(1) .saturating_add(1) .saturating_add(1) .saturating_add(1) .saturating_add(1) .saturating_add(1)], n => [n], }); } ``` this needs some investigation and then this testcase needs to be enabled by commenting it out closes rust-lang#8878 related to rust-lang#8734
Configuration menu - View commit details
-
Copy full SHA for 67a0891 - Browse repository at this point
Copy the full SHA 67a0891View commit details -
Auto merge of rust-lang#8862 - Alexendoo:get-last-with-len, r=Jarcho,…
…xFrednet `get_last_with_len`: lint `VecDeque` and any deref to slice changelog: [`get_last_with_len`]: lint `VecDeque` and any deref to slice Previously only `Vec`s were linted, this will now catch any usages on slices, arrays, etc. It also suggests `.back()` for `VecDeque`s Also moves the lint into `methods/`
Configuration menu - View commit details
-
Copy full SHA for b97784f - Browse repository at this point
Copy the full SHA b97784fView commit details
Commits on May 25, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 1dd0266 - Browse repository at this point
Copy the full SHA 1dd0266View commit details -
Configuration menu - View commit details
-
Copy full SHA for b531eb1 - Browse repository at this point
Copy the full SHA b531eb1View commit details -
Configuration menu - View commit details
-
Copy full SHA for e47c5b0 - Browse repository at this point
Copy the full SHA e47c5b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for d0f93c1 - Browse repository at this point
Copy the full SHA d0f93c1View commit details -
Auto merge of rust-lang#8882 - kyoto7250:get_first, r=llogiq
feat(lint): impl lint about use first() instead of get(0) close rust-lang#8851 This PR adds new lint about considering replacing .get(0) with .first(). Thank you in advance. changelog: adds new lint [`get_first`] to consider replacing .get(0) with .first()
Configuration menu - View commit details
-
Copy full SHA for 3cc50a4 - Browse repository at this point
Copy the full SHA 3cc50a4View commit details -
Configuration menu - View commit details
-
Copy full SHA for d8a281e - Browse repository at this point
Copy the full SHA d8a281eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4de301e - Browse repository at this point
Copy the full SHA 4de301eView commit details -
Configuration menu - View commit details
-
Copy full SHA for f489954 - Browse repository at this point
Copy the full SHA f489954View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2f25078 - Browse repository at this point
Copy the full SHA 2f25078View commit details -
Configuration menu - View commit details
-
Copy full SHA for 45be175 - Browse repository at this point
Copy the full SHA 45be175View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1c573c7 - Browse repository at this point
Copy the full SHA 1c573c7View commit details -
Auto merge of rust-lang#8889 - Serial-ATA:remove-newlines, r=xFrednet
Remove newlines in [`match_str_case_mismatch`] example changelog: none
Configuration menu - View commit details
-
Copy full SHA for 45785fe - Browse repository at this point
Copy the full SHA 45785feView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ee211a - Browse repository at this point
Copy the full SHA 9ee211aView commit details
Commits on May 26, 2022
-
Auto merge of rust-lang#8866 - botahamec:unused-rounding, r=llogiq
Add new lint `[unused_rounding]` fixes rust-lang#39 changelog: added a ``[`unused_rounding`]`` lint to check for the rounding of whole-number literals
Configuration menu - View commit details
-
Copy full SHA for bc4d39e - Browse repository at this point
Copy the full SHA bc4d39eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 17f7047 - Browse repository at this point
Copy the full SHA 17f7047View commit details -
Configuration menu - View commit details
-
Copy full SHA for ea06a41 - Browse repository at this point
Copy the full SHA ea06a41View commit details -
Auto merge of rust-lang#8896 - Alexendoo:fn_sig_ice, r=llogiq
Only return `DefId`s to `Fn`-like definitions in `clippy_utils::fn_def_id` Fixes rust-lang#8850 in `returns.rs` `tcx.fn_sig` is called on the result of `fn_def_id`, which panics if the def is a `const`/`static`/etc rather than a functions definition https://github.com/rust-lang/rust-clippy/blob/bc4d39e5fea64970dded1e6d2132d41435c0ef24/clippy_lints/src/returns.rs#L294-L303 changelog: Fix ICE due to callable `static`/`const`s
Configuration menu - View commit details
-
Copy full SHA for 6553b98 - Browse repository at this point
Copy the full SHA 6553b98View commit details
Commits on May 27, 2022
-
Configuration menu - View commit details
-
Copy full SHA for fc28f6a - Browse repository at this point
Copy the full SHA fc28f6aView commit details -
Auto merge of rust-lang#8885 - Serial-ATA:rc-clone-in-vec-init-weak, …
…r=llogiq Support `Weak` in [`rc_clone_in_vec_init`] changelog: Support `Weak` in [`rc_clone_in_vec_init`]
Configuration menu - View commit details
-
Copy full SHA for a5ece81 - Browse repository at this point
Copy the full SHA a5ece81View commit details -
When setting suggestion, add suggestion for MoveAndClone for non-ref
When trying to set the current suggestion, if the type of the expression is not a reference and it is not trivially pure clone copy, we should still trigger and emit a lint message. Since this fix may require cloning an expensive-to-clone type, do not attempt to offer a suggested fix. This change means that matches generated from TryDesugar and AwaitDesugar would normally trigger a lint, but they are out of scope for this lint, so we will explicitly ignore matches with sources of TryDesugar or AwaitDesugar. changelog: Update for [`significant_drop_in_scrutinee`] to correctly emit lint messages for cases where the type is not a reference and not trivially pure clone copy.
Configuration menu - View commit details
-
Copy full SHA for e33d87d - Browse repository at this point
Copy the full SHA e33d87dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 911eb1f - Browse repository at this point
Copy the full SHA 911eb1fView commit details -
Configuration menu - View commit details
-
Copy full SHA for c91a7f0 - Browse repository at this point
Copy the full SHA c91a7f0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8f49e41 - Browse repository at this point
Copy the full SHA 8f49e41View commit details -
Auto merge of rust-lang#8897 - tamaroning:improve_dbg, r=Alexendoo
Introduce `allow-dbg-in-tests` config value related to: Issue rust-lang#8758, PR rust-lang/rust-clippy#8838 changelog: Introduced `allow-dbg-in-tests` config value. [dbg_macro] does not allow `dbg!` in test code by default.
Configuration menu - View commit details
-
Copy full SHA for 461a661 - Browse repository at this point
Copy the full SHA 461a661View commit details -
Auto merge of rust-lang#8892 - smoelius:fix-empty-line-false-positive…
…, r=Manishearth Fix `empty_line_after_outer_attribute` false positive This PR fixes a false positive in `empty_line_after_outer_attribute`. Here is a minimal example that trigger the FP: ```rust #[derive(clap::Parser)] #[clap(after_help = "This ia a help message. You're welcome. ")] pub struct Args; ``` changelog: PF: [`empty_line_after_outer_attribute`]: No longer lints empty lines in inner string values.
Configuration menu - View commit details
-
Copy full SHA for 1dd5547 - Browse repository at this point
Copy the full SHA 1dd5547View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6027255 - Browse repository at this point
Copy the full SHA 6027255View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4fc0ee6 - Browse repository at this point
Copy the full SHA 4fc0ee6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 19f94d5 - Browse repository at this point
Copy the full SHA 19f94d5View commit details
Commits on May 28, 2022
-
Configuration menu - View commit details
-
Copy full SHA for c9be57d - Browse repository at this point
Copy the full SHA c9be57dView commit details -
Auto merge of rust-lang#8844 - smoelius:fixed-paths, r=Alexendoo
Check `.fixed` paths' existence in `run_ui` This PR adds a test to check that there exists a `.fixed` file for every `.stderr` file in `tests/ui` that mentions a `MachineApplicable` lint. The test leverages `compiletest-rs`'s `rustfix_coverage` option. I tried to add `.fixed` files where they appeared to be missing. However, 38 exceptional `.rs` files remain. Several of those include comments indicating that they are exceptions, though not all do. Apologies, as I have not tried to associate the 38 files with GH issues. (I think that would be a lot of work, and I worry about linking the wrong issue.) changelog: none
Configuration menu - View commit details
-
Copy full SHA for 5920fa3 - Browse repository at this point
Copy the full SHA 5920fa3View commit details -
Configuration menu - View commit details
-
Copy full SHA for cfd0f55 - Browse repository at this point
Copy the full SHA cfd0f55View commit details -
Configuration menu - View commit details
-
Copy full SHA for adafb6c - Browse repository at this point
Copy the full SHA adafb6cView commit details -
Auto merge of rust-lang#8385 - cameron1024:doc_link_with_quotes, r=ll…
…ogiq add doc_link_with_quotes lint I'm not sure about wording, it seems OK to me but happy to change if other people have better ideas closes rust-lang#8383 --- changelog: add [`doc_link_with_quotes`] lint
Configuration menu - View commit details
-
Copy full SHA for 39231b4 - Browse repository at this point
Copy the full SHA 39231b4View commit details
Commits on May 29, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 722f7d2 - Browse repository at this point
Copy the full SHA 722f7d2View commit details
Commits on May 30, 2022
-
Configuration menu - View commit details
-
Copy full SHA for c541015 - Browse repository at this point
Copy the full SHA c541015View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8430fa2 - Browse repository at this point
Copy the full SHA 8430fa2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2aa4569 - Browse repository at this point
Copy the full SHA 2aa4569View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0a7f19b - Browse repository at this point
Copy the full SHA 0a7f19bView commit details -
Auto merge of rust-lang#8899 - botahamec:use-self-tuple-struct-varian…
…ts, r=Alexendoo Fix `[use_self]` false negative with on struct and tuple struct patterns fixes rust-lang#8845 changelog: Triggered the warning for ``[`use_self`]`` on `TupleStruct` and `Struct` patterns, whereas currently it's only triggered for `Path` patterns
Configuration menu - View commit details
-
Copy full SHA for d9f4978 - Browse repository at this point
Copy the full SHA d9f4978View commit details
Commits on May 31, 2022
-
Add a pointer to address cast kind
A pointer to address cast are often special-cased. Introduce a dedicated cast kind to make them easy distinguishable.
Configuration menu - View commit details
-
Copy full SHA for 4e45960 - Browse repository at this point
Copy the full SHA 4e45960View commit details -
Auto merge of rust-lang#8913 - InfRandomness:ICE-rust-lang#8748, r=gi…
…raffate Fix rust-lang#8748 Thank you for making Clippy better! changelog: Fix ICE rust-lang#8748 in shadow.rs
Configuration menu - View commit details
-
Copy full SHA for 588e198 - Browse repository at this point
Copy the full SHA 588e198View commit details -
Auto merge of rust-lang#8912 - Alexendoo:needless-late-init-ice, r=gi…
…raffate needless_late_init: fix ICE when all branches return the never type Fixes rust-lang#8911 When the assignment is done in a match guard or the if condition and all of the branches return the never type `assignment_suggestions` would return an empty `Vec` which caused the ICE. It now returns `None` in that scenario Also moves some tests to the top of the file changelog: ICE Fixes: [`needless_late_init`] rust-lang#8911
Configuration menu - View commit details
-
Copy full SHA for e1607e9 - Browse repository at this point
Copy the full SHA e1607e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for eb2908b - Browse repository at this point
Copy the full SHA eb2908bView commit details -
Auto merge of rust-lang#8918 - Jarcho:almost_complete_letter_range, r…
…=llogiq Add lint `almost_complete_letter_range` fixes rust-lang#7269 changelog: Add lint `almost_complete_letter_range`
Configuration menu - View commit details
-
Copy full SHA for 2466a05 - Browse repository at this point
Copy the full SHA 2466a05View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9c9cca3 - Browse repository at this point
Copy the full SHA 9c9cca3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0c6ebf1 - Browse repository at this point
Copy the full SHA 0c6ebf1View commit details -
Auto merge of rust-lang#8876 - Alexendoo:cast-abs-to-different-uint, …
…r=dswij,xFrednet `cast_abs_to_unsigned`: do not remove cast if it's required Fixes rust-lang#8873 If `iX` is not cast to `uX` then keep the cast rather than removing it changelog: [`cast_abs_to_unsigned`]: do not remove cast if it's required
Configuration menu - View commit details
-
Copy full SHA for 9add456 - Browse repository at this point
Copy the full SHA 9add456View commit details -
Auto merge of rust-lang#8564 - Jarcho:transmute_erase_regions, r=Alex…
…endoo Don't lint `useless_transmute` on types with erased regions fixes rust-lang#6356 fixes rust-lang#3340 fixes rust-lang#2906 This should get a proper fix at some point, but this at least gets the lint running on some types. cc rust-lang#5343 changelog: Don't lint `useless_transmute` on types with erased regions
Configuration menu - View commit details
-
Copy full SHA for 7000e75 - Browse repository at this point
Copy the full SHA 7000e75View commit details -
Auto merge of rust-lang#8884 - evantypanski:manual_range_contains_mul…
…tiple, r=Manishearth Fix `manual_range_contains` false negative with chains of `&&` and `||` Fixes rust-lang#8745 Since the precedence for `&&` is the same as itself the HIR for a chain of `&&` ends up with a right skewed tree like: ``` && / \ && c2 / \ ... c1 ``` So only the leftmost `&&` was actually "fully" checked, the top level was just `c2` and `&&` so the `manual_range_contains` lint won't apply. This change makes it also check `c2` with `c1`. There's a bit of a hacky solution in the [second commit](rust-lang/rust-clippy@257f097) to check if the number of open/closing parens in the snippet match. This is to prevent a case like `((x % 2 == 0) || (x < 0)) || (x >= 10)` from offering a suggestion like `((x % 2 == 0) || !(0..10).contains(&x)` which now won't compile. Any suggestions for that paren hack welcome, kinda new to working on this so not too sure about possible solutions :) it's weird because I don't know how else to check for parens in HIR considering they're removed when lowering AST. changelog: Fix [`manual_range_contains`] false negative with chains of `&&` and `||`
Configuration menu - View commit details
-
Copy full SHA for 5b1a4c0 - Browse repository at this point
Copy the full SHA 5b1a4c0View commit details -
Configuration menu - View commit details
-
Copy full SHA for ca78e24 - Browse repository at this point
Copy the full SHA ca78e24View commit details -
Auto merge of rust-lang#8916 - Jarcho:swap_ptr_to_ref, r=Manishearth
New lint `swap_ptr_to_ref` fixes: rust-lang#7381 changelog: New lint `swap_ptr_to_ref`
Configuration menu - View commit details
-
Copy full SHA for f0bf200 - Browse repository at this point
Copy the full SHA f0bf200View commit details
Commits on Jun 1, 2022
-
`SourceFile::lines` is a big part of metadata. It's stored in a compressed form (a difference list) to save disk space. Decoding it is a big fraction of compile time for very small crates/programs. This commit introduces a new type `SourceFileLines` which has a `Lines` form and a `Diffs` form. The latter is used when the metadata is first read, and it is only decoded into the `Lines` form when line data is actually needed. This avoids the decoding cost for many files, especially in `std`. It's a performance win of up to 15% for tiny crates/programs where metadata decoding is a high part of compilation costs. A `Lock` is needed because the methods that access lines data (which can trigger decoding) take `&self` rather than `&mut self`. To allow for this, `SourceFile::lines` now takes a `FnMut` that operates on the lines slice rather than returning the lines slice.
Configuration menu - View commit details
-
Copy full SHA for 11d22ae - Browse repository at this point
Copy the full SHA 11d22aeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 202fdb9 - Browse repository at this point
Copy the full SHA 202fdb9View commit details -
Auto merge of rust-lang#7930 - lengyijun:needless_deref_new, r=Jarcho
new lint: `borrow_deref_ref` changelog: ``[`borrow_deref_ref`]`` Related pr: rust-lang#6837 rust-lang#7577 `@Jarcho` Could you please give a review? `cargo lintcheck` gives no false negative (but tested crates are out-of-date). TODO: 1. Not sure the name. `deref_on_immutable_ref` or some others?
Configuration menu - View commit details
-
Copy full SHA for c4c413b - Browse repository at this point
Copy the full SHA c4c413bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 86092a7 - Browse repository at this point
Copy the full SHA 86092a7View commit details -
Auto merge of rust-lang#8869 - Jarcho:derive_partial_eq_without_eq, r…
…=flip1995 Set correct `ParamEnv` for `derive_partial_eq_without_eq` fixes rust-lang#8867 changelog: Handle differing predicates applied by `#[derive(PartialEq)]` and `#[derive(Eq)]` in `derive_partial_eq_without_eq`
Configuration menu - View commit details
-
Copy full SHA for 7572b6b - Browse repository at this point
Copy the full SHA 7572b6bView commit details -
Configuration menu - View commit details
-
Copy full SHA for b20f95c - Browse repository at this point
Copy the full SHA b20f95cView commit details
Commits on Jun 2, 2022
-
Auto merge of rust-lang#8908 - Serial-ATA:doc-comment-issues, r=xFrednet
Make docs more consistent changelog: none This just fixes some docs to make them more consistent. I mostly just changed `// Good`, `// Bad`, etc to `Use instead:`.
Configuration menu - View commit details
-
Copy full SHA for 0d5ace3 - Browse repository at this point
Copy the full SHA 0d5ace3View commit details -
Configuration menu - View commit details
-
Copy full SHA for bc5a8e9 - Browse repository at this point
Copy the full SHA bc5a8e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 756caf7 - Browse repository at this point
Copy the full SHA 756caf7View commit details -
Auto merge of rust-lang#8905 - c410-f3r:arith, r=llogiq
[1/N] Implement Arithmetic lint Assuming that rust-lang/rust-clippy#8903 is OK, this PR starts the creation of the `Arithmetic` lint with configurable types. My current struggle to get a rustc review inspired me to create smaller PRs in order to easy review and make merges as fast as possible. So the first step here only moves the `arithmetic.rs` file to `numeric_arithmetic.rs` to make room for the new lint. -- changelog: none
Configuration menu - View commit details
-
Copy full SHA for 9428e2e - Browse repository at this point
Copy the full SHA 9428e2eView commit details -
Configuration menu - View commit details
-
Copy full SHA for b885035 - Browse repository at this point
Copy the full SHA b885035View commit details -
Configuration menu - View commit details
-
Copy full SHA for 678dcdd - Browse repository at this point
Copy the full SHA 678dcddView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0600de4 - Browse repository at this point
Copy the full SHA 0600de4View commit details -
Auto merge of rust-lang#8906 - rust-lang:copy-large-enum-variants, r=…
…Jarcho remove `large_enum_variant` suggestion for `Copy` types Replaces the (erroneous) suggestion on `large_enum_variant` for `Copy` types by a note. This fixes rust-lang#8894. --- changelog: none
Configuration menu - View commit details
-
Copy full SHA for e32b66c - Browse repository at this point
Copy the full SHA e32b66cView commit details -
Auto merge of rust-lang#8902 - PrestonFrom:add_suggestion_for_move_an…
…d_clone_when_not_ref, r=flip1995 When setting suggestion for significant_drop_in_scrutinee, add suggestion for MoveAndClone for non-ref When trying to set the current suggestion, if the type of the expression is not a reference and it is not trivially pure clone copy, we should still trigger and emit a lint message. Since this fix may require cloning an expensive-to-clone type, do not attempt to offer a suggested fix. This change means that matches generated from TryDesugar and AwaitDesugar would normally trigger a lint, but they are out of scope for this lint, so we will explicitly ignore matches with sources of TryDesugar or AwaitDesugar. changelog: Update for ``[`significant_drop_in_scrutinee`]`` to correctly emit lint messages for cases where the type is not a reference *and* not trivially pure clone copy. changelog: [`significant_drop_in_scrutinee`]: No longer lint on Try `?` and `await` desugared expressions.
Configuration menu - View commit details
-
Copy full SHA for 97e5449 - Browse repository at this point
Copy the full SHA 97e5449View commit details -
Auto merge of rust-lang#97575 - nnethercote:lazify-SourceFile-lines, …
…r=Mark-Simulacrum Lazify `SourceFile::lines`. `SourceFile::lines` is a big part of metadata. It's stored in a compressed form (a difference list) to save disk space. Decoding it is a big fraction of compile time for very small crates/programs. This commit introduces a new type `SourceFileLines` which has a `Lines` form and a `Diffs` form. The latter is used when the metadata is first read, and it is only decoded into the `Lines` form when line data is actually needed. This avoids the decoding cost for many files, especially in `std`. It's a performance win of up to 15% for tiny crates/programs where metadata decoding is a high part of compilation costs. A `RefCell` is needed because the methods that access lines data (which can trigger decoding) take `&self` rather than `&mut self`. To allow for this, `SourceFile::lines` now takes a `FnMut` that operates on the lines slice rather than returning the lines slice. r? `@Mark-Simulacrum`
Configuration menu - View commit details
-
Copy full SHA for 2a18d12 - Browse repository at this point
Copy the full SHA 2a18d12View commit details
Commits on Jun 3, 2022
-
Auto merge of rust-lang#8932 - dswij:pr-8879, r=giraffate
`needless_return` checks for macro expr in return stmts closes rust-lang#8879 Macro expressions in returns were not checked by `needless_return`. The test added in [this commit](rust-lang/rust-clippy@6396a7a#diff-a869168cfafb7e6e5010feb76a16389d6c96d59e98113dee5c2b304a5160e43aR51-R55) seems to have regressed. changelog: [`needless_return`] checks for macro exprs in return statements
Configuration menu - View commit details
-
Copy full SHA for 1194c63 - Browse repository at this point
Copy the full SHA 1194c63View commit details -
Add new lint mismatching_type_param_order
Add new lint for checking if type parameters are consistent between type definitions and impl blocks.
Configuration menu - View commit details
-
Copy full SHA for 58cd01c - Browse repository at this point
Copy the full SHA 58cd01cView commit details -
Rollup merge of rust-lang#97653 - RalfJung:int-to-ptr, r=oli-obk
add cast kind of from_exposed_addr (int-to-ptr casts) This is basically the dual to rust-lang#97582, for int2ptr casts. Cc `@tmiasko` rust-lang#97649
Configuration menu - View commit details
-
Copy full SHA for baacbfd - Browse repository at this point
Copy the full SHA baacbfdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1e86cc5 - Browse repository at this point
Copy the full SHA 1e86cc5View commit details -
Auto merge of rust-lang#8831 - arieluy:type_params, r=dswij
Add new lint `mismatching_type_param_order` changelog: Add new lint [`mismatching_type_param_order`] for checking if type parameters are consistent between type definitions and impl blocks. fixes rust-lang#7147
Configuration menu - View commit details
-
Copy full SHA for 7c0d649 - Browse repository at this point
Copy the full SHA 7c0d649View commit details -
Rollup merge of rust-lang#97415 - cjgillot:is-late-bound-solo, r=este…
…bank Compute `is_late_bound_map` query separately from lifetime resolution This query is actually very simple, and is only useful for functions and method. It can be computed directly by fetching the HIR, with no need to embed it within the lifetime resolution visitor. Based on rust-lang#96296
Configuration menu - View commit details
-
Copy full SHA for 5730482 - Browse repository at this point
Copy the full SHA 5730482View commit details -
Configuration menu - View commit details
-
Copy full SHA for 64fe4e3 - Browse repository at this point
Copy the full SHA 64fe4e3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 81e4450 - Browse repository at this point
Copy the full SHA 81e4450View commit details -
Auto merge of rust-lang#8934 - DevAccentor:as_underscore, r=Manishearth
add [`as_underscore`] lint closes rust-lang#8847 detect usage of `as _` and enforce the usage of explicit type like ```rust fn foo(n: usize) {} let n: u16 = 256; foo(n as _); ``` will suggest to change to ```rust fn foo(n: usize) {} let n: u16 = 256; foo(n as usize); ``` changelog: add [`as_underscore`] lint
Configuration menu - View commit details
-
Copy full SHA for ebd357e - Browse repository at this point
Copy the full SHA ebd357eView commit details -
Configuration menu - View commit details
-
Copy full SHA for b337f9e - Browse repository at this point
Copy the full SHA b337f9eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3d8d734 - Browse repository at this point
Copy the full SHA 3d8d734View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8c8a52e - Browse repository at this point
Copy the full SHA 8c8a52eView commit details -
Configuration menu - View commit details
-
Copy full SHA for dbc7753 - Browse repository at this point
Copy the full SHA dbc7753View commit details -
Configuration menu - View commit details
-
Copy full SHA for 67cb5ec - Browse repository at this point
Copy the full SHA 67cb5ecView commit details -
Configuration menu - View commit details
-
Copy full SHA for 68c411f - Browse repository at this point
Copy the full SHA 68c411fView commit details
Commits on Jun 4, 2022
-
Auto merge of rust-lang#8937 - Jarcho:merge_match_passes, r=llogiq
Merge various passes into `Matches` changelog: None
Configuration menu - View commit details
-
Copy full SHA for b1a3e7e - Browse repository at this point
Copy the full SHA b1a3e7eView commit details -
Auto merge of rust-lang#8843 - Serial-ATA:collect-renamed, r=xFrednet
Collect renamed lints changelog: Display past names of renamed lints on Clippy's lint list cc rust-lang#7172 r? `@xFrednet`
Configuration menu - View commit details
-
Copy full SHA for 8ef4908 - Browse repository at this point
Copy the full SHA 8ef4908View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7f402b1 - Browse repository at this point
Copy the full SHA 7f402b1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 36b1892 - Browse repository at this point
Copy the full SHA 36b1892View commit details -
Auto merge of rust-lang#8942 - flip1995:rustup, r=flip1995
Rustup r? `@ghost` changelog: none
Configuration menu - View commit details
-
Copy full SHA for d9ddce8 - Browse repository at this point
Copy the full SHA d9ddce8View commit details -
Configuration menu - View commit details
-
Copy full SHA for d55c373 - Browse repository at this point
Copy the full SHA d55c373View commit details -
Remove unnecessary clap_derive dependency added in 9ee211a
The fixed issue in this commit can be tested without depending on clap/clap_derive. This updates the test case to do so.
Configuration menu - View commit details
-
Copy full SHA for c22d4e6 - Browse repository at this point
Copy the full SHA c22d4e6View commit details -
This updates the Cargo.lock file for Clippy: - parking_lot 0.11.2 -> 0.12 (now 2 versions in parking lot) - rustfix 0.6.0 -> 0.6.1 (now only one version left) - compiletest_rs 0.7.1 -> 0.8 - clap 2.34.0 -> 3.1.1
Configuration menu - View commit details
-
Copy full SHA for 586cbd0 - Browse repository at this point
Copy the full SHA 586cbd0View commit details
Commits on Jun 6, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 9525e0c - Browse repository at this point
Copy the full SHA 9525e0cView commit details