Skip to content

Commit 23e3ffa

Browse files
committed
Simplify now that placeholders are gone
1 parent 3212751 commit 23e3ffa

File tree

1 file changed

+10
-21
lines changed
  • compiler/rustc_borrowck/src/region_infer

1 file changed

+10
-21
lines changed

compiler/rustc_borrowck/src/region_infer/mod.rs

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,29 +1451,18 @@ impl<'tcx> RegionInferenceContext<'tcx> {
14511451
placeholder: ty::PlaceholderRegion,
14521452
errors_buffer: &mut RegionErrors<'tcx>,
14531453
) {
1454-
debug!("check_bound_universal_region(fr={:?}, placeholder={:?})", longer_fr, placeholder,);
1455-
14561454
let longer_fr_scc = self.constraint_sccs.scc(longer_fr);
1457-
debug!("check_bound_universal_region: longer_fr_scc={:?}", longer_fr_scc,);
1458-
1459-
// FIXME(amandasystems): This is an inlined version of elements_contained_in, without
1460-
// placeholders, which are handled separately. Later, when placeholders are removed
1461-
// from scc_values, this part will just be elements_contained_in():
1462-
let mut non_placeholder_regions_in = self
1463-
.scc_values
1464-
.locations_outlived_by(longer_fr_scc)
1465-
.map(RegionElement::Location)
1466-
.chain(
1467-
self.scc_values
1468-
.universal_regions_outlived_by(longer_fr_scc)
1469-
.map(RegionElement::RootUniversalRegion),
1470-
);
14711455

1472-
// If we have some bound universal region `'a`, then the only
1473-
// elements it can contain is itself -- we don't know anything
1474-
// else about it!
1475-
if let Some(error_element) = non_placeholder_regions_in.next() {
1476-
// Stop after the first error, it gets too noisy otherwise, and does not provide more information.
1456+
debug!(
1457+
"check_bound_universal_region(fr={:?}, placeholder={:?}, scc={:?})",
1458+
longer_fr, placeholder, longer_fr_scc
1459+
);
1460+
1461+
// If we have some bound universal region `'a`, then the only elements it can contain
1462+
// is itself -- we don't know anything else about it!
1463+
//
1464+
// Stop after the first error, it gets too noisy otherwise, and does not provide more information.
1465+
if let Some(error_element) = self.scc_values.elements_contained_in(longer_fr_scc).next() {
14771466
errors_buffer.push(RegionErrorKind::PlaceholderOutlivesLocationOrUniversal {
14781467
longer_fr,
14791468
error_element,

0 commit comments

Comments
 (0)