@@ -13,7 +13,7 @@ use rustc_errors::MultiSpan;
13
13
use rustc_hir:: def:: { CtorOf , DefKind , Res } ;
14
14
use rustc_hir:: def_id:: { DefId , LocalDefId , LocalModDefId } ;
15
15
use rustc_hir:: intravisit:: { self , Visitor } ;
16
- use rustc_hir:: { self as hir, Node , PatExpr , PatExprKind , PatKind , TyKind } ;
16
+ use rustc_hir:: { self as hir, Node , PatKind , TyKind } ;
17
17
use rustc_middle:: middle:: codegen_fn_attrs:: CodegenFnAttrFlags ;
18
18
use rustc_middle:: middle:: privacy:: Level ;
19
19
use rustc_middle:: query:: Providers ;
@@ -636,10 +636,6 @@ impl<'tcx> Visitor<'tcx> for MarkSymbolVisitor<'tcx> {
636
636
let res = self . typeck_results ( ) . qpath_res ( path, pat. hir_id ) ;
637
637
self . handle_field_pattern_match ( pat, res, fields) ;
638
638
}
639
- PatKind :: Expr ( PatExpr { kind : PatExprKind :: Path ( ref qpath) , hir_id, .. } ) => {
640
- let res = self . typeck_results ( ) . qpath_res ( qpath, * hir_id) ;
641
- self . handle_res ( res) ;
642
- }
643
639
PatKind :: TupleStruct ( ref qpath, fields, dotdot) => {
644
640
let res = self . typeck_results ( ) . qpath_res ( qpath, pat. hir_id ) ;
645
641
self . handle_tuple_field_pattern_match ( pat, res, fields, dotdot) ;
@@ -651,6 +647,17 @@ impl<'tcx> Visitor<'tcx> for MarkSymbolVisitor<'tcx> {
651
647
self . in_pat = false ;
652
648
}
653
649
650
+ fn visit_pat_expr ( & mut self , expr : & ' tcx rustc_hir:: PatExpr < ' tcx > ) {
651
+ match & expr. kind {
652
+ rustc_hir:: PatExprKind :: Path ( qpath) => {
653
+ let res = self . typeck_results ( ) . qpath_res ( qpath, expr. hir_id ) ;
654
+ self . handle_res ( res) ;
655
+ }
656
+ _ => { }
657
+ }
658
+ intravisit:: walk_pat_expr ( self , expr) ;
659
+ }
660
+
654
661
fn visit_path ( & mut self , path : & hir:: Path < ' tcx > , _: hir:: HirId ) {
655
662
self . handle_res ( path. res ) ;
656
663
intravisit:: walk_path ( self , path) ;
0 commit comments