Skip to content

Commit 4a97441

Browse files
committed
core: Fix an unsigned negation warning
1 parent 255908a commit 4a97441

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/num/uint_macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl Rem<$T,$T> for $T {
8989
#[cfg(not(test))]
9090
impl Neg<$T> for $T {
9191
#[inline]
92-
fn neg(&self) -> $T { -*self }
92+
fn neg(&self) -> $T { -(*self as $T_SIGNED) as $T }
9393
}
9494

9595
impl Unsigned for $T {}

0 commit comments

Comments
 (0)