|
1 | 1 | use std::ops::ControlFlow; |
2 | 2 |
|
3 | | -use crate::{ |
4 | | - ty::{self, BoundRegion, BoundRegionKind}, |
5 | | - Opaque, |
6 | | -}; |
| 3 | +use crate::Opaque; |
7 | 4 |
|
8 | 5 | use super::ty::{ |
9 | 6 | Allocation, Binder, Const, ConstDef, ConstantKind, ExistentialPredicate, FnSig, GenericArgKind, |
@@ -116,36 +113,8 @@ impl Foldable for Region { |
116 | 113 | fn fold<V: Folder>(&self, folder: &mut V) -> ControlFlow<V::Break, Self> { |
117 | 114 | folder.fold_reg(self) |
118 | 115 | } |
119 | | - fn super_fold<V: Folder>(&self, folder: &mut V) -> ControlFlow<V::Break, Self> { |
120 | | - let mut kind = self.kind.clone(); |
121 | | - match &mut kind { |
122 | | - crate::ty::RegionKind::ReEarlyBound(_) => {} |
123 | | - crate::ty::RegionKind::ReLateBound(_, bound_reg) => { |
124 | | - *bound_reg = bound_reg.fold(folder)? |
125 | | - } |
126 | | - crate::ty::RegionKind::ReStatic => {} |
127 | | - crate::ty::RegionKind::RePlaceholder(bound_reg) => { |
128 | | - bound_reg.bound = bound_reg.bound.fold(folder)? |
129 | | - } |
130 | | - crate::ty::RegionKind::ReErased => {} |
131 | | - } |
132 | | - ControlFlow::Continue(ty::Region { kind: kind }.into()) |
133 | | - } |
134 | | -} |
135 | | - |
136 | | -impl Foldable for BoundRegion { |
137 | | - fn super_fold<V: Folder>(&self, folder: &mut V) -> ControlFlow<V::Break, Self> { |
138 | | - ControlFlow::Continue(BoundRegion { var: self.var, kind: self.kind.fold(folder)? }) |
139 | | - } |
140 | | -} |
141 | | - |
142 | | -impl Foldable for BoundRegionKind { |
143 | | - fn super_fold<V: Folder>(&self, _folder: &mut V) -> ControlFlow<V::Break, Self> { |
144 | | - match self { |
145 | | - BoundRegionKind::BrAnon => ControlFlow::Continue(self.clone()), |
146 | | - BoundRegionKind::BrNamed(_, _) => ControlFlow::Continue(self.clone()), |
147 | | - BoundRegionKind::BrEnv => ControlFlow::Continue(self.clone()), |
148 | | - } |
| 116 | + fn super_fold<V: Folder>(&self, _: &mut V) -> ControlFlow<V::Break, Self> { |
| 117 | + ControlFlow::Continue(self.clone()) |
149 | 118 | } |
150 | 119 | } |
151 | 120 |
|
|
0 commit comments