@@ -246,7 +246,6 @@ TrivialTypeTraversalAndLiftImpls! {
246246///////////////////////////////////////////////////////////////////////////
247247// Lift implementations
248248
249- // FIXME(eddyb) replace all the uses of `Option::map` with `?`.
250249impl < ' tcx , A : Lift < ' tcx > , B : Lift < ' tcx > > Lift < ' tcx > for ( A , B ) {
251250 type Lifted = ( A :: Lifted , B :: Lifted ) ;
252251 fn lift_to_tcx ( self , tcx : TyCtxt < ' tcx > ) -> Option < Self :: Lifted > {
@@ -264,10 +263,7 @@ impl<'tcx, A: Lift<'tcx>, B: Lift<'tcx>, C: Lift<'tcx>> Lift<'tcx> for (A, B, C)
264263impl < ' tcx , T : Lift < ' tcx > > Lift < ' tcx > for Option < T > {
265264 type Lifted = Option < T :: Lifted > ;
266265 fn lift_to_tcx ( self , tcx : TyCtxt < ' tcx > ) -> Option < Self :: Lifted > {
267- match self {
268- Some ( x) => tcx. lift ( x) . map ( Some ) ,
269- None => Some ( None ) ,
270- }
266+ tcx. lift ( self ?) . map ( Some )
271267 }
272268}
273269
@@ -284,21 +280,21 @@ impl<'tcx, T: Lift<'tcx>, E: Lift<'tcx>> Lift<'tcx> for Result<T, E> {
284280impl < ' tcx , T : Lift < ' tcx > > Lift < ' tcx > for Box < T > {
285281 type Lifted = Box < T :: Lifted > ;
286282 fn lift_to_tcx ( self , tcx : TyCtxt < ' tcx > ) -> Option < Self :: Lifted > {
287- tcx. lift ( * self ) . map ( Box :: new )
283+ Some ( Box :: new ( tcx. lift ( * self ) ? ) )
288284 }
289285}
290286
291287impl < ' tcx , T : Lift < ' tcx > + Clone > Lift < ' tcx > for Rc < T > {
292288 type Lifted = Rc < T :: Lifted > ;
293289 fn lift_to_tcx ( self , tcx : TyCtxt < ' tcx > ) -> Option < Self :: Lifted > {
294- tcx. lift ( self . as_ref ( ) . clone ( ) ) . map ( Rc :: new )
290+ Some ( Rc :: new ( tcx. lift ( self . as_ref ( ) . clone ( ) ) ? ) )
295291 }
296292}
297293
298294impl < ' tcx , T : Lift < ' tcx > + Clone > Lift < ' tcx > for Arc < T > {
299295 type Lifted = Arc < T :: Lifted > ;
300296 fn lift_to_tcx ( self , tcx : TyCtxt < ' tcx > ) -> Option < Self :: Lifted > {
301- tcx. lift ( self . as_ref ( ) . clone ( ) ) . map ( Arc :: new )
297+ Some ( Arc :: new ( tcx. lift ( self . as_ref ( ) . clone ( ) ) ? ) )
302298 }
303299}
304300impl < ' tcx , T : Lift < ' tcx > > Lift < ' tcx > for Vec < T > {
0 commit comments