Make TypeFoldable
implementors short-circuit on error
Co-authored-by: Alan Egerton <eggyal@gmail.com>
This commit is contained in:
parent
c5f0d0ebb4
commit
6e3fa20b00
11 changed files with 299 additions and 204 deletions
|
@ -2760,11 +2760,11 @@ impl UserTypeProjection {
|
|||
TrivialTypeFoldableAndLiftImpls! { ProjectionKind, }
|
||||
|
||||
impl<'tcx> TypeFoldable<'tcx> for UserTypeProjection {
|
||||
fn super_fold_with<F: TypeFolder<'tcx>>(self, folder: &mut F) -> Self {
|
||||
UserTypeProjection {
|
||||
base: self.base.fold_with(folder),
|
||||
projs: self.projs.fold_with(folder),
|
||||
}
|
||||
fn super_fold_with<F: TypeFolder<'tcx>>(self, folder: &mut F) -> Result<Self, F::Error> {
|
||||
Ok(UserTypeProjection {
|
||||
base: self.base.fold_with(folder)?,
|
||||
projs: self.projs.fold_with(folder)?,
|
||||
})
|
||||
}
|
||||
|
||||
fn super_visit_with<Vs: TypeVisitor<'tcx>>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue