-
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
Rollup of 9 pull requests #101246
Rollup of 9 pull requests #101246
Commits on Aug 2, 2022
-
Compare where predicates to trait bounds.
- only compare where predicates to trait bounds when generating where clause specific message to fix rust-lang#9151 - use comparable_trait_ref to account for trait bound generics to fix rust-lang#8757
Configuration menu - View commit details
-
Copy full SHA for 171d082 - Browse repository at this point
Copy the full SHA 171d082View commit details -
Configuration menu - View commit details
-
Copy full SHA for b96842d - Browse repository at this point
Copy the full SHA b96842dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3ddc04f - Browse repository at this point
Copy the full SHA 3ddc04fView commit details
Commits on Aug 3, 2022
-
Don't lint
transmute_undefined_repr
when the the first field of a `……repr(C)` type is compatible with the other type
Configuration menu - View commit details
-
Copy full SHA for b426bd5 - Browse repository at this point
Copy the full SHA b426bd5View commit details
Commits on Aug 4, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 80f0f28 - Browse repository at this point
Copy the full SHA 80f0f28View commit details
Commits on Aug 7, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 99e77d0 - Browse repository at this point
Copy the full SHA 99e77d0View commit details
Commits on Aug 8, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 73cd954 - Browse repository at this point
Copy the full SHA 73cd954View commit details -
Configuration menu - View commit details
-
Copy full SHA for 332e031 - Browse repository at this point
Copy the full SHA 332e031View commit details -
Move iter_once and iter_empty to methods as a late pass
This enables more thorough checking of types to avoid triggering on custom Some and None enum variants
Configuration menu - View commit details
-
Copy full SHA for f3f86d8 - Browse repository at this point
Copy the full SHA f3f86d8View commit details -
Configuration menu - View commit details
-
Copy full SHA for f30d7c2 - Browse repository at this point
Copy the full SHA f30d7c2View commit details -
Configuration menu - View commit details
-
Copy full SHA for b247594 - Browse repository at this point
Copy the full SHA b247594View commit details -
Configuration menu - View commit details
-
Copy full SHA for af4885c - Browse repository at this point
Copy the full SHA af4885cView commit details
Commits on Aug 9, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 9ffddf5 - Browse repository at this point
Copy the full SHA 9ffddf5View commit details
Commits on Aug 10, 2022
-
Configuration menu - View commit details
-
Copy full SHA for cf3f71d - Browse repository at this point
Copy the full SHA cf3f71dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6a73a45 - Browse repository at this point
Copy the full SHA 6a73a45View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0428f0d - Browse repository at this point
Copy the full SHA 0428f0dView commit details
Commits on Aug 11, 2022
-
Simplify
rustc_ast::visit::Visitor::visit_poly_trait_ref
.It is passed an argument that is never used.
Configuration menu - View commit details
-
Copy full SHA for eb68895 - Browse repository at this point
Copy the full SHA eb68895View commit details -
Configuration menu - View commit details
-
Copy full SHA for 459821b - Browse repository at this point
Copy the full SHA 459821bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 45084ee - Browse repository at this point
Copy the full SHA 45084eeView commit details -
Configuration menu - View commit details
-
Copy full SHA for dc29cfb - Browse repository at this point
Copy the full SHA dc29cfbView commit details -
Rollup merge of rust-lang#100392 - nnethercote:simplify-visitors, r=c…
…jgillot Simplify visitors By removing some unused arguments. r? `@cjgillot`
Configuration menu - View commit details
-
Copy full SHA for 4d8b6d4 - Browse repository at this point
Copy the full SHA 4d8b6d4View commit details
Commits on Aug 12, 2022
-
Auto merge of rust-lang#100419 - flip1995:clippyup, r=Manishearth
Update Clippy r? `@Manishearth`
Configuration menu - View commit details
-
Copy full SHA for 9ac237d - Browse repository at this point
Copy the full SHA 9ac237dView commit details -
Configuration menu - View commit details
-
Copy full SHA for f7f60b8 - Browse repository at this point
Copy the full SHA f7f60b8View commit details -
Lint trait duplication in one pass.
Allen Hsu committedAug 12, 2022 Configuration menu - View commit details
-
Copy full SHA for 8bae517 - Browse repository at this point
Copy the full SHA 8bae517View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3c4aec5 - Browse repository at this point
Copy the full SHA 3c4aec5View commit details -
Auto merge of rust-lang#9289 - mkrasnitski:9094, r=xFrednet
Extend `if_then_some_else_none` to also suggest `bool::then_some` Closes rust-lang#9094. changelog: Extend `if_then_some_else_none` to also suggest `bool::then_some`
Configuration menu - View commit details
-
Copy full SHA for 05fc1c7 - Browse repository at this point
Copy the full SHA 05fc1c7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1a3192a - Browse repository at this point
Copy the full SHA 1a3192aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 35486cb - Browse repository at this point
Copy the full SHA 35486cbView commit details -
Auto merge of rust-lang#9324 - flip1995:changelog, r=xFrednet
1.63 Changelog r? `@xFrednet` changelog: none [Rendered](https://github.com/flip1995/rust-clippy/blob/changelog/CHANGELOG.md)
Configuration menu - View commit details
-
Copy full SHA for dfa780e - Browse repository at this point
Copy the full SHA dfa780eView commit details -
Configuration menu - View commit details
-
Copy full SHA for f18cd27 - Browse repository at this point
Copy the full SHA f18cd27View commit details
Commits on Aug 13, 2022
-
Auto merge of rust-lang#9326 - flip1995:version-update, r=xFrednet
Update lint versions for 1.63 release r? `@xFrednet` changelog: none
Configuration menu - View commit details
-
Copy full SHA for 4d5d191 - Browse repository at this point
Copy the full SHA 4d5d191View commit details
Commits on Aug 14, 2022
-
Auto merge of rust-lang#9167 - aldhsu:fix-trait-duplication-false-pos…
…, r=flip1995 Fixes [`trait_duplication_in_bounds`] false positives Fixes rust-lang#9076 rust-lang#9151 rust-lang#8757. Partially fixes rust-lang#8771. changelog: [`trait_duplication_in_bounds`]: Reduce number of false positives.
Configuration menu - View commit details
-
Copy full SHA for 84df61c - Browse repository at this point
Copy the full SHA 84df61cView commit details -
Auto merge of rust-lang#9187 - sgued:iter-once, r=flip1995
Add lint recommending using `std::iter::once` and `std::iter::empty` ``` changelog: [`iter_once`]: add new lint changelog: [`iter_empty`]: add new lint ``` fixes rust-lang#9186 - \[ ] Followed [lint naming conventions][lint_naming] - \[x] Added passing UI tests (including committed `.stderr` file) - \[x] `cargo test` passes locally - \[x] Executed `cargo dev update_lints` - \[x] Added lint documentation - \[x] Run `cargo dev fmt` [lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints The lint doesn't really follow the naming conventions. I don't have any better idea so I'm open to suggestions.
Configuration menu - View commit details
-
Copy full SHA for 679fa9f - Browse repository at this point
Copy the full SHA 679fa9fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 80826c3 - Browse repository at this point
Copy the full SHA 80826c3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1bf8841 - Browse repository at this point
Copy the full SHA 1bf8841View commit details -
Skip
unnecessary_to_owned
whent != t.to_string()
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 1a2aaf6 - Browse repository at this point
Copy the full SHA 1a2aaf6View commit details
Commits on Aug 15, 2022
-
Auto merge of rust-lang#96745 - ehuss:even-more-attribute-validation,…
… r=cjgillot Visit attributes in more places. This adds 3 loosely related changes (I can split PRs if desired): - Attribute checking on pattern struct fields. - Attribute checking on struct expression fields. - Lint level visiting on pattern struct fields, struct expression fields, and generic parameters. There are still some lints which ignore lint levels in various positions. This is a consequence of how the lints themselves are implemented. For example, lint levels on associated consts don't work with `unused_braces`.
Configuration menu - View commit details
-
Copy full SHA for 86a0a18 - Browse repository at this point
Copy the full SHA 86a0a18View commit details -
Auto merge of rust-lang#9329 - xphoniex:fix-rust-lang#9317, r=flip1995
Skip `unnecessary_to_owned` when `t != t.to_string()` Fixes rust-lang#9317 changelog: [`unnecessary_to_owned`]: none
Configuration menu - View commit details
-
Copy full SHA for 8c9040c - Browse repository at this point
Copy the full SHA 8c9040cView commit details -
Fix label not starting with lcase-letter
Co-authored-by: Fridtjof Stoldt <xFrednet@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 6de4bdf - Browse repository at this point
Copy the full SHA 6de4bdfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7727c30 - Browse repository at this point
Copy the full SHA 7727c30View commit details -
Auto merge of rust-lang#9318 - lukaslueg:ifletmutexref, r=xFrednet
Fix if_let_mutex not checking Mutexes behind refs Fixes rust-lang#9193 We can always peel references because we are looking for a method-call, for which autoderef applies. --- changelog: [`if_let_mutex`]: detect calls to `Mutex::lock()` if mutex is behind a ref changelog: [`if_let_mutex`]: Add labels to the two instances of the same Mutex that will deadlock
Configuration menu - View commit details
-
Copy full SHA for 0fc95e8 - Browse repository at this point
Copy the full SHA 0fc95e8View commit details
Commits on Aug 16, 2022
-
Auto merge of rust-lang#9328 - stanislav-tkach:borrow_deref_ref-remov…
…e-extra-deref-from-example, r=giraffate Remove extra dereference from the borrow_deref_ref lint example I don't think such minor change should be mentioned in the changelog. changelog: none
Configuration menu - View commit details
-
Copy full SHA for a427b12 - Browse repository at this point
Copy the full SHA a427b12View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6e5f90a - Browse repository at this point
Copy the full SHA 6e5f90aView commit details -
Rename some things related to literals.
- Rename `ast::Lit::token` as `ast::Lit::token_lit`, because its type is `token::Lit`, which is not a token. (This has been confusing me for a long time.) reasonable because we have an `ast::token::Lit` inside an `ast::Lit`. - Rename `LitKind::{from,to}_lit_token` as `LitKind::{from,to}_token_lit`, to match the above change and `token::Lit`.
Configuration menu - View commit details
-
Copy full SHA for e92183c - Browse repository at this point
Copy the full SHA e92183cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e9b3dd - Browse repository at this point
Copy the full SHA 9e9b3ddView commit details -
Auto merge of rust-lang#9040 - miam-miam100:unused_named_parameter, r…
…=dswij Add new lint [`positional_named_format_parameters`] *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: Add new lint [`positional_named_format_parameters`] to warn when named parameters in format strings are used as positional arguments.
Configuration menu - View commit details
-
Copy full SHA for 86ac6e8 - Browse repository at this point
Copy the full SHA 86ac6e8View commit details -
Auto merge of rust-lang#9340 - alex-semenyuk:box_t, r=dswij
Fix example The example didn't show the actual problem [playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=9d0e0727ca5bbd854767f50da693ca0f) changelog: none
Configuration menu - View commit details
-
Copy full SHA for 048e4d0 - Browse repository at this point
Copy the full SHA 048e4d0View commit details -
Configuration menu - View commit details
-
Copy full SHA for c1e0435 - Browse repository at this point
Copy the full SHA c1e0435View commit details -
Configuration menu - View commit details
-
Copy full SHA for bd121ef - Browse repository at this point
Copy the full SHA bd121efView commit details -
suggest map_or in case_sensitive_file_extension_comparisons
Currently, case_sensitive_file_extension_comparisons suggests using `map(..).unwrap_or(..)` which trips up `map_unwrap_or`. This updates the suggestion to use map_or.
Brian Caswell committedAug 16, 2022 Configuration menu - View commit details
-
Copy full SHA for bfeaae8 - Browse repository at this point
Copy the full SHA bfeaae8View commit details -
Auto merge of rust-lang#9327 - Serial-ATA:non_ascii_literal_macro, r=…
…Alexendoo Fix [`non_ascii_literal`] in tests changelog: Don't lint [`non_ascii_literal`] when using non-ascii comments in tests changelog: Don't lint [`non_ascii_literal`] when `allow`ed on tests closes: rust-lang#7739 closes: rust-lang#8263
Configuration menu - View commit details
-
Copy full SHA for f4f5bb4 - Browse repository at this point
Copy the full SHA f4f5bb4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 343476d - Browse repository at this point
Copy the full SHA 343476dView commit details -
Auto merge of rust-lang#9343 - Serial-ATA:compiletest-target-env, r=M…
…anishearth Use `CARGO_TARGET_DIR` in compile-test changelog: none I have a global `CARGO_TARGET_DIR` set, but forgot to delete the old target dir. `compile-test` was getting tripped up on an outdated `rustfix_missing_coverage.txt` I had in there, keeping me from running tests 😄.
Configuration menu - View commit details
-
Copy full SHA for a331766 - Browse repository at this point
Copy the full SHA a331766View commit details -
Configuration menu - View commit details
-
Copy full SHA for a05cb74 - Browse repository at this point
Copy the full SHA a05cb74View commit details -
Configuration menu - View commit details
-
Copy full SHA for 032f112 - Browse repository at this point
Copy the full SHA 032f112View commit details
Commits on Aug 17, 2022
-
Auto merge of rust-lang#9341 - bmc-msft:suggest-map_or-instead-of-unw…
…rap_or, r=giraffate suggest map_or in case_sensitive_file_extension_comparisons changelog: [`case_sensitive_file_extension_comparisons `]: updated suggestion in the example to use `map_or` Currently, case_sensitive_file_extension_comparisons suggests using `map(..).unwrap_or(..)` which trips up the `map_unwrap_or` lint. This updates the suggestion to use `map_or`.
Configuration menu - View commit details
-
Copy full SHA for 18c6818 - Browse repository at this point
Copy the full SHA 18c6818View commit details -
Configuration menu - View commit details
-
Copy full SHA for 48cb816 - Browse repository at this point
Copy the full SHA 48cb816View commit details -
Configuration menu - View commit details
-
Copy full SHA for aadd014 - Browse repository at this point
Copy the full SHA aadd014View commit details -
Auto merge of rust-lang#9344 - Jarcho:opt_target_dir, r=flip1995
Handle `CARGO_TARGET_DIR` not being set in compile-test changelog: None
Configuration menu - View commit details
-
Copy full SHA for 4235b64 - Browse repository at this point
Copy the full SHA 4235b64View commit details -
Auto merge of rust-lang#9345 - cherryblossom000:patch-1, r=flip1995
Fix typo in as_undescore docs *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 dc497c8 - Browse repository at this point
Copy the full SHA dc497c8View commit details -
Rollup merge of rust-lang#100018 - nnethercote:clean-up-LitKind, r=pe…
…trochenkov Clean up `LitKind` r? ``@petrochenkov``
Configuration menu - View commit details
-
Copy full SHA for 37eeed7 - Browse repository at this point
Copy the full SHA 37eeed7View commit details -
Auto merge of rust-lang#9287 - Jarcho:trans_undefined, r=xFrednet
`transmute_undefined_repr` fix changelog: Don't lint `transmute_undefined_repr` when the the first field of a `repr(C)` type is compatible with the other type
Configuration menu - View commit details
-
Copy full SHA for 84fb7e0 - Browse repository at this point
Copy the full SHA 84fb7e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab91d5a - Browse repository at this point
Copy the full SHA ab91d5aView commit details -
Auto merge of rust-lang#9338 - sgued:9331-unwrap-err-used, r=giraffate
unwrap_used and expect_used: trigger on uses of their _err variants changelog: [`unwrap_used`]: lint uses of `unwrap_err` changelog: [`expect_used`]: lint uses of `expect_err` fixes rust-lang#9331
Configuration menu - View commit details
-
Copy full SHA for 849c1c0 - Browse repository at this point
Copy the full SHA 849c1c0View commit details
Commits on Aug 18, 2022
-
Auto merge of rust-lang#9136 - smoelius:enhance-needless-borrow, r=Ja…
…rcho Enhance `needless_borrow` to consider trait implementations The proposed enhancement causes `needless_borrow` to suggest removing `&` from `&e` when `&e` is an argument position requiring trait implementations, and `e` implements the required traits. Example: ``` error: the borrowed expression implements the required traits --> $DIR/needless_borrow.rs:131:51 | LL | let _ = std::process::Command::new("ls").args(&["-a", "-l"]).status().unwrap(); | ^^^^^^^^^^^^^ help: change this to: `["-a", "-l"]` ``` r? `@Jarcho` changelog: Enhance `needless_borrow` to consider trait implementations
Configuration menu - View commit details
-
Copy full SHA for c419d0a - Browse repository at this point
Copy the full SHA c419d0aView commit details -
Dont lint on match pattern-binding
Fixes rust-lang#9347 Technically it is possible to have a blank match-pattern that does nothing, and we fail to lint. But its easier to be safe than sorry here.
Configuration menu - View commit details
-
Copy full SHA for e87a5a1 - Browse repository at this point
Copy the full SHA e87a5a1View commit details -
Auto merge of rust-lang#9348 - lukaslueg:issue9347, r=Alexendoo
Don't lint on match pattern-binding in ´question_mark` Fixes rust-lang#9347 Technically it is possible to have a blank match-pattern that does nothing, and we fail to lint. But it's easier to be safe than sorry here. changelog: [`question_mark`]: don't lint `if let`s with subpatterns
Configuration menu - View commit details
-
Copy full SHA for eeaaba3 - Browse repository at this point
Copy the full SHA eeaaba3View commit details
Commits on Aug 19, 2022
-
Auto merge of rust-lang#9295 - Guilherme-Vasconcelos:manual-empty-str…
…ing-creation, r=dswij Add `manual_empty_string_creations` lint Closes rust-lang#2972 - [x] Followed [lint naming conventions][lint_naming] - [x] Added passing UI tests (including committed `.stderr` file) - [x] `cargo test` passes locally - [x] Executed `cargo dev update_lints` - [x] Added lint documentation - [x] Run `cargo dev fmt` changelog: [`manual_empty_string_creations`]: Add lint for empty String not being created with `String::new()`
Configuration menu - View commit details
-
Copy full SHA for 868dba9 - Browse repository at this point
Copy the full SHA 868dba9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2666c38 - Browse repository at this point
Copy the full SHA 2666c38View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0efafa4 - Browse repository at this point
Copy the full SHA 0efafa4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8ab2f88 - Browse repository at this point
Copy the full SHA 8ab2f88View commit details -
Configuration menu - View commit details
-
Copy full SHA for 21f5954 - Browse repository at this point
Copy the full SHA 21f5954View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2502898 - Browse repository at this point
Copy the full SHA 2502898View commit details -
Configuration menu - View commit details
-
Copy full SHA for ba6a459 - Browse repository at this point
Copy the full SHA ba6a459View commit details -
Configuration menu - View commit details
-
Copy full SHA for e3b7797 - Browse repository at this point
Copy the full SHA e3b7797View commit details -
Configuration menu - View commit details
-
Copy full SHA for a8d80d5 - Browse repository at this point
Copy the full SHA a8d80d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5bc8813 - Browse repository at this point
Copy the full SHA 5bc8813View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4523954 - Browse repository at this point
Copy the full SHA 4523954View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2f0ed0a - Browse repository at this point
Copy the full SHA 2f0ed0aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 508cf6b - Browse repository at this point
Copy the full SHA 508cf6bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0cc01ce - Browse repository at this point
Copy the full SHA 0cc01ceView commit details -
Configuration menu - View commit details
-
Copy full SHA for 226f135 - Browse repository at this point
Copy the full SHA 226f135View commit details -
Configuration menu - View commit details
-
Copy full SHA for fd53761 - Browse repository at this point
Copy the full SHA fd53761View commit details -
Configuration menu - View commit details
-
Copy full SHA for 06d752e - Browse repository at this point
Copy the full SHA 06d752eView commit details -
Configuration menu - View commit details
-
Copy full SHA for e834855 - Browse repository at this point
Copy the full SHA e834855View commit details -
Configuration menu - View commit details
-
Copy full SHA for e213b6e - Browse repository at this point
Copy the full SHA e213b6eView commit details -
Configuration menu - View commit details
-
Copy full SHA for bb0584d - Browse repository at this point
Copy the full SHA bb0584dView commit details -
Configuration menu - View commit details
-
Copy full SHA for d8d4a13 - Browse repository at this point
Copy the full SHA d8d4a13View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8acc4d2 - Browse repository at this point
Copy the full SHA 8acc4d2View commit details -
Configuration menu - View commit details
-
Copy full SHA for d8808db - Browse repository at this point
Copy the full SHA d8808dbView commit details -
Auto merge of rust-lang#8957 - Jarcho:more_pass_merges, r=flip1995
More lint pass merges changelog: None
Configuration menu - View commit details
-
Copy full SHA for 477c16d - Browse repository at this point
Copy the full SHA 477c16dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4f049f5 - Browse repository at this point
Copy the full SHA 4f049f5View commit details -
Configuration menu - View commit details
-
Copy full SHA for d95b675 - Browse repository at this point
Copy the full SHA d95b675View commit details -
Configuration menu - View commit details
-
Copy full SHA for 39f4bee - Browse repository at this point
Copy the full SHA 39f4beeView commit details -
Auto merge of rust-lang#9349 - Alexendoo:format-args-expn, r=flip1995
Refactor `FormatArgsExpn` It now for each format argument `{..}` has: - The `Expr` it points to, and how it does so (named/named inline/numbered/implicit) - The parsed `FormatSpec` (format trait/fill/align/etc., the precision/width and any value they point to) - Many spans The caller no longer needs to pair up arguments to their value, or separately interpret the `specs` `Expr`s when it isn't `None` The gist is that it combines the result of [`rustc_parse_format::Parser`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse_format/struct.Parser.html) with the macro expansion itself This unfortunately makes the code a bit longer, however we need to use both as neither have all the information we're after. `rustc_parse_format` doesn't have the information to resolve named arguments to their values. The macro expansion doesn't contain whether the positions are implicit/numbered/named, or the spans for format arguments Wanted by rust-lang#9233 and rust-lang#8518 to be able to port the changes from rust-lang#9040 Also fixes rust-lang#8643, previously the format args seem to have been paired up with the wrong values somehow changelog: [`format_in_format_args`]: Fix false positive due to misattributed arguments r? `@flip1995` cc `@nyurik`
Configuration menu - View commit details
-
Copy full SHA for 3e594de - Browse repository at this point
Copy the full SHA 3e594deView commit details -
Auto merge of rust-lang#8804 - Jarcho:in_recursion, r=Alexendoo
Rework `only_used_in_recursion` fixes rust-lang#8782 fixes rust-lang#8629 fixes rust-lang#8560 fixes rust-lang#8556 This is a complete rewrite of the lint. This loses some capabilities of the old implementation. Namely the ability to track through tuple and slice patterns, as well as the ability to trace through assignments. The two reported bugs are fixed with this. One was caused by using the name of the method rather than resolving to the `DefId` of the called method. The second was cause by using the existence of a cycle in the dependency graph to determine whether the parameter was used in recursion even though there were other ways to create a cycle in the graph. Implementation wise this switches from using a visitor to walking up the tree from every use of each parameter until it has been determined the parameter is used for something other than recursion. This is likely to perform better as it avoids walking the entire function a second time, and it is unlikely to walk up the HIR tree very much. Some cases would perform worse though. cc `@buttercrab` changelog: Scale back `only_used_in_recursion` to fix false positives changelog: Move `only_used_in_recursion` back to `complexity`
Configuration menu - View commit details
-
Copy full SHA for 3a54117 - Browse repository at this point
Copy the full SHA 3a54117View commit details -
Configuration menu - View commit details
-
Copy full SHA for a4413f7 - Browse repository at this point
Copy the full SHA a4413f7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 89698b9 - Browse repository at this point
Copy the full SHA 89698b9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6e86687 - Browse repository at this point
Copy the full SHA 6e86687View commit details -
Configuration menu - View commit details
-
Copy full SHA for a9bd0bd - Browse repository at this point
Copy the full SHA a9bd0bdView commit details -
Configuration menu - View commit details
-
Copy full SHA for c989746 - Browse repository at this point
Copy the full SHA c989746View commit details -
Configuration menu - View commit details
-
Copy full SHA for fb30b64 - Browse repository at this point
Copy the full SHA fb30b64View commit details -
Auto merge of rust-lang#9258 - Serial-ATA:unused-peekable, r=Alexendoo
Add [`unused_peekable`] lint changelog: Add [`unused_peekable`] lint closes: rust-lang#854
Configuration menu - View commit details
-
Copy full SHA for 2091142 - Browse repository at this point
Copy the full SHA 2091142View commit details
Commits on Aug 20, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 2781ad0 - Browse repository at this point
Copy the full SHA 2781ad0View commit details -
Configuration menu - View commit details
-
Copy full SHA for b070b40 - Browse repository at this point
Copy the full SHA b070b40View commit details -
Auto merge of rust-lang#9355 - alex-semenyuk:fixed_typos, r=giraffate
Fix typos changelog: none
Configuration menu - View commit details
-
Copy full SHA for 0dfec01 - Browse repository at this point
Copy the full SHA 0dfec01View commit details -
Auto merge of rust-lang#9269 - nahuakang:collapsible_str_replace, r=f…
…lip1995 Lint `collapsible_str_replace` fixes rust-lang#6651 ``` changelog: [`collapsible_str_replace`]: create new lint `collapsible_str_replace` ``` If you added a new lint, here's a checklist for things that will be checked during review or continuous integration. - \[x] Followed [lint naming conventions][lint_naming] - \[x] Added passing UI tests (including committed `.stderr` file) - \[x] `cargo test` passes locally - \[ ] Executed `cargo dev update_lints` - \[x] Added lint documentation - \[x] Run `cargo dev fmt`
Configuration menu - View commit details
-
Copy full SHA for 5820add - Browse repository at this point
Copy the full SHA 5820addView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6f3d398 - Browse repository at this point
Copy the full SHA 6f3d398View commit details -
Auto merge of rust-lang#8857 - smoelius:fix-8855, r=flip1995
Add test for rust-lang#8855 Fix rust-lang#8855 Here is what I think is going on. First, the expression `format!("{:>6} {:>6}", a, b.to_string())` expands to: ```rust { let res = ::alloc::fmt::format(::core::fmt::Arguments::new_v1_formatted(&["", " "], &[::core::fmt::ArgumentV1::new_display(&a), ::core::fmt::ArgumentV1::new_display(&b.to_string())], &[::core::fmt::rt::v1::Argument { position: 0usize, format: ::core::fmt::rt::v1::FormatSpec { fill: ' ', align: ::core::fmt::rt::v1::Alignment::Right, flags: 0u32, precision: ::core::fmt::rt::v1::Count::Implied, width: ::core::fmt::rt::v1::Count::Is(6usize), }, }, ::core::fmt::rt::v1::Argument { position: 1usize, format: ::core::fmt::rt::v1::FormatSpec { fill: ' ', align: ::core::fmt::rt::v1::Alignment::Right, flags: 0u32, precision: ::core::fmt::rt::v1::Count::Implied, width: ::core::fmt::rt::v1::Count::Is(6usize), }, }], unsafe { ::core::fmt::UnsafeArg::new() })); res } ``` When I dump the expressions that get past the call to `has_string_formatting` [here](https://github.com/rust-lang/rust-clippy/blob/b312ad7d0cf0f30be2bd4658b71a3520a2e76709/clippy_lints/src/format_args.rs#L83), I see more than I would expect. In particular, I see this subexpression of the above: ``` &[::core::fmt::ArgumentV1::new_display(&a), ::core::fmt::ArgumentV1::new_display(&b.to_string())], ``` This suggests to me that more expressions are getting past [this call](https://github.com/rust-lang/rust-clippy/blob/b312ad7d0cf0f30be2bd4658b71a3520a2e76709/clippy_lints/src/format_args.rs#L71) to `FormatArgsExpn::parse` than should. Those expressions are then visited, but no `::core::fmt::rt::v1::Argument`s are found and pushed [here](https://github.com/rust-lang/rust-clippy/blob/b312ad7d0cf0f30be2bd4658b71a3520a2e76709/clippy_utils/src/macros.rs#L407). As a result, the expressions appear unformatted, hence, the false positive. My proposed fix is to restrict `FormatArgsExpn::parse` so that it only matches `Call` expressions. cc: `@akanalytics` changelog: none
Configuration menu - View commit details
-
Copy full SHA for 41309df - Browse repository at this point
Copy the full SHA 41309dfView commit details
Commits on Aug 21, 2022
-
Configuration menu - View commit details
-
Copy full SHA for bafa89b - Browse repository at this point
Copy the full SHA bafa89bView commit details -
allow check for
match
in lint [option_if_let_else
]and add test case for `Result`
Configuration menu - View commit details
-
Copy full SHA for 5d403c0 - Browse repository at this point
Copy the full SHA 5d403c0View commit details -
Configuration menu - View commit details
-
Copy full SHA for ffe7125 - Browse repository at this point
Copy the full SHA ffe7125View commit details -
Configuration menu - View commit details
-
Copy full SHA for f7a376e - Browse repository at this point
Copy the full SHA f7a376eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f75845 - Browse repository at this point
Copy the full SHA 1f75845View commit details -
Auto merge of rust-lang#8696 - J-ZhengLi:issue8492, r=flip1995
check for if-some-or-ok-else-none-or-err fixes: rust-lang#8492 --- changelog: make [`option_if_let_else`] to check for match expression with both Option and Result; **TODO: Change lint name? Add new lint with similar functionality?**
Configuration menu - View commit details
-
Copy full SHA for 87b3afc - Browse repository at this point
Copy the full SHA 87b3afcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5048af7 - Browse repository at this point
Copy the full SHA 5048af7View commit details -
Only check for the kind of loop once instead of re-desugaring it.
Configuration menu - View commit details
-
Copy full SHA for 318ed05 - Browse repository at this point
Copy the full SHA 318ed05View commit details -
Configuration menu - View commit details
-
Copy full SHA for 070b035 - Browse repository at this point
Copy the full SHA 070b035View commit details -
Auto merge of rust-lang#8992 - kyoto7250:fix_8753, r=flip1995
feat(fix): Do not lint if the target code is inside a loop close rust-lang#8753 we consider the following code. ```rust fn main() { let vec = vec![1]; let w: Vec<usize> = vec.iter().map(|i| i * i).collect(); // <- once. for i in 0..2 { let _ = w.contains(&i); } } ``` and the clippy will issue the following warning. ```rust warning: avoid using `collect()` when not needed --> src/main.rs:3:51 | 3 | let w: Vec<usize> = vec.iter().map(|i| i * i).collect(); | ^^^^^^^ ... 6 | let _ = w.contains(&i); | -------------- the iterator could be used here instead | = note: `#[warn(clippy::needless_collect)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_collect help: check if the original Iterator contains an element instead of collecting then checking | 3 ~ 4 | 5 | for i in 0..2 { 6 ~ let _ = vec.iter().map(|i| i * i).any(|x| x == i); ``` Rewrite the code as indicated. ```rust fn main() { let vec = vec![1]; for i in 0..2 { let _ = vec.iter().map(|i| i * i).any(|x| x == i); // <- execute `map` every loop. } } ``` this code is valid in the compiler, but, it is different from the code before the rewrite. So, we should not lint, If `collect` is outside of a loop. Thank you in advance. --- changelog: Do not lint if the target code is inside a loop in `needless_collect`
Configuration menu - View commit details
-
Copy full SHA for e19a05c - Browse repository at this point
Copy the full SHA e19a05cView commit details -
Auto merge of rust-lang#9092 - tamaroning:fix-needless-match, r=llogiq
Fix false positives of needless_match closes: rust-lang#9084 made needless_match take into account arm in the form of `_ if => ...` changelog: none
Configuration menu - View commit details
-
Copy full SHA for cc637ba - Browse repository at this point
Copy the full SHA cc637baView commit details -
Configuration menu - View commit details
-
Copy full SHA for 687fcf1 - Browse repository at this point
Copy the full SHA 687fcf1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0bc26c8 - Browse repository at this point
Copy the full SHA 0bc26c8View commit details
Commits on Aug 22, 2022
-
Auto merge of rust-lang#9259 - smoelius:fix-9256, r=llogiq
Fix `to_string_in_format_args` false positive Fix rust-lang#9256 changelog: none
Configuration menu - View commit details
-
Copy full SHA for 5735a3b - Browse repository at this point
Copy the full SHA 5735a3bView commit details
Commits on Aug 23, 2022
-
Remove the symbol from
ast::LitKind::Err
.Because it's never used meaningfully.
Configuration menu - View commit details
-
Copy full SHA for 06d7119 - Browse repository at this point
Copy the full SHA 06d7119View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2cb5318 - Browse repository at this point
Copy the full SHA 2cb5318View commit details -
Auto merge of rust-lang#9366 - Alexendoo:manual_string_new, r=xFrednet
Rename `manual_empty_string_creation` and move to pedantic Renames it to `manual_string_new` and moves it to the pedantic category Pedantic because it's a fairly minor style change but could be very noisy changelog: *doesn't need its own entry, but remember to s/manual_empty_string_creation/manual_string_new/ the changelog entry for rust-lang#9295* r? `@xFrednet` to get it in before the upcoming sync as this isn't a `cargo dev rename_lint` style rename
Configuration menu - View commit details
-
Copy full SHA for b33002d - Browse repository at this point
Copy the full SHA b33002dView commit details
Commits on Aug 24, 2022
-
Stabilize
#![feature(label_break_value)]
# Stabilization proposal The feature was implemented in rust-lang#50045 by est31 and has been in nightly since 2018-05-16 (over 4 years now). There are [no open issues][issue-label] other than the tracking issue. There is a strong consensus that `break` is the right keyword and we should not use `return`. There have been several concerns raised about this feature on the tracking issue (other than the one about tests, which has been fixed, and an interaction with try blocks, which has been fixed). 1. nrc's original comment about cost-benefit analysis: rust-lang#48594 (comment) 2. joshtriplett's comments about seeing use cases: rust-lang#48594 (comment) 3. withoutboats's comments that Rust does not need more control flow constructs: rust-lang#48594 (comment) Many different examples of code that's simpler using this feature have been provided: - A lexer by rpjohnst which must repeat code without label-break-value: rust-lang#48594 (comment) - A snippet by SergioBenitez which avoids using a new function and adding several new return points to a function: rust-lang#48594 (comment). This particular case would also work if `try` blocks were stabilized (at the cost of making the code harder to optimize). - Several examples by JohnBSmith: rust-lang#48594 (comment) - Several examples by Centril: rust-lang#48594 (comment) - An example by petrochenkov where this is used in the compiler itself to avoid duplicating error checking code: rust-lang#48594 (comment) - Amanieu recently provided another example related to complex conditions, where try blocks would not have helped: rust-lang#48594 (comment) Additionally, petrochenkov notes that this is strictly more powerful than labelled loops due to macros which accidentally exit a loop instead of being consumed by the macro matchers: rust-lang#48594 (comment) nrc later resolved their concern, mostly because of the aforementioned macro problems. joshtriplett suggested that macros could be able to generate IR directly (rust-lang#48594 (comment)) but there are no open RFCs, and the design space seems rather speculative. joshtriplett later resolved his concerns, due to a symmetry between this feature and existing labelled break: rust-lang#48594 (comment) withoutboats has regrettably left the language team. joshtriplett later posted that the lang team would consider starting an FCP given a stabilization report: rust-lang#48594 (comment) [issue-label]: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+label%3AF-label_break_value+ ## Report + Feature gate: - https://github.com/rust-lang/rust/blob/d695a497bbf4b20d2580b75075faa80230d41667/src/test/ui/feature-gates/feature-gate-label_break_value.rs + Diagnostics: - https://github.com/rust-lang/rust/blob/6b2d3d5f3cd1e553d87b5496632132565b6779d3/compiler/rustc_parse/src/parser/diagnostics.rs#L2629 - https://github.com/rust-lang/rust/blob/f65bf0b2bb1a99f73095c01a118f3c37d3ee614c/compiler/rustc_resolve/src/diagnostics.rs#L749 - https://github.com/rust-lang/rust/blob/f65bf0b2bb1a99f73095c01a118f3c37d3ee614c/compiler/rustc_resolve/src/diagnostics.rs#L1001 - https://github.com/rust-lang/rust/blob/111df9e6eda1d752233482c1309d00d20a4bbf98/compiler/rustc_passes/src/loops.rs#L254 - https://github.com/rust-lang/rust/blob/d695a497bbf4b20d2580b75075faa80230d41667/compiler/rustc_parse/src/parser/expr.rs#L2079 - https://github.com/rust-lang/rust/blob/d695a497bbf4b20d2580b75075faa80230d41667/compiler/rustc_parse/src/parser/expr.rs#L1569 + Tests: - https://github.com/rust-lang/rust/blob/master/src/test/ui/label/label_break_value_continue.rs - https://github.com/rust-lang/rust/blob/master/src/test/ui/label/label_break_value_unlabeled_break.rs - https://github.com/rust-lang/rust/blob/master/src/test/ui/label/label_break_value_illegal_uses.rs - https://github.com/rust-lang/rust/blob/master/src/test/ui/lint/unused_labels.rs - https://github.com/rust-lang/rust/blob/master/src/test/ui/run-pass/for-loop-while/label_break_value.rs ## Interactions with other features Labels follow the hygiene of local variables. label-break-value is permitted within `try` blocks: ```rust let _: Result<(), ()> = try { 'foo: { Err(())?; break 'foo; } }; ``` label-break-value is disallowed within closures, generators, and async blocks: ```rust 'a: { || break 'a //~^ ERROR use of unreachable label `'a` //~| ERROR `break` inside of a closure } ``` label-break-value is disallowed on [_BlockExpression_]; it can only occur as a [_LoopExpression_]: ```rust fn labeled_match() { match false 'b: { //~ ERROR block label not supported here _ => {} } } macro_rules! m { ($b:block) => { 'lab: $b; //~ ERROR cannot use a `block` macro fragment here unsafe $b; //~ ERROR cannot use a `block` macro fragment here |x: u8| -> () $b; //~ ERROR cannot use a `block` macro fragment here } } fn foo() { m!({}); } ``` [_BlockExpression_]: https://doc.rust-lang.org/nightly/reference/expressions/block-expr.html [_LoopExpression_]: https://doc.rust-lang.org/nightly/reference/expressions/loop-expr.html
Configuration menu - View commit details
-
Copy full SHA for 345c42a - Browse repository at this point
Copy the full SHA 345c42aView commit details -
Replace
contains_ty(..)
withTy::contains(..)
This removes some code we don't need and the method syntax is also more readable IMO.
Michael Wright committedAug 24, 2022 Configuration menu - View commit details
-
Copy full SHA for a0afbdf - Browse repository at this point
Copy the full SHA a0afbdfView commit details -
Auto merge of rust-lang#9370 - mikerite:20220824_ty_contains, r=Jarcho
Replace `contains_ty(..)` with `Ty::contains(..)` This removes some code we don't need and the method syntax is also more readable IMO. changelog: none
Configuration menu - View commit details
-
Copy full SHA for 79a439a - Browse repository at this point
Copy the full SHA 79a439aView commit details -
Rollup merge of rust-lang#99332 - jyn514:stabilize-label-break-value,…
… r=petrochenkov Stabilize `#![feature(label_break_value)]` See the stabilization report in rust-lang#48594 (comment).
Configuration menu - View commit details
-
Copy full SHA for 2cdc54d - Browse repository at this point
Copy the full SHA 2cdc54dView commit details
Commits on Aug 25, 2022
-
uninit_vec: Vec::spare_capacity_mut is stable
Quick documentation fix: `Vec::spare_capacity_mut` no longer needs nightly.
Configuration menu - View commit details
-
Copy full SHA for 61aa4ef - Browse repository at this point
Copy the full SHA 61aa4efView commit details
Commits on Aug 26, 2022
-
Configuration menu - View commit details
-
Copy full SHA for fb7dffe - Browse repository at this point
Copy the full SHA fb7dffeView commit details -
Auto merge of rust-lang#9379 - royrustdev:multi_assignments, r=llogiq
new lint This fixes rust-lang#6576 If you added a new lint, here's a checklist for things that will be checked during review or continuous integration. - \[x] Followed [lint naming conventions][lint_naming] - \[x] Added passing UI tests (including committed `.stderr` file) - \[x] `cargo test` passes locally - \[x] Executed `cargo dev update_lints` - \[x] Added lint documentation - \[x] Run `cargo dev fmt` --- changelog: add [`multi_assignments`] lint
Configuration menu - View commit details
-
Copy full SHA for 21f103a - Browse repository at this point
Copy the full SHA 21f103aView commit details -
Auto merge of rust-lang#9374 - sk1p:patch-1, r=Jarcho
uninit_vec: Vec::spare_capacity_mut is stable Quick documentation fix: `Vec::spare_capacity_mut` no longer needs nightly. changelog: none
Configuration menu - View commit details
-
Copy full SHA for 602bec2 - Browse repository at this point
Copy the full SHA 602bec2View commit details -
Configuration menu - View commit details
-
Copy full SHA for fe93b8d - Browse repository at this point
Copy the full SHA fe93b8dView commit details
Commits on Aug 27, 2022
-
Implemented suspicious_to_owned lint to check if
to_owned
is called…… on a `Cow`. This is done because `to_owned` is very similarly named to `into_owned`, but the effect of calling those two methods is completely different. This creates confusion (stemming from the ambiguity of the 'owned' term in the context of `Cow`s) and might not be what the writer intended.
Configuration menu - View commit details
-
Copy full SHA for de028e2 - Browse repository at this point
Copy the full SHA de028e2View commit details -
Auto merge of rust-lang#9381 - lukaslueg:issue9361, r=dswij
Don't lint `needless_return` if `return` has attrs Fixes rust-lang#9361 The lint used to have a mechanic to allow `cfg`-attrs on naked `return`-statements. This was well-intentioned, yet we can have any kind of attribute, e.g. `allow`, `expect` or even custom `derive`. So the mechanic was simply removed. We now never lint on a naked `return`-statement that has attributes on it. Turns out that the ui-test had a Catch22 in it: In `check_expect()` the `#[expect(clippy::needless_return)]` is an attribute on the `return` statement that can and will be rustfixed away without side effects. But any other attribute would also have been removed, which is what rust-lang#9361 is about. The test proved the wrong thing. Removed the test, the body is tested elsewhere as well. changelog: Ignore [`needless_return`] on `return`s with attrs
Configuration menu - View commit details
-
Copy full SHA for be8bd60 - Browse repository at this point
Copy the full SHA be8bd60View commit details -
Configuration menu - View commit details
-
Copy full SHA for 90fe3be - Browse repository at this point
Copy the full SHA 90fe3beView commit details -
Configuration menu - View commit details
-
Copy full SHA for 51e9113 - Browse repository at this point
Copy the full SHA 51e9113View commit details -
Configuration menu - View commit details
-
Copy full SHA for b07d72b - Browse repository at this point
Copy the full SHA b07d72bView commit details -
Auto merge of rust-lang#8984 - xanathar:pr/suspicious_to_owned, r=llogiq
Implemented `suspicious_to_owned` lint to check if `to_owned` is called on a `Cow` changelog: Add lint ``[`suspicious_to_owned`]`` ----------------- Hi, posting this unsolicited PR as I've been burned by this issue :) Being unsolicited, feel free to reject it or reassign a different lint level etc. This lint checks whether `to_owned` is called on `Cow<'_, _>`. This is done because `to_owned` is very similarly named to `into_owned`, but the effect of calling those two methods is completely different (one makes the `Cow::Borrowed` into a `Cow::Owned`, the other just clones the `Cow`). If the cow is then passed to code for which the type is not checked (e.g. generics, closures, etc.) it might slip through and if the cow data is coming from an unsafe context there is the potential for accidentally cause undefined behavior. Even if not falling into this painful case, there's really no reason to call `to_owned` on a `Cow` other than confusing people reading the code: either `into_owned` or `clone` should be called. Note that this overlaps perfectly with `implicit_clone` as a warning, but `implicit_clone` is classified pedantic (while the consequences for `Cow` might be of a wider blast radius than just pedantry); given the overlap, I set-up the lint so that if `suspicious_to_owned` triggers `implicit_clone` will not trigger. I'm not 100% sure this is done in the correct way (I tried to copy what other lints were doing) so please provide feedback on it if it isn't. ### Checklist - \[x] Followed [lint naming conventions][lint_naming] - \[x] Added passing UI tests (including committed `.stderr` file) - \[x] `cargo test` passes locally - \[x] Executed `cargo dev update_lints` - \[x] Added lint documentation - \[x] Run `cargo dev fmt`
Configuration menu - View commit details
-
Copy full SHA for 2d4d8e1 - Browse repository at this point
Copy the full SHA 2d4d8e1View commit details
Commits on Aug 28, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 9678751 - Browse repository at this point
Copy the full SHA 9678751View commit details -
Configuration menu - View commit details
-
Copy full SHA for 722d136 - Browse repository at this point
Copy the full SHA 722d136View commit details -
Auto merge of rust-lang#9276 - dswij:9164, r=flip1995
Ignore `match_like_matches_macro` when there is comment Closes rust-lang#9164 changelog: [`match_like_matches_macro`] is ignored when there is some comment inside the match block. Also add `span_contains_comment` util to check if given span contains comments.
Configuration menu - View commit details
-
Copy full SHA for 8d9da4d - Browse repository at this point
Copy the full SHA 8d9da4dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 75ed56f - Browse repository at this point
Copy the full SHA 75ed56fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1529137 - Browse repository at this point
Copy the full SHA 1529137View commit details -
Configuration menu - View commit details
-
Copy full SHA for c542f1f - Browse repository at this point
Copy the full SHA c542f1fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3ad398d - Browse repository at this point
Copy the full SHA 3ad398dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 278b092 - Browse repository at this point
Copy the full SHA 278b092View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9790a32 - Browse repository at this point
Copy the full SHA 9790a32View commit details -
Auto merge of rust-lang#9389 - lukaslueg:penmacro, r=llogiq
Don't lint literal `None` from expansion This addresses rust-lang/rust-clippy#9288 (comment): If the literal `None` is from expansion, we never lint. This is correct because e.g. replacing the call to `option_env!` with whatever that macro expanded to at the time of linting is certainly wrong. changelog: Don't lint [`partialeq_to_none`] for macro-expansions
Configuration menu - View commit details
-
Copy full SHA for 4e31c8c - Browse repository at this point
Copy the full SHA 4e31c8cView commit details -
Configuration menu - View commit details
-
Copy full SHA for e550739 - Browse repository at this point
Copy the full SHA e550739View commit details
Commits on Aug 29, 2022
-
Auto merge of rust-lang#9388 - Jarcho:rustup, r=Jarcho
Rustup Hopefully this is done right. changelog: None
Configuration menu - View commit details
-
Copy full SHA for 28ec27b - Browse repository at this point
Copy the full SHA 28ec27bView commit details -
Auto merge of rust-lang#9385 - rust-lang:unnecessary-cast-remove-pare…
…ns, r=Alexendoo remove parenthesis from `unnecessary_cast` suggestion This fixes rust-lang#9380. --- changelog: none
Configuration menu - View commit details
-
Copy full SHA for 58bbb1a - Browse repository at this point
Copy the full SHA 58bbb1aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 26a6891 - Browse repository at this point
Copy the full SHA 26a6891View commit details -
Configuration menu - View commit details
-
Copy full SHA for c5a8230 - Browse repository at this point
Copy the full SHA c5a8230View commit details -
Configuration menu - View commit details
-
Copy full SHA for 30979bf - Browse repository at this point
Copy the full SHA 30979bfView commit details -
Update clippy_lints/src/casts/mod.rs
Co-authored-by: Alex Macleod <alex@macleod.io>
Configuration menu - View commit details
-
Copy full SHA for cc9f203 - Browse repository at this point
Copy the full SHA cc9f203View commit details -
Auto merge of rust-lang#9247 - clubby789:raw_slice_pointer_cast, r=Al…
…exendoo New lint: Raw slice pointer cast Adds a lint to check for a raw slice being created and cast back to a pointer, suggesting `ptr::slice_from_raw_parts`, to identify UB such as thomcc/rust-typed-arena#54. ``` changelog: [`cast_slice_from_raw_parts`]: Add lint to check for `slice::from_raw_parts(.., ..) as *const _` ```
Configuration menu - View commit details
-
Copy full SHA for e9f7ce1 - Browse repository at this point
Copy the full SHA e9f7ce1View commit details -
Auto merge of rust-lang#9395 - Alexendoo:suspicious-to-owned-test, r=…
…Manishearth Fix `suspicious_to_owned` test when `c_char` is `u8` e.g. on aarch64 linux changelog: none
Configuration menu - View commit details
-
Copy full SHA for e1ecdb6 - Browse repository at this point
Copy the full SHA e1ecdb6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ffc5a5 - Browse repository at this point
Copy the full SHA 9ffc5a5View commit details
Commits on Aug 30, 2022
-
Auto merge of rust-lang#9394 - lukaslueg:issue9391, r=Jarcho
Fix missing parens in `suboptimal_flops` suggestion Fixes rust-lang#9391. The problem is simple enough, I didn't check if the same problem occurs elsewhere, though. changelog: fix missing parenthesis in `suboptimal_flops` suggestion
Configuration menu - View commit details
-
Copy full SHA for 4df6032 - Browse repository at this point
Copy the full SHA 4df6032View commit details -
Configuration menu - View commit details
-
Copy full SHA for 77eb1ae - Browse repository at this point
Copy the full SHA 77eb1aeView commit details -
Fix the order of
trait_duplication_in_bounds
* Emit the lint in source order * Make suggestions with multiple traits be in source order rather than alphabetical
Configuration menu - View commit details
-
Copy full SHA for 19ef04f - Browse repository at this point
Copy the full SHA 19ef04fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 66a9705 - Browse repository at this point
Copy the full SHA 66a9705View commit details -
Auto merge of rust-lang#9373 - lukaslueg:result_large_err, r=Alexendoo
Initial implementation `result_large_err` This is a shot at rust-lang#6560, rust-lang#4652, and rust-lang#3884. The lint checks for `Result` being returned from functions/methods where the `Err` variant is larger than a configurable threshold (the default of which is 128 bytes). There has been some discussion around this, which I'll try to quickly summarize: * A large `Err`-variant may force an equally large `Result` if `Err` is actually bigger than `Ok`. * There is a cost involved in large `Result`, as LLVM may choose to `memcpy` them around above a certain size. * We usually expect the `Err` variant to be seldomly used, but pay the cost every time. * `Result` returned from library code has a high chance of bubbling up the call stack, getting stuffed into `MyLibError { IoError(std::io::Error), ParseError(parselib::Error), ...}`, exacerbating the problem. This PR deliberately does not take into account comparing the `Ok` to the `Err` variant (e.g. a ratio, or one being larger than the other). Rather we choose an absolute threshold for `Err`'s size, above which we warn. The reason for this is that `Err`s probably get `map_err`'ed further up the call stack, and we can't draw conclusions from the ratio at the point where the `Result` is returned. A relative threshold would also be less predictable, while not accounting for the cost of LLVM being forced to generate less efficient code if the `Err`-variant is _large_ in absolute terms. We lint private functions as well as public functions, as the perf-cost applies to in-crate code as well. In order to account for type-parameters, I conjured up `fn approx_ty_size`. The function relies on `LateContext::layout_of` to compute the actual size, and in case of failure (e.g. due to generics) tries to come up with an "at least size". In the latter case, the size of obviously wrong, but the inspected size certainly can't be smaller than that. Please give the approach a heavy dose of review, as I'm not actually familiar with the type-system at all (read: I have no idea what I'm doing). The approach does, however flimsy it is, allow us to successfully lint situations like ```rust pub union UnionError<T: Copy> { _maybe: T, _or_perhaps_even: (T, [u8; 512]), } // We know `UnionError<T>` will be at least 512 bytes, no matter what `T` is pub fn param_large_union<T: Copy>() -> Result<(), UnionError<T>> { Ok(()) } ``` I've given some refactoring to `functions/result_unit_err.rs` to re-use some bits. This is also the groundwork for rust-lang#6409 The default threshold is 128 because of rust-lang/rust-clippy#4652 (comment) `lintcheck` does not trigger this lint for a threshold of 128. It does warn for 64, though. The suggestion currently is the following, which is just a placeholder for discussion to be had. I did have the computed size in a `span_label`. However, that might cause both ui-tests here and lints elsewhere to become flaky wrt to their output (as the size is platform dependent). ``` error: the `Err`-variant returned via this `Result` is very large --> $DIR/result_large_err.rs:36:34 | LL | pub fn param_large_error<R>() -> Result<(), (u128, R, FullyDefinedLargeError)> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The `Err` variant is unusually large, at least 128 bytes ``` changelog: Add [`result_large_err`] lint
Configuration menu - View commit details
-
Copy full SHA for 09e4659 - Browse repository at this point
Copy the full SHA 09e4659View commit details
Commits on Aug 31, 2022
-
Fix uintended diagnostic caused by
drain(..)
Donough Liu authored and bogon-right committedAug 31, 2022 Configuration menu - View commit details
-
Copy full SHA for 3f66efd - Browse repository at this point
Copy the full SHA 3f66efdView commit details -
Auto merge of rust-lang#9397 - Jarcho:trait_dup_order, r=dswij
Fix the emission order of `trait_duplication_in_bounds` Makes the lint emit in source order rather than whatever order the hash map happens to be in. This is currently blocking the sync into rustc. changelog: None
Configuration menu - View commit details
-
Copy full SHA for f51aade - Browse repository at this point
Copy the full SHA f51aadeView commit details -
Link “? operator” to relevant chapter in The Book
Before, the text simply asked people to use a symbol which is hard to search for. Now the text links back to the chapter on error propagation in The Book. That should help people find the relevant keywords for further searches.
Configuration menu - View commit details
-
Copy full SHA for e10ab62 - Browse repository at this point
Copy the full SHA e10ab62View commit details -
This commit removes many cases of MIR opt tests emitting `.diff`s for more than one pass. These tests cannot be `unit-test`s, and so they are easy to break, and they also provide little value due to having excessively strong opinions over *how* a piece of code should be optimized. Where reasonable, we instead add separate test files that only emit the `PreCodegen.after` MIR for code where we want to track what the result of the net result of the optimization pipeline's output is.
Configuration menu - View commit details
-
Copy full SHA for 4a33bf3 - Browse repository at this point
Copy the full SHA 4a33bf3View commit details -
migrate rustc_query_system to use SessionDiagnostic
with manual impl SessionDiagnostic
Configuration menu - View commit details
-
Copy full SHA for b8075e4 - Browse repository at this point
Copy the full SHA b8075e4View commit details -
Co-authored-by: David Wood <agile.lion3441@fuligin.ink>
Configuration menu - View commit details
-
Copy full SHA for d7e07c0 - Browse repository at this point
Copy the full SHA d7e07c0View commit details -
use derive proc macro to impl SessionDiagnostic
fixes `SessionSubdiagnostic` to accept multiple attributes emitting list of fluent message remains unresolved
Configuration menu - View commit details
-
Copy full SHA for ac638c1 - Browse repository at this point
Copy the full SHA ac638c1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 166aef9 - Browse repository at this point
Copy the full SHA 166aef9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7ce59eb - Browse repository at this point
Copy the full SHA 7ce59ebView commit details -
lint: avoid linting diag functions with diag lints
Functions annotated with `#[rustc_lint_diagnostics]` are used by the diagnostic migration lints to know when to lint, but functions that are annotated with this attribute shouldn't themselves be linted. Signed-off-by: David Wood <david.wood@huawei.com>
Configuration menu - View commit details
-
Copy full SHA for 11fc785 - Browse repository at this point
Copy the full SHA 11fc785View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9a67767 - Browse repository at this point
Copy the full SHA 9a67767View commit details -
Configuration menu - View commit details
-
Copy full SHA for cacc7bf - Browse repository at this point
Copy the full SHA cacc7bfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7ed1333 - Browse repository at this point
Copy the full SHA 7ed1333View commit details -
Rollup merge of rust-lang#100787 - chenyukang:fix-100770-pretty-crash…
…, r=petrochenkov Pretty printing give proper error message without panic Fixes rust-lang#100770
Configuration menu - View commit details
-
Copy full SHA for fa49d58 - Browse repository at this point
Copy the full SHA fa49d58View commit details -
Rollup merge of rust-lang#100827 - JakobDegen:better-tests, r=wesleyw…
…iser Simplify MIR opt tests This commit removes many cases of MIR opt tests emitting `.diff`s for more than one pass. These tests cannot be `unit-test`s, and so they are easy to break, and they also provide little value due to having excessively strong opinions over *how* a piece of code should be optimized. Where reasonable, we instead add separate test files that only emit the `PreCodegen.after` MIR for code where we want to track what the end to end effect of the optimization pipeline on the example code is. r? ``@wesleywiser``
Configuration menu - View commit details
-
Copy full SHA for 62b35a7 - Browse repository at this point
Copy the full SHA 62b35a7View commit details -
Rollup merge of rust-lang#100838 - hkmatsumoto:move-gen-args-to-trait…
…-when-appropriate, r=davidtwco Suggest moving redundant generic args of an assoc fn to its trait Closes rust-lang#89064
Configuration menu - View commit details
-
Copy full SHA for 2d7644a - Browse repository at this point
Copy the full SHA 2d7644aView commit details -
Rollup merge of rust-lang#100844 - evopen:migrate-diag, r=davidtwco
migrate rustc_query_system to use SessionDiagnostic issues: * variable list is not supported in fluent * ~~cannot have two sub diagnostic with the same tag (eg. 2 .note or 2 .help)~~ allow multiple tag with SessionSubdiagnostic derive
Configuration menu - View commit details
-
Copy full SHA for c8fede9 - Browse repository at this point
Copy the full SHA c8fede9View commit details -
Rollup merge of rust-lang#101140 - Jarcho:clippyup, r=Jarcho
Update Clippy r? ``@Manishearth``
Configuration menu - View commit details
-
Copy full SHA for 3af942d - Browse repository at this point
Copy the full SHA 3af942dView commit details -
Rollup merge of rust-lang#101161 - ldm0:ldm_fix_diagnostic, r=cjgillot
Fix uintended diagnostic caused by `drain(..)` Calling `drain(..)` makes later `suggestable_variants.is_empty()` always true, which makes the diagnostics unintended.
Configuration menu - View commit details
-
Copy full SHA for 579c050 - Browse repository at this point
Copy the full SHA 579c050View commit details -
Rollup merge of rust-lang#101229 - mgeisler:link-try-operator, r=thomcc
Link “? operator” to relevant chapter in The Book Before, the text simply asked people to use a symbol which is hard to search for. Now the text links back to the chapter on error propagation in The Book. That should help people find the relevant keywords for further searches.
Configuration menu - View commit details
-
Copy full SHA for 99154f5 - Browse repository at this point
Copy the full SHA 99154f5View commit details -
Rollup merge of rust-lang#101230 - davidtwco:translation-internal-lin…
…t-no-self-lint, r=fee1-dead lint: avoid linting diag functions with diag lints Functions annotated with `#[rustc_lint_diagnostics]` are used by the diagnostic migration lints to know when to lint, but functions that are annotated with this attribute shouldn't themselves be linted. cc rust-lang#100717 rust-lang#101041 (comment)
Configuration menu - View commit details
-
Copy full SHA for 2e0b1d8 - Browse repository at this point
Copy the full SHA 2e0b1d8View commit details -
Rollup merge of rust-lang#101240 - JohnTitor:JohnTitor-patch-1, r=ehuss
Fix a typo on `wasm64-unknown-unknown` doc
Configuration menu - View commit details
-
Copy full SHA for d78ae31 - Browse repository at this point
Copy the full SHA d78ae31View commit details