aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-30 14:25:46 +0100
committerAleksey Kladov <[email protected]>2020-07-30 14:25:46 +0100
commiteb2f8063444b11257111f4f8ade990ec810e0361 (patch)
tree999cef9fc647293699515f1e0ac59492e64c1116 /crates/ra_hir_def
parent1142112c70b705f59b7d559d9d72cdc831865158 (diff)
Rename TypeAliasDef -> TypeAlias
Diffstat (limited to 'crates/ra_hir_def')
-rw-r--r--crates/ra_hir_def/src/body/lower.rs2
-rw-r--r--crates/ra_hir_def/src/item_tree.rs4
-rw-r--r--crates/ra_hir_def/src/item_tree/lower.rs8
-rw-r--r--crates/ra_hir_def/src/item_tree/tests.rs2
-rw-r--r--crates/ra_hir_def/src/keys.rs2
5 files changed, 9 insertions, 9 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs
index 6b13f013d..f463997e7 100644
--- a/crates/ra_hir_def/src/body/lower.rs
+++ b/crates/ra_hir_def/src/body/lower.rs
@@ -634,7 +634,7 @@ impl ExprCollector<'_> {
634 def.name(), 634 def.name(),
635 ) 635 )
636 } 636 }
637 ast::Item::TypeAliasDef(def) => { 637 ast::Item::TypeAlias(def) => {
638 let id = self.find_inner_item(&def)?; 638 let id = self.find_inner_item(&def)?;
639 ( 639 (
640 TypeAliasLoc { container: container.into(), id }.intern(self.db).into(), 640 TypeAliasLoc { container: container.into(), id }.intern(self.db).into(),
diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs
index 34fc9ff8e..ea61ac217 100644
--- a/crates/ra_hir_def/src/item_tree.rs
+++ b/crates/ra_hir_def/src/item_tree.rs
@@ -421,7 +421,7 @@ mod_items! {
421 Static in statics -> ast::StaticDef, 421 Static in statics -> ast::StaticDef,
422 Trait in traits -> ast::TraitDef, 422 Trait in traits -> ast::TraitDef,
423 Impl in impls -> ast::ImplDef, 423 Impl in impls -> ast::ImplDef,
424 TypeAlias in type_aliases -> ast::TypeAliasDef, 424 TypeAlias in type_aliases -> ast::TypeAlias,
425 Mod in mods -> ast::Module, 425 Mod in mods -> ast::Module,
426 MacroCall in macro_calls -> ast::MacroCall, 426 MacroCall in macro_calls -> ast::MacroCall,
427} 427}
@@ -592,7 +592,7 @@ pub struct TypeAlias {
592 pub bounds: Box<[TypeBound]>, 592 pub bounds: Box<[TypeBound]>,
593 pub generic_params: GenericParamsId, 593 pub generic_params: GenericParamsId,
594 pub type_ref: Option<TypeRef>, 594 pub type_ref: Option<TypeRef>,
595 pub ast_id: FileAstId<ast::TypeAliasDef>, 595 pub ast_id: FileAstId<ast::TypeAlias>,
596} 596}
597 597
598#[derive(Debug, Clone, Eq, PartialEq)] 598#[derive(Debug, Clone, Eq, PartialEq)]
diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/ra_hir_def/src/item_tree/lower.rs
index 2764d8674..4cfc68f53 100644
--- a/crates/ra_hir_def/src/item_tree/lower.rs
+++ b/crates/ra_hir_def/src/item_tree/lower.rs
@@ -79,7 +79,7 @@ impl Ctx {
79 | ast::Item::UnionDef(_) 79 | ast::Item::UnionDef(_)
80 | ast::Item::EnumDef(_) 80 | ast::Item::EnumDef(_)
81 | ast::Item::Fn(_) 81 | ast::Item::Fn(_)
82 | ast::Item::TypeAliasDef(_) 82 | ast::Item::TypeAlias(_)
83 | ast::Item::ConstDef(_) 83 | ast::Item::ConstDef(_)
84 | ast::Item::StaticDef(_) 84 | ast::Item::StaticDef(_)
85 | ast::Item::MacroCall(_) => { 85 | ast::Item::MacroCall(_) => {
@@ -104,7 +104,7 @@ impl Ctx {
104 ast::Item::UnionDef(ast) => self.lower_union(ast).map(Into::into), 104 ast::Item::UnionDef(ast) => self.lower_union(ast).map(Into::into),
105 ast::Item::EnumDef(ast) => self.lower_enum(ast).map(Into::into), 105 ast::Item::EnumDef(ast) => self.lower_enum(ast).map(Into::into),
106 ast::Item::Fn(ast) => self.lower_function(ast).map(Into::into), 106 ast::Item::Fn(ast) => self.lower_function(ast).map(Into::into),
107 ast::Item::TypeAliasDef(ast) => self.lower_type_alias(ast).map(Into::into), 107 ast::Item::TypeAlias(ast) => self.lower_type_alias(ast).map(Into::into),
108 ast::Item::StaticDef(ast) => self.lower_static(ast).map(Into::into), 108 ast::Item::StaticDef(ast) => self.lower_static(ast).map(Into::into),
109 ast::Item::ConstDef(ast) => Some(self.lower_const(ast).into()), 109 ast::Item::ConstDef(ast) => Some(self.lower_const(ast).into()),
110 ast::Item::Module(ast) => self.lower_module(ast).map(Into::into), 110 ast::Item::Module(ast) => self.lower_module(ast).map(Into::into),
@@ -156,7 +156,7 @@ impl Ctx {
156 fn lower_assoc_item(&mut self, item: &ast::AssocItem) -> Option<AssocItem> { 156 fn lower_assoc_item(&mut self, item: &ast::AssocItem) -> Option<AssocItem> {
157 match item { 157 match item {
158 ast::AssocItem::Fn(ast) => self.lower_function(ast).map(Into::into), 158 ast::AssocItem::Fn(ast) => self.lower_function(ast).map(Into::into),
159 ast::AssocItem::TypeAliasDef(ast) => self.lower_type_alias(ast).map(Into::into), 159 ast::AssocItem::TypeAlias(ast) => self.lower_type_alias(ast).map(Into::into),
160 ast::AssocItem::ConstDef(ast) => Some(self.lower_const(ast).into()), 160 ast::AssocItem::ConstDef(ast) => Some(self.lower_const(ast).into()),
161 ast::AssocItem::MacroCall(ast) => self.lower_macro_call(ast).map(Into::into), 161 ast::AssocItem::MacroCall(ast) => self.lower_macro_call(ast).map(Into::into),
162 } 162 }
@@ -348,7 +348,7 @@ impl Ctx {
348 348
349 fn lower_type_alias( 349 fn lower_type_alias(
350 &mut self, 350 &mut self,
351 type_alias: &ast::TypeAliasDef, 351 type_alias: &ast::TypeAlias,
352 ) -> Option<FileItemTreeId<TypeAlias>> { 352 ) -> Option<FileItemTreeId<TypeAlias>> {
353 let name = type_alias.name()?.as_name(); 353 let name = type_alias.name()?.as_name();
354 let type_ref = type_alias.type_ref().map(|it| self.lower_type_ref(&it)); 354 let type_ref = type_alias.type_ref().map(|it| self.lower_type_ref(&it));
diff --git a/crates/ra_hir_def/src/item_tree/tests.rs b/crates/ra_hir_def/src/item_tree/tests.rs
index 4e2f6008b..a8f5da1c1 100644
--- a/crates/ra_hir_def/src/item_tree/tests.rs
+++ b/crates/ra_hir_def/src/item_tree/tests.rs
@@ -236,7 +236,7 @@ fn smoke() {
236 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("on_trait"))] }, input: None }]) }] 236 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("on_trait"))] }, input: None }]) }]
237 Trait { name: Name(Text("Tr")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(0), auto: false, items: [TypeAlias(Idx::<TypeAlias>(0)), Const(Idx::<Const>(0)), Function(Idx::<Function>(0)), Function(Idx::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::TraitDef>(2) } 237 Trait { name: Name(Text("Tr")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(0), auto: false, items: [TypeAlias(Idx::<TypeAlias>(0)), Const(Idx::<Const>(0)), Function(Idx::<Function>(0)), Function(Idx::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::TraitDef>(2) }
238 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_ty"))] }, input: None }]) }] 238 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_ty"))] }, input: None }]) }]
239 > TypeAlias { name: Name(Text("AssocTy")), visibility: RawVisibilityId("pub(self)"), bounds: [Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Tr"))] }, generic_args: [Some(GenericArgs { args: [Type(Tuple([]))], has_self_type: false, bindings: [] })] })], generic_params: GenericParamsId(4294967295), type_ref: None, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::TypeAliasDef>(8) } 239 > TypeAlias { name: Name(Text("AssocTy")), visibility: RawVisibilityId("pub(self)"), bounds: [Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Tr"))] }, generic_args: [Some(GenericArgs { args: [Type(Tuple([]))], has_self_type: false, bindings: [] })] })], generic_params: GenericParamsId(4294967295), type_ref: None, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::TypeAlias>(8) }
240 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_const"))] }, input: None }]) }] 240 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_const"))] }, input: None }]) }]
241 > Const { name: Some(Name(Text("CONST"))), visibility: RawVisibilityId("pub(self)"), type_ref: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("u8"))] }, generic_args: [None] }), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::ConstDef>(9) } 241 > Const { name: Some(Name(Text("CONST"))), visibility: RawVisibilityId("pub(self)"), type_ref: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("u8"))] }, generic_args: [None] }), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::ConstDef>(9) }
242 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_method"))] }, input: None }]) }] 242 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_method"))] }, input: None }]) }]
diff --git a/crates/ra_hir_def/src/keys.rs b/crates/ra_hir_def/src/keys.rs
index 7fed5523e..f627eab1f 100644
--- a/crates/ra_hir_def/src/keys.rs
+++ b/crates/ra_hir_def/src/keys.rs
@@ -17,7 +17,7 @@ pub type Key<K, V> = crate::dyn_map::Key<InFile<K>, V, AstPtrPolicy<K, V>>;
17pub const FUNCTION: Key<ast::Fn, FunctionId> = Key::new(); 17pub const FUNCTION: Key<ast::Fn, FunctionId> = Key::new();
18pub const CONST: Key<ast::ConstDef, ConstId> = Key::new(); 18pub const CONST: Key<ast::ConstDef, ConstId> = Key::new();
19pub const STATIC: Key<ast::StaticDef, StaticId> = Key::new(); 19pub const STATIC: Key<ast::StaticDef, StaticId> = Key::new();
20pub const TYPE_ALIAS: Key<ast::TypeAliasDef, TypeAliasId> = Key::new(); 20pub const TYPE_ALIAS: Key<ast::TypeAlias, TypeAliasId> = Key::new();
21pub const IMPL: Key<ast::ImplDef, ImplId> = Key::new(); 21pub const IMPL: Key<ast::ImplDef, ImplId> = Key::new();
22pub const TRAIT: Key<ast::TraitDef, TraitId> = Key::new(); 22pub const TRAIT: Key<ast::TraitDef, TraitId> = Key::new();
23pub const STRUCT: Key<ast::StructDef, StructId> = Key::new(); 23pub const STRUCT: Key<ast::StructDef, StructId> = Key::new();