Skip to content

Commit b04d8aa

Browse files
committed
rename variable and add test directive for #58030
1 parent 7854067 commit b04d8aa

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/librustc_mir/interpret/intrinsics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
139139
// the fact that the operation has overflowed (if either is 0 no
140140
// overflow can occur)
141141
let first_term: u128 = l.to_scalar()?.to_bits(l.layout.size)?;
142-
let first_term_pos = first_term & (1 << (num_bits-1)) == 0;
143-
if first_term_pos {
142+
let first_term_positive = first_term & (1 << (num_bits-1)) == 0;
143+
if first_term_positive {
144144
// Negative overflow not possible since the positive first term
145145
// can only increase an (in range) negative term for addition
146146
// or corresponding negated positive term for subtraction

src/test/run-pass/const-int-saturating-arith.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// ignore-emscripten no i128 support
12
#![feature(const_saturating_int_methods)]
23

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

0 commit comments

Comments
 (0)