From 3e6c9e5a194902ec6c8c26586fe6fa72dd624004 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Wed, 21 Sep 2022 08:29:19 +0000 Subject: [PATCH] Fix wrongly refactored Lift impl --- compiler/rustc_middle/src/ty/structural_impls.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_middle/src/ty/structural_impls.rs b/compiler/rustc_middle/src/ty/structural_impls.rs index 004fcffdc4074..3304e7e160200 100644 --- a/compiler/rustc_middle/src/ty/structural_impls.rs +++ b/compiler/rustc_middle/src/ty/structural_impls.rs @@ -272,7 +272,10 @@ impl<'tcx, A: Lift<'tcx>, B: Lift<'tcx>, C: Lift<'tcx>> Lift<'tcx> for (A, B, C) impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for Option { type Lifted = Option; fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option { - tcx.lift(self?).map(Some) + Some(match self { + Some(x) => Some(tcx.lift(x)?), + None => None, + }) } }