rename needs_subst
to has_param
This commit is contained in:
parent
f04b8fe0af
commit
842419712a
18 changed files with 28 additions and 28 deletions
|
@ -761,7 +761,7 @@ impl<'tcx, T: TypeFoldable<TyCtxt<'tcx>>> ty::EarlyBinder<T> {
|
|||
|
||||
/// Returns the inner value, but only if it contains no bound vars.
|
||||
pub fn no_bound_vars(self) -> Option<T> {
|
||||
if !self.0.needs_subst() { Some(self.0) } else { None }
|
||||
if !self.0.has_param() { Some(self.0) } else { None }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -840,7 +840,7 @@ impl<'a, 'tcx> TypeFolder<TyCtxt<'tcx>> for SubstFolder<'a, 'tcx> {
|
|||
}
|
||||
|
||||
fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> {
|
||||
if !t.needs_subst() {
|
||||
if !t.has_param() {
|
||||
return t;
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ pub trait TypeVisitableExt<'tcx>: TypeVisitable<TyCtxt<'tcx>> {
|
|||
}
|
||||
}
|
||||
fn has_non_region_param(&self) -> bool {
|
||||
self.has_type_flags(TypeFlags::NEEDS_SUBST - TypeFlags::HAS_RE_PARAM)
|
||||
self.has_type_flags(TypeFlags::HAS_PARAM - TypeFlags::HAS_RE_PARAM)
|
||||
}
|
||||
fn has_infer_regions(&self) -> bool {
|
||||
self.has_type_flags(TypeFlags::HAS_RE_INFER)
|
||||
|
@ -94,8 +94,8 @@ pub trait TypeVisitableExt<'tcx>: TypeVisitable<TyCtxt<'tcx>> {
|
|||
fn has_non_region_placeholders(&self) -> bool {
|
||||
self.has_type_flags(TypeFlags::HAS_TY_PLACEHOLDER | TypeFlags::HAS_CT_PLACEHOLDER)
|
||||
}
|
||||
fn needs_subst(&self) -> bool {
|
||||
self.has_type_flags(TypeFlags::NEEDS_SUBST)
|
||||
fn has_param(&self) -> bool {
|
||||
self.has_type_flags(TypeFlags::HAS_PARAM)
|
||||
}
|
||||
/// "Free" regions in this context means that it has any region
|
||||
/// that is not (a) erased or (b) late-bound.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue