@@ -246,7 +246,6 @@ TrivialTypeTraversalAndLiftImpls! {
246
246
///////////////////////////////////////////////////////////////////////////
247
247
// Lift implementations
248
248
249
- // FIXME(eddyb) replace all the uses of `Option::map` with `?`.
250
249
impl < ' tcx , A : Lift < ' tcx > , B : Lift < ' tcx > > Lift < ' tcx > for ( A , B ) {
251
250
type Lifted = ( A :: Lifted , B :: Lifted ) ;
252
251
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)
264
263
impl < ' tcx , T : Lift < ' tcx > > Lift < ' tcx > for Option < T > {
265
264
type Lifted = Option < T :: Lifted > ;
266
265
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 )
271
267
}
272
268
}
273
269
@@ -284,21 +280,21 @@ impl<'tcx, T: Lift<'tcx>, E: Lift<'tcx>> Lift<'tcx> for Result<T, E> {
284
280
impl < ' tcx , T : Lift < ' tcx > > Lift < ' tcx > for Box < T > {
285
281
type Lifted = Box < T :: Lifted > ;
286
282
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 ) ? ) )
288
284
}
289
285
}
290
286
291
287
impl < ' tcx , T : Lift < ' tcx > + Clone > Lift < ' tcx > for Rc < T > {
292
288
type Lifted = Rc < T :: Lifted > ;
293
289
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 ( ) ) ? ) )
295
291
}
296
292
}
297
293
298
294
impl < ' tcx , T : Lift < ' tcx > + Clone > Lift < ' tcx > for Arc < T > {
299
295
type Lifted = Arc < T :: Lifted > ;
300
296
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 ( ) ) ? ) )
302
298
}
303
299
}
304
300
impl < ' tcx , T : Lift < ' tcx > > Lift < ' tcx > for Vec < T > {
0 commit comments