-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clippy subtree update #119387
Clippy subtree update #119387
Conversation
…affleLapkin Don't pass lint back out of lint decorator Change the decorator function in the signature of the `emit_lint`/`span_lint`/etc family of methods from `impl for<'a, 'b> FnOnce(&'b mut DiagnosticBuilder<'a, ()>) -> &'b mut DiagnosticBuilder<'a, ()>` to `impl for<'a, 'b> FnOnce(&'b mut DiagnosticBuilder<'a, ()>)`. I consider it easier to read this way, especially when there's control flow involved. r? nnethercote though feel free to reassign
Added the `Result` mirror of `option_filter_map` to catch ``` .into_iter().filter(Result::is_ok).map(Result::unwrap) ``` changelog: New Lint: [`result_filter_map`] Co-authored-by: Alex Macleod <alex@macleod.io>
[`redundant_pattern_matching`]: lint `if let true`, `while let true`, `matches!(.., true)` Closes rust-lang#11917 This could also lint e.g. `if let (true, true, false) = (a, b, c)` and suggest `if a && b && c`, but that's a change in semantics (going from eager to lazy, so I just left it out for now. Could be a future improvement. changelog: [`redundant_pattern_matching`]: lint `if let true`, `while let true`, `matches!(.., true)`
…n, r=llogiq Add new `unconditional_recursion` lint Currently, rustc `unconditional_recursion` doesn't detect cases like: ```rust enum Foo { A, B, } impl PartialEq for Foo { fn eq(&self, other: &Self) -> bool { self == other } } ``` This is because the lint is currently implemented only for one level, and in the above code, `self == other` will then call `impl PartialEq for &T`, escaping from the detection. The fix for it seems to be a bit tricky (I started investigating potential solution to add one extra level of recursion [here](https://github.com/rust-lang/rust/compare/master...GuillaumeGomez:rust:trait-impl-recursion?expand=1) but completely broken at the moment). I expect that this situation will remain for a while. In the meantime, I think it's acceptable to check it directly into clippy for the time being as a lot of easy cases like this one can be easily checked (next I plan to extend it to cover other traits like `ToString`). changelog: Add new `unconditional_recursion` lint
…hearth don't visit nested bodies in `is_const_evaluatable` Fixes rust-lang#11939 This ICE happened in `if_let_some_else_none`, but the root problem is in one of the utils that it uses. It is (was) possible for `is_const_evalutable` to visit nested bodies which would lead to it trying to get the type of one of the expressions with the wrong typeck table, which won't have the type stored. Notably, for the expression `Bytes::from_static(&[0; 256 * 1024]);` in the linked issue, the array length is an anonymous const in which type checking happens on its own, so we can't use the typeck table of the enclosing function in there. Visiting nested bodies is also not needed for checking whether an expression can be const, so I think it's safe to ignore just ignore them altogether. changelog: Fix ICE when checking for constness in nested bodies
…lexendoo New Lint: `result_filter_map` / Mirror of `option_filter_map` Added the `Result` mirror of `option_filter_map`. changelog: New Lint: [`result_filter_map`] I had to move around some code because the function def was too long 🙃. I have also added some pattern checks on `option_filter_map`
…Jarcho Do not lint `assertions_on_constants` for `const _: () = assert!(expr)` Fixes rust-lang#8159 ```rust pub fn f() { // warning assert!(true); assert!(usize::BITS >= 32); // ok const _: () = assert!(usize::BITS >= 32); } ``` changelog: Fix `const _: () = assert!(expr)` false positive on `assertions_on_constants` lint
…r=blyxyas,xFrednet fix: broken GitHub corner changelog: none fixes rust-lang#11946
💔 Test failed - checks-actions |
@bors retry don't see an actual failure? |
…hiaskrgr Clippy subtree update r? `@Manishearth`
💥 Test timed out |
@bors retry timeout |
☀️ Test successful - checks-actions |
Finished benchmarking commit (1a7e97f): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 671.85s -> 670.236s (-0.24%) |
Don't mind me, just doing an experiment @bors try @rust-timer queue scenario=clippy |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
Hmmmm... It seems like bors is not even recognizing the command. |
@blyxyas bors ignores all closed/merged PRs |
…hiaskrgr Clippy subtree update r? `@Manishearth`
r? @Manishearth