diff options
| author | kenta7777 <k.hasegw7@gmail.com> | 2019-03-12 01:06:12 +0900 |
|---|---|---|
| committer | kenta7777 <k.hasegw7@gmail.com> | 2019-03-12 01:06:12 +0900 |
| commit | 0ede9e61e2f483f93ad9ba9e6d4c19fbfc127cd0 (patch) | |
| tree | ce19710df0ddcb5c172ab5730a0870698b48495c /src | |
| parent | 4c9f7a08e5a92745772eb50b3c8f0612cc476c6b (diff) | |
| download | rust-0ede9e61e2f483f93ad9ba9e6d4c19fbfc127cd0.tar.gz rust-0ede9e61e2f483f93ad9ba9e6d4c19fbfc127cd0.zip | |
replaced some bit operations with truncate
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_mir/build/matches/simplify.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_mir/build/matches/simplify.rs b/src/librustc_mir/build/matches/simplify.rs index a6919246825..d60a0941b59 100644 --- a/src/librustc_mir/build/matches/simplify.rs +++ b/src/librustc_mir/build/matches/simplify.rs @@ -19,7 +19,7 @@ use rustc::ty; use rustc::ty::layout::{Integer, IntegerExt, Size}; use syntax::attr::{SignedInt, UnsignedInt}; use rustc::hir::RangeEnd; -use rustc::mir::interpret::mask; +use rustc::mir::interpret::truncate; use std::mem; @@ -116,14 +116,14 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> { ty::Int(ity) => { // FIXME(49937): refactor these bit manipulations into interpret. let size = Integer::from_attr(&tcx, SignedInt(ity)).size(); - let max = mask(size); + let max = truncate(u128::max_value(), size); let bias = 1u128 << (size.bits() - 1); (Some((0, max, size)), bias) } ty::Uint(uty) => { // FIXME(49937): refactor these bit manipulations into interpret. let size = Integer::from_attr(&tcx, UnsignedInt(uty)).size(); - let max = mask(size); + let max = truncate(u128::max_value(), size); (Some((0, max, size)), 0) } _ => (None, 0), |
