-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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 #111799
Update Clippy #111799
Commits on Feb 1, 2023
-
Configuration menu - View commit details
-
Copy full SHA for a408e76 - Browse repository at this point
Copy the full SHA a408e76View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4931f45 - Browse repository at this point
Copy the full SHA 4931f45View commit details -
Remove old feature flag in code comment
Since let_else feature has been stable in 1.65.0, it's now unnecessary
Configuration menu - View commit details
-
Copy full SHA for 20338fd - Browse repository at this point
Copy the full SHA 20338fdView commit details -
Avoid renaming for TupleStruct with multiple arguments
update spec fix: move specs in fire
Configuration menu - View commit details
-
Copy full SHA for 07c8c50 - Browse repository at this point
Copy the full SHA 07c8c50View commit details
Commits on Apr 22, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 5fc1c79 - Browse repository at this point
Copy the full SHA 5fc1c79View commit details
Commits on Apr 29, 2023
-
Configuration menu - View commit details
-
Copy full SHA for cc607fe - Browse repository at this point
Copy the full SHA cc607feView commit details
Commits on Apr 30, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 478555d - Browse repository at this point
Copy the full SHA 478555dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1eff408 - Browse repository at this point
Copy the full SHA 1eff408View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0fb3f3b - Browse repository at this point
Copy the full SHA 0fb3f3bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8db21e9 - Browse repository at this point
Copy the full SHA 8db21e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for b9788fe - Browse repository at this point
Copy the full SHA b9788feView commit details
Commits on May 2, 2023
-
Make the BUG_REPORT_URL configurable by tools
This greatly simplifies how hard it is to set a custom bug report url; previously tools had to copy the entire hook implementation. - Switch clippy to the new hook This also adds a `extra_info` callback so clippy can include its own version number, which differs from rustc's. - Call `install_ice_hook` in rustfmt
Configuration menu - View commit details
-
Copy full SHA for a233bd5 - Browse repository at this point
Copy the full SHA a233bd5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 37127b8 - Browse repository at this point
Copy the full SHA 37127b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for f7595e0 - Browse repository at this point
Copy the full SHA f7595e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for cbd0135 - Browse repository at this point
Copy the full SHA cbd0135View commit details -
Configuration menu - View commit details
-
Copy full SHA for 122793b - Browse repository at this point
Copy the full SHA 122793bView commit details
Commits on May 3, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 477c8b3 - Browse repository at this point
Copy the full SHA 477c8b3View commit details
Commits on May 4, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 2bc479a - Browse repository at this point
Copy the full SHA 2bc479aView commit details
Commits on May 5, 2023
-
Rollup merge of rust-lang#108801 - fee1-dead-contrib:c-str, r=compile…
…r-errors Implement RFC 3348, `c"foo"` literals RFC: rust-lang/rfcs#3348 Tracking issue: rust-lang#105723
Configuration menu - View commit details
-
Copy full SHA for a48c735 - Browse repository at this point
Copy the full SHA a48c735View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7e9abb3 - Browse repository at this point
Copy the full SHA 7e9abb3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 68eb864 - Browse repository at this point
Copy the full SHA 68eb864View commit details -
Configuration menu - View commit details
-
Copy full SHA for afa2741 - Browse repository at this point
Copy the full SHA afa2741View commit details -
Configuration menu - View commit details
-
Copy full SHA for d2bbe76 - Browse repository at this point
Copy the full SHA d2bbe76View commit details -
Configuration menu - View commit details
-
Copy full SHA for d80ca09 - Browse repository at this point
Copy the full SHA d80ca09View commit details -
Auto merge of rust-lang#111255 - flip1995:clippyup, r=Manishearth
Update Clippy r? `@Manishearth`
Configuration menu - View commit details
-
Copy full SHA for 5889ecd - Browse repository at this point
Copy the full SHA 5889ecdView commit details
Commits on May 6, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 2a4571d - Browse repository at this point
Copy the full SHA 2a4571dView commit details -
Rollup merge of rust-lang#110989 - jyn514:bug-report-url, r=WaffleLapkin
Make the BUG_REPORT_URL configurable by tools This greatly simplifies how hard it is to set a custom bug report url; previously tools had to copy the entire hook implementation. I haven't changed clippy in case they want to make the change upstream instead of the subtree, but I'm happy to do so here if the maintainers want - cc ````@rust-lang/clippy```` Fixes rust-lang#109486.
Configuration menu - View commit details
-
Copy full SHA for 0b7acaa - Browse repository at this point
Copy the full SHA 0b7acaaView commit details -
Configuration menu - View commit details
-
Copy full SHA for f4b8cb1 - Browse repository at this point
Copy the full SHA f4b8cb1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e535f6 - Browse repository at this point
Copy the full SHA 9e535f6View commit details
Commits on May 7, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 630f31c - Browse repository at this point
Copy the full SHA 630f31cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 450a22f - Browse repository at this point
Copy the full SHA 450a22fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 39db64e - Browse repository at this point
Copy the full SHA 39db64eView commit details -
changes from review: add FIXME to clippy and change subst_identity to…
… skip_binder in mir subst methods
Configuration menu - View commit details
-
Copy full SHA for 3fc1155 - Browse repository at this point
Copy the full SHA 3fc1155View commit details -
Configuration menu - View commit details
-
Copy full SHA for fb6bf1e - Browse repository at this point
Copy the full SHA fb6bf1eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5c8a009 - Browse repository at this point
Copy the full SHA 5c8a009View commit details -
Configuration menu - View commit details
-
Copy full SHA for 394b4c1 - Browse repository at this point
Copy the full SHA 394b4c1View commit details
Commits on May 8, 2023
-
Auto merge of rust-lang#10752 - Alexendoo:default-units-macros, r=gir…
…affate Ignore expressions from macros in `default_constructed_unit_structs` changelog: none, should be the same release as the lint itself
Configuration menu - View commit details
-
Copy full SHA for 3aab0dd - Browse repository at this point
Copy the full SHA 3aab0ddView commit details -
Configuration menu - View commit details
-
Copy full SHA for 56e8e1a - Browse repository at this point
Copy the full SHA 56e8e1aView commit details -
Auto merge of rust-lang#10736 - NotAPenguin0:master, r=Alexendoo
initial clippy::ref_pattern implementation This implements a new lint that discourages the use of the `ref` keyword as outlined in rust-lang#9010. I think there are still some things to improve about this lint, but I need some feedback before I can implement those. - [x] ~~Maybe it's desirable that a quick fix is listed too, instead of a generic `avoid using the ref keyword` lint.~~ - [x] `let ref x = y` already has a lint (`clippy::toplevel_ref_arg`). This implementation will report this too, so you get two lints for the same issue, which is not great. I don't really know a way around this though. - [X] The dogfood test is currently failing locally, though I ran `cargo clippy -- -D clippy::all -D clippy::pedantic` and got no output, so I'm not sure why this is. Any help with these would be greatly appreciated. fixes rust-lang#9010 changelog: [`ref_pattern`]: newly added lint
Configuration menu - View commit details
-
Copy full SHA for 8798c66 - Browse repository at this point
Copy the full SHA 8798c66View commit details -
Auto merge of rust-lang#10757 - cakebaker:add_missing_word, r=Jarcho
Add missing word "are" changelog: none
Configuration menu - View commit details
-
Copy full SHA for e66488a - Browse repository at this point
Copy the full SHA e66488aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5491241 - Browse repository at this point
Copy the full SHA 5491241View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5acc299 - Browse repository at this point
Copy the full SHA 5acc299View commit details -
Configuration menu - View commit details
-
Copy full SHA for ba0e7e8 - Browse repository at this point
Copy the full SHA ba0e7e8View commit details -
Auto merge of rust-lang#10761 - lochetti:fix_9871, r=Manishearth
Ignore `borrow_deref_ref` warnings in code from procedural macros. Don't linting `borrow_deref_ref` if code was generated by procedural macro. This PR fixes rust-lang/rust-clippy#8971 changelog: [`borrow_deref_ref`] avoiding warnings in macro-generated code
Configuration menu - View commit details
-
Copy full SHA for 90ce1a2 - Browse repository at this point
Copy the full SHA 90ce1a2View commit details -
Rollup merge of rust-lang#109410 - fmease:iat-alias-kind-inherent, r=…
…compiler-errors Introduce `AliasKind::Inherent` for inherent associated types Allows us to check (possibly generic) inherent associated types for well-formedness. Type inference now also works properly. Follow-up to rust-lang#105961. Supersedes rust-lang#108430. Fixes rust-lang#106722. Fixes rust-lang#108957. Fixes rust-lang#109768. Fixes rust-lang#109789. Fixes rust-lang#109790. ~Not to be merged before rust-lang#108860 (`AliasKind::Weak`).~ CC `@jackh726` r? `@compiler-errors` `@rustbot` label T-types F-inherent_associated_types
Configuration menu - View commit details
-
Copy full SHA for 34655df - Browse repository at this point
Copy the full SHA 34655dfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4c3e2ff - Browse repository at this point
Copy the full SHA 4c3e2ffView commit details -
Auto merge of rust-lang#10584 - blyxyas:fix-wildcard_imports_testsrs,…
… r=flip1995 fix: `wildcard_imports` ignore `test.rs` files Adds a check to see if the building crate is a test one, if so, ignore it --- Closes rust-lang#10580 changelog:[`wildcard_imports`]: Add a check to ignore files named `test.rs` and `tests.rs`
Configuration menu - View commit details
-
Copy full SHA for d696f3b - Browse repository at this point
Copy the full SHA d696f3bView commit details -
Auto merge of rust-lang#10735 - alnoki:patch-1, r=dswij
Bump README copyright changelog: none
Configuration menu - View commit details
-
Copy full SHA for b4075e8 - Browse repository at this point
Copy the full SHA b4075e8View commit details
Commits on May 9, 2023
-
Configuration menu - View commit details
-
Copy full SHA for b169bdb - Browse repository at this point
Copy the full SHA b169bdbView commit details -
Auto merge of rust-lang#10727 - john-h-k:lint/dup-auto-traits, r=Mani…
…shearth Extend `trait_duplication_in_bounds` to cover trait objects This PR extends `trait_duplication_in_bounds` to cover trait objects. Currently, ```rs fn foo(_a: &(dyn Any + Send + Send)) {} ``` generates no warnings. With this PR, it will complain about a duplicate trait and can remove it Moved from rust-lang#110991 changelog: [`trait_duplication_in_bounds`]: warn on duplicate trait object constraints
Configuration menu - View commit details
-
Copy full SHA for 77e4d7a - Browse repository at this point
Copy the full SHA 77e4d7aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3e8fea6 - Browse repository at this point
Copy the full SHA 3e8fea6View commit details -
Auto merge of rust-lang#10751 - blyxyas:explain_with_config, r=xFrednet
Add configuration options to `--explain` This PR rearranges some modules, taking `metadata_collector` out of `internal_lints` and making public just the necessary functions for `explain()` to use. The output looks something like this: ```sh $ cargo run --bin cargo-clippy --manifest-path ../rust-clippy/Cargo.toml -- --explain cognitive_complexity ### What it does Checks for methods with high cognitive complexity. ### Why is this bad? Methods of high cognitive complexity tend to be hard to both read and maintain. Also LLVM will tend to optimize small methods better. ### Known problems Sometimes it's hard to find a way to reduce the complexity. ### Example You'll see it when you get the warning. ======================================== Configuration for clippy::cognitive_complexity: - cognitive-complexity-threshold: The maximum cognitive complexity a function can have (default: 25) ``` Fixes rust-lang#9990 r? `@xFrednet` --- changelog: Docs: `cargo clippy --explain LINT` now shows possible configuration options for the explained lint [rust-lang#10751](rust-lang/rust-clippy#10751) <!-- changelog_checked -->
Configuration menu - View commit details
-
Copy full SHA for 1407c76 - Browse repository at this point
Copy the full SHA 1407c76View commit details -
Configuration menu - View commit details
-
Copy full SHA for 342ce3d - Browse repository at this point
Copy the full SHA 342ce3dView commit details
Commits on May 10, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 6af0359 - Browse repository at this point
Copy the full SHA 6af0359View commit details -
Configuration menu - View commit details
-
Copy full SHA for 551f6e6 - Browse repository at this point
Copy the full SHA 551f6e6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 22688fc - Browse repository at this point
Copy the full SHA 22688fcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 35e5aac - Browse repository at this point
Copy the full SHA 35e5aacView commit details -
Configuration menu - View commit details
-
Copy full SHA for c5d4b04 - Browse repository at this point
Copy the full SHA c5d4b04View commit details -
Auto merge of rust-lang#10766 - samueltardieu:issue-10710, r=Manishearth
needless_bool: do not simplify code if it loses comments Fix rust-lang#10710 changelog: [`needless_bool`]: do not simplify code if it loses comments
Configuration menu - View commit details
-
Copy full SHA for c56dd3d - Browse repository at this point
Copy the full SHA c56dd3dView commit details
Commits on May 11, 2023
-
fix: warn on empty line outer AttrKind::DocComment
changelog: [`empty_line_after_doc_comments`]: add lint for checking empty lines after rustdoc comments. Fixes: rust-lang#10395
Configuration menu - View commit details
-
Copy full SHA for 0a4cfbf - Browse repository at this point
Copy the full SHA 0a4cfbfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3991dd1 - Browse repository at this point
Copy the full SHA 3991dd1View commit details -
Configuration menu - View commit details
-
Copy full SHA for c53ceba - Browse repository at this point
Copy the full SHA c53cebaView commit details -
checks for manual reverse iteration (`.rev().next()`) of a `DoubleEndedIterator`
Configuration menu - View commit details
-
Copy full SHA for a8834bc - Browse repository at this point
Copy the full SHA a8834bcView commit details
Commits on May 12, 2023
-
Auto merge of rust-lang#10769 - Icxolu:manual_next_back, r=giraffate
add lint `manual_next_back` changelog: [`manual_next_back`]: checks for manual reverse iteration (`.rev().next()`) of a `DoubleEndedIterator` fixes rust-lang#10274
Configuration menu - View commit details
-
Copy full SHA for 3d456ce - Browse repository at this point
Copy the full SHA 3d456ceView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8100a88 - Browse repository at this point
Copy the full SHA 8100a88View commit details -
Auto merge of rust-lang#10771 - giraffate:update_actions_checkout, r=…
…flip1995 Update actions/checkout Suppress the warning in GitHub Actions: https://github.com/rust-lang/rust-clippy/actions/runs/4941438718 changelog: none
Configuration menu - View commit details
-
Copy full SHA for 035c457 - Browse repository at this point
Copy the full SHA 035c457View commit details -
Configuration menu - View commit details
-
Copy full SHA for fce41ce - Browse repository at this point
Copy the full SHA fce41ceView commit details -
Auto merge of rust-lang#10772 - giraffate:update_actions_setup-node, …
…r=flip1995 Update actions/setup-node Follow up of rust-lang/rust-clippy#10771. One warning remains: https://github.com/rust-lang/rust-clippy/actions/runs/4959567213 changelog: none
Configuration menu - View commit details
-
Copy full SHA for 6cbd767 - Browse repository at this point
Copy the full SHA 6cbd767View commit details -
Auto merge of rust-lang#10691 - jdswensen:jds/fix-doc-empty-line, r=J…
…archo fix: warn on empty line outer AttrKind::DocComment changelog: [`empty_line_after_doc_comments`]: add lint for checking empty lines after rustdoc comments. Fixes: rust-lang#10395
Configuration menu - View commit details
-
Copy full SHA for fff790b - Browse repository at this point
Copy the full SHA fff790bView commit details
Commits on May 14, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 891fffe - Browse repository at this point
Copy the full SHA 891fffeView commit details -
Auto merge of rust-lang#10768 - c410-f3r:arith-3, r=Jarcho
[arithmetic_side_effects] Consider referenced allowed or hard-coded types Fix rust-lang#10767 ``` changelog: [`arithmetic_side_effects`]: Do not fire when dealing with allowed or hard-coded types that are referenced. ```
Configuration menu - View commit details
-
Copy full SHA for a167973 - Browse repository at this point
Copy the full SHA a167973View commit details -
Configuration menu - View commit details
-
Copy full SHA for e234dfa - Browse repository at this point
Copy the full SHA e234dfaView commit details -
Configuration menu - View commit details
-
Copy full SHA for df200aa - Browse repository at this point
Copy the full SHA df200aaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 493b2ae - Browse repository at this point
Copy the full SHA 493b2aeView commit details -
Configuration menu - View commit details
-
Copy full SHA for fcb1327 - Browse repository at this point
Copy the full SHA fcb1327View commit details -
Updates `needless_collect` to lint for collecting into a method or function argument thats taking an `IntoIterator` (for example `extend`). Every `Iterator` trivially implements `IntoIterator` and colleting it only causes an unnecessary allocation.
Configuration menu - View commit details
-
Copy full SHA for 84f89f3 - Browse repository at this point
Copy the full SHA 84f89f3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1190c02 - Browse repository at this point
Copy the full SHA 1190c02View commit details -
Configuration menu - View commit details
-
Copy full SHA for a36d9a7 - Browse repository at this point
Copy the full SHA a36d9a7View commit details -
Auto merge of rust-lang#10778 - Centri3:type-alias-fix, r=llogiq
Don't emit clippy::useless_conversion on type aliases Fixes rust-lang#10773 changelog: Enhancement: [`useless_conversion`]: Don't lint on type aliases
Configuration menu - View commit details
-
Copy full SHA for 590c9fc - Browse repository at this point
Copy the full SHA 590c9fcView commit details
Commits on May 15, 2023
-
flip1995: Stepping down from the reviewer rotation
A step I was trying to avoid for way too long, but sadly necessary now. I hope I can come back stronger in a few months.
Configuration menu - View commit details
-
Copy full SHA for 9c6350b - Browse repository at this point
Copy the full SHA 9c6350bView commit details -
Auto merge of rust-lang#10781 - flip1995:stepping-down, r=xFrednet
flip1995: Stepping down from the reviewer rotation A step I was trying to avoid for way too long, but sadly necessary now. I hope I can come back stronger in a few months. More explanation on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Stepping.20back.20from.20review.20rotation/near/358384096) changelog: none
Configuration menu - View commit details
-
Copy full SHA for c490974 - Browse repository at this point
Copy the full SHA c490974View commit details -
Configuration menu - View commit details
-
Copy full SHA for 79a8867 - Browse repository at this point
Copy the full SHA 79a8867View commit details -
Configuration menu - View commit details
-
Copy full SHA for f0be0ee - Browse repository at this point
Copy the full SHA f0be0eeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 79eb06c - Browse repository at this point
Copy the full SHA 79eb06cView commit details
Commits on May 16, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 2d9d81f - Browse repository at this point
Copy the full SHA 2d9d81fView commit details -
It's just a short wrapper used by `tcx.require_lang_item`. Deleting it gives us a negative diff.
Configuration menu - View commit details
-
Copy full SHA for fc12637 - Browse repository at this point
Copy the full SHA fc12637View commit details -
Configuration menu - View commit details
-
Copy full SHA for ae40b7f - Browse repository at this point
Copy the full SHA ae40b7fView commit details
Commits on May 17, 2023
-
Rollup merge of rust-lang#111648 - Nilstrieb:language-items, r=Waffle…
…Lapkin Remove `LangItems::require` It's just a short wrapper used by `tcx.require_lang_item`. Deleting it gives us a negative diff.
Configuration menu - View commit details
-
Copy full SHA for 506b50e - Browse repository at this point
Copy the full SHA 506b50eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 591f5f7 - Browse repository at this point
Copy the full SHA 591f5f7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0eb364b - Browse repository at this point
Copy the full SHA 0eb364bView commit details
Commits on May 18, 2023
-
Auto merge of rust-lang#10175 - koka831:fix/10171, r=giraffate
Use original variable name in the suggestion Fix rust-lang/rust-clippy#10171 --- changelog: Sugg: [`manual_let_else`]: Now suggest the correct variable name [rust-lang#10175](rust-lang/rust-clippy#10175) <!-- changelog_checked -->
Configuration menu - View commit details
-
Copy full SHA for 7e18451 - Browse repository at this point
Copy the full SHA 7e18451View commit details -
Auto merge of rust-lang#10337 - EliasHolzmann:fix/10335, r=dswij
Fix: Some suggestions generated by the option_if_let_else lint did not compile This addresses a bug in Clippy where the fix suggestend by the `option_if_let_else` lint would not compile for `Result`s which have an impure expression in the `else` branch. --- changelog: [`option_if_let_else`]: Fixed incorrect suggestion for `Result`s [rust-lang#10337](rust-lang/rust-clippy#10337) <!-- changelog_checked --> Fixes rust-lang#10335.
Configuration menu - View commit details
-
Copy full SHA for 407c352 - Browse repository at this point
Copy the full SHA 407c352View commit details -
Auto merge of rust-lang#10682 - J-ZhengLi:issue10680, r=dswij
fix [`invalid_regex`] not recognizing new syntax introduced after regex-1.8.0 fixes: rust-lang#10680 --- changelog: fix [`invalid_regex`] not recognizing new syntax introduced after regex-1.8.0 bump up `regex-syntax` dependency version to 0.7.0
Configuration menu - View commit details
-
Copy full SHA for 223f518 - Browse repository at this point
Copy the full SHA 223f518View commit details -
Auto merge of rust-lang#10775 - lochetti:fix_10723, r=xFrednet
Ignoring `let_underscore_untyped` warnings in code from proc macros Don't linting let_underscore_untyped if code was generated by procedural macro. This PR fixes rust-lang/rust-clippy#10723 --- closes: rust-lang/rust-clippy#10723 changelog: Fix: [`let_underscore_untyped`]: No longer lints inside proc macros [rust-lang#10775](rust-lang/rust-clippy#10775) <!-- changelog_checked -->
Configuration menu - View commit details
-
Copy full SHA for f3f6fd8 - Browse repository at this point
Copy the full SHA f3f6fd8View commit details -
Auto merge of rust-lang#10786 - mickvangelderen:remove-unnecessary-cl…
…one-from-needless-collect-example, r=Alexendoo Remove unnecessary `clone` from `needless_collect` example The example for [clippy::needless_collect](https://rust-lang.github.io/rust-clippy/master/#needless_collect) is written as follows: ```rust let len = iterator.clone().collect::<Vec<_>>().len(); // should be let len = iterator.count(); ``` With this change, the unnecessary `clone()` is removed and the the standard ### Example ```rust // original ``` Use instead: ```rust // improved ``` structure is followed. Discussion: rust-lang/rust-clippy#10784 (comment) changelog: [`needless_collect`]: Cleaned up the example in the lint documentation.
Configuration menu - View commit details
-
Copy full SHA for 9cd483d - Browse repository at this point
Copy the full SHA 9cd483dView commit details -
Auto merge of rust-lang#10789 - Centri3:patch-1, r=xFrednet
fix example heading in `string_slice` changelog: none
Configuration menu - View commit details
-
Copy full SHA for cf182b9 - Browse repository at this point
Copy the full SHA cf182b9View commit details -
Auto merge of rust-lang#10725 - y21:issue9914, r=Jarcho
don't remove `dbg!` in arbitrary expressions Fixes rust-lang#9914 The `dbg_macro` lint replaces empty `dbg!` invocations with the empty string in its suggestion, which is not always valid code in certain contexts (e.g. `let _ = dbg!();` becomes `let _ = ;`). This PR changes it to `()`, which should always be valid where `dbg!()` is valid (`dbg!()` with no arguments evaluates to `()`). It also special-cases "standalone" `dbg!();` expression statements, where it will suggest removing the whole statement entirely like it did before. changelog: [`dbg_macro`]: don't remove `dbg!()` in arbitrary expressions as it sometimes results in syntax errors
Configuration menu - View commit details
-
Copy full SHA for 815a07e - Browse repository at this point
Copy the full SHA 815a07eView commit details -
Auto merge of rust-lang#10674 - c410-f3r:macro-lint, r=Jarcho
Rename `integer_arithmetic` The lack of official feedback in rust-lang#10200 made me give up on pursuing the matter but after yet another use-case that is not handled by `integer_arithmetic` (rust-lang#10615), I think it is worth trying again. --- changelog: Move/Deprecation: Rename `integer_arithmetic` to `arithmetic_side_effects` [rust-lang#10674](rust-lang/rust-clippy#10674) <!-- changelog_checked -->
Configuration menu - View commit details
-
Copy full SHA for 270cbeb - Browse repository at this point
Copy the full SHA 270cbebView commit details -
Auto merge of rust-lang#10753 - disco07:master, r=xFrednet
redundant_pattern_matching This PR try to solve this issue rust-lang/rust-clippy#10726, but it enter in conflict with another test. changelog: none Try to test this: ``` let _w = match x { Some(_) => true, _ => false, }; ``` this happen: ``` error: match expression looks like `matches!` macro --> $DIR/match_expr_like_matches_macro.rs:21:14 | LL | let _w = match x { | ______________^ LL | | Some(_) => true, LL | | _ => false, LL | | }; | |_____^ help: try this: `matches!(x, Some(_))` +error: redundant pattern matching, consider using `is_some()` + --> $DIR/match_expr_like_matches_macro.rs:21:14 + | +LL | let _w = match x { + | ______________^ +LL | | Some(_) => true, +LL | | _ => false, +LL | | }; + | |_____^ help: try this: `x.is_some()` + | + = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings` + ``` I need some help to fix this. Thanks
Configuration menu - View commit details
-
Copy full SHA for 22b3196 - Browse repository at this point
Copy the full SHA 22b3196View commit details -
Configuration menu - View commit details
-
Copy full SHA for cfa5aa2 - Browse repository at this point
Copy the full SHA cfa5aa2View commit details -
Auto merge of rust-lang#10798 - Alexendoo:unnameable-ty-suggestions, …
…r=Jarcho Don't suggest unnameable types in `box_default`, `let_underscore_untyped` changelog: [`box_default`], [`let_underscore_untyped`]: Don't suggest unnameable types
Configuration menu - View commit details
-
Copy full SHA for 392e955 - Browse repository at this point
Copy the full SHA 392e955View commit details -
Search for inactive
cfg
attributes and empty macro expansion throughthe entire block
Configuration menu - View commit details
-
Copy full SHA for 0b3c2ed - Browse repository at this point
Copy the full SHA 0b3c2edView commit details -
Slightly refactor constant evaluation and add detection for empty mac…
…ro expansion and `cfg`ed statements.
Configuration menu - View commit details
-
Copy full SHA for 5351170 - Browse repository at this point
Copy the full SHA 5351170View commit details -
* Don't consider expansions of different macros to be the same, even if they expand to the same tokens * Don't consider `cfg!` expansions to be equal if they check different configs.
Configuration menu - View commit details
-
Copy full SHA for 58132cb - Browse repository at this point
Copy the full SHA 58132cbView commit details
Commits on May 19, 2023
-
Auto merge of rust-lang#10478 - Jarcho:block_eq, r=xFrednet
`SpanlessEq` improvements fixes rust-lang#9775 Also includes a simplification to `consts::constant`'s interface since I was already touching the code. At the start of `eq_expr` the check: ```rust if !self.inner.allow_side_effects && left.span.ctxt() != right.span.ctxt() { return false; } ``` was removed. This was added in 49e2501 to handle `cfg` macros. This is better handled by the newly added `check_ctxt`. changelog: [various lints]: Don't consider different `cfg!` expansions to be the same unless they are for the same config. changelog: [various lints]: Don't consider the expansion of two different macros to be equal, even when they expand to the same token sequence. changelog: [various lints]: Don't consider two blocks to be equal if they contain disabled code or empty macro expansions, unless those section contain the exact same token sequence.
Configuration menu - View commit details
-
Copy full SHA for 1e8d2c5 - Browse repository at this point
Copy the full SHA 1e8d2c5View commit details -
Auto merge of rust-lang#10777 - Icxolu:unnecessary_collect, r=xFrednet
Enhance `needless_collect`: lint in method/function arguments that take an `IntoIterator` Updates `needless_collect` to also lint `collect` calls in method/function arguments that take an `IntoIterator` (for example `Extend::extend`). Every `Iterator` trivially implements `IntoIterator` and collecting it only causes an unnecessary allocation. --- changelog: Enhancement: [`needless_collect`]: Now also detects function arguments, taking a generic `IntoIterator` [rust-lang#10777](rust-lang/rust-clippy#10777) <!-- changelog_checked --> fixes rust-lang#10762
Configuration menu - View commit details
-
Copy full SHA for 2a1dbba - Browse repository at this point
Copy the full SHA 2a1dbbaView commit details -
Configuration menu - View commit details
-
Copy full SHA for ab66a86 - Browse repository at this point
Copy the full SHA ab66a86View commit details -
Configuration menu - View commit details
-
Copy full SHA for fcf1948 - Browse repository at this point
Copy the full SHA fcf1948View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5328852 - Browse repository at this point
Copy the full SHA 5328852View commit details -
Configuration menu - View commit details
-
Copy full SHA for dbc76a7 - Browse repository at this point
Copy the full SHA dbc76a7View commit details
Commits on May 20, 2023
-
Auto merge of rust-lang#10763 - GuillaumeGomez:unique_cfg_condition, …
…r=Jarcho Add `MINIMAL_CFG_CONDITION` lint I encountered a few cases where some code had: ```rust #[cfg(any(unix))] ``` In this case, the `any` is useless. This lint checks this and also for the `all` condition. ``` changelog: [`unique_cfg_condition`]: Add new `UNIQUE_CFG_CONDITION` lint ```
Configuration menu - View commit details
-
Copy full SHA for 940ffdf - Browse repository at this point
Copy the full SHA 940ffdfView commit details -
Auto merge of rust-lang#10795 - adrianEffe:fix/TyKind-enum, r=flip1995
Update URLs in Type Checking chapter Updated links to `Adt`, `pat_ty` and `Tykind` in the "Type Checking" chapter of the book. ### Notes: - For discussion about the whole project, please use the tracking issue for the project rust-lang#10597 (It also contains a timeline, discussions, and more information). changelog: Fix broken links in "Type Checking" chapter of the book
Configuration menu - View commit details
-
Copy full SHA for 28dddc7 - Browse repository at this point
Copy the full SHA 28dddc7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 96b32b1 - Browse repository at this point
Copy the full SHA 96b32b1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2e95a4f - Browse repository at this point
Copy the full SHA 2e95a4fView commit details -
Auto merge of rust-lang#10802 - flip1995:rustup, r=flip1995
Rustup r? `@ghost` changelog: none
Configuration menu - View commit details
-
Copy full SHA for 435a8ad - Browse repository at this point
Copy the full SHA 435a8adView commit details -
Configuration menu - View commit details
-
Copy full SHA for 12cbb6c - Browse repository at this point
Copy the full SHA 12cbb6cView commit details -
Configuration menu - View commit details
-
Copy full SHA for d780efc - Browse repository at this point
Copy the full SHA d780efcView commit details