PatKind::TupleStruct(ref qpath, subpats, ddpos) => {
self.check_pat_tuple_struct(pat, qpath, subpats, ddpos, expected, def_bm, ti)
}
- PatKind::Path(_) => self.check_pat_path(pat, path_res.unwrap(), expected, ti),
+ PatKind::Path(ref qpath) => {
+ self.check_pat_path(pat, qpath, path_res.unwrap(), expected, ti)
+ }
PatKind::Struct(ref qpath, fields, has_rest_pat) => {
self.check_pat_struct(pat, qpath, fields, has_rest_pat, expected, def_bm, ti)
}
fn check_pat_path<'b>(
&self,
pat: &Pat<'_>,
+ qpath: &hir::QPath<'_>,
path_resolution: (Res, Option<Ty<'tcx>>, &'b [hir::PathSegment<'b>]),
expected: Ty<'tcx>,
ti: TopInfo<'tcx>,
return tcx.ty_error();
}
Res::Def(DefKind::AssocFn | DefKind::Ctor(_, CtorKind::Fictive | CtorKind::Fn), _) => {
- report_unexpected_variant_res(tcx, res, pat.span);
+ report_unexpected_variant_res(tcx, res, qpath, pat.span);
return tcx.ty_error();
}
Res::SelfCtor(..)