From bd8ed644e4362785b079ba9fbe2d4e490a678d27 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 24 Feb 2019 21:36:49 +0100 Subject: Rename Type => TypeAlias --- crates/ra_hir/src/ty/infer.rs | 4 ++-- crates/ra_hir/src/ty/lower.rs | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'crates/ra_hir/src/ty') diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 29331bea5..921130b71 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs @@ -406,7 +406,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { crate::ImplItem::Const(_) => None, // TODO: Resolve associated types - crate::ImplItem::Type(_) => None, + crate::ImplItem::TypeAlias(_) => None, })?; resolved = Resolution::Def(item.into()); } @@ -477,7 +477,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { let ty = self.insert_type_vars(ty.apply_substs(substs)); (ty, Some(var.into())) } - TypableDef::Type(_) | TypableDef::Function(_) | TypableDef::Enum(_) => { + TypableDef::TypeAlias(_) | TypableDef::Function(_) | TypableDef::Enum(_) => { (Ty::Unknown, None) } } diff --git a/crates/ra_hir/src/ty/lower.rs b/crates/ra_hir/src/ty/lower.rs index a11d964c8..b66b8e4a5 100644 --- a/crates/ra_hir/src/ty/lower.rs +++ b/crates/ra_hir/src/ty/lower.rs @@ -10,7 +10,7 @@ use std::sync::Arc; use crate::{ Function, Struct, StructField, Enum, EnumVariant, Path, Name, - ModuleDef, Type, + ModuleDef, TypeAlias, HirDatabase, type_ref::TypeRef, name::KnownName, @@ -124,7 +124,7 @@ impl Ty { TypableDef::Struct(s) => s.generic_params(db), TypableDef::Enum(e) => e.generic_params(db), TypableDef::EnumVariant(var) => var.parent_enum(db).generic_params(db), - TypableDef::Type(t) => t.generic_params(db), + TypableDef::TypeAlias(t) => t.generic_params(db), }; let parent_param_count = def_generics.count_parent_params(); substs.extend((0..parent_param_count).map(|_| Ty::Unknown)); @@ -163,7 +163,7 @@ impl Ty { TypableDef::Function(_) | TypableDef::Struct(_) | TypableDef::Enum(_) - | TypableDef::Type(_) => last, + | TypableDef::TypeAlias(_) => last, TypableDef::EnumVariant(_) => { // the generic args for an enum variant may be either specified // on the segment referring to the enum, or on the segment @@ -196,13 +196,13 @@ pub(crate) fn type_for_def(db: &impl HirDatabase, def: TypableDef, ns: Namespace (TypableDef::Struct(s), Namespace::Values) => type_for_struct_constructor(db, s), (TypableDef::Enum(e), Namespace::Types) => type_for_enum(db, e), (TypableDef::EnumVariant(v), Namespace::Values) => type_for_enum_variant_constructor(db, v), - (TypableDef::Type(t), Namespace::Types) => type_for_type_alias(db, t), + (TypableDef::TypeAlias(t), Namespace::Types) => type_for_type_alias(db, t), // 'error' cases: (TypableDef::Function(_), Namespace::Types) => Ty::Unknown, (TypableDef::Enum(_), Namespace::Values) => Ty::Unknown, (TypableDef::EnumVariant(_), Namespace::Types) => Ty::Unknown, - (TypableDef::Type(_), Namespace::Values) => Ty::Unknown, + (TypableDef::TypeAlias(_), Namespace::Values) => Ty::Unknown, } } @@ -302,7 +302,7 @@ fn type_for_enum(db: &impl HirDatabase, s: Enum) -> Ty { } } -fn type_for_type_alias(db: &impl HirDatabase, t: Type) -> Ty { +fn type_for_type_alias(db: &impl HirDatabase, t: TypeAlias) -> Ty { let generics = t.generic_params(db); let resolver = t.resolver(db); let type_ref = t.type_ref(db); @@ -317,9 +317,9 @@ pub enum TypableDef { Struct(Struct), Enum(Enum), EnumVariant(EnumVariant), - Type(Type), + TypeAlias(TypeAlias), } -impl_froms!(TypableDef: Function, Struct, Enum, EnumVariant, Type); +impl_froms!(TypableDef: Function, Struct, Enum, EnumVariant, TypeAlias); impl From for Option { fn from(def: ModuleDef) -> Option { @@ -328,7 +328,7 @@ impl From for Option { ModuleDef::Struct(s) => s.into(), ModuleDef::Enum(e) => e.into(), ModuleDef::EnumVariant(v) => v.into(), - ModuleDef::Type(t) => t.into(), + ModuleDef::TypeAlias(t) => t.into(), ModuleDef::Const(_) | ModuleDef::Static(_) | ModuleDef::Module(_) -- cgit v1.2.3