@@ -11,10 +11,9 @@ use hir::def::DefKind;
1111use hir:: pat_util:: EnumerateAndAdjustIterator as _;
1212use rustc_abi:: { FIRST_VARIANT , FieldIdx , VariantIdx } ;
1313use rustc_data_structures:: fx:: FxIndexMap ;
14- use rustc_hir as hir;
1514use rustc_hir:: def:: { CtorOf , Res } ;
1615use rustc_hir:: def_id:: LocalDefId ;
17- use rustc_hir:: { HirId , PatKind } ;
16+ use rustc_hir:: { self as hir , HirId , PatKind , PatLit , PatLitKind } ;
1817use rustc_lint:: LateContext ;
1918use rustc_middle:: hir:: place:: ProjectionKind ;
2019// Export these here so that Clippy can use them.
@@ -560,11 +559,11 @@ impl<'tcx, Cx: TypeInformationCtxt<'tcx>, D: Delegate<'tcx>> ExprUseVisitor<'tcx
560559 // FIXME(never_patterns): does this do what I expect?
561560 needs_to_be_read = true ;
562561 }
563- PatKind :: Path ( qpath) => {
562+ PatKind :: Lit ( PatLit { kind : PatLitKind :: Path ( qpath) , hir_id , .. } ) => {
564563 // A `Path` pattern is just a name like `Foo`. This is either a
565564 // named constant or else it refers to an ADT variant
566565
567- let res = self . cx . typeck_results ( ) . qpath_res ( qpath, pat . hir_id ) ;
566+ let res = self . cx . typeck_results ( ) . qpath_res ( qpath, * hir_id) ;
568567 match res {
569568 Res :: Def ( DefKind :: Const , _) | Res :: Def ( DefKind :: AssocConst , _) => {
570569 // Named constants have to be equated with the value
@@ -1793,8 +1792,7 @@ impl<'tcx, Cx: TypeInformationCtxt<'tcx>, D: Delegate<'tcx>> ExprUseVisitor<'tcx
17931792 }
17941793 }
17951794
1796- PatKind :: Path ( _)
1797- | PatKind :: Binding ( .., None )
1795+ PatKind :: Binding ( .., None )
17981796 | PatKind :: Lit ( ..)
17991797 | PatKind :: Range ( ..)
18001798 | PatKind :: Never
0 commit comments