about summary refs log tree commit diff
path: root/compiler/rustc_infer/src
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-05-29 09:08:22 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-05-29 10:04:08 +0000
commitceb45d55190eb00d30b8762bc4c34cf71c53b637 (patch)
treeaf6ffc2dd4e90d69a9ee6359b76b0e4ce01c633d /compiler/rustc_infer/src
parent5870f1ccbbb2661c92cdc356231386210a64d723 (diff)
downloadrust-ceb45d55190eb00d30b8762bc4c34cf71c53b637.tar.gz
rust-ceb45d55190eb00d30b8762bc4c34cf71c53b637.zip
Don't require `visit_body` to take a lifetime that must outlive the function call
Diffstat (limited to 'compiler/rustc_infer/src')
-rw-r--r--compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs2
-rw-r--r--compiler/rustc_infer/src/infer/error_reporting/suggest.rs4
2 files changed, 1 insertions, 5 deletions
diff --git a/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs b/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs
index 98fd7906e70..63d41a1faf3 100644
--- a/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs
+++ b/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs
@@ -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 {:?}",
diff --git a/compiler/rustc_infer/src/infer/error_reporting/suggest.rs b/compiler/rustc_infer/src/infer/error_reporting/suggest.rs
index 75479decebc..c333f024ad1 100644
--- a/compiler/rustc_infer/src/infer/error_reporting/suggest.rs
+++ b/compiler/rustc_infer/src/infer/error_reporting/suggest.rs
@@ -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| {