Add suggestion for neg_multiply lint by Gh0stm4chine · Pull Request #8144 · rust...
source link: https://github.com/rust-lang/rust-clippy/pull/8144
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
It looks good to me . The pipeline failed as it was unable to apply one suggestion. This can happen when multiple suggestions overlap, but that shouldn't be the case here. I've restarted the pipeline to see if it works now.
Also thank you to @r00ster91 for the review comment
Outdated
@@ -1,3 +1,4 @@
// run-rustfix
#![warn(clippy::neg_multiply)]
#![allow(clippy::no_effect, clippy::unnecessary_operation)]
The clippy::precedence
lint triggers for the 0xcafe | 0xff00 * -1;
expression. This causes the pipeline to fail. If you allow that lint and rerun the tests and update the output, everything should be fine
Done
The pipeline fails because it can't compile the fixed code. I tested it locally, it compiles fine
Some tests can't be executed on Windows, if you use that it might explain this behavior. I'll check it out and try to find the problem
The tests fail due to the configuration of compiletest-rs
. In the normal UI tests all lints inside the unused
group are allowed, this is sadly not true for .fixed
files. The problem can be solved by adding #![allow(unused)]
to the file, as that will allow these lints and prevent the warnings that make the test fail.
(This is something I want to fix at some point, but for now, this is the best and easiest solution. Sorry that you ran into this )
Some tests can't be executed on Windows, if you use that it might explain this behavior. I'll check it out and try to find the problem
Yes, I am on Windows, but actually running the test locally was failing too. I thought the problem was about compiling the .fixed file.
The tests fail due to the configuration of
compiletest-rs
. In the normal UI tests all lints inside theunused
group are allowed, this is sadly not true for.fixed
files. The problem can be solved by adding#![allow(unused)]
to the file, as that will allow these lints and prevent the warnings that make the test fail.
I was not sure if the #![allow(unused)]
should be added in the .fixed only even though it's a generated file ?
I added it in test file for now.
Yes, I am on Windows, but actually running the test locally was failing too. I thought the problem was about compiling the .fixed file.
Alright, your assumption was correct, it was with the compilation of the .fixed
files.
I was not sure if the
#![allow(unused)]
should be added in the .fixed only even though it's a generated file?
I added it in test file for now.
You did it correctly, that's what I meant
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK