]> git.lizzy.rs Git - rust.git/commitdiff
report shift right error instead of shift left error on right shift
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Tue, 26 Apr 2016 09:17:32 +0000 (11:17 +0200)
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Tue, 26 Apr 2016 09:17:32 +0000 (11:17 +0200)
src/librustc_const_math/int.rs

index 658d4d9a6d2fa3dc64730cd77b33ef79e0e7ccd6..64f03be3b5f07454ba0c50e7ef106554d96bb2a4 100644 (file)
@@ -503,7 +503,7 @@ fn shr(self, rhs: Self) -> Result<Self, ConstMathErr> {
             I8(a) => Ok(I8(overflowing!(a.overflowing_shr(b), Op::Shr))),
             I16(a) => Ok(I16(overflowing!(a.overflowing_shr(b), Op::Shr))),
             I32(a) => Ok(I32(overflowing!(a.overflowing_shr(b), Op::Shr))),
-            I64(a) => Ok(I64(overflowing!(a.overflowing_shr(b), Op::Shl))),
+            I64(a) => Ok(I64(overflowing!(a.overflowing_shr(b), Op::Shr))),
             Isize(Is32(a)) => Ok(Isize(Is32(overflowing!(a.overflowing_shr(b), Op::Shr)))),
             Isize(Is64(a)) => Ok(Isize(Is64(overflowing!(a.overflowing_shr(b), Op::Shr)))),
             U8(a) => Ok(U8(overflowing!(a.overflowing_shr(b), Op::Shr))),