Skip to content

Should cast_{un,}signed() be considered an as cast for linting purposes? #14975

@ojeda

Description

@ojeda

cast_signed() and cast_unsigned() are stable since 1.87.

They produce the same result as an as cast, but they ensure that the bit-width remains the same.

Should lints like cast_possible_wrap, cast_abs_to_unsigned and cast_sign_loss consider the new cast_{un,}signed() as as casts too?

Should this be configurable?

Related: #14974.

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-needs-discussionStatus: Needs further discussion before merging or work can be started

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions