ty.flags -> ty.flags()
This commit is contained in:
parent
085e417087
commit
4d28a82c59
8 changed files with 23 additions and 11 deletions
|
@ -1828,9 +1828,9 @@ macro_rules! sty_debug_print {
|
|||
ty::Error(_) => /* unimportant */ continue,
|
||||
$(ty::$variant(..) => &mut $variant,)*
|
||||
};
|
||||
let lt = t.flags.intersects(ty::TypeFlags::HAS_RE_INFER);
|
||||
let ty = t.flags.intersects(ty::TypeFlags::HAS_TY_INFER);
|
||||
let ct = t.flags.intersects(ty::TypeFlags::HAS_CT_INFER);
|
||||
let lt = t.flags().intersects(ty::TypeFlags::HAS_RE_INFER);
|
||||
let ty = t.flags().intersects(ty::TypeFlags::HAS_TY_INFER);
|
||||
let ct = t.flags().intersects(ty::TypeFlags::HAS_CT_INFER);
|
||||
|
||||
variant.total += 1;
|
||||
total.total += 1;
|
||||
|
|
|
@ -253,7 +253,7 @@ impl FlagComputation {
|
|||
}
|
||||
|
||||
fn add_ty(&mut self, ty: Ty<'_>) {
|
||||
self.add_flags(ty.flags);
|
||||
self.add_flags(ty.flags());
|
||||
self.add_exclusive_binder(ty.outer_exclusive_binder);
|
||||
}
|
||||
|
||||
|
|
|
@ -352,7 +352,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
|
||||
fn visit_ty(&mut self, ty: Ty<'tcx>) -> bool {
|
||||
// We're only interested in types involving regions
|
||||
if ty.flags.intersects(TypeFlags::HAS_FREE_REGIONS) {
|
||||
if ty.flags().intersects(TypeFlags::HAS_FREE_REGIONS) {
|
||||
ty.super_visit_with(self)
|
||||
} else {
|
||||
false // keep visiting
|
||||
|
@ -922,8 +922,13 @@ struct HasTypeFlagsVisitor {
|
|||
|
||||
impl<'tcx> TypeVisitor<'tcx> for HasTypeFlagsVisitor {
|
||||
fn visit_ty(&mut self, t: Ty<'_>) -> bool {
|
||||
debug!("HasTypeFlagsVisitor: t={:?} t.flags={:?} self.flags={:?}", t, t.flags, self.flags);
|
||||
t.flags.intersects(self.flags)
|
||||
debug!(
|
||||
"HasTypeFlagsVisitor: t={:?} t.flags={:?} self.flags={:?}",
|
||||
t,
|
||||
t.flags(),
|
||||
self.flags
|
||||
);
|
||||
t.flags().intersects(self.flags)
|
||||
}
|
||||
|
||||
fn visit_region(&mut self, r: ty::Region<'tcx>) -> bool {
|
||||
|
|
|
@ -583,7 +583,9 @@ pub struct TyS<'tcx> {
|
|||
/// This field shouldn't be used directly and may be removed in the future.
|
||||
/// Use `TyS::kind()` instead.
|
||||
kind: TyKind<'tcx>,
|
||||
pub flags: TypeFlags,
|
||||
/// This field shouldn't be used directly and may be removed in the future.
|
||||
/// Use `TyS::flags()` instead.
|
||||
flags: TypeFlags,
|
||||
|
||||
/// This is a kind of confusing thing: it stores the smallest
|
||||
/// binder such that
|
||||
|
|
|
@ -1748,6 +1748,11 @@ impl<'tcx> TyS<'tcx> {
|
|||
&self.kind
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn flags(&self) -> TypeFlags {
|
||||
self.flags
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_unit(&self) -> bool {
|
||||
match self.kind() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue