From e65d49d33860befebb3c5b2a13907983d57929a3 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Wed, 6 May 2020 12:11:52 +0100 Subject: [PATCH] Fix incorrect ordering I introduced this mistake in 175976e2a2b03c3f347d4eff28661445c3c58372 and I can't quite remember what the reasoning was back then. I think I modeled it on `apply_constructor`, not realizing there was an important difference in the order in which fields were stored. --- src/librustc_mir_build/hair/pattern/_match.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_mir_build/hair/pattern/_match.rs b/src/librustc_mir_build/hair/pattern/_match.rs index f6941d3293b5..01e3bacda753 100644 --- a/src/librustc_mir_build/hair/pattern/_match.rs +++ b/src/librustc_mir_build/hair/pattern/_match.rs @@ -1033,7 +1033,7 @@ impl<'tcx> Constructor<'tcx> { /// Like `apply`, but where all the subpatterns are wildcards `_`. fn apply_wildcards<'a>(&self, cx: &MatchCheckCtxt<'a, 'tcx>, ty: Ty<'tcx>) -> Pat<'tcx> { - let subpatterns = self.wildcard_subpatterns(cx, ty).into_iter().rev(); + let subpatterns = self.wildcard_subpatterns(cx, ty).into_iter(); self.apply(cx, ty, subpatterns) } }