Skip to content

Commit f293558

Browse files
committed
Fix the bug
1 parent 7f34b61 commit f293558

File tree

1 file changed

+9
-2
lines changed
  • compiler/rustc_borrowck/src/region_infer

1 file changed

+9
-2
lines changed

compiler/rustc_borrowck/src/region_infer/mod.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ pub(crate) struct TypeTest<'tcx> {
479479
}
480480

481481
impl<'t> TypeTest<'t> {
482+
#[instrument(skip(sccs, scc_annotations, universal_regions), ret)]
482483
fn bound_has_universe_violation(
483484
bound: &VerifyBound<'t>,
484485
lower_scc: ConstraintSccIndex,
@@ -490,8 +491,13 @@ impl<'t> TypeTest<'t> {
490491
match bound {
491492
// An outlives constraint is equivalent to requiring the universe of that region.
492493
VerifyBound::OutlivedBy(region) => {
493-
let bound = scc_annotations[sccs.scc(universal_regions.to_region_vid(*region))];
494-
!bound.universe_compatible_with(lower)
494+
let rvid = universal_regions.to_region_vid(*region);
495+
if rvid == universal_regions.fr_static {
496+
false
497+
} else {
498+
let bound = scc_annotations[sccs.scc(rvid)];
499+
!bound.universe_compatible_with(lower)
500+
}
495501
}
496502
// This one is not obvious, but the argument goes something like this:
497503
// equality is implemented in a later check as verifying that they
@@ -526,6 +532,7 @@ impl<'t> TypeTest<'t> {
526532
}
527533
}
528534

535+
#[instrument(skip(sccs, tcx, universal_regions, scc_annotations), ret)]
529536
pub(crate) fn rewrite_higher_kinded_constraints(
530537
self,
531538
sccs: &Sccs<RegionVid, ConstraintSccIndex>,

0 commit comments

Comments
 (0)