From 609680ef97dbf82c07b6b06e21aa366423892304 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 17:52:53 +0200 Subject: Rename EnumDef -> Enum --- crates/ra_hir_def/src/adt.rs | 2 +- crates/ra_hir_def/src/body/lower.rs | 2 +- crates/ra_hir_def/src/item_tree.rs | 4 ++-- crates/ra_hir_def/src/item_tree/lower.rs | 6 +++--- crates/ra_hir_def/src/item_tree/tests.rs | 2 +- crates/ra_hir_def/src/keys.rs | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) (limited to 'crates/ra_hir_def/src') diff --git a/crates/ra_hir_def/src/adt.rs b/crates/ra_hir_def/src/adt.rs index 2be23c45d..df98ded62 100644 --- a/crates/ra_hir_def/src/adt.rs +++ b/crates/ra_hir_def/src/adt.rs @@ -124,7 +124,7 @@ impl HasChildSource for EnumId { fn lower_enum( db: &dyn DefDatabase, trace: &mut Trace, - ast: &InFile, + ast: &InFile, module_id: ModuleId, ) { let expander = CfgExpander::new(db, ast.file_id, module_id.krate); diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 840841d87..105299f70 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs @@ -656,7 +656,7 @@ impl ExprCollector<'_> { let id = self.find_inner_item(&def)?; (StructLoc { container, id }.intern(self.db).into(), def.name()) } - ast::Item::EnumDef(def) => { + ast::Item::Enum(def) => { let id = self.find_inner_item(&def)?; (EnumLoc { container, id }.intern(self.db).into(), def.name()) } diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs index 6b96a4c20..24ad41187 100644 --- a/crates/ra_hir_def/src/item_tree.rs +++ b/crates/ra_hir_def/src/item_tree.rs @@ -416,7 +416,7 @@ mod_items! { Function in functions -> ast::Fn, Struct in structs -> ast::Struct, Union in unions -> ast::Union, - Enum in enums -> ast::EnumDef, + Enum in enums -> ast::Enum, Const in consts -> ast::ConstDef, Static in statics -> ast::StaticDef, Trait in traits -> ast::TraitDef, @@ -543,7 +543,7 @@ pub struct Enum { pub visibility: RawVisibilityId, pub generic_params: GenericParamsId, pub variants: IdRange, - pub ast_id: FileAstId, + pub ast_id: FileAstId, } #[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 a85618015..da7238416 100644 --- a/crates/ra_hir_def/src/item_tree/lower.rs +++ b/crates/ra_hir_def/src/item_tree/lower.rs @@ -80,7 +80,7 @@ impl Ctx { match item { ast::Item::Struct(_) | ast::Item::Union(_) - | ast::Item::EnumDef(_) + | ast::Item::Enum(_) | ast::Item::Fn(_) | ast::Item::TypeAlias(_) | ast::Item::ConstDef(_) @@ -105,7 +105,7 @@ impl Ctx { let items = match item { ast::Item::Struct(ast) => self.lower_struct(ast).map(Into::into), ast::Item::Union(ast) => self.lower_union(ast).map(Into::into), - ast::Item::EnumDef(ast) => self.lower_enum(ast).map(Into::into), + ast::Item::Enum(ast) => self.lower_enum(ast).map(Into::into), ast::Item::Fn(ast) => self.lower_function(ast).map(Into::into), ast::Item::TypeAlias(ast) => self.lower_type_alias(ast).map(Into::into), ast::Item::StaticDef(ast) => self.lower_static(ast).map(Into::into), @@ -246,7 +246,7 @@ impl Ctx { Some(id(self.data().unions.alloc(res))) } - fn lower_enum(&mut self, enum_: &ast::EnumDef) -> Option> { + fn lower_enum(&mut self, enum_: &ast::Enum) -> Option> { let visibility = self.lower_visibility(enum_); let name = enum_.name()?.as_name(); let generic_params = self.lower_generic_params(GenericsOwner::Enum, enum_); diff --git a/crates/ra_hir_def/src/item_tree/tests.rs b/crates/ra_hir_def/src/item_tree/tests.rs index db37223da..bf3474c51 100644 --- a/crates/ra_hir_def/src/item_tree/tests.rs +++ b/crates/ra_hir_def/src/item_tree/tests.rs @@ -250,7 +250,7 @@ fn smoke() { #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct2"))] }, input: None }]) }] Struct { name: Name(Text("Struct2")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(3), fields: Record(IdRange::(1..2)), ast_id: FileAstId::(5), kind: Record } #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("en"))] }, input: None }]) }] - Enum { name: Name(Text("En")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), variants: IdRange::(0..1), ast_id: FileAstId::(6) } + Enum { name: Name(Text("En")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), variants: IdRange::(0..1), ast_id: FileAstId::(6) } #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("un"))] }, input: None }]) }] Union { name: Name(Text("Un")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), fields: Record(IdRange::(3..4)), ast_id: FileAstId::(7) } "##]], diff --git a/crates/ra_hir_def/src/keys.rs b/crates/ra_hir_def/src/keys.rs index d9ec0f305..2695e8c24 100644 --- a/crates/ra_hir_def/src/keys.rs +++ b/crates/ra_hir_def/src/keys.rs @@ -22,7 +22,7 @@ pub const IMPL: Key = Key::new(); pub const TRAIT: Key = Key::new(); pub const STRUCT: Key = Key::new(); pub const UNION: Key = Key::new(); -pub const ENUM: Key = Key::new(); +pub const ENUM: Key = Key::new(); pub const ENUM_VARIANT: Key = Key::new(); pub const TUPLE_FIELD: Key = Key::new(); -- cgit v1.2.3