@@ -171,8 +171,6 @@ crate struct LifetimeContext<'a, 'tcx> {
171171 /// Used to disallow the use of in-band lifetimes in `fn` or `Fn` syntax.
172172 is_in_fn_syntax : bool ,
173173
174- is_in_const_generic : bool ,
175-
176174 /// Indicates that we only care about the definition of a trait. This should
177175 /// be false if the `Item` we are resolving lifetimes for is not a trait or
178176 /// we eventually need lifetimes resolve for trait items.
@@ -454,7 +452,6 @@ fn do_resolve(
454452 map : & mut named_region_map,
455453 scope : ROOT_SCOPE ,
456454 is_in_fn_syntax : false ,
457- is_in_const_generic : false ,
458455 trait_definition_only,
459456 xcrate_object_lifetime_defaults : Default :: default ( ) ,
460457 lifetime_uses : & mut Default :: default ( ) ,
@@ -1277,10 +1274,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
12771274 self . insert_lifetime ( lifetime_ref, Region :: Static ) ;
12781275 return ;
12791276 }
1280- if self . is_in_const_generic && lifetime_ref. name != LifetimeName :: Error {
1281- self . emit_non_static_lt_in_const_generic_error ( lifetime_ref) ;
1282- return ;
1283- }
12841277 self . resolve_lifetime_ref ( lifetime_ref) ;
12851278 }
12861279
@@ -1355,11 +1348,8 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
13551348 }
13561349 }
13571350 GenericParamKind :: Const { ref ty, .. } => {
1358- let was_in_const_generic = this. is_in_const_generic ;
1359- this. is_in_const_generic = true ;
13601351 walk_list ! ( this, visit_param_bound, param. bounds) ;
13611352 this. visit_ty ( & ty) ;
1362- this. is_in_const_generic = was_in_const_generic;
13631353 }
13641354 }
13651355 }
@@ -1696,7 +1686,6 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
16961686 map,
16971687 scope : & wrap_scope,
16981688 is_in_fn_syntax : self . is_in_fn_syntax ,
1699- is_in_const_generic : self . is_in_const_generic ,
17001689 trait_definition_only : self . trait_definition_only ,
17011690 xcrate_object_lifetime_defaults,
17021691 lifetime_uses,
0 commit comments