put ReSkolemized into the global tcx
This commit is contained in:
parent
69400751ab
commit
149ab1bc39
@ -2192,12 +2192,7 @@ pub fn keep_local<'tcx, T: ty::TypeFoldable<'tcx>>(x: &T) -> bool {
|
||||
}
|
||||
|
||||
direct_interners!('tcx,
|
||||
region: mk_region(|r| {
|
||||
match r {
|
||||
&ty::ReVar(_) | &ty::ReSkolemized(..) => true,
|
||||
_ => false
|
||||
}
|
||||
}) -> RegionKind,
|
||||
region: mk_region(|r: &RegionKind| r.keep_in_local_tcx()) -> RegionKind,
|
||||
const_: mk_const(|c: &Const| keep_local(&c.ty) || keep_local(&c.val)) -> Const<'tcx>
|
||||
);
|
||||
|
||||
|
@ -1188,19 +1188,29 @@ impl RegionKind {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn keep_in_local_tcx(&self) -> bool {
|
||||
if let ty::ReVar(..) = self {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
pub fn type_flags(&self) -> TypeFlags {
|
||||
let mut flags = TypeFlags::empty();
|
||||
|
||||
if self.keep_in_local_tcx() {
|
||||
flags = flags | TypeFlags::KEEP_IN_LOCAL_TCX;
|
||||
}
|
||||
|
||||
match *self {
|
||||
ty::ReVar(..) => {
|
||||
flags = flags | TypeFlags::HAS_FREE_REGIONS;
|
||||
flags = flags | TypeFlags::HAS_RE_INFER;
|
||||
flags = flags | TypeFlags::KEEP_IN_LOCAL_TCX;
|
||||
}
|
||||
ty::ReSkolemized(..) => {
|
||||
flags = flags | TypeFlags::HAS_FREE_REGIONS;
|
||||
flags = flags | TypeFlags::HAS_RE_SKOL;
|
||||
flags = flags | TypeFlags::KEEP_IN_LOCAL_TCX;
|
||||
}
|
||||
ty::ReLateBound(..) => { }
|
||||
ty::ReEarlyBound(..) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user