From a947b751969156d67b2a5c866d8e4d74e1a8b2e0 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Thu, 13 Jun 2019 04:58:12 +0200 Subject: [PATCH] Small cleanup in check_pat_path. --- src/librustc_typeck/check/_match.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/librustc_typeck/check/_match.rs b/src/librustc_typeck/check/_match.rs index 3fea080f299..b882b696938 100644 --- a/src/librustc_typeck/check/_match.rs +++ b/src/librustc_typeck/check/_match.rs @@ -1067,10 +1067,7 @@ fn check_pat_path( self.set_tainted_by_errors(); return tcx.types.err; } - Res::Def(DefKind::Method, _) => { - report_unexpected_variant_res(tcx, res, pat.span, qpath); - return tcx.types.err; - } + Res::Def(DefKind::Method, _) | Res::Def(DefKind::Ctor(_, CtorKind::Fictive), _) | Res::Def(DefKind::Ctor(_, CtorKind::Fn), _) => { report_unexpected_variant_res(tcx, res, pat.span, qpath);