@@ -1706,7 +1706,7 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
1706
1706
if ident. name == kw:: StaticLifetime {
1707
1707
self . record_lifetime_res (
1708
1708
lifetime. id ,
1709
- LifetimeRes :: Static { suppress_elision_warning : false } ,
1709
+ LifetimeRes :: Static ,
1710
1710
LifetimeElisionCandidate :: Named ,
1711
1711
) ;
1712
1712
return ;
@@ -1854,8 +1854,7 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
1854
1854
if lifetimes_in_scope. is_empty ( ) {
1855
1855
self . record_lifetime_res (
1856
1856
lifetime. id ,
1857
- // We are inside a const item, so do not warn.
1858
- LifetimeRes :: Static { suppress_elision_warning : true } ,
1857
+ LifetimeRes :: Static ,
1859
1858
elision_candidate,
1860
1859
) ;
1861
1860
return ;
@@ -2202,47 +2201,6 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
2202
2201
panic ! ( "lifetime {id:?} resolved multiple times ({prev_res:?} before, {res:?} now)" )
2203
2202
}
2204
2203
2205
- match candidate {
2206
- LifetimeElisionCandidate :: Missing ( missing @ MissingLifetime { .. } ) => {
2207
- debug_assert_eq ! ( id, missing. id) ;
2208
- match res {
2209
- LifetimeRes :: Static { suppress_elision_warning } => {
2210
- if !suppress_elision_warning {
2211
- self . r . lint_buffer . buffer_lint (
2212
- lint:: builtin:: ELIDED_NAMED_LIFETIMES ,
2213
- missing. id_for_lint ,
2214
- missing. span ,
2215
- BuiltinLintDiag :: ElidedNamedLifetimes {
2216
- elided : ( missing. span , missing. kind ) ,
2217
- resolution : lint:: ElidedLifetimeResolution :: Static ,
2218
- } ,
2219
- ) ;
2220
- }
2221
- }
2222
- LifetimeRes :: Param { param, binder : _ } => {
2223
- let tcx = self . r . tcx ( ) ;
2224
- self . r . lint_buffer . buffer_lint (
2225
- lint:: builtin:: ELIDED_NAMED_LIFETIMES ,
2226
- missing. id_for_lint ,
2227
- missing. span ,
2228
- BuiltinLintDiag :: ElidedNamedLifetimes {
2229
- elided : ( missing. span , missing. kind ) ,
2230
- resolution : lint:: ElidedLifetimeResolution :: Param (
2231
- tcx. item_name ( param. into ( ) ) ,
2232
- tcx. source_span ( param) ,
2233
- ) ,
2234
- } ,
2235
- ) ;
2236
- }
2237
- LifetimeRes :: Fresh { .. }
2238
- | LifetimeRes :: Infer
2239
- | LifetimeRes :: Error
2240
- | LifetimeRes :: ElidedAnchor { .. } => { }
2241
- }
2242
- }
2243
- LifetimeElisionCandidate :: Ignore | LifetimeElisionCandidate :: Named => { }
2244
- }
2245
-
2246
2204
match res {
2247
2205
LifetimeRes :: Param { .. } | LifetimeRes :: Fresh { .. } | LifetimeRes :: Static { .. } => {
2248
2206
if let Some ( ref mut candidates) = self . lifetime_elision_candidates {
@@ -2760,14 +2718,9 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
2760
2718
..
2761
2719
} ) => {
2762
2720
self . with_static_rib ( def_kind, |this| {
2763
- this. with_lifetime_rib (
2764
- LifetimeRibKind :: Elided ( LifetimeRes :: Static {
2765
- suppress_elision_warning : true ,
2766
- } ) ,
2767
- |this| {
2768
- this. visit_ty ( ty) ;
2769
- } ,
2770
- ) ;
2721
+ this. with_lifetime_rib ( LifetimeRibKind :: Elided ( LifetimeRes :: Static ) , |this| {
2722
+ this. visit_ty ( ty) ;
2723
+ } ) ;
2771
2724
if let Some ( expr) = expr {
2772
2725
// We already forbid generic params because of the above item rib,
2773
2726
// so it doesn't matter whether this is a trivial constant.
@@ -2804,9 +2757,7 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
2804
2757
this. visit_generics ( generics) ;
2805
2758
2806
2759
this. with_lifetime_rib (
2807
- LifetimeRibKind :: Elided ( LifetimeRes :: Static {
2808
- suppress_elision_warning : true ,
2809
- } ) ,
2760
+ LifetimeRibKind :: Elided ( LifetimeRes :: Static ) ,
2810
2761
|this| this. visit_ty ( ty) ,
2811
2762
) ;
2812
2763
0 commit comments