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( ) ) ) ;
@@ -533,9 +532,9 @@ define_Conf! {
533532 ) ]
534533 avoid_breaking_exported_api: bool = true ,
535534 /// The list of types which may not be held across an await point.
536- #[ disallowed_paths_allow_replacements = false ]
535+ #[ conf_paths_allow_replacements = false ]
537536 #[ lints( await_holding_invalid_type) ]
538- await_holding_invalid_types: Vec <DisallowedPathWithoutReplacement > = Vec :: new( ) ,
537+ await_holding_invalid_types: Vec <ConfPathWithoutReplacement > = Vec :: new( ) ,
539538 /// DEPRECATED LINT: BLACKLISTED_NAME.
540539 ///
541540 /// Use the Disallowed Names lint instead
@@ -589,9 +588,9 @@ define_Conf! {
589588 /// - `replacement` (optional): suggested alternative macro
590589 /// - `allow-invalid` (optional, `false` by default): when set to `true`, it will ignore this entry
591590 /// if the path doesn't exist, instead of emitting an error
592- #[ disallowed_paths_allow_replacements = true ]
591+ #[ conf_paths_allow_replacements = true ]
593592 #[ lints( disallowed_macros) ]
594- disallowed_macros: Vec <DisallowedPath > = Vec :: new( ) ,
593+ disallowed_macros: Vec <ConfPath > = Vec :: new( ) ,
595594 /// The list of disallowed methods, written as fully qualified paths.
596595 ///
597596 /// **Fields:**
@@ -600,9 +599,9 @@ define_Conf! {
600599 /// - `replacement` (optional): suggested alternative method
601600 /// - `allow-invalid` (optional, `false` by default): when set to `true`, it will ignore this entry
602601 /// if the path doesn't exist, instead of emitting an error
603- #[ disallowed_paths_allow_replacements = true ]
602+ #[ conf_paths_allow_replacements = true ]
604603 #[ lints( disallowed_methods) ]
605- disallowed_methods: Vec <DisallowedPath > = Vec :: new( ) ,
604+ disallowed_methods: Vec <ConfPath > = Vec :: new( ) ,
606605 /// The list of disallowed names to lint about. NB: `bar` is not here since it has legitimate uses. The value
607606 /// `".."` can be used as part of the list to indicate that the configured values should be appended to the
608607 /// default configuration of Clippy. By default, any configuration will replace the default value.
@@ -616,9 +615,9 @@ define_Conf! {
616615 /// - `replacement` (optional): suggested alternative type
617616 /// - `allow-invalid` (optional, `false` by default): when set to `true`, it will ignore this entry
618617 /// if the path doesn't exist, instead of emitting an error
619- #[ disallowed_paths_allow_replacements = true ]
618+ #[ conf_paths_allow_replacements = true ]
620619 #[ lints( disallowed_types) ]
621- disallowed_types: Vec <DisallowedPath > = Vec :: new( ) ,
620+ disallowed_types: Vec <ConfPath > = Vec :: new( ) ,
622621 /// The list of words this lint should not consider as identifiers needing ticks. The value
623622 /// `".."` can be used as part of the list to indicate, that the configured values should be appended to the
624623 /// default configuration of Clippy. By default, any configuration will replace the default value. For example:
0 commit comments