Skip to content

Commit dce5e9e

Browse files
committed
Run x.py fmt to fix tidy issues
1 parent 7c7f10b commit dce5e9e

File tree

4 files changed

+19
-22
lines changed

4 files changed

+19
-22
lines changed

compiler/rustc_mir_build/src/build/expr/into.rs

-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
275275
let fields: Vec<_> = if let Some(FruInfo { base, field_types }) = base {
276276
let place_builder = unpack!(block = this.as_place_builder(block, base));
277277

278-
279278
// MIR does not natively support FRU, so for each
280279
// base-supplied field, generate an operand that
281280
// reads it from the base.

compiler/rustc_mir_build/src/build/matches/mod.rs

+6-14
Original file line numberDiff line numberDiff line change
@@ -1422,12 +1422,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
14221422
match test.kind {
14231423
TestKind::SwitchInt { switch_ty, ref mut options } => {
14241424
for candidate in candidates.iter() {
1425-
if !self.add_cases_to_switch(
1426-
&match_place,
1427-
candidate,
1428-
switch_ty,
1429-
options,
1430-
) {
1425+
if !self.add_cases_to_switch(&match_place, candidate, switch_ty, options) {
14311426
break;
14321427
}
14331428
}
@@ -1842,14 +1837,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
18421837
// ```
18431838
//
18441839
// and that is clearly not correct.
1845-
let by_value_bindings =
1846-
parent_bindings
1847-
.iter()
1848-
.flat_map(|(bindings, _)| bindings)
1849-
.chain(&candidate.bindings)
1850-
.filter(|binding| {
1851-
matches!(binding.binding_mode, BindingMode::ByValue )
1852-
});
1840+
let by_value_bindings = parent_bindings
1841+
.iter()
1842+
.flat_map(|(bindings, _)| bindings)
1843+
.chain(&candidate.bindings)
1844+
.filter(|binding| matches!(binding.binding_mode, BindingMode::ByValue));
18531845
// Read all of the by reference bindings to ensure that the
18541846
// place they refer to can't be modified by the guard.
18551847
for binding in by_value_bindings.clone() {

compiler/rustc_mir_build/src/build/mod.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ fn mir_build(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> Body<'_
7676
kind: hir::TraitItemKind::Const(ty, Some(body_id)),
7777
..
7878
}) => (*body_id, ty.span, None),
79-
Node::AnonConst(hir::AnonConst { body, hir_id, .. }) => (*body, tcx.hir().span(*hir_id), None),
79+
Node::AnonConst(hir::AnonConst { body, hir_id, .. }) => {
80+
(*body, tcx.hir().span(*hir_id), None)
81+
}
8082

8183
_ => span_bug!(tcx.hir().span(id), "can't build MIR for {:?}", def.did),
8284
};
@@ -184,7 +186,7 @@ fn mir_build(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> Body<'_
184186
return_ty,
185187
return_ty_span,
186188
body,
187-
span_with_body
189+
span_with_body,
188190
);
189191
mir.yield_ty = yield_ty;
190192
mir
@@ -582,7 +584,7 @@ fn construct_fn<'a, 'tcx, A>(
582584
return_ty: Ty<'tcx>,
583585
return_ty_span: Span,
584586
body: &'tcx hir::Body<'tcx>,
585-
span_with_body: Span
587+
span_with_body: Span,
586588
) -> Body<'tcx>
587589
where
588590
A: Iterator<Item = ArgInfo<'tcx>>,
@@ -658,7 +660,8 @@ fn construct_const<'a, 'tcx>(
658660
let owner_id = tcx.hir().body_owner(body_id);
659661
let def_id = tcx.hir().local_def_id(owner_id);
660662
let span = tcx.hir().span(owner_id);
661-
let mut builder = Builder::new(hir, def_id.to_def_id(), span, 0, Safety::Safe, const_ty, const_ty_span, None);
663+
let mut builder =
664+
Builder::new(hir, def_id.to_def_id(), span, 0, Safety::Safe, const_ty, const_ty_span, None);
662665

663666
let mut block = START_BLOCK;
664667
let ast_expr = &tcx.hir().body(body_id).value;
@@ -698,7 +701,8 @@ fn construct_error<'a, 'tcx>(hir: Cx<'a, 'tcx>, body_id: hir::BodyId) -> Body<'t
698701
hir::BodyOwnerKind::Const => 0,
699702
hir::BodyOwnerKind::Static(_) => 0,
700703
};
701-
let mut builder = Builder::new(hir, def_id.to_def_id(), span, num_params, Safety::Safe, ty, span, None);
704+
let mut builder =
705+
Builder::new(hir, def_id.to_def_id(), span, num_params, Safety::Safe, ty, span, None);
702706
let source_info = builder.source_info(span);
703707
// Some MIR passes will expect the number of parameters to match the
704708
// function declaration.

compiler/rustc_mir_build/src/build/scope.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
458458
let breakable_scope = self.scopes.breakable_scopes.pop().unwrap();
459459
assert!(breakable_scope.region_scope == region_scope);
460460
let break_block = self.build_exit_tree(breakable_scope.break_drops, None);
461-
if let Some(drops) = breakable_scope.continue_drops { self.build_exit_tree(drops, loop_block); }
461+
if let Some(drops) = breakable_scope.continue_drops {
462+
self.build_exit_tree(drops, loop_block);
463+
}
462464
match (normal_exit_block, break_block) {
463465
(Some(block), None) | (None, Some(block)) => block,
464466
(None, None) => self.cfg.start_new_block().unit(),
@@ -1364,7 +1366,7 @@ impl<'tcx> DropTreeBuilder<'tcx> for Unwind {
13641366
| TerminatorKind::Yield { .. }
13651367
| TerminatorKind::GeneratorDrop
13661368
| TerminatorKind::FalseEdge { .. }
1367-
| TerminatorKind::InlineAsm {.. } => {
1369+
| TerminatorKind::InlineAsm { .. } => {
13681370
span_bug!(term.source_info.span, "cannot unwind from {:?}", term.kind)
13691371
}
13701372
}

0 commit comments

Comments
 (0)