Skip to content

Commit 5233a12

Browse files
committed
Run rustfmt
1 parent fcb58ab commit 5233a12

File tree

4 files changed

+13
-32
lines changed

4 files changed

+13
-32
lines changed

src/librustc_mir/borrow_check/nll/region_infer/mod.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -305,17 +305,11 @@ impl<'tcx> RegionInferenceContext<'tcx> {
305305

306306
// Add all nodes in the CFG to liveness constraints
307307
for point_index in self.elements.all_point_indices() {
308-
self.liveness_constraints.add_element(
309-
variable,
310-
point_index,
311-
);
308+
self.liveness_constraints.add_element(variable, point_index);
312309
}
313310

314311
// Add `end(X)` into the set for X.
315-
self.liveness_constraints.add_element(
316-
variable,
317-
variable,
318-
);
312+
self.liveness_constraints.add_element(variable, variable);
319313
}
320314
}
321315

src/librustc_mir/borrow_check/nll/region_infer/values.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ pub(super) struct RegionValueElements {
2828
impl RegionValueElements {
2929
pub(super) fn new(mir: &Mir<'_>, num_universal_regions: usize) -> Self {
3030
let mut num_points = 0;
31-
let statements_before_block = mir.basic_blocks()
31+
let statements_before_block = mir
32+
.basic_blocks()
3233
.iter()
3334
.map(|block_data| {
3435
let v = num_points;
@@ -96,7 +97,8 @@ impl RegionValueElements {
9697
// be (BB2, 20).
9798
//
9899
// Nit: we could do a binary search here but I'm too lazy.
99-
let (block, &first_index) = self.statements_before_block
100+
let (block, &first_index) = self
101+
.statements_before_block
100102
.iter_enumerated()
101103
.filter(|(_, first_index)| **first_index <= point_index)
102104
.last()
@@ -203,11 +205,7 @@ impl RegionValues {
203205

204206
/// Adds the given element to the value for the given region. Returns true if
205207
/// the element is newly added (i.e., was not already present).
206-
pub(super) fn add_element<E: ToElementIndex>(
207-
&mut self,
208-
r: RegionVid,
209-
elem: E,
210-
) -> bool {
208+
pub(super) fn add_element<E: ToElementIndex>(&mut self, r: RegionVid, elem: E) -> bool {
211209
let i = self.elements.index(elem);
212210
debug!("add(r={:?}, elem={:?})", r, elem);
213211
self.matrix.add(r, i)

src/librustc_mir/borrow_check/nll/type_check/liveness.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,7 @@ impl<'gen, 'typeck, 'flow, 'gcx, 'tcx> TypeLivenessGenerator<'gen, 'typeck, 'flo
168168
);
169169

170170
cx.tcx().for_each_free_region(&value, |live_region| {
171-
cx.constraints
172-
.liveness_set
173-
.push((live_region, location));
171+
cx.constraints.liveness_set.push((live_region, location));
174172
});
175173
}
176174

src/librustc_mir/borrow_check/nll/type_check/mod.rs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -768,12 +768,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
768768
}
769769
}
770770

771-
fn sub_types(
772-
&mut self,
773-
sub: Ty<'tcx>,
774-
sup: Ty<'tcx>,
775-
locations: Locations,
776-
) -> Fallible<()> {
771+
fn sub_types(&mut self, sub: Ty<'tcx>, sup: Ty<'tcx>, locations: Locations) -> Fallible<()> {
777772
let param_env = self.param_env;
778773
self.fully_perform_op(
779774
locations,
@@ -993,10 +988,9 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
993988
// output) types in the signature must be live, since
994989
// all the inputs that fed into it were live.
995990
for &late_bound_region in map.values() {
996-
self.constraints.liveness_set.push((
997-
late_bound_region,
998-
term_location,
999-
));
991+
self.constraints
992+
.liveness_set
993+
.push((late_bound_region, term_location));
1000994
}
1001995

1002996
self.check_call_inputs(mir, term, &sig, args, term_location);
@@ -1516,10 +1510,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
15161510
*substs,
15171511
);
15181512

1519-
self.push_region_constraints(
1520-
location.at_self(),
1521-
&closure_constraints,
1522-
);
1513+
self.push_region_constraints(location.at_self(), &closure_constraints);
15231514
}
15241515

15251516
tcx.predicates_of(*def_id).instantiate(tcx, substs.substs)

0 commit comments

Comments
 (0)