Don't require visit_body to take a lifetime that must outlive the function call
This commit is contained in:
@@ -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 {:?}",
|
||||
|
||||
@@ -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| {
|
||||
|
||||
Reference in New Issue
Block a user