-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Uplift clippy::double_neg
lint as double_negations
#126604
Conversation
r? @nnethercote rustbot has assigned @nnethercote. Use |
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
This comment has been minimized.
This comment has been minimized.
af85271
to
a745a8d
Compare
@rustbot author |
This needs T-lang approval. The appropriate labels have been applied to summon them. |
☔ The latest upstream changes (presumably #127174) made this pull request unmergeable. Please resolve the merge conflicts. |
a745a8d
to
8f3387c
Compare
clippy::double_neg
lint as double_negation
clippy::double_neg
lint as double_negations
This comment has been minimized.
This comment has been minimized.
8f3387c
to
9862f05
Compare
@rustbot ready |
Still waiting on T-lang, AFAICT. |
@rustbot label: -S-waiting-on-review +S-waiting-on-team |
☔ The latest upstream changes (presumably #128985) made this pull request unmergeable. Please resolve the merge conflicts. |
9862f05
to
beb1dd2
Compare
Makes sense to me! It's not something that people would normally write, so worth linting since (I guess they could use it as a really obscure way to @rfcbot reviewed |
while let Some(LintDeclSearchResult { content, .. }) = iter.find(|result| result.token == TokenKind::Ident) { | ||
while let Some(LintDeclSearchResult { content, .. }) = iter.find(|result| result.token_kind == TokenKind::Ident) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes were necessary to get the clippy dev tool to compile
#![allow(clippy::manual_find_map)] | ||
#![allow(clippy::manual_filter_map)] | ||
#![allow(unpredictable_function_pointer_comparisons)] | ||
#![allow(clippy::manual_find_map)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is supposed to be auto-generated (it has a comment at the top saying so), but most people seem to edit it manually. I used the generator though, that's why so many lines are changed in this file.
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
☔ The latest upstream changes (presumably #136070) made this pull request unmergeable. Please resolve the merge conflicts. |
d3cbf72
to
c1dcbeb
Compare
@rustbot label: -S-waiting-on-team +S-waiting-on-review -I-lang-nominated |
Updated code looks fine to me. I think/hope this has gone through all the appropriate hoops and is ready to be merged. @bors r+ |
Rollup of 8 pull requests Successful merges: - rust-lang#126604 (Uplift `clippy::double_neg` lint as `double_negations`) - rust-lang#135158 (Add `TooGeneric` variant to `LayoutError` and emit `Unknown`) - rust-lang#135635 (Move `std::io::pipe` code into its own file) - rust-lang#136072 (add two old crash tests) - rust-lang#136079 (compiler_fence: fix example) - rust-lang#136091 (Add some tracing to core bootstrap logic) - rust-lang#136097 (rustc_ast: replace some len-checks + indexing with slice patterns etc.) - rust-lang#136101 (triagebot: set myself on vacation) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#126604 - kadiwa4:uplift_double_negation, r=nnethercote Uplift `clippy::double_neg` lint as `double_negations` Warns about cases like this: ```rust fn main() { let x = 1; let _b = --x; //~ WARN use of a double negation } ``` The intent is to keep people from thinking that `--x` is a prefix decrement operator. `++x`, `x++` and `x--` are invalid expressions and already have a helpful diagnostic. I didn't add a machine-applicable suggestion to the lint because it's not entirely clear what the programmer was trying to achieve with the `--x` operation. The code that triggers the lint should always be reviewed manually. Closes rust-lang#82987
…nnethercote Uplift `clippy::double_neg` lint as `double_negations` Warns about cases like this: ```rust fn main() { let x = 1; let _b = --x; //~ WARN use of a double negation } ``` The intent is to keep people from thinking that `--x` is a prefix decrement operator. `++x`, `x++` and `x--` are invalid expressions and already have a helpful diagnostic. I didn't add a machine-applicable suggestion to the lint because it's not entirely clear what the programmer was trying to achieve with the `--x` operation. The code that triggers the lint should always be reviewed manually. Closes rust-lang#82987
@bors r- ('fixing' desync) |
Warns about cases like this:
The intent is to keep people from thinking that
--x
is a prefix decrement operator.++x
,x++
andx--
are invalid expressions and already have a helpful diagnostic.I didn't add a machine-applicable suggestion to the lint because it's not entirely clear what the programmer was trying to achieve with the
--x
operation. The code that triggers the lint should always be reviewed manually.Closes #82987