@@ -1700,7 +1700,7 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
17001700 if ident. name == kw:: StaticLifetime {
17011701 self . record_lifetime_res (
17021702 lifetime. id ,
1703- LifetimeRes :: Static { suppress_elision_warning : false } ,
1703+ LifetimeRes :: Static ,
17041704 LifetimeElisionCandidate :: Named ,
17051705 ) ;
17061706 return ;
@@ -1845,8 +1845,7 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
18451845 if lifetimes_in_scope. is_empty ( ) {
18461846 self . record_lifetime_res (
18471847 lifetime. id ,
1848- // We are inside a const item, so do not warn.
1849- LifetimeRes :: Static { suppress_elision_warning : true } ,
1848+ LifetimeRes :: Static ,
18501849 elision_candidate,
18511850 ) ;
18521851 return ;
@@ -2193,47 +2192,6 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
21932192 panic ! ( "lifetime {id:?} resolved multiple times ({prev_res:?} before, {res:?} now)" )
21942193 }
21952194
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-
22372195 match res {
22382196 LifetimeRes :: Param { .. } | LifetimeRes :: Fresh { .. } | LifetimeRes :: Static { .. } => {
22392197 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> {
27482706 ref ty, ref expr, ref define_opaque, ..
27492707 } ) => {
27502708 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+ } ) ;
27592712 if let Some ( expr) = expr {
27602713 // We already forbid generic params because of the above item rib,
27612714 // 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> {
27912744 this. visit_generics ( generics) ;
27922745
27932746 this. with_lifetime_rib (
2794- LifetimeRibKind :: Elided ( LifetimeRes :: Static {
2795- suppress_elision_warning : true ,
2796- } ) ,
2747+ LifetimeRibKind :: Elided ( LifetimeRes :: Static ) ,
27972748 |this| this. visit_ty ( ty) ,
27982749 ) ;
27992750
0 commit comments