aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def
diff options
context:
space:
mode:
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.rs6
-rw-r--r--crates/ra_hir_def/src/item_tree/tests.rs6
-rw-r--r--crates/ra_hir_def/src/keys.rs2
5 files changed, 10 insertions, 10 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs
index d8963f63f..840841d87 100644
--- a/crates/ra_hir_def/src/body/lower.rs
+++ b/crates/ra_hir_def/src/body/lower.rs
@@ -652,7 +652,7 @@ impl ExprCollector<'_> {
652 let id = self.find_inner_item(&def)?; 652 let id = self.find_inner_item(&def)?;
653 (StaticLoc { container, id }.intern(self.db).into(), def.name()) 653 (StaticLoc { container, id }.intern(self.db).into(), def.name())
654 } 654 }
655 ast::Item::StructDef(def) => { 655 ast::Item::Struct(def) => {
656 let id = self.find_inner_item(&def)?; 656 let id = self.find_inner_item(&def)?;
657 (StructLoc { container, id }.intern(self.db).into(), def.name()) 657 (StructLoc { container, id }.intern(self.db).into(), def.name())
658 } 658 }
diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs
index 7bcc13b06..6b96a4c20 100644
--- a/crates/ra_hir_def/src/item_tree.rs
+++ b/crates/ra_hir_def/src/item_tree.rs
@@ -414,7 +414,7 @@ mod_items! {
414 Import in imports -> ast::Use, 414 Import in imports -> ast::Use,
415 ExternCrate in extern_crates -> ast::ExternCrate, 415 ExternCrate in extern_crates -> ast::ExternCrate,
416 Function in functions -> ast::Fn, 416 Function in functions -> ast::Fn,
417 Struct in structs -> ast::StructDef, 417 Struct in structs -> ast::Struct,
418 Union in unions -> ast::Union, 418 Union in unions -> ast::Union,
419 Enum in enums -> ast::EnumDef, 419 Enum in enums -> ast::EnumDef,
420 Const in consts -> ast::ConstDef, 420 Const in consts -> ast::ConstDef,
@@ -514,7 +514,7 @@ pub struct Struct {
514 pub visibility: RawVisibilityId, 514 pub visibility: RawVisibilityId,
515 pub generic_params: GenericParamsId, 515 pub generic_params: GenericParamsId,
516 pub fields: Fields, 516 pub fields: Fields,
517 pub ast_id: FileAstId<ast::StructDef>, 517 pub ast_id: FileAstId<ast::Struct>,
518 pub kind: StructDefKind, 518 pub kind: StructDefKind,
519} 519}
520 520
diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/ra_hir_def/src/item_tree/lower.rs
index 2721a02a5..a85618015 100644
--- a/crates/ra_hir_def/src/item_tree/lower.rs
+++ b/crates/ra_hir_def/src/item_tree/lower.rs
@@ -78,7 +78,7 @@ impl Ctx {
78 78
79 // Collect inner items for 1-to-1-lowered items. 79 // Collect inner items for 1-to-1-lowered items.
80 match item { 80 match item {
81 ast::Item::StructDef(_) 81 ast::Item::Struct(_)
82 | ast::Item::Union(_) 82 | ast::Item::Union(_)
83 | ast::Item::EnumDef(_) 83 | ast::Item::EnumDef(_)
84 | ast::Item::Fn(_) 84 | ast::Item::Fn(_)
@@ -103,7 +103,7 @@ impl Ctx {
103 103
104 let attrs = Attrs::new(item, &self.hygiene); 104 let attrs = Attrs::new(item, &self.hygiene);
105 let items = match item { 105 let items = match item {
106 ast::Item::StructDef(ast) => self.lower_struct(ast).map(Into::into), 106 ast::Item::Struct(ast) => self.lower_struct(ast).map(Into::into),
107 ast::Item::Union(ast) => self.lower_union(ast).map(Into::into), 107 ast::Item::Union(ast) => self.lower_union(ast).map(Into::into),
108 ast::Item::EnumDef(ast) => self.lower_enum(ast).map(Into::into), 108 ast::Item::EnumDef(ast) => self.lower_enum(ast).map(Into::into),
109 ast::Item::Fn(ast) => self.lower_function(ast).map(Into::into), 109 ast::Item::Fn(ast) => self.lower_function(ast).map(Into::into),
@@ -165,7 +165,7 @@ impl Ctx {
165 } 165 }
166 } 166 }
167 167
168 fn lower_struct(&mut self, strukt: &ast::StructDef) -> Option<FileItemTreeId<Struct>> { 168 fn lower_struct(&mut self, strukt: &ast::Struct) -> Option<FileItemTreeId<Struct>> {
169 let visibility = self.lower_visibility(strukt); 169 let visibility = self.lower_visibility(strukt);
170 let name = strukt.name()?.as_name(); 170 let name = strukt.name()?.as_name();
171 let generic_params = self.lower_generic_params(GenericsOwner::Struct, strukt); 171 let generic_params = self.lower_generic_params(GenericsOwner::Struct, strukt);
diff --git a/crates/ra_hir_def/src/item_tree/tests.rs b/crates/ra_hir_def/src/item_tree/tests.rs
index 0be021948..db37223da 100644
--- a/crates/ra_hir_def/src/item_tree/tests.rs
+++ b/crates/ra_hir_def/src/item_tree/tests.rs
@@ -244,11 +244,11 @@ fn smoke() {
244 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_dfl_method"))] }, input: None }]) }] 244 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_dfl_method"))] }, input: None }]) }]
245 > Function { name: Name(Text("dfl_method")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: true, is_unsafe: false, params: [Reference(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Self"))] }, generic_args: [None] }), Mut)], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Fn>(11) } 245 > Function { name: Name(Text("dfl_method")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: true, is_unsafe: false, params: [Reference(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Self"))] }, generic_args: [None] }), Mut)], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Fn>(11) }
246 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct0"))] }, input: None }]) }] 246 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct0"))] }, input: None }]) }]
247 Struct { name: Name(Text("Struct0")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), fields: Unit, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::StructDef>(3), kind: Unit } 247 Struct { name: Name(Text("Struct0")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), fields: Unit, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Struct>(3), kind: Unit }
248 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct1"))] }, input: None }]) }] 248 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct1"))] }, input: None }]) }]
249 Struct { name: Name(Text("Struct1")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(2), fields: Tuple(IdRange::<ra_hir_def::item_tree::Field>(0..1)), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::StructDef>(4), kind: Tuple } 249 Struct { name: Name(Text("Struct1")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(2), fields: Tuple(IdRange::<ra_hir_def::item_tree::Field>(0..1)), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Struct>(4), kind: Tuple }
250 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct2"))] }, input: None }]) }] 250 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct2"))] }, input: None }]) }]
251 Struct { name: Name(Text("Struct2")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(3), fields: Record(IdRange::<ra_hir_def::item_tree::Field>(1..2)), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::StructDef>(5), kind: Record } 251 Struct { name: Name(Text("Struct2")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(3), fields: Record(IdRange::<ra_hir_def::item_tree::Field>(1..2)), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Struct>(5), kind: Record }
252 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("en"))] }, input: None }]) }] 252 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("en"))] }, input: None }]) }]
253 Enum { name: Name(Text("En")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), variants: IdRange::<ra_hir_def::item_tree::Variant>(0..1), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::EnumDef>(6) } 253 Enum { name: Name(Text("En")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), variants: IdRange::<ra_hir_def::item_tree::Variant>(0..1), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::EnumDef>(6) }
254 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("un"))] }, input: None }]) }] 254 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("un"))] }, input: None }]) }]
diff --git a/crates/ra_hir_def/src/keys.rs b/crates/ra_hir_def/src/keys.rs
index 2282aed14..d9ec0f305 100644
--- a/crates/ra_hir_def/src/keys.rs
+++ b/crates/ra_hir_def/src/keys.rs
@@ -20,7 +20,7 @@ pub const STATIC: Key<ast::StaticDef, StaticId> = Key::new();
20pub const TYPE_ALIAS: Key<ast::TypeAlias, 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::Struct, StructId> = Key::new();
24pub const UNION: Key<ast::Union, UnionId> = Key::new(); 24pub const UNION: Key<ast::Union, UnionId> = Key::new();
25pub const ENUM: Key<ast::EnumDef, EnumId> = Key::new(); 25pub const ENUM: Key<ast::EnumDef, EnumId> = Key::new();
26 26