11use std:: num:: NonZero ;
22
3- use rustc_attr_data_structures:: { AllowedThroughUnstableModules , AttributeKind , DefaultBodyStability , PartialConstStability , Stability , StabilityLevel , StableSince , UnstableReason , VERSION_PLACEHOLDER } ;
3+ use rustc_attr_data_structures:: {
4+ AllowedThroughUnstableModules , AttributeKind , DefaultBodyStability , PartialConstStability , Stability , StabilityLevel , StableSince , UnstableReason , VERSION_PLACEHOLDER
5+ } ;
46use rustc_span:: { ErrorGuaranteed , Span , Symbol , sym} ;
57
68use super :: util:: parse_version;
79use super :: { AttributeGroup , AttributeMapping , SingleAttributeGroup } ;
810use crate :: context:: { AttributeAcceptContext , AttributeGroupContext } ;
9- use crate :: parser:: { ArgParser , MetaItemParser , NameValueParser } ;
11+ use crate :: parser:: { ArgParser , MetaItemParser } ;
1012use crate :: session_diagnostics:: { self , UnsupportedLiteralReason } ;
1113
1214#[ derive( Default ) ]
@@ -112,10 +114,7 @@ impl SingleAttributeGroup for ConstStabilityIndirectGroup {
112114 // ignore
113115 fn on_duplicate ( _cx : & AttributeAcceptContext < ' _ > , _first_span : Span ) { }
114116
115- fn convert (
116- _cx : & AttributeAcceptContext < ' _ > ,
117- _args : & super :: GenericArgParser < ' _ , rustc_ast:: Expr > ,
118- ) -> Option < AttributeKind > {
117+ fn convert ( _cx : & AttributeAcceptContext < ' _ > , _args : & ArgParser < ' _ > ) -> Option < AttributeKind > {
119118 Some ( AttributeKind :: ConstStabilityIndirect )
120119 }
121120}
@@ -190,9 +189,9 @@ impl AttributeGroup for ConstStabilityGroup {
190189///
191190/// Emits an error when either the option was already Some, or the arguments weren't of form
192191/// `name = value`
193- fn insert_value_into_option_or_error < ' a > (
192+ fn insert_value_into_option_or_error (
194193 cx : & AttributeAcceptContext < ' _ > ,
195- param : & impl MetaItemParser < ' a > ,
194+ param : & MetaItemParser < ' _ > ,
196195 item : & mut Option < Symbol > ,
197196) -> Option < ( ) > {
198197 if item. is_some ( ) {
@@ -217,9 +216,9 @@ fn insert_value_into_option_or_error<'a>(
217216
218217/// Read the content of a `stable`/`rustc_const_stable` attribute, and return the feature name and
219218/// its stability information.
220- pub ( crate ) fn parse_stability < ' a > (
219+ pub ( crate ) fn parse_stability (
221220 cx : & AttributeAcceptContext < ' _ > ,
222- args : & ' a impl ArgParser < ' a > ,
221+ args : & ArgParser < ' _ > ,
223222) -> Option < ( Symbol , StabilityLevel ) > {
224223 let mut feature = None ;
225224 let mut since = None ;
@@ -283,9 +282,9 @@ pub(crate) fn parse_stability<'a>(
283282
284283// Read the content of a `unstable`/`rustc_const_unstable`/`rustc_default_body_unstable`
285284/// attribute, and return the feature name and its stability information.
286- pub ( crate ) fn parse_unstability < ' a > (
285+ pub ( crate ) fn parse_unstability (
287286 cx : & AttributeAcceptContext < ' _ > ,
288- args : & ' a impl ArgParser < ' a > ,
287+ args : & ArgParser < ' _ > ,
289288) -> Option < ( Symbol , StabilityLevel ) > {
290289 let mut feature = None ;
291290 let mut reason = None ;
0 commit comments