Uplift clippy::double_neg into rustc #82987
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
D-newcomer-roadblock
Diagnostics: Confusing error or lint; hard to understand for new users.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
See this https://dtolnay.github.io/rust-quiz/17
I agree with our position on the inclusion of --/++ in Rust, however currently we just silently treat --i as -(-i), which means that users who are coming from C++ and C get absolutely no warning that their code is going to do something entirely different than they expect - and there's arguably no use case for an unbracketed - -i : its the same as a literal i.
I expected to see this happen:
A warning, or an error: "attempt to use unsupported post-increment operator. Use +=1 instead". Or something like that.
Instead, this happened: explanation
Meta
I'm not sure what rustc version the rust-quiz website is running.
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: