mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-28 20:16:58 +03:00
Avoid unnecessary renumbering
This commit is contained in:
@@ -81,6 +81,10 @@ fn tcx(&self) -> TyCtxt<'tcx> {
|
||||
|
||||
#[instrument(skip(self), level = "debug")]
|
||||
fn visit_ty(&mut self, ty: &mut Ty<'tcx>, ty_context: TyContext) {
|
||||
if matches!(ty_context, TyContext::ReturnTy(_)) {
|
||||
// We will renumber the return ty when called again with `TyContext::LocalDecl`
|
||||
return;
|
||||
}
|
||||
*ty = self.renumber_regions(*ty, || RegionCtxt::TyContext(ty_context));
|
||||
|
||||
debug!(?ty);
|
||||
|
||||
Reference in New Issue
Block a user