From 7a39bc3ba29351feabcd4a16e12568a9e12818ca Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 11 Apr 2020 16:42:24 +0200 Subject: Make records grammar more orthogonal We used name [: expr] grammar before, now it is [name :] expr which makes things simpler --- crates/ra_ide_db/src/defs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_ide_db/src') diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs index e9934844e..49a8c74fb 100644 --- a/crates/ra_ide_db/src/defs.rs +++ b/crates/ra_ide_db/src/defs.rs @@ -216,7 +216,7 @@ pub fn classify_name_ref( } } - if let Some(record_field) = ast::RecordField::cast(parent.clone()) { + if let Some(record_field) = ast::RecordField::for_field_name(name_ref) { tested_by!(goto_def_for_record_fields; force); tested_by!(goto_def_for_field_init_shorthand; force); if let Some((field, local)) = sema.resolve_record_field(&record_field) { -- cgit v1.2.3