11use crate :: ClippyConfiguration ;
22use crate :: types:: {
3- DisallowedPath , DisallowedPathWithoutReplacement , MacroMatcher , MatchLintBehaviour , PubUnderscoreFieldsBehaviour ,
4- Rename , SourceItemOrdering , SourceItemOrderingCategory , SourceItemOrderingModuleItemGroupings ,
3+ ConfPath , ConfPathWithoutReplacement , MacroMatcher , MatchLintBehaviour , PubUnderscoreFieldsBehaviour , Rename ,
4+ SourceItemOrdering , SourceItemOrderingCategory , SourceItemOrderingModuleItemGroupings ,
55 SourceItemOrderingModuleItemKind , SourceItemOrderingTraitAssocItemKind , SourceItemOrderingTraitAssocItemKinds ,
66 SourceItemOrderingWithinModuleItemGroupings ,
77} ;
@@ -190,17 +190,16 @@ macro_rules! deserialize {
190190 ( value, value_span)
191191 } } ;
192192
193- ( $map: expr, $ty: ty, $errors: expr, $file: expr, $replacements_allowed : expr) => { {
193+ ( $map: expr, $ty: ty, $errors: expr, $file: expr, $replaceable : expr) => { {
194194 let array = $map. next_value:: <Vec <toml:: Spanned <toml:: Value >>>( ) ?;
195- let mut disallowed_paths_span = Range {
195+ let mut conf_paths_span = Range {
196196 start: usize :: MAX ,
197197 end: usize :: MIN ,
198198 } ;
199- let mut disallowed_paths = Vec :: new( ) ;
199+ let mut conf_paths = Vec :: new( ) ;
200200 for raw_value in array {
201201 let value_span = raw_value. span( ) ;
202- let mut disallowed_path = match DisallowedPath :: <$replacements_allowed>:: deserialize( raw_value. into_inner( ) )
203- {
202+ let mut conf_path = match ConfPath :: <$replaceable>:: deserialize( raw_value. into_inner( ) ) {
204203 Err ( e) => {
205204 $errors. push( ConfError :: spanned(
206205 $file,
@@ -210,13 +209,13 @@ macro_rules! deserialize {
210209 ) ) ;
211210 continue ;
212211 } ,
213- Ok ( disallowed_path ) => disallowed_path ,
212+ Ok ( conf_path ) => conf_path ,
214213 } ;
215- disallowed_paths_span = union ( & disallowed_paths_span , & value_span) ;
216- disallowed_path . set_span( span_from_toml_range( $file, value_span) ) ;
217- disallowed_paths . push( disallowed_path ) ;
214+ conf_paths_span = union ( & conf_paths_span , & value_span) ;
215+ conf_path . set_span( span_from_toml_range( $file, value_span) ) ;
216+ conf_paths . push( conf_path ) ;
218217 }
219- ( disallowed_paths , disallowed_paths_span )
218+ ( conf_paths , conf_paths_span )
220219 } } ;
221220}
222221
@@ -225,7 +224,7 @@ macro_rules! define_Conf {
225224 $( #[ doc = $doc: literal] ) +
226225 $( #[ conf_deprecated( $dep: literal, $new_conf: ident) ] ) ?
227226 $( #[ default_text = $default_text: expr] ) ?
228- $( #[ disallowed_paths_allow_replacements = $replacements_allowed : expr] ) ?
227+ $( #[ conf_paths_allow_replacements = $replaceable : expr] ) ?
229228 $( #[ lints( $( $for_lints: ident) ,* $( , ) ?) ] ) ?
230229 $name: ident: $ty: ty = $default: expr,
231230 ) * ) => {
@@ -283,7 +282,7 @@ macro_rules! define_Conf {
283282 // Is this a deprecated field, i.e., is `$dep` set? If so, push a warning.
284283 $( warnings. push( ConfError :: spanned( self . 0 , format!( "deprecated field `{}`. {}" , name. get_ref( ) , $dep) , None , name. span( ) ) ) ; ) ?
285284 let ( value, value_span) =
286- deserialize!( map, $ty, errors, self . 0 $( , $replacements_allowed ) ?) ;
285+ deserialize!( map, $ty, errors, self . 0 $( , $replaceable ) ?) ;
287286 // Was this field set previously?
288287 if $name. is_some( ) {
289288 errors. push( ConfError :: spanned( self . 0 , format!( "duplicate field `{}`" , name. get_ref( ) ) , None , name. span( ) ) ) ;
@@ -529,9 +528,9 @@ define_Conf! {
529528 ) ]
530529 avoid_breaking_exported_api: bool = true ,
531530 /// The list of types which may not be held across an await point.
532- #[ disallowed_paths_allow_replacements = false ]
531+ #[ conf_paths_allow_replacements = false ]
533532 #[ lints( await_holding_invalid_type) ]
534- await_holding_invalid_types: Vec <DisallowedPathWithoutReplacement > = Vec :: new( ) ,
533+ await_holding_invalid_types: Vec <ConfPathWithoutReplacement > = Vec :: new( ) ,
535534 /// DEPRECATED LINT: BLACKLISTED_NAME.
536535 ///
537536 /// Use the Disallowed Names lint instead
@@ -582,9 +581,9 @@ define_Conf! {
582581 /// - `replacement` (optional): suggested alternative macro
583582 /// - `allow-invalid` (optional, `false` by default): when set to `true`, it will ignore this entry
584583 /// if the path doesn't exist, instead of emitting an error
585- #[ disallowed_paths_allow_replacements = true ]
584+ #[ conf_paths_allow_replacements = true ]
586585 #[ lints( disallowed_macros) ]
587- disallowed_macros: Vec <DisallowedPath > = Vec :: new( ) ,
586+ disallowed_macros: Vec <ConfPath > = Vec :: new( ) ,
588587 /// The list of disallowed methods, written as fully qualified paths.
589588 ///
590589 /// **Fields:**
@@ -593,9 +592,9 @@ define_Conf! {
593592 /// - `replacement` (optional): suggested alternative method
594593 /// - `allow-invalid` (optional, `false` by default): when set to `true`, it will ignore this entry
595594 /// if the path doesn't exist, instead of emitting an error
596- #[ disallowed_paths_allow_replacements = true ]
595+ #[ conf_paths_allow_replacements = true ]
597596 #[ lints( disallowed_methods) ]
598- disallowed_methods: Vec <DisallowedPath > = Vec :: new( ) ,
597+ disallowed_methods: Vec <ConfPath > = Vec :: new( ) ,
599598 /// The list of disallowed names to lint about. NB: `bar` is not here since it has legitimate uses. The value
600599 /// `".."` can be used as part of the list to indicate that the configured values should be appended to the
601600 /// default configuration of Clippy. By default, any configuration will replace the default value.
@@ -609,9 +608,9 @@ define_Conf! {
609608 /// - `replacement` (optional): suggested alternative type
610609 /// - `allow-invalid` (optional, `false` by default): when set to `true`, it will ignore this entry
611610 /// if the path doesn't exist, instead of emitting an error
612- #[ disallowed_paths_allow_replacements = true ]
611+ #[ conf_paths_allow_replacements = true ]
613612 #[ lints( disallowed_types) ]
614- disallowed_types: Vec <DisallowedPath > = Vec :: new( ) ,
613+ disallowed_types: Vec <ConfPath > = Vec :: new( ) ,
615614 /// The list of words this lint should not consider as identifiers needing ticks. The value
616615 /// `".."` can be used as part of the list to indicate, that the configured values should be appended to the
617616 /// default configuration of Clippy. By default, any configuration will replace the default value. For example:
0 commit comments