Rollup merge of #110345 - nnethercote:rm-Super-impls-for-Region, r=compiler-errors
Remove `TypeSuper{Foldable,Visitable}` impls for `Region`.
These traits exist so that folders/visitors can recurse into types of interest: binders, types, regions, predicates, and consts. But `Region` is non-recursive and cannot contain other types of interest, so its methods in these traits are trivial.
This commit inlines and removes those trivial methods.
r? `@compiler-errors`
This commit is contained in:
commit
eba419195c
11 changed files with 51 additions and 66 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use rustc_data_structures::fx::FxHashSet;
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::lang_items::LangItem;
|
||||
use rustc_middle::ty::{self, Region, RegionVid, TypeFoldable, TypeSuperFoldable};
|
||||
use rustc_middle::ty::{self, Region, RegionVid, TypeFoldable};
|
||||
use rustc_trait_selection::traits::auto_trait::{self, AutoTraitResult};
|
||||
use thin_vec::ThinVec;
|
||||
|
||||
|
|
@ -740,10 +740,9 @@ impl<'a, 'tcx> TypeFolder<TyCtxt<'tcx>> for RegionReplacer<'a, 'tcx> {
|
|||
}
|
||||
|
||||
fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> {
|
||||
(match *r {
|
||||
ty::ReVar(vid) => self.vid_to_region.get(&vid).cloned(),
|
||||
_ => None,
|
||||
})
|
||||
.unwrap_or_else(|| r.super_fold_with(self))
|
||||
match *r {
|
||||
ty::ReVar(vid) => self.vid_to_region.get(&vid).cloned().unwrap_or(r),
|
||||
_ => r,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue