|
13 | 13 |
|
14 | 14 | use borrow_check::nll::universal_regions::UniversalRegions;
|
15 | 15 | 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}; |
17 | 18 | use rustc::mir::{Location, Mir};
|
18 | 19 | use rustc::ty::RegionVid;
|
19 | 20 | use rustc_data_structures::fx::FxHashSet;
|
@@ -112,9 +113,7 @@ pub(super) trait DfsOp {
|
112 | 113 |
|
113 | 114 | /// Adds all universal regions in the source region to the target region, returning
|
114 | 115 | /// 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>; |
118 | 117 | }
|
119 | 118 |
|
120 | 119 | /// Used during inference to enforce a `R1: R2 @ P` constraint. For
|
@@ -143,16 +142,11 @@ impl<'v> DfsOp for CopyFromSourceToTarget<'v> {
|
143 | 142 | .contains(self.source_region, point_index)
|
144 | 143 | }
|
145 | 144 |
|
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, !> { |
150 | 146 | Ok(self.inferred_values.add(self.target_region, point_index))
|
151 | 147 | }
|
152 | 148 |
|
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, !> { |
156 | 150 | Ok(
|
157 | 151 | self.inferred_values
|
158 | 152 | .add_universal_regions_outlived_by(self.source_region, self.target_region),
|
@@ -215,16 +209,19 @@ impl<'v, 'tcx> DfsOp for TestTargetOutlivesSource<'v, 'tcx> {
|
215 | 209 | // (This is implied by the loop below, actually, just an
|
216 | 210 | // irresistible micro-opt. Mm. Premature optimization. So
|
217 | 211 | // 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 | + { |
219 | 215 | continue;
|
220 | 216 | }
|
221 | 217 |
|
222 | 218 | // If there is some other element X such that `target_region: X` and
|
223 | 219 | // `X: ur_in_source`, OK.
|
224 | 220 | 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 | + }) { |
228 | 225 | continue;
|
229 | 226 | }
|
230 | 227 |
|
|
0 commit comments