collect existentials and placeholders
This commit is contained in:
parent
2f79f73821
commit
960ebaf899
5 changed files with 76 additions and 20 deletions
|
@ -27,7 +27,7 @@ use rustc_middle::ty::fold::TypeFoldable;
|
|||
use rustc_middle::ty::relate::TypeRelation;
|
||||
use rustc_middle::ty::subst::{GenericArg, GenericArgKind};
|
||||
use rustc_middle::ty::{self, BoundVar, ToPredicate, Ty, TyCtxt};
|
||||
use rustc_span::Span;
|
||||
use rustc_span::{Span, Symbol};
|
||||
use std::fmt::Debug;
|
||||
use std::iter;
|
||||
|
||||
|
@ -318,7 +318,11 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||
|
||||
// Screen out `'a: 'a` cases.
|
||||
let ty::OutlivesPredicate(k1, r2) = r_c.0;
|
||||
if k1 != r2.into() { Some(r_c) } else { None }
|
||||
if k1 != r2.into() {
|
||||
Some(r_c)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
|
@ -683,7 +687,11 @@ impl<'tcx> TypeRelatingDelegate<'tcx> for QueryTypeRelatingDelegate<'_, 'tcx> {
|
|||
self.infcx.create_next_universe()
|
||||
}
|
||||
|
||||
fn next_existential_region_var(&mut self, from_forall: bool) -> ty::Region<'tcx> {
|
||||
fn next_existential_region_var(
|
||||
&mut self,
|
||||
from_forall: bool,
|
||||
_name: Option<Symbol>,
|
||||
) -> ty::Region<'tcx> {
|
||||
let origin = NllRegionVariableOrigin::Existential { from_forall };
|
||||
self.infcx.next_nll_region_var(origin)
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ use rustc_middle::ty::error::TypeError;
|
|||
use rustc_middle::ty::relate::{self, Relate, RelateResult, TypeRelation};
|
||||
use rustc_middle::ty::visit::{ir::TypeVisitor, TypeSuperVisitable, TypeVisitable};
|
||||
use rustc_middle::ty::{self, InferConst, Ty, TyCtxt};
|
||||
use rustc_span::Span;
|
||||
use rustc_span::{Span, Symbol};
|
||||
use std::fmt::Debug;
|
||||
use std::ops::ControlFlow;
|
||||
|
||||
|
@ -100,7 +100,11 @@ pub trait TypeRelatingDelegate<'tcx> {
|
|||
/// we will invoke this method to instantiate `'a` with an
|
||||
/// inference variable (though `'b` would be instantiated first,
|
||||
/// as a placeholder).
|
||||
fn next_existential_region_var(&mut self, was_placeholder: bool) -> ty::Region<'tcx>;
|
||||
fn next_existential_region_var(
|
||||
&mut self,
|
||||
was_placeholder: bool,
|
||||
name: Option<Symbol>,
|
||||
) -> ty::Region<'tcx>;
|
||||
|
||||
/// Creates a new region variable representing a
|
||||
/// higher-ranked region that is instantiated universally.
|
||||
|
@ -188,7 +192,7 @@ where
|
|||
let placeholder = ty::PlaceholderRegion { universe, name: br.kind };
|
||||
delegate.next_placeholder_region(placeholder)
|
||||
} else {
|
||||
delegate.next_existential_region_var(true)
|
||||
delegate.next_existential_region_var(true, br.kind.get_name())
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue