Skip to content

Clippy misses integer arithmetic when one operand is a referenceΒ #5328

Closed
@RalfJung

Description

@RalfJung

I expected this code to trigger an "integer arithmetic" warning:

#![warn(clippy::integer_arithmetic)]

pub fn foo(x: &i32) -> i32 {
    let a = 5;
    a+x
}

However, no such warning is emitted.

Metadata

Metadata

Assignees

Labels

C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messages

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions