@@ -1700,7 +1700,7 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
1700
1700
if ident. name == kw:: StaticLifetime {
1701
1701
self . record_lifetime_res (
1702
1702
lifetime. id ,
1703
- LifetimeRes :: Static { suppress_elision_warning : false } ,
1703
+ LifetimeRes :: Static ,
1704
1704
LifetimeElisionCandidate :: Named ,
1705
1705
) ;
1706
1706
return ;
@@ -1845,8 +1845,7 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
1845
1845
if lifetimes_in_scope. is_empty ( ) {
1846
1846
self . record_lifetime_res (
1847
1847
lifetime. id ,
1848
- // We are inside a const item, so do not warn.
1849
- LifetimeRes :: Static { suppress_elision_warning : true } ,
1848
+ LifetimeRes :: Static ,
1850
1849
elision_candidate,
1851
1850
) ;
1852
1851
return ;
@@ -2193,47 +2192,6 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
2193
2192
panic ! ( "lifetime {id:?} resolved multiple times ({prev_res:?} before, {res:?} now)" )
2194
2193
}
2195
2194
2196
- match candidate {
2197
- LifetimeElisionCandidate :: Missing ( missing @ MissingLifetime { .. } ) => {
2198
- debug_assert_eq ! ( id, missing. id) ;
2199
- match res {
2200
- LifetimeRes :: Static { suppress_elision_warning } => {
2201
- if !suppress_elision_warning {
2202
- self . r . lint_buffer . buffer_lint (
2203
- lint:: builtin:: ELIDED_NAMED_LIFETIMES ,
2204
- missing. id_for_lint ,
2205
- missing. span ,
2206
- BuiltinLintDiag :: ElidedNamedLifetimes {
2207
- elided : ( missing. span , missing. kind ) ,
2208
- resolution : lint:: ElidedLifetimeResolution :: Static ,
2209
- } ,
2210
- ) ;
2211
- }
2212
- }
2213
- LifetimeRes :: Param { param, binder : _ } => {
2214
- let tcx = self . r . tcx ( ) ;
2215
- self . r . lint_buffer . buffer_lint (
2216
- lint:: builtin:: ELIDED_NAMED_LIFETIMES ,
2217
- missing. id_for_lint ,
2218
- missing. span ,
2219
- BuiltinLintDiag :: ElidedNamedLifetimes {
2220
- elided : ( missing. span , missing. kind ) ,
2221
- resolution : lint:: ElidedLifetimeResolution :: Param (
2222
- tcx. item_name ( param. into ( ) ) ,
2223
- tcx. source_span ( param) ,
2224
- ) ,
2225
- } ,
2226
- ) ;
2227
- }
2228
- LifetimeRes :: Fresh { .. }
2229
- | LifetimeRes :: Infer
2230
- | LifetimeRes :: Error
2231
- | LifetimeRes :: ElidedAnchor { .. } => { }
2232
- }
2233
- }
2234
- LifetimeElisionCandidate :: Ignore | LifetimeElisionCandidate :: Named => { }
2235
- }
2236
-
2237
2195
match res {
2238
2196
LifetimeRes :: Param { .. } | LifetimeRes :: Fresh { .. } | LifetimeRes :: Static { .. } => {
2239
2197
if let Some ( ref mut candidates) = self . lifetime_elision_candidates {
@@ -2748,14 +2706,9 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
2748
2706
ref ty, ref expr, ref define_opaque, ..
2749
2707
} ) => {
2750
2708
self . with_static_rib ( def_kind, |this| {
2751
- this. with_lifetime_rib (
2752
- LifetimeRibKind :: Elided ( LifetimeRes :: Static {
2753
- suppress_elision_warning : true ,
2754
- } ) ,
2755
- |this| {
2756
- this. visit_ty ( ty) ;
2757
- } ,
2758
- ) ;
2709
+ this. with_lifetime_rib ( LifetimeRibKind :: Elided ( LifetimeRes :: Static ) , |this| {
2710
+ this. visit_ty ( ty) ;
2711
+ } ) ;
2759
2712
if let Some ( expr) = expr {
2760
2713
// We already forbid generic params because of the above item rib,
2761
2714
// so it doesn't matter whether this is a trivial constant.
@@ -2791,9 +2744,7 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
2791
2744
this. visit_generics ( generics) ;
2792
2745
2793
2746
this. with_lifetime_rib (
2794
- LifetimeRibKind :: Elided ( LifetimeRes :: Static {
2795
- suppress_elision_warning : true ,
2796
- } ) ,
2747
+ LifetimeRibKind :: Elided ( LifetimeRes :: Static ) ,
2797
2748
|this| this. visit_ty ( ty) ,
2798
2749
) ;
2799
2750
0 commit comments