Skip to content

0u8..-1 compiles without warning #25206

Closed
@bluss

Description

@bluss

0u8..-1 compiles, runs (as 0..255) without warning or error. Debug assertions don't fire.

We error on 0..-1u8 error: unary negation of unsigned integers may be removed in the future.

We can't "fix" this backwards compatibly after 1.0.

0u8..-1 should either warn or trip debug assertions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions