@@ -183,7 +183,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
183
183
PatKind :: TupleStruct ( ref qpath, subpats, ddpos) => {
184
184
self . check_pat_tuple_struct ( pat, qpath, subpats, ddpos, expected, def_bm, ti)
185
185
}
186
- PatKind :: Path ( _) => self . check_pat_path ( pat, path_res. unwrap ( ) , expected, ti) ,
186
+ PatKind :: Path ( ref qpath) => {
187
+ self . check_pat_path ( pat, qpath, path_res. unwrap ( ) , expected, ti)
188
+ }
187
189
PatKind :: Struct ( ref qpath, fields, has_rest_pat) => {
188
190
self . check_pat_struct ( pat, qpath, fields, has_rest_pat, expected, def_bm, ti)
189
191
}
@@ -800,6 +802,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
800
802
fn check_pat_path < ' b > (
801
803
& self ,
802
804
pat : & Pat < ' _ > ,
805
+ qpath : & hir:: QPath < ' _ > ,
803
806
path_resolution : ( Res , Option < Ty < ' tcx > > , & ' b [ hir:: PathSegment < ' b > ] ) ,
804
807
expected : Ty < ' tcx > ,
805
808
ti : TopInfo < ' tcx > ,
@@ -814,7 +817,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
814
817
return tcx. ty_error ( ) ;
815
818
}
816
819
Res :: Def ( DefKind :: AssocFn | DefKind :: Ctor ( _, CtorKind :: Fictive | CtorKind :: Fn ) , _) => {
817
- report_unexpected_variant_res ( tcx, res, pat. span ) ;
820
+ report_unexpected_variant_res ( tcx, res, qpath , pat. span ) ;
818
821
return tcx. ty_error ( ) ;
819
822
}
820
823
Res :: SelfCtor ( ..)
0 commit comments