Skip to content

Commit fad3d1d

Browse files
committed
dfs.rs: rustfmt
1 parent 6193c5c commit fad3d1d

File tree

1 file changed

+12
-15
lines changed
  • src/librustc_mir/borrow_check/nll/region_infer

1 file changed

+12
-15
lines changed

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

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
1414
use borrow_check::nll::universal_regions::UniversalRegions;
1515
use borrow_check::nll::region_infer::RegionInferenceContext;
16-
use borrow_check::nll::region_infer::values::{RegionElementIndex, RegionValues, RegionValueElements};
16+
use borrow_check::nll::region_infer::values::{RegionElementIndex, RegionValueElements,
17+
RegionValues};
1718
use rustc::mir::{Location, Mir};
1819
use rustc::ty::RegionVid;
1920
use rustc_data_structures::fx::FxHashSet;
@@ -112,9 +113,7 @@ pub(super) trait DfsOp {
112113

113114
/// Adds all universal regions in the source region to the target region, returning
114115
/// true if something has changed.
115-
fn add_universal_regions_outlived_by_source_to_target(
116-
&mut self,
117-
) -> Result<bool, Self::Early>;
116+
fn add_universal_regions_outlived_by_source_to_target(&mut self) -> Result<bool, Self::Early>;
118117
}
119118

120119
/// Used during inference to enforce a `R1: R2 @ P` constraint. For
@@ -143,16 +142,11 @@ impl<'v> DfsOp for CopyFromSourceToTarget<'v> {
143142
.contains(self.source_region, point_index)
144143
}
145144

146-
fn add_to_target_region(
147-
&mut self,
148-
point_index: RegionElementIndex,
149-
) -> Result<bool, !> {
145+
fn add_to_target_region(&mut self, point_index: RegionElementIndex) -> Result<bool, !> {
150146
Ok(self.inferred_values.add(self.target_region, point_index))
151147
}
152148

153-
fn add_universal_regions_outlived_by_source_to_target(
154-
&mut self,
155-
) -> Result<bool, !> {
149+
fn add_universal_regions_outlived_by_source_to_target(&mut self) -> Result<bool, !> {
156150
Ok(
157151
self.inferred_values
158152
.add_universal_regions_outlived_by(self.source_region, self.target_region),
@@ -215,16 +209,19 @@ impl<'v, 'tcx> DfsOp for TestTargetOutlivesSource<'v, 'tcx> {
215209
// (This is implied by the loop below, actually, just an
216210
// irresistible micro-opt. Mm. Premature optimization. So
217211
// tasty.)
218-
if self.inferred_values.contains(self.target_region, ur_in_source) {
212+
if self.inferred_values
213+
.contains(self.target_region, ur_in_source)
214+
{
219215
continue;
220216
}
221217

222218
// If there is some other element X such that `target_region: X` and
223219
// `X: ur_in_source`, OK.
224220
if self.inferred_values
225-
.universal_regions_outlived_by(self.target_region)
226-
.any(|ur_in_target| self.universal_regions.outlives(ur_in_target, ur_in_source))
227-
{
221+
.universal_regions_outlived_by(self.target_region)
222+
.any(|ur_in_target| {
223+
self.universal_regions.outlives(ur_in_target, ur_in_source)
224+
}) {
228225
continue;
229226
}
230227

0 commit comments

Comments
 (0)