Skip to content

Commit e39f66a

Browse files
committed
implement Lift for Arc
1 parent e6b6873 commit e39f66a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/librustc/ty/structural_impls.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use crate::mir::interpret;
1515

1616
use std::fmt;
1717
use std::rc::Rc;
18+
use std::sync::Arc;
1819

1920
impl fmt::Debug for ty::GenericParamDef {
2021
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
@@ -385,6 +386,13 @@ impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for Rc<T> {
385386
}
386387
}
387388

389+
impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for Arc<T> {
390+
type Lifted = Arc<T::Lifted>;
391+
fn lift_to_tcx(&self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
392+
tcx.lift(&**self).map(Arc::new)
393+
}
394+
}
395+
388396
impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for [T] {
389397
type Lifted = Vec<T::Lifted>;
390398
fn lift_to_tcx(&self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {

0 commit comments

Comments
 (0)