Skip to content

type_limits warning should fire for operators like (<=) #16389

@bfops

Description

@bfops

The following appropriately generates a type_limits warning:

pub fn main() {
    let x: u64 = 0;
    println!("is {} negative? {}", x, (x < 0));
}

The following does not:

pub fn main() {
    let x: u64 = 0;
    println!("is {} nonpositive? {}", x, (x <= 0));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions