about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2023-04-29 10:32:31 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2023-04-29 10:32:31 +0000
commit63028ac3a1cdad56e4a61b8fcb260456efc2b71e (patch)
tree4bb658bef00fe3aaef4055901026fd687ad9358d /compiler/rustc_resolve/src
parent6ce22733b973355573efd1e6294e585460e90e17 (diff)
downloadrust-63028ac3a1cdad56e4a61b8fcb260456efc2b71e.tar.gz
rust-63028ac3a1cdad56e4a61b8fcb260456efc2b71e.zip
Do not force anonymous lifetimes in consts to be static.
Diffstat (limited to 'compiler/rustc_resolve/src')
-rw-r--r--compiler/rustc_resolve/src/late.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs
index a97857e05e2..5da67dbc2aa 100644
--- a/compiler/rustc_resolve/src/late.rs
+++ b/compiler/rustc_resolve/src/late.rs
@@ -656,7 +656,7 @@ impl<'a: 'ast, 'ast, 'tcx> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast,
     fn visit_anon_const(&mut self, constant: &'ast AnonConst) {
         // We deal with repeat expressions explicitly in `resolve_expr`.
         self.with_lifetime_rib(LifetimeRibKind::AnonConst, |this| {
-            this.with_lifetime_rib(LifetimeRibKind::Elided(LifetimeRes::Static), |this| {
+            this.with_lifetime_rib(LifetimeRibKind::Elided(LifetimeRes::Infer), |this| {
                 this.resolve_anon_const(constant, IsRepeatExpr::No);
             })
         })
@@ -4130,7 +4130,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
             ExprKind::Repeat(ref elem, ref ct) => {
                 self.visit_expr(elem);
                 self.with_lifetime_rib(LifetimeRibKind::AnonConst, |this| {
-                    this.with_lifetime_rib(LifetimeRibKind::Elided(LifetimeRes::Static), |this| {
+                    this.with_lifetime_rib(LifetimeRibKind::Elided(LifetimeRes::Infer), |this| {
                         this.resolve_anon_const(ct, IsRepeatExpr::Yes)
                     })
                 });