Skip to content

Clippy misses integer arithmetic error for a specific type #8968

Closed
@Chralt98

Description

@Chralt98

Summary

I expected an clippy error when using a specific type, which resolves to be an integer (u128).

Reproducer

I tried this code:

pub type SpecificIntegerType = u128;
pub const NewValue: SpecificIntegerType = 42;

...

let test_arithmetic_integer_error = NewValue + NewValue;

When running with -Dclippy::integer_arithmetic

I expected to see this happen:

error: integer arithmetic detected

Instead, this happened:

No error.

Version

rustc 1.62.0-nightly

Additional Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn't

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions