diff options
author | Dmitry <[email protected]> | 2020-08-09 14:35:51 +0100 |
---|---|---|
committer | Dmitry <[email protected]> | 2020-08-09 14:39:32 +0100 |
commit | 8068302fefc75440b823f4bf1731a5f347d7c767 (patch) | |
tree | 251b967182e79bc82a58c2fb208c688f6152df1f /crates/ra_hir_expand/src/builtin_derive.rs | |
parent | 1a43a0f63e0008787225abb6fb2baef97b6a39e0 (diff) | |
parent | 8a57afe5a4bfab40072a83f7dc4ca560bf860919 (diff) |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'crates/ra_hir_expand/src/builtin_derive.rs')
-rw-r--r-- | crates/ra_hir_expand/src/builtin_derive.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_hir_expand/src/builtin_derive.rs b/crates/ra_hir_expand/src/builtin_derive.rs index f2d664863..69fa907cb 100644 --- a/crates/ra_hir_expand/src/builtin_derive.rs +++ b/crates/ra_hir_expand/src/builtin_derive.rs | |||
@@ -4,7 +4,7 @@ use log::debug; | |||
4 | 4 | ||
5 | use ra_parser::FragmentKind; | 5 | use ra_parser::FragmentKind; |
6 | use ra_syntax::{ | 6 | use ra_syntax::{ |
7 | ast::{self, AstNode, ModuleItemOwner, NameOwner, TypeParamsOwner}, | 7 | ast::{self, AstNode, GenericParamsOwner, ModuleItemOwner, NameOwner}, |
8 | match_ast, | 8 | match_ast, |
9 | }; | 9 | }; |
10 | 10 | ||
@@ -72,9 +72,9 @@ fn parse_adt(tt: &tt::Subtree) -> Result<BasicAdtInfo, mbe::ExpandError> { | |||
72 | let node = item.syntax(); | 72 | let node = item.syntax(); |
73 | let (name, params) = match_ast! { | 73 | let (name, params) = match_ast! { |
74 | match node { | 74 | match node { |
75 | ast::StructDef(it) => (it.name(), it.type_param_list()), | 75 | ast::Struct(it) => (it.name(), it.generic_param_list()), |
76 | ast::EnumDef(it) => (it.name(), it.type_param_list()), | 76 | ast::Enum(it) => (it.name(), it.generic_param_list()), |
77 | ast::UnionDef(it) => (it.name(), it.type_param_list()), | 77 | ast::Union(it) => (it.name(), it.generic_param_list()), |
78 | _ => { | 78 | _ => { |
79 | debug!("unexpected node is {:?}", node); | 79 | debug!("unexpected node is {:?}", node); |
80 | return Err(mbe::ExpandError::ConversionError) | 80 | return Err(mbe::ExpandError::ConversionError) |
@@ -276,7 +276,7 @@ mod tests { | |||
276 | let file_id = file_pos.file_id; | 276 | let file_id = file_pos.file_id; |
277 | let parsed = db.parse(file_id); | 277 | let parsed = db.parse(file_id); |
278 | let items: Vec<_> = | 278 | let items: Vec<_> = |
279 | parsed.syntax_node().descendants().filter_map(ast::ModuleItem::cast).collect(); | 279 | parsed.syntax_node().descendants().filter_map(ast::Item::cast).collect(); |
280 | 280 | ||
281 | let ast_id_map = db.ast_id_map(file_id.into()); | 281 | let ast_id_map = db.ast_id_map(file_id.into()); |
282 | 282 | ||