implement Lift for Arc
This commit is contained in:
parent
e6b6873525
commit
e39f66a859
@ -15,6 +15,7 @@ use crate::mir::interpret;
|
||||
|
||||
use std::fmt;
|
||||
use std::rc::Rc;
|
||||
use std::sync::Arc;
|
||||
|
||||
impl fmt::Debug for ty::GenericParamDef {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
@ -385,6 +386,13 @@ impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for Rc<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for Arc<T> {
|
||||
type Lifted = Arc<T::Lifted>;
|
||||
fn lift_to_tcx(&self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&**self).map(Arc::new)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for [T] {
|
||||
type Lifted = Vec<T::Lifted>;
|
||||
fn lift_to_tcx(&self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user