-
Notifications
You must be signed in to change notification settings - Fork 1.6k
cast_possible_truncation: Fix some false-positive cases #12962
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
Conversation
defa4af
to
8fea999
Compare
0f2daf3
to
e86a94c
Compare
Require all fields to be local
Looks ok. Thank you @bors r+ |
cast_possible_truncation: Fix some false-positive cases Fix partially #7486 (comment). Fix #9613. changelog: [`cast_possible_truncation`]: fix some false-positive on % operator, valid constants, and size_of
💔 Test failed - checks-action_test |
@tesuji you may need to rebase to fix the errors. |
I think I'm stuck. I don't know any ways to bless test for 32-bit target. Running with |
The |
It's complicated than I expected: > rustup install nightly-2024-07-25-i686-unknown-linux-gnu -c rust-src rustc-dev llvm-tools-preview
> # also install i386 zlib
> cargo +i686-unknown-linux-gnu uitest But hey, since I added this condition |
That condition should be |
If the constant is locally defined and have value < u32::MAX, it will be linted again when changes the condition. I don't have time or enough motivation for developing clippy in general. Closing this for now. Anyway, thank you very much for your reviewing, Jarcho. |
Fix partially #7486 (comment).
Fix #9613.
changelog: [
cast_possible_truncation
]: fix some false-positive on % operator, valid constants, and size_of