Skip to content

Commit a7c9eb6

Browse files
committed
fmt
1 parent e915b4b commit a7c9eb6

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

compiler/rustc_const_eval/src/interpret/machine.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,10 @@ pub trait Machine<'tcx>: Sized {
297297
}
298298

299299
/// Determines the result of a `NullaryOp::RuntimeChecks` invocation.
300-
fn runtime_checks(_ecx: &InterpCx<'tcx, Self>, r: mir::RuntimeChecks) -> InterpResult<'tcx, bool>;
300+
fn runtime_checks(
301+
_ecx: &InterpCx<'tcx, Self>,
302+
r: mir::RuntimeChecks,
303+
) -> InterpResult<'tcx, bool>;
301304

302305
/// Called when the interpreter encounters a `StatementKind::ConstEvalCounter` instruction.
303306
/// You can use this to detect long or endlessly running programs.
@@ -674,7 +677,10 @@ pub macro compile_time_machine(<$tcx: lifetime>) {
674677
}
675678

676679
#[inline(always)]
677-
fn runtime_checks(_ecx: &InterpCx<$tcx, Self>, _r: mir::RuntimeChecks) -> InterpResult<$tcx, bool> {
680+
fn runtime_checks(
681+
_ecx: &InterpCx<$tcx, Self>,
682+
_r: mir::RuntimeChecks,
683+
) -> InterpResult<$tcx, bool> {
678684
// We can't look at `tcx.sess` here as that can differ across crates, which can lead to
679685
// unsound differences in evaluating the same constant at different instantiation sites.
680686
interp_ok(true)

compiler/rustc_mir_transform/src/instsimplify.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ impl<'tcx> InstSimplifyContext<'_, 'tcx> {
169169

170170
fn simplify_ub_check(&self, rvalue: &mut Rvalue<'tcx>) {
171171
// FIXME: Should we do the same for overflow checks?
172-
let Rvalue::NullaryOp(NullOp::RuntimeChecks(RuntimeChecks::UbChecks), _) = *rvalue else { return };
172+
let Rvalue::NullaryOp(NullOp::RuntimeChecks(RuntimeChecks::UbChecks), _) = *rvalue else {
173+
return;
174+
};
173175

174176
let const_ = Const::from_bool(self.tcx, self.tcx.sess.ub_checks());
175177
let constant = ConstOperand { span: DUMMY_SP, const_, user_ty: None };

library/core/src/iter/range.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ impl<A: Step> Iterator for ops::RangeFrom<A> {
10361036
self.start = Step::forward(plus_n.clone(), 1);
10371037
return Some(self.start.clone());
10381038
}
1039-
1039+
10401040
let plus_n = Step::forward(self.start.clone(), n);
10411041
self.start = Step::forward(plus_n.clone(), 1);
10421042
Some(plus_n)

tests/codegen/iterrangefrom-overflow-checks.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
//@ compile-flags: -O -Cdebug-assertions=yes
1212

1313
#![crate_type = "lib"]
14-
1514
#![feature(new_range_api)]
16-
use std::range::{RangeFrom, IterRangeFrom};
15+
use std::range::{IterRangeFrom, RangeFrom};
1716

1817
// CHECK-LABEL: @iterrangefrom_remainder(
1918
#[no_mangle]

0 commit comments

Comments
 (0)