Skip to content

Commit 599d2c0

Browse files
committed
Auto merge of rust-lang#52037 - lqd:skipping-regionless-types, r=nikomatsakis
NLL Liveness: Skip regionless types when visiting free regions The tuple-stress benchmark exercises the liveness constraint generation code for types which do not have regions Closes rust-lang#52027
2 parents 4f0ca92 + 0190286 commit 599d2c0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/librustc/ty/fold.rs

+9
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,15 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
325325
_ => (self.callback)(r),
326326
}
327327
}
328+
329+
fn visit_ty(&mut self, ty: Ty<'tcx>) -> bool {
330+
// We're only interested in types involving regions
331+
if ty.flags.intersects(TypeFlags::HAS_FREE_REGIONS) {
332+
ty.super_visit_with(self)
333+
} else {
334+
false // keep visiting
335+
}
336+
}
328337
}
329338
}
330339
}

0 commit comments

Comments
 (0)