aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r--crates/ra_hir_def/src/body/lower.rs2
-rw-r--r--crates/ra_hir_def/src/generics.rs4
-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.rs4
-rw-r--r--crates/ra_hir_def/src/keys.rs2
6 files changed, 12 insertions, 12 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs
index 4a26e6397..0d0242173 100644
--- a/crates/ra_hir_def/src/body/lower.rs
+++ b/crates/ra_hir_def/src/body/lower.rs
@@ -664,7 +664,7 @@ impl ExprCollector<'_> {
664 let id = self.find_inner_item(&def)?; 664 let id = self.find_inner_item(&def)?;
665 (UnionLoc { container, id }.intern(self.db).into(), def.name()) 665 (UnionLoc { container, id }.intern(self.db).into(), def.name())
666 } 666 }
667 ast::Item::TraitDef(def) => { 667 ast::Item::Trait(def) => {
668 let id = self.find_inner_item(&def)?; 668 let id = self.find_inner_item(&def)?;
669 (TraitLoc { container, id }.intern(self.db).into(), def.name()) 669 (TraitLoc { container, id }.intern(self.db).into(), def.name())
670 } 670 }
diff --git a/crates/ra_hir_def/src/generics.rs b/crates/ra_hir_def/src/generics.rs
index 5fa2fbb3f..8ea61fcf2 100644
--- a/crates/ra_hir_def/src/generics.rs
+++ b/crates/ra_hir_def/src/generics.rs
@@ -66,7 +66,7 @@ pub enum WherePredicateTarget {
66 TypeParam(LocalTypeParamId), 66 TypeParam(LocalTypeParamId),
67} 67}
68 68
69type SourceMap = ArenaMap<LocalTypeParamId, Either<ast::TraitDef, ast::TypeParam>>; 69type SourceMap = ArenaMap<LocalTypeParamId, Either<ast::Trait, ast::TypeParam>>;
70 70
71impl GenericParams { 71impl GenericParams {
72 pub(crate) fn generic_params_query( 72 pub(crate) fn generic_params_query(
@@ -317,7 +317,7 @@ impl GenericParams {
317 317
318impl HasChildSource for GenericDefId { 318impl HasChildSource for GenericDefId {
319 type ChildId = LocalTypeParamId; 319 type ChildId = LocalTypeParamId;
320 type Value = Either<ast::TraitDef, ast::TypeParam>; 320 type Value = Either<ast::Trait, ast::TypeParam>;
321 fn child_source(&self, db: &dyn DefDatabase) -> InFile<SourceMap> { 321 fn child_source(&self, db: &dyn DefDatabase) -> InFile<SourceMap> {
322 let (_, sm) = GenericParams::new(db, *self); 322 let (_, sm) = GenericParams::new(db, *self);
323 sm 323 sm
diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs
index c478a9909..11002b1ad 100644
--- a/crates/ra_hir_def/src/item_tree.rs
+++ b/crates/ra_hir_def/src/item_tree.rs
@@ -419,7 +419,7 @@ mod_items! {
419 Enum in enums -> ast::Enum, 419 Enum in enums -> ast::Enum,
420 Const in consts -> ast::Const, 420 Const in consts -> ast::Const,
421 Static in statics -> ast::Static, 421 Static in statics -> ast::Static,
422 Trait in traits -> ast::TraitDef, 422 Trait in traits -> ast::Trait,
423 Impl in impls -> ast::ImplDef, 423 Impl in impls -> ast::ImplDef,
424 TypeAlias in type_aliases -> ast::TypeAlias, 424 TypeAlias in type_aliases -> ast::TypeAlias,
425 Mod in mods -> ast::Module, 425 Mod in mods -> ast::Module,
@@ -571,7 +571,7 @@ pub struct Trait {
571 pub generic_params: GenericParamsId, 571 pub generic_params: GenericParamsId,
572 pub auto: bool, 572 pub auto: bool,
573 pub items: Box<[AssocItem]>, 573 pub items: Box<[AssocItem]>,
574 pub ast_id: FileAstId<ast::TraitDef>, 574 pub ast_id: FileAstId<ast::Trait>,
575} 575}
576 576
577#[derive(Debug, Clone, Eq, PartialEq)] 577#[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 a94548e5d..aaf3cfd3a 100644
--- a/crates/ra_hir_def/src/item_tree/lower.rs
+++ b/crates/ra_hir_def/src/item_tree/lower.rs
@@ -95,7 +95,7 @@ impl Ctx {
95 95
96 // These are handled in their respective `lower_X` method (since we can't just blindly 96 // These are handled in their respective `lower_X` method (since we can't just blindly
97 // walk them). 97 // walk them).
98 ast::Item::TraitDef(_) | ast::Item::ImplDef(_) | ast::Item::ExternBlock(_) => {} 98 ast::Item::Trait(_) | ast::Item::ImplDef(_) | ast::Item::ExternBlock(_) => {}
99 99
100 // These don't have inner items. 100 // These don't have inner items.
101 ast::Item::Module(_) | ast::Item::ExternCrate(_) | ast::Item::Use(_) => {} 101 ast::Item::Module(_) | ast::Item::ExternCrate(_) | ast::Item::Use(_) => {}
@@ -111,7 +111,7 @@ impl Ctx {
111 ast::Item::Static(ast) => self.lower_static(ast).map(Into::into), 111 ast::Item::Static(ast) => self.lower_static(ast).map(Into::into),
112 ast::Item::Const(ast) => Some(self.lower_const(ast).into()), 112 ast::Item::Const(ast) => Some(self.lower_const(ast).into()),
113 ast::Item::Module(ast) => self.lower_module(ast).map(Into::into), 113 ast::Item::Module(ast) => self.lower_module(ast).map(Into::into),
114 ast::Item::TraitDef(ast) => self.lower_trait(ast).map(Into::into), 114 ast::Item::Trait(ast) => self.lower_trait(ast).map(Into::into),
115 ast::Item::ImplDef(ast) => self.lower_impl(ast).map(Into::into), 115 ast::Item::ImplDef(ast) => self.lower_impl(ast).map(Into::into),
116 ast::Item::Use(ast) => Some(ModItems( 116 ast::Item::Use(ast) => Some(ModItems(
117 self.lower_use(ast).into_iter().map(Into::into).collect::<SmallVec<_>>(), 117 self.lower_use(ast).into_iter().map(Into::into).collect::<SmallVec<_>>(),
@@ -413,7 +413,7 @@ impl Ctx {
413 Some(id(self.data().mods.alloc(res))) 413 Some(id(self.data().mods.alloc(res)))
414 } 414 }
415 415
416 fn lower_trait(&mut self, trait_def: &ast::TraitDef) -> Option<FileItemTreeId<Trait>> { 416 fn lower_trait(&mut self, trait_def: &ast::Trait) -> Option<FileItemTreeId<Trait>> {
417 let name = trait_def.name()?.as_name(); 417 let name = trait_def.name()?.as_name();
418 let visibility = self.lower_visibility(trait_def); 418 let visibility = self.lower_visibility(trait_def);
419 let generic_params = 419 let generic_params =
@@ -698,7 +698,7 @@ enum GenericsOwner<'a> {
698 Enum, 698 Enum,
699 Union, 699 Union,
700 /// The `TraitDef` is needed to fill the source map for the implicit `Self` parameter. 700 /// The `TraitDef` is needed to fill the source map for the implicit `Self` parameter.
701 Trait(&'a ast::TraitDef), 701 Trait(&'a ast::Trait),
702 TypeAlias, 702 TypeAlias,
703 Impl, 703 Impl,
704} 704}
diff --git a/crates/ra_hir_def/src/item_tree/tests.rs b/crates/ra_hir_def/src/item_tree/tests.rs
index e61ce58bc..40a9bd53d 100644
--- a/crates/ra_hir_def/src/item_tree/tests.rs
+++ b/crates/ra_hir_def/src/item_tree/tests.rs
@@ -234,7 +234,7 @@ fn smoke() {
234 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("ext_crate"))] }, input: None }]) }] 234 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("ext_crate"))] }, input: None }]) }]
235 ExternCrate { path: ModPath { kind: Plain, segments: [Name(Text("krate"))] }, alias: None, visibility: RawVisibilityId("pub(self)"), is_macro_use: false, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::ExternCrate>(1) } 235 ExternCrate { path: ModPath { kind: Plain, segments: [Name(Text("krate"))] }, alias: None, visibility: RawVisibilityId("pub(self)"), is_macro_use: false, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::ExternCrate>(1) }
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::Trait>(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::TypeAlias>(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 }]) }]
@@ -327,7 +327,7 @@ fn trait_attrs() {
327 327
328 top-level items: 328 top-level items:
329 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("trait_attr"))] }, input: None }]) }] 329 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("trait_attr"))] }, input: None }]) }]
330 Trait { name: Name(Text("Tr")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(0), auto: false, items: [Function(Idx::<Function>(0)), Function(Idx::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::TraitDef>(0) } 330 Trait { name: Name(Text("Tr")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(0), auto: false, items: [Function(Idx::<Function>(0)), Function(Idx::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Trait>(0) }
331 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_a"))] }, input: None }]) }] 331 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_a"))] }, input: None }]) }]
332 > Function { name: Name(Text("a")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Fn>(1) } 332 > Function { name: Name(Text("a")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Fn>(1) }
333 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_b"))] }, input: None }]) }] 333 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_b"))] }, input: None }]) }]
diff --git a/crates/ra_hir_def/src/keys.rs b/crates/ra_hir_def/src/keys.rs
index f75e3bb50..0bed08875 100644
--- a/crates/ra_hir_def/src/keys.rs
+++ b/crates/ra_hir_def/src/keys.rs
@@ -19,7 +19,7 @@ pub const CONST: Key<ast::Const, ConstId> = Key::new();
19pub const STATIC: Key<ast::Static, StaticId> = Key::new(); 19pub const STATIC: Key<ast::Static, 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::Trait, TraitId> = Key::new();
23pub const STRUCT: Key<ast::Struct, 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::Enum, EnumId> = Key::new(); 25pub const ENUM: Key<ast::Enum, EnumId> = Key::new();