@@ -62,10 +62,9 @@ pub(crate) enum ReferenceResult {
6262
6363impl ReferenceResult {
6464 fn to_vec ( self ) -> Vec < NavigationTarget > {
65- use self :: ReferenceResult :: * ;
6665 match self {
67- Exact ( target) => vec ! [ target] ,
68- Approximate ( vec) => vec,
66+ ReferenceResult :: Exact ( target) => vec ! [ target] ,
67+ ReferenceResult :: Approximate ( vec) => vec,
6968 }
7069 }
7170}
@@ -74,8 +73,6 @@ pub(crate) fn reference_definition(
7473 sema : & Semantics < RootDatabase > ,
7574 name_ref : & ast:: NameRef ,
7675) -> ReferenceResult {
77- use self :: ReferenceResult :: * ;
78-
7976 let name_kind = classify_name_ref ( sema, name_ref) ;
8077 if let Some ( def) = name_kind {
8178 let def = def. definition ( ) ;
@@ -91,7 +88,7 @@ pub(crate) fn reference_definition(
9188 . into_iter ( )
9289 . map ( |s| s. to_nav ( sema. db ) )
9390 . collect ( ) ;
94- Approximate ( navs)
91+ ReferenceResult :: Approximate ( navs)
9592}
9693
9794#[ cfg( test) ]
@@ -398,6 +395,25 @@ mod tests {
398395 ) ;
399396 }
400397
398+ #[ test]
399+ fn goto_def_for_record_pat_fields ( ) {
400+ covers ! ( ra_ide_db:: goto_def_for_record_field_pats) ;
401+ check_goto (
402+ r"
403+ //- /lib.rs
404+ struct Foo {
405+ spam: u32,
406+ }
407+
408+ fn bar(foo: Foo) -> Foo {
409+ let Foo { spam<|>: _, } = foo
410+ }
411+ " ,
412+ "spam RECORD_FIELD_DEF FileId(1) [17; 26) [17; 21)" ,
413+ "spam: u32|spam" ,
414+ ) ;
415+ }
416+
401417 #[ test]
402418 fn goto_def_for_record_fields_macros ( ) {
403419 check_goto (
0 commit comments