1
Fork 0

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:
fee1-dead 2023-04-16 18:55:38 +08:00 committed by GitHub
commit eba419195c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 51 additions and 66 deletions

View file

@ -13,7 +13,7 @@ use rustc_hir::intravisit::Visitor;
use rustc_middle::hir::nested_filter;
use rustc_middle::ty::error::ExpectedFound;
use rustc_middle::ty::print::RegionHighlightMode;
use rustc_middle::ty::{self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitor};
use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitor};
use rustc_span::Span;
use std::ops::ControlFlow;
@ -81,7 +81,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
self.highlight.highlighting_region(r, self.counter);
self.counter += 1;
}
r.super_visit_with(self)
ControlFlow::Continue(())
}
}