Skip to content
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

integer_arithmetic gives unhelpful warnings for const expressions #1761

Closed
ssokolow opened this issue May 14, 2017 · 1 comment
Closed

integer_arithmetic gives unhelpful warnings for const expressions #1761

ssokolow opened this issue May 14, 2017 · 1 comment
Labels
C-bug Category: Clippy is not doing the correct thing E-medium Call for participation: Medium difficulty level problem and requires some initial experience. I-false-positive Issue: The lint was triggered on code it shouldn't have T-middle Type: Probably requires verifiying types

Comments

@ssokolow
Copy link

I use the integer_arithmetic lint as a reminder to explicitly decide on what kind of behaviour I want, but it also triggers in situations like this line, where the math makes the line more readable and the *_mul methods aren't available.

pub const MAX_SCRIPT_SIZE: u64 = 1024 * 1024; // 1 MiB

It should probably be limited to non-constant expressions (or split into two lints) until an alternative is stabilized.

@oli-obk oli-obk added E-medium Call for participation: Medium difficulty level problem and requires some initial experience. C-bug Category: Clippy is not doing the correct thing T-middle Type: Probably requires verifiying types labels May 15, 2017
@phansch
Copy link
Member

phansch commented Dec 21, 2020

This was fixed as part of #3331 so I'm going to go ahead and close this issue, thank you for the report!

@phansch phansch closed this as completed Dec 21, 2020
@phansch phansch added the I-false-positive Issue: The lint was triggered on code it shouldn't have label Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing E-medium Call for participation: Medium difficulty level problem and requires some initial experience. I-false-positive Issue: The lint was triggered on code it shouldn't have T-middle Type: Probably requires verifiying types
Projects
None yet
Development

No branches or pull requests

3 participants