Skip to content

Commit

Permalink
rename variable and add test directive for #58030
Browse files Browse the repository at this point in the history
  • Loading branch information
pmccarter committed Feb 11, 2019
1 parent 7854067 commit b04d8aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustc_mir/interpret/intrinsics.rs
Expand Up @@ -139,8 +139,8 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
// the fact that the operation has overflowed (if either is 0 no
// overflow can occur)
let first_term: u128 = l.to_scalar()?.to_bits(l.layout.size)?;
let first_term_pos = first_term & (1 << (num_bits-1)) == 0;
if first_term_pos {
let first_term_positive = first_term & (1 << (num_bits-1)) == 0;
if first_term_positive {
// Negative overflow not possible since the positive first term
// can only increase an (in range) negative term for addition
// or corresponding negated positive term for subtraction
Expand Down
1 change: 1 addition & 0 deletions src/test/run-pass/const-int-saturating-arith.rs
@@ -1,3 +1,4 @@
// ignore-emscripten no i128 support
#![feature(const_saturating_int_methods)]

const INT_U32_NO: u32 = (42 as u32).saturating_add(2);
Expand Down

0 comments on commit b04d8aa

Please sign in to comment.