Skip to content

Commit 5b95e9c

Browse files
committed
Remove some stuff we don't need or can't use anymore
1 parent 72a267a commit 5b95e9c

File tree

3 files changed

+7
-20
lines changed

3 files changed

+7
-20
lines changed

compiler/rustc_borrowck/src/nll.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,14 @@ pub(crate) fn compute_regions<'cx, 'tcx>(
119119
// base constraints generated by the type-check.
120120
let var_origins = infcx.get_region_var_origins();
121121
let MirTypeckRegionConstraints {
122-
placeholder_indices,
122+
placeholder_indices: _,
123123
placeholder_index_to_region: _,
124124
liveness_constraints,
125125
mut outlives_constraints,
126126
mut member_constraints,
127127
universe_causes,
128128
type_tests,
129129
} = constraints;
130-
let placeholder_indices = Rc::new(placeholder_indices);
131130

132131
// If requested, emit legacy polonius facts.
133132
polonius::emit_facts(
@@ -155,7 +154,6 @@ pub(crate) fn compute_regions<'cx, 'tcx>(
155154
infcx,
156155
var_origins,
157156
universal_regions,
158-
placeholder_indices,
159157
universal_region_relations,
160158
outlives_constraints,
161159
member_constraints,

compiler/rustc_borrowck/src/region_infer/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
493493
infcx: &BorrowckInferCtxt<'tcx>,
494494
var_infos: VarInfos,
495495
universal_regions: Rc<UniversalRegions<'tcx>>,
496-
placeholder_indices: Rc<PlaceholderIndices>,
497496
universal_region_relations: Frozen<UniversalRegionRelations<'tcx>>,
498497
mut outlives_constraints: OutlivesConstraintSet<'tcx>,
499498
member_constraints_in: MemberConstraintSet<'tcx, RegionVid>,
@@ -504,7 +503,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
504503
) -> Self {
505504
debug!("universal_regions: {:#?}", universal_regions);
506505
debug!("outlives constraints: {:#?}", outlives_constraints);
507-
debug!("placeholder_indices: {:#?}", placeholder_indices);
508506
debug!("type tests: {:#?}", type_tests);
509507

510508
// Create a RegionDefinition for each inference variable.
@@ -1672,9 +1670,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
16721670
debug!(
16731671
"check_bound_universal_region, error_element: {error_element:?} for placeholder {placeholder:?} in scc: {longer_fr_scc:?}"
16741672
);
1675-
match error_element {
1676-
RegionElement::Location(_) | RegionElement::RootUniversalRegion(_) => {}
1677-
}
16781673

16791674
errors_buffer.push(RegionErrorKind::BoundUniversalRegionError {
16801675
longer_fr,

compiler/rustc_borrowck/src/region_infer/opaque_types.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -212,18 +212,12 @@ impl<'tcx> RegionInferenceContext<'tcx> {
212212

213213
// Special handling of higher-ranked regions.
214214
if !self.scc_universe(scc).is_root() {
215-
if self
216-
.constraint_sccs
217-
.annotation(scc)
218-
.placeholder_representative()
219-
.is_some_and(|scc_placeholder| vid == scc_placeholder)
220-
{
221-
// FIXME: somehow construct the right type out of the representative!
222-
return region;
223-
} else {
224-
// Fallback: this will produce a cryptic error message.
225-
return region;
226-
}
215+
// FIXME: the original logic was: if this SCC contains one single
216+
// placeholder, equal to vid, then construct a
217+
// ty::Region::new_placeholder out of it, somehow. This no longer
218+
// works as an approach, since we cannot get the prerequisite indices.
219+
debug!("Cannot get a nice name for higher-ranked region {vid:?} as {region:?}");
220+
return region;
227221
}
228222

229223
// Find something that we can name

0 commit comments

Comments
 (0)