Skip to content

negate_unsigned feature gate triggered for user-defined Neg #26840

Closed
@eefriedman

Description

@eefriedman
struct S;
impl std::ops::Neg for S {
    type Output = u32;
    fn neg(self) -> u32 { 0 }
}
fn main() { -S; }
<anon>:6:13: 6:15 error: unary negation of unsigned integers may be removed in the future
<anon>:6 fn main() { -S; }
                     ^~

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