Skip to content

Turn the overflowing_literals lint from warn to deny for the 2018 edition #50633

Closed
@bstrie

Description

@bstrie

This code compiles with a warning:

let x: u8 = 256;  // warning: literal out of range for u8

I can think of no use case for allowing overflowing literals. The lint has existed since 2012, back before we had any firm story regarding integer overflow and back when literal underflow was also allowed (in modern Rust, integer literal underflow is a parse error). This is a prime candidate for a lint that advances to deny for the 2018 edition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions