Skip to content

Commit ecc1d79

Browse files
amandasystemslcnr
andcommitted
Code review adjustments to naming, comments, docstrings
Co-authored-by: lcnr <rust@lcnr.de>
1 parent 6a325fd commit ecc1d79

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

compiler/rustc_borrowck/src/handle_placeholders.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ impl RegionTracker {
163163

164164
/// Determine if the tracked universes of the two SCCs are compatible.
165165
pub(crate) fn universe_compatible_with(&self, other: Self) -> bool {
166+
// HACK: We first check whether we can name the highest existential universe
167+
// of `other`. This only exists to avoid errors in case that scc already
168+
// depends on a placeholder it cannot name itself.
166169
self.max_nameable_universe().can_name(other.max_nameable_universe())
167170
|| other.reachable_placeholders.can_be_named_by(self.max_nameable_universe())
168171
}
@@ -419,12 +422,12 @@ fn rewrite_placeholder_outlives<'tcx>(
419422
annotation.representative
420423
);
421424
// We only add one `r: 'static` constraint per SCC, where `r` is the SCC representative.
422-
// That constraint is annotated with some outlives relation `tries: unnameable` where
423-
// `unnameable` is unnameable from `tries` and there is a path in the constraint
424-
// graph between them.
425+
// That constraint is annotated with some outlives relation `lt: unnameable` where
426+
// `unnameable` is unnameable from `lt` and there is a path in the constraint graph
427+
// between them.
425428
//
426-
// We prefer the representative as `tries` in all cases but one: where the problem
427-
// is that the SCC has had its universe lowered to accomodate some other region and
429+
// We prefer the representative, `r`, as `lt` in all cases but one: where the problem
430+
// is that the SCC has had its universe lowered to accommodate some other region and
428431
// no longer can name its representative. In that case, we blame `r: low_u`, where `low_u`
429432
// cannot name `r` so that any explanation always starts with the SCC representative.
430433
let blame_to = if annotation.representative.rvid() == max_u_rvid {

0 commit comments

Comments
 (0)