11use crate :: ClippyConfiguration ;
22use crate :: types:: {
3- DisallowedPath , DisallowedPathWithoutReplacement , InherentImplLintScope , MacroMatcher , MatchLintBehaviour ,
3+ ConfPath , ConfPathWithoutReplacement , InherentImplLintScope , MacroMatcher , MatchLintBehaviour ,
44 PubUnderscoreFieldsBehaviour , Rename , SourceItemOrdering , SourceItemOrderingCategory ,
55 SourceItemOrderingModuleItemGroupings , SourceItemOrderingModuleItemKind , SourceItemOrderingTraitAssocItemKind ,
66 SourceItemOrderingTraitAssocItemKinds , SourceItemOrderingWithinModuleItemGroupings ,
@@ -191,17 +191,16 @@ macro_rules! deserialize {
191191 ( value, value_span)
192192 } } ;
193193
194- ( $map: expr, $ty: ty, $errors: expr, $file: expr, $replacements_allowed : expr) => { {
194+ ( $map: expr, $ty: ty, $errors: expr, $file: expr, $replaceable : expr) => { {
195195 let array = $map. next_value:: <Vec <toml:: Spanned <toml:: Value >>>( ) ?;
196- let mut disallowed_paths_span = Range {
196+ let mut conf_paths_span = Range {
197197 start: usize :: MAX ,
198198 end: usize :: MIN ,
199199 } ;
200- let mut disallowed_paths = Vec :: new( ) ;
200+ let mut conf_paths = Vec :: new( ) ;
201201 for raw_value in array {
202202 let value_span = raw_value. span( ) ;
203- let mut disallowed_path = match DisallowedPath :: <$replacements_allowed>:: deserialize( raw_value. into_inner( ) )
204- {
203+ let mut conf_path = match ConfPath :: <$replaceable>:: deserialize( raw_value. into_inner( ) ) {
205204 Err ( e) => {
206205 $errors. push( ConfError :: spanned(
207206 $file,
@@ -211,13 +210,13 @@ macro_rules! deserialize {
211210 ) ) ;
212211 continue ;
213212 } ,
214- Ok ( disallowed_path ) => disallowed_path ,
213+ Ok ( conf_path ) => conf_path ,
215214 } ;
216- disallowed_paths_span = union ( & disallowed_paths_span , & value_span) ;
217- disallowed_path . set_span( span_from_toml_range( $file, value_span) ) ;
218- disallowed_paths . push( disallowed_path ) ;
215+ conf_paths_span = union ( & conf_paths_span , & value_span) ;
216+ conf_path . set_span( span_from_toml_range( $file, value_span) ) ;
217+ conf_paths . push( conf_path ) ;
219218 }
220- ( disallowed_paths , disallowed_paths_span )
219+ ( conf_paths , conf_paths_span )
221220 } } ;
222221}
223222
@@ -226,7 +225,7 @@ macro_rules! define_Conf {
226225 $( #[ doc = $doc: literal] ) +
227226 $( #[ conf_deprecated( $dep: literal, $new_conf: ident) ] ) ?
228227 $( #[ default_text = $default_text: expr] ) ?
229- $( #[ disallowed_paths_allow_replacements = $replacements_allowed : expr] ) ?
228+ $( #[ conf_paths_allow_replacements = $replaceable : expr] ) ?
230229 $( #[ lints( $( $for_lints: ident) ,* $( , ) ?) ] ) ?
231230 $name: ident: $ty: ty = $default: expr,
232231 ) * ) => {
@@ -284,7 +283,7 @@ macro_rules! define_Conf {
284283 // Is this a deprecated field, i.e., is `$dep` set? If so, push a warning.
285284 $( warnings. push( ConfError :: spanned( self . 0 , format!( "deprecated field `{}`. {}" , name. get_ref( ) , $dep) , None , name. span( ) ) ) ; ) ?
286285 let ( value, value_span) =
287- deserialize!( map, $ty, errors, self . 0 $( , $replacements_allowed ) ?) ;
286+ deserialize!( map, $ty, errors, self . 0 $( , $replaceable ) ?) ;
288287 // Was this field set previously?
289288 if $name. is_some( ) {
290289 errors. push( ConfError :: spanned( self . 0 , format!( "duplicate field `{}`" , name. get_ref( ) ) , None , name. span( ) ) ) ;
@@ -530,9 +529,9 @@ define_Conf! {
530529 ) ]
531530 avoid_breaking_exported_api: bool = true ,
532531 /// The list of types which may not be held across an await point.
533- #[ disallowed_paths_allow_replacements = false ]
532+ #[ conf_paths_allow_replacements = false ]
534533 #[ lints( await_holding_invalid_type) ]
535- await_holding_invalid_types: Vec <DisallowedPathWithoutReplacement > = Vec :: new( ) ,
534+ await_holding_invalid_types: Vec <ConfPathWithoutReplacement > = Vec :: new( ) ,
536535 /// DEPRECATED LINT: BLACKLISTED_NAME.
537536 ///
538537 /// Use the Disallowed Names lint instead
@@ -586,9 +585,9 @@ define_Conf! {
586585 /// - `replacement` (optional): suggested alternative macro
587586 /// - `allow-invalid` (optional, `false` by default): when set to `true`, it will ignore this entry
588587 /// if the path doesn't exist, instead of emitting an error
589- #[ disallowed_paths_allow_replacements = true ]
588+ #[ conf_paths_allow_replacements = true ]
590589 #[ lints( disallowed_macros) ]
591- disallowed_macros: Vec <DisallowedPath > = Vec :: new( ) ,
590+ disallowed_macros: Vec <ConfPath > = Vec :: new( ) ,
592591 /// The list of disallowed methods, written as fully qualified paths.
593592 ///
594593 /// **Fields:**
@@ -597,9 +596,9 @@ define_Conf! {
597596 /// - `replacement` (optional): suggested alternative method
598597 /// - `allow-invalid` (optional, `false` by default): when set to `true`, it will ignore this entry
599598 /// if the path doesn't exist, instead of emitting an error
600- #[ disallowed_paths_allow_replacements = true ]
599+ #[ conf_paths_allow_replacements = true ]
601600 #[ lints( disallowed_methods) ]
602- disallowed_methods: Vec <DisallowedPath > = Vec :: new( ) ,
601+ disallowed_methods: Vec <ConfPath > = Vec :: new( ) ,
603602 /// The list of disallowed names to lint about. NB: `bar` is not here since it has legitimate uses. The value
604603 /// `".."` can be used as part of the list to indicate that the configured values should be appended to the
605604 /// default configuration of Clippy. By default, any configuration will replace the default value.
@@ -613,9 +612,9 @@ define_Conf! {
613612 /// - `replacement` (optional): suggested alternative type
614613 /// - `allow-invalid` (optional, `false` by default): when set to `true`, it will ignore this entry
615614 /// if the path doesn't exist, instead of emitting an error
616- #[ disallowed_paths_allow_replacements = true ]
615+ #[ conf_paths_allow_replacements = true ]
617616 #[ lints( disallowed_types) ]
618- disallowed_types: Vec <DisallowedPath > = Vec :: new( ) ,
617+ disallowed_types: Vec <ConfPath > = Vec :: new( ) ,
619618 /// The list of words this lint should not consider as identifiers needing ticks. The value
620619 /// `".."` can be used as part of the list to indicate, that the configured values should be appended to the
621620 /// default configuration of Clippy. By default, any configuration will replace the default value. For example:
0 commit comments