-
Notifications
You must be signed in to change notification settings - Fork 1.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
Rollup of 12 pull requests #5432
Commits on Mar 20, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 5f1bb72 - Browse repository at this point
Copy the full SHA 5f1bb72View commit details -
Configuration menu - View commit details
-
Copy full SHA for b53bcc7 - Browse repository at this point
Copy the full SHA b53bcc7View commit details -
Configuration menu - View commit details
-
Copy full SHA for e91f5b2 - Browse repository at this point
Copy the full SHA e91f5b2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0f9a0f8 - Browse repository at this point
Copy the full SHA 0f9a0f8View commit details -
Configuration menu - View commit details
-
Copy full SHA for b630644 - Browse repository at this point
Copy the full SHA b630644View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0766002 - Browse repository at this point
Copy the full SHA 0766002View commit details -
Configuration menu - View commit details
-
Copy full SHA for 74f5090 - Browse repository at this point
Copy the full SHA 74f5090View commit details -
Configuration menu - View commit details
-
Copy full SHA for bce1293 - Browse repository at this point
Copy the full SHA bce1293View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4165236 - Browse repository at this point
Copy the full SHA 4165236View commit details -
Configuration menu - View commit details
-
Copy full SHA for 517fa65 - Browse repository at this point
Copy the full SHA 517fa65View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1a7bddb - Browse repository at this point
Copy the full SHA 1a7bddbView commit details
Commits on Apr 3, 2020
-
Configuration menu - View commit details
-
Copy full SHA for adcaa1b - Browse repository at this point
Copy the full SHA adcaa1bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 94154ca - Browse repository at this point
Copy the full SHA 94154caView commit details -
Configuration menu - View commit details
-
Copy full SHA for e26ae7a - Browse repository at this point
Copy the full SHA e26ae7aView commit details -
Configuration menu - View commit details
-
Copy full SHA for ffb2e41 - Browse repository at this point
Copy the full SHA ffb2e41View commit details -
Configuration menu - View commit details
-
Copy full SHA for da67982 - Browse repository at this point
Copy the full SHA da67982View commit details -
Configuration menu - View commit details
-
Copy full SHA for 98c30fe - Browse repository at this point
Copy the full SHA 98c30feView commit details -
Configuration menu - View commit details
-
Copy full SHA for a186d9f - Browse repository at this point
Copy the full SHA a186d9fView commit details -
Configuration menu - View commit details
-
Copy full SHA for d89bb50 - Browse repository at this point
Copy the full SHA d89bb50View commit details -
Configuration menu - View commit details
-
Copy full SHA for 045722a - Browse repository at this point
Copy the full SHA 045722aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 30503a9 - Browse repository at this point
Copy the full SHA 30503a9View commit details
Commits on Apr 4, 2020
-
result_map_or_into_option: add lint to catch manually adpating Result…
… -> Option Result<T, E> has an `ok()` method that adapts a Result<T,E> into an Option<T>. It's possible to get around this adapter by writing Result<T,E>.map_or(None, Some). This lint is implemented as a new variant of the existing [`option_map_none` lint](rust-lang#2128)
Configuration menu - View commit details
-
Copy full SHA for 91d8a80 - Browse repository at this point
Copy the full SHA 91d8a80View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2481d3c - Browse repository at this point
Copy the full SHA 2481d3cView commit details -
Configuration menu - View commit details
-
Copy full SHA for fac5a41 - Browse repository at this point
Copy the full SHA fac5a41View commit details -
Configuration menu - View commit details
-
Copy full SHA for be34bc4 - Browse repository at this point
Copy the full SHA be34bc4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 560c8c9 - Browse repository at this point
Copy the full SHA 560c8c9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 91759a7 - Browse repository at this point
Copy the full SHA 91759a7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a29aed - Browse repository at this point
Copy the full SHA 3a29aedView commit details -
Configuration menu - View commit details
-
Copy full SHA for d0738bd - Browse repository at this point
Copy the full SHA d0738bdView commit details -
Configuration menu - View commit details
-
Copy full SHA for fb276dc - Browse repository at this point
Copy the full SHA fb276dcView commit details -
Configuration menu - View commit details
-
Copy full SHA for acc3bc1 - Browse repository at this point
Copy the full SHA acc3bc1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2533f56 - Browse repository at this point
Copy the full SHA 2533f56View commit details -
Configuration menu - View commit details
-
Copy full SHA for fecdb72 - Browse repository at this point
Copy the full SHA fecdb72View commit details -
Configuration menu - View commit details
-
Copy full SHA for 325d0b6 - Browse repository at this point
Copy the full SHA 325d0b6View commit details
Commits on Apr 5, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 5d54fbb - Browse repository at this point
Copy the full SHA 5d54fbbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9c9af1d - Browse repository at this point
Copy the full SHA 9c9af1dView commit details
Commits on Apr 6, 2020
-
Configuration menu - View commit details
-
Copy full SHA for f8fd4ac - Browse repository at this point
Copy the full SHA f8fd4acView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7294acb - Browse repository at this point
Copy the full SHA 7294acbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 16b4003 - Browse repository at this point
Copy the full SHA 16b4003View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4348af2 - Browse repository at this point
Copy the full SHA 4348af2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4f14826 - Browse repository at this point
Copy the full SHA 4f14826View commit details
Commits on Apr 7, 2020
-
Configuration menu - View commit details
-
Copy full SHA for d7056f8 - Browse repository at this point
Copy the full SHA d7056f8View commit details -
Rollup merge of rust-lang#5345 - Toxyxer:add-lint-for-float-in-array-…
…comparison, r=flip1995 Add lint for float in array comparison Fixes rust-lang#4277 changelog: - Added new handler for expression of index kind (e.g. `arr[i]`). It returns a constant when both array and index are constant, or when the array is constant and all values are equal. - Trigger float_cmp and float_cmp_const lint when comparing arrays. Allow for comparison when one of the arrays contains only zeros or infinities. - Added appropriate tests for such cases.
Configuration menu - View commit details
-
Copy full SHA for acd4342 - Browse repository at this point
Copy the full SHA acd4342View commit details -
Rollup merge of rust-lang#5406 - flip1995:update_lints_fix, r=flip1995
Fix update_lints This fixes a bug in update_lints, where `internal` lints were not registered properly. This also cleans up some code. For example: The code generation functions no longer filter the lints the are given. This is now the task of the caller. This way, it is more obvious in the `replace_in_file` calls which lints will be included in which part of a file. This also turns the lint modules private. There is no need for them to be public, since shared code should be in the utils module anyway. And last but not least, this fixes the `register_lints` code generation, so also internal lints get registered. changelog: none
Configuration menu - View commit details
-
Copy full SHA for 3da43d0 - Browse repository at this point
Copy the full SHA 3da43d0View commit details -
Rollup merge of rust-lang#5409 - dtolnay:letunit, r=flip1995
Downgrade let_unit_value to pedantic Given that the false positive in rust-lang#1502 is marked E-hard and I don't have much hope of it getting fixed, I think it would be wise to disable this lint by default. I have had to suppress this lint in every substantial codebase (\>100k line) I have worked in. Any time this lint is being triggered, it's always the false positive case. The motivation for this lint is documented as: > A unit value cannot usefully be used anywhere. So binding one is kind of pointless. with this example: > ```rust > let x = { > 1; > }; > ``` Sure, but the author would find this out via an unused_variable warning or from `x` not being the type that they need further down. If there ends up being a type error on `x`, clippy's advice isn't going to help get the code compiling because it can only run if the code already compiles. changelog: Remove let_unit_value from default set of enabled lints
Configuration menu - View commit details
-
Copy full SHA for 52ca269 - Browse repository at this point
Copy the full SHA 52ca269View commit details -
Rollup merge of rust-lang#5410 - dtolnay:trivially, r=flip1995
Downgrade trivially_copy_pass_by_ref to pedantic The rationale for this lint is documented as: > In many calling conventions instances of structs will be passed through registers if they fit into two or less general purpose registers. I think the purported performance benefits of clippy's recommendation are overstated. This isn't worth asking people to sprinkle code with more `*``*``&``*``&` to chase the alleged performance. This should be a pedantic lint that is disabled by default and opted in if some specific performance sensitive codebase determines that it is worthwhile. As a reminder, a typical place that a reference to a primitive would come up is if the function is used as a filter. Triggering a performance-oriented lint on this type of code is the definition of pedantic. ```rust fn filter(_n: &i32) -> bool { true } fn main() { let v = vec![1, 2, 3]; v.iter().copied().filter(filter).for_each(drop); } ``` ```console warning: this argument (4 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) --> src/main.rs:1:15 | 1 | fn filter(_n: &i32) -> bool { | ^^^^ help: consider passing by value instead: `i32` ``` changelog: Remove trivially_copy_pass_by_ref from default set of enabled lints
Configuration menu - View commit details
-
Copy full SHA for e26c922 - Browse repository at this point
Copy the full SHA e26c922View commit details -
Rollup merge of rust-lang#5412 - dtolnay:tostring, r=flip1995
Downgrade inefficient_to_string to pedantic From the [documentation](https://rust-lang.github.io/rust-clippy/master/index.html#inefficient_to_string): > ```diff > - ["foo", "bar"].iter().map(|s| s.to_string()); > > + ["foo", "bar"].iter().map(|&s| s.to_string()); > ``` I feel like saving 10 nanoseconds from the formatting machinery isn't worth asking the programmer to insert extra `&` / `*` noise in the *vast* majority of cases. This is a pedantic lint. changelog: Remove inefficient_to_string from default set of enabled lints
Configuration menu - View commit details
-
Copy full SHA for 5afb882 - Browse repository at this point
Copy the full SHA 5afb882View commit details -
Rollup merge of rust-lang#5415 - nickrtorres:master, r=flip1995
Add new lint for `Result<T, E>.map_or(None, Some(T))` Fixes rust-lang#5414 PR Checklist --- - [x] Followed lint naming conventions (the name is a bit awkward, but it seems to conform) - [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 `Result<T, E>` has an [`ok()`](https://doc.rust-lang.org/std/result/enum.Result.html#method.ok) method that adapts a `Result<T,E>` into an `Option<T>`. It's possible to get around this adapter by writing `Result<T,E>.map_or(None, Some)`. This lint is implemented as a new variant of the existing [`option_map_none` lint](rust-lang#2128)
Configuration menu - View commit details
-
Copy full SHA for 0c63766 - Browse repository at this point
Copy the full SHA 0c63766View commit details -
Rollup merge of rust-lang#5417 - flip1995:doc_update, r=flip1995
Update doc links and mentioned names in docs changelog: none
Configuration menu - View commit details
-
Copy full SHA for 858bfd4 - Browse repository at this point
Copy the full SHA 858bfd4View commit details -
Rollup merge of rust-lang#5419 - dtolnay:unreadable, r=flip1995
Downgrade unreadable_literal to pedantic As motivated by rust-lang#5418. This is the top most commonly suppressed Clippy style lint, which indicates that the community has decided they don't share Clippy's opinion on the best style of this. I've left the lint in as pedantic, though it could be that "restriction" would be better -- I can see this lint being useful as an opt-in restriction in some codebases. changelog: Remove unreadable_literal from default set of enabled lints
Configuration menu - View commit details
-
Copy full SHA for 642d743 - Browse repository at this point
Copy the full SHA 642d743View commit details -
Rollup merge of rust-lang#5420 - dtolnay:newret, r=flip1995
Downgrade new_ret_no_self to pedantic As motivated by rust-lang#5418. This is the second most widely suppressed Clippy style lint, and [this grep.app search](https://grep.app/search?q=%5C%5Ballow%5C%28.%2Aclippy%3A%3Anew_ret_no_self%5Cb®exp=true&case=true&filter[lang][0]=Rust) shows a large number of diverse reasonable signatures for a `new` method. changelog: Remove new_ret_no_self from default set of enabled lints
Configuration menu - View commit details
-
Copy full SHA for 3ef6b9b - Browse repository at this point
Copy the full SHA 3ef6b9bView commit details -
Rollup merge of rust-lang#5422 - nickrtorres:contributing-triage, r=f…
…lip1995 CONTRIBUTING.md: fix broken triage link Fixes rust-lang#5421
Configuration menu - View commit details
-
Copy full SHA for e55ec76 - Browse repository at this point
Copy the full SHA e55ec76View commit details -
Rollup merge of rust-lang#5424 - jpospychala:suspicious_op_assign_imp…
…l, r=flip1995 Incorrect suspicious_op_assign_impl fixes rust-lang#5255 changelog: In suspicious_op_assign_impl ignore all operators in expression if it's part of AssignOp
Configuration menu - View commit details
-
Copy full SHA for 1242808 - Browse repository at this point
Copy the full SHA 1242808View commit details -
Rollup merge of rust-lang#5425 - xiongmao86:issue5367, r=flip1995
Ehance opt_as_ref_deref lint. - [x] Added passing UI tests (including committed `.stderr` file) - [x] `cargo test` passes locally - [x] Run `cargo dev fmt` Lint on opt.as_ref().map(|x| &**x). Fixes rust-lang#5367. changelog: lint on opt.as_ref().map(|x| &**x)
Configuration menu - View commit details
-
Copy full SHA for 635518f - Browse repository at this point
Copy the full SHA 635518fView commit details -
Configuration menu - View commit details
-
Copy full SHA for f663da1 - Browse repository at this point
Copy the full SHA f663da1View commit details