Module unary Copy item path Source check_logical_not_operation Checks if logical negation (!) is valid for the given operand type.
Only boolean types can be logically negated. check_negation_operation Checks if arithmetic negation (-) is valid for the given operand type.
Supports signed integers, floats, and unspecified numeric literals.
Unsigned integers cannot be negated. check_unary_operation Checks if a unary operation is valid for the given operand type.
Handles both arithmetic negation (-) and logical negation (!). is_signed_numeric_type Checks if a type is a signed numeric type that can be negated.
Includes signed integers (i32, i64) and floating point types (f32, f64). is_unsigned_integer_type Checks if a type is an unsigned integer type that cannot be negated.
Includes u32 and u64 types.