Skip to content

Commit cbc75c6

Browse files
committed
implement TypeFoldable for Arc
1 parent 134fc4a commit cbc75c6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/librustc/ty/structural_impls.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,16 @@ impl<'tcx, T: TypeFoldable<'tcx>> TypeFoldable<'tcx> for Rc<T> {
853853
}
854854
}
855855

856+
impl<'tcx, T: TypeFoldable<'tcx>> TypeFoldable<'tcx> for Arc<T> {
857+
fn super_fold_with<F: TypeFolder<'tcx>>(&self, folder: &mut F) -> Self {
858+
Arc::new((**self).fold_with(folder))
859+
}
860+
861+
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool {
862+
(**self).visit_with(visitor)
863+
}
864+
}
865+
856866
impl<'tcx, T: TypeFoldable<'tcx>> TypeFoldable<'tcx> for Box<T> {
857867
fn super_fold_with<F: TypeFolder<'tcx>>(&self, folder: &mut F) -> Self {
858868
let content: T = (**self).fold_with(folder);

0 commit comments

Comments
 (0)