@@ -13,7 +13,7 @@ use rustc_errors::MultiSpan;
1313use rustc_hir:: def:: { CtorOf , DefKind , Res } ;
1414use rustc_hir:: def_id:: { DefId , LocalDefId , LocalModDefId } ;
1515use 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 } ;
1717use rustc_middle:: middle:: codegen_fn_attrs:: CodegenFnAttrFlags ;
1818use rustc_middle:: middle:: privacy:: Level ;
1919use rustc_middle:: query:: Providers ;
@@ -636,10 +636,6 @@ impl<'tcx> Visitor<'tcx> for MarkSymbolVisitor<'tcx> {
636636 let res = self . typeck_results ( ) . qpath_res ( path, pat. hir_id ) ;
637637 self . handle_field_pattern_match ( pat, res, fields) ;
638638 }
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- }
643639 PatKind :: TupleStruct ( ref qpath, fields, dotdot) => {
644640 let res = self . typeck_results ( ) . qpath_res ( qpath, pat. hir_id ) ;
645641 self . handle_tuple_field_pattern_match ( pat, res, fields, dotdot) ;
@@ -651,6 +647,17 @@ impl<'tcx> Visitor<'tcx> for MarkSymbolVisitor<'tcx> {
651647 self . in_pat = false ;
652648 }
653649
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+
654661 fn visit_path ( & mut self , path : & hir:: Path < ' tcx > , _: hir:: HirId ) {
655662 self . handle_res ( path. res ) ;
656663 intravisit:: walk_path ( self , path) ;
0 commit comments