1
Fork 0

Don't require visit_body to take a lifetime that must outlive the function call

This commit is contained in:
Oli Scherer 2024-05-29 09:08:22 +00:00
parent 5870f1ccbb
commit ceb45d5519
20 changed files with 27 additions and 31 deletions

View file

@ -1163,7 +1163,7 @@ impl<'a, 'tcx> Visitor<'tcx> for FindInferSourceVisitor<'a, 'tcx> {
/// For closures, we first visit the parameters and then the content,
/// as we prefer those.
fn visit_body(&mut self, body: &'tcx Body<'tcx>) {
fn visit_body(&mut self, body: &Body<'tcx>) {
for param in body.params {
debug!(
"param: span {:?}, ty_span {:?}, pat.span {:?}",

View file

@ -578,10 +578,6 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
walk_stmt(self, ex)
}
}
fn visit_body(&mut self, body: &'v hir::Body<'v>) -> Self::Result {
hir::intravisit::walk_body(self, body)
}
}
self.tcx.hir().maybe_body_owned_by(cause.body_id).and_then(|body_id| {