@@ -1729,7 +1729,7 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
17291729 if ident. name == kw:: StaticLifetime {
17301730 self . record_lifetime_res (
17311731 lifetime. id ,
1732- LifetimeRes :: Static { suppress_elision_warning : false } ,
1732+ LifetimeRes :: Static ,
17331733 LifetimeElisionCandidate :: Named ,
17341734 ) ;
17351735 return ;
@@ -1877,8 +1877,7 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
18771877 if lifetimes_in_scope. is_empty ( ) {
18781878 self . record_lifetime_res (
18791879 lifetime. id ,
1880- // We are inside a const item, so do not warn.
1881- LifetimeRes :: Static { suppress_elision_warning : true } ,
1880+ LifetimeRes :: Static ,
18821881 elision_candidate,
18831882 ) ;
18841883 return ;
@@ -2225,47 +2224,6 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
22252224 panic ! ( "lifetime {id:?} resolved multiple times ({prev_res:?} before, {res:?} now)" )
22262225 }
22272226
2228- match candidate {
2229- LifetimeElisionCandidate :: Missing ( missing @ MissingLifetime { .. } ) => {
2230- debug_assert_eq ! ( id, missing. id) ;
2231- match res {
2232- LifetimeRes :: Static { suppress_elision_warning } => {
2233- if !suppress_elision_warning {
2234- self . r . lint_buffer . buffer_lint (
2235- lint:: builtin:: ELIDED_NAMED_LIFETIMES ,
2236- missing. id_for_lint ,
2237- missing. span ,
2238- BuiltinLintDiag :: ElidedNamedLifetimes {
2239- elided : ( missing. span , missing. kind ) ,
2240- resolution : lint:: ElidedLifetimeResolution :: Static ,
2241- } ,
2242- ) ;
2243- }
2244- }
2245- LifetimeRes :: Param { param, binder : _ } => {
2246- let tcx = self . r . tcx ( ) ;
2247- self . r . lint_buffer . buffer_lint (
2248- lint:: builtin:: ELIDED_NAMED_LIFETIMES ,
2249- missing. id_for_lint ,
2250- missing. span ,
2251- BuiltinLintDiag :: ElidedNamedLifetimes {
2252- elided : ( missing. span , missing. kind ) ,
2253- resolution : lint:: ElidedLifetimeResolution :: Param (
2254- tcx. item_name ( param. into ( ) ) ,
2255- tcx. source_span ( param) ,
2256- ) ,
2257- } ,
2258- ) ;
2259- }
2260- LifetimeRes :: Fresh { .. }
2261- | LifetimeRes :: Infer
2262- | LifetimeRes :: Error
2263- | LifetimeRes :: ElidedAnchor { .. } => { }
2264- }
2265- }
2266- LifetimeElisionCandidate :: Ignore | LifetimeElisionCandidate :: Named => { }
2267- }
2268-
22692227 match res {
22702228 LifetimeRes :: Param { .. } | LifetimeRes :: Fresh { .. } | LifetimeRes :: Static { .. } => {
22712229 if let Some ( ref mut candidates) = self . lifetime_elision_candidates {
@@ -2788,14 +2746,9 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
27882746 ..
27892747 } ) => {
27902748 self . with_static_rib ( def_kind, |this| {
2791- this. with_lifetime_rib (
2792- LifetimeRibKind :: Elided ( LifetimeRes :: Static {
2793- suppress_elision_warning : true ,
2794- } ) ,
2795- |this| {
2796- this. visit_ty ( ty) ;
2797- } ,
2798- ) ;
2749+ this. with_lifetime_rib ( LifetimeRibKind :: Elided ( LifetimeRes :: Static ) , |this| {
2750+ this. visit_ty ( ty) ;
2751+ } ) ;
27992752 if let Some ( expr) = expr {
28002753 // We already forbid generic params because of the above item rib,
28012754 // so it doesn't matter whether this is a trivial constant.
@@ -2832,9 +2785,7 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
28322785 this. visit_generics ( generics) ;
28332786
28342787 this. with_lifetime_rib (
2835- LifetimeRibKind :: Elided ( LifetimeRes :: Static {
2836- suppress_elision_warning : true ,
2837- } ) ,
2788+ LifetimeRibKind :: Elided ( LifetimeRes :: Static ) ,
28382789 |this| this. visit_ty ( ty) ,
28392790 ) ;
28402791
0 commit comments