Rollup merge of #61791 - Centril:cleanup-check_pat_path, r=petrochenkov

Small cleanup in `check_pat_path`
This commit is contained in:
Mazdak Farrokhzad 2019-06-13 14:52:00 +02:00 committed by GitHub
commit 8917b8e32c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1067,10 +1067,7 @@ fn check_pat_path(
self.set_tainted_by_errors(); self.set_tainted_by_errors();
return tcx.types.err; return tcx.types.err;
} }
Res::Def(DefKind::Method, _) => { Res::Def(DefKind::Method, _) |
report_unexpected_variant_res(tcx, res, pat.span, qpath);
return tcx.types.err;
}
Res::Def(DefKind::Ctor(_, CtorKind::Fictive), _) | Res::Def(DefKind::Ctor(_, CtorKind::Fictive), _) |
Res::Def(DefKind::Ctor(_, CtorKind::Fn), _) => { Res::Def(DefKind::Ctor(_, CtorKind::Fn), _) => {
report_unexpected_variant_res(tcx, res, pat.span, qpath); report_unexpected_variant_res(tcx, res, pat.span, qpath);