about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils/src/consts.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-12-26 13:29:14 -0500
committerGitHub <noreply@github.com>2023-12-26 13:29:14 -0500
commite1be642b41a79bd23b46aaa229cac4e23638b169 (patch)
tree523210bd477925f28b5c6aca115973d79ef297c1 /compiler/rustc_ty_utils/src/consts.rs
parent65aaece6c0d09ec0129088c6abc203612c9e39d0 (diff)
parent48d089a8002d57f0c7b473905bc1925e99bcc76d (diff)
downloadrust-e1be642b41a79bd23b46aaa229cac4e23638b169.tar.gz
rust-e1be642b41a79bd23b46aaa229cac4e23638b169.zip
Rollup merge of #119307 - compiler-errors:pat-lifetimes, r=Nadrieril
Clean up some lifetimes in `rustc_pattern_analysis`

This PR removes some redundant lifetimes. I figured out that we were shortening the lifetime of an arena-allocated `&'p DeconstructedPat<'p>` to `'a DeconstructedPat<'p>`, which forced us to carry both lifetimes when we could otherwise carry just one.

This PR also removes and elides some unnecessary lifetimes.

I also cherry-picked 0292eb9bb9b897f5c0926c6a8530877f67e7cc9b, and then simplified more lifetimes in `MatchVisitor`, which should make #119233 a very simple PR!

r? Nadrieril
Diffstat (limited to 'compiler/rustc_ty_utils/src/consts.rs')
-rw-r--r--compiler/rustc_ty_utils/src/consts.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_ty_utils/src/consts.rs b/compiler/rustc_ty_utils/src/consts.rs
index c9f99012b29..2a2e53a81ed 100644
--- a/compiler/rustc_ty_utils/src/consts.rs
+++ b/compiler/rustc_ty_utils/src/consts.rs
@@ -379,7 +379,7 @@ impl<'a, 'tcx> visit::Visitor<'a, 'tcx> for IsThirPolymorphic<'a, 'tcx> {
     }
 
     #[instrument(skip(self), level = "debug")]
-    fn visit_expr(&mut self, expr: &thir::Expr<'tcx>) {
+    fn visit_expr(&mut self, expr: &'a thir::Expr<'tcx>) {
         self.is_poly |= self.expr_is_poly(expr);
         if !self.is_poly {
             visit::walk_expr(self, expr)
@@ -387,7 +387,7 @@ impl<'a, 'tcx> visit::Visitor<'a, 'tcx> for IsThirPolymorphic<'a, 'tcx> {
     }
 
     #[instrument(skip(self), level = "debug")]
-    fn visit_pat(&mut self, pat: &thir::Pat<'tcx>) {
+    fn visit_pat(&mut self, pat: &'a thir::Pat<'tcx>) {
         self.is_poly |= self.pat_is_poly(pat);
         if !self.is_poly {
             visit::walk_pat(self, pat);