1
1
use crate :: ClippyConfiguration ;
2
2
use crate :: types:: {
3
- DisallowedPath , DisallowedPathWithoutReplacement , MacroMatcher , MatchLintBehaviour , PubUnderscoreFieldsBehaviour ,
4
- Rename , SourceItemOrdering , SourceItemOrderingCategory , SourceItemOrderingModuleItemGroupings ,
3
+ ConfPath , ConfPathWithoutReplacement , MacroMatcher , MatchLintBehaviour , PubUnderscoreFieldsBehaviour , Rename ,
4
+ SourceItemOrdering , SourceItemOrderingCategory , SourceItemOrderingModuleItemGroupings ,
5
5
SourceItemOrderingModuleItemKind , SourceItemOrderingTraitAssocItemKind , SourceItemOrderingTraitAssocItemKinds ,
6
6
SourceItemOrderingWithinModuleItemGroupings ,
7
7
} ;
@@ -190,17 +190,16 @@ macro_rules! deserialize {
190
190
( value, value_span)
191
191
} } ;
192
192
193
- ( $map: expr, $ty: ty, $errors: expr, $file: expr, $replacements_allowed : expr) => { {
193
+ ( $map: expr, $ty: ty, $errors: expr, $file: expr, $replaceable : expr) => { {
194
194
let array = $map. next_value:: <Vec <toml:: Spanned <toml:: Value >>>( ) ?;
195
- let mut disallowed_paths_span = Range {
195
+ let mut conf_paths_span = Range {
196
196
start: usize :: MAX ,
197
197
end: usize :: MIN ,
198
198
} ;
199
- let mut disallowed_paths = Vec :: new( ) ;
199
+ let mut conf_paths = Vec :: new( ) ;
200
200
for raw_value in array {
201
201
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( ) ) {
204
203
Err ( e) => {
205
204
$errors. push( ConfError :: spanned(
206
205
$file,
@@ -210,13 +209,13 @@ macro_rules! deserialize {
210
209
) ) ;
211
210
continue ;
212
211
} ,
213
- Ok ( disallowed_path ) => disallowed_path ,
212
+ Ok ( conf_path ) => conf_path ,
214
213
} ;
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 ) ;
218
217
}
219
- ( disallowed_paths , disallowed_paths_span )
218
+ ( conf_paths , conf_paths_span )
220
219
} } ;
221
220
}
222
221
@@ -225,7 +224,7 @@ macro_rules! define_Conf {
225
224
$( #[ doc = $doc: literal] ) +
226
225
$( #[ conf_deprecated( $dep: literal, $new_conf: ident) ] ) ?
227
226
$( #[ default_text = $default_text: expr] ) ?
228
- $( #[ disallowed_paths_allow_replacements = $replacements_allowed : expr] ) ?
227
+ $( #[ conf_paths_allow_replacements = $replaceable : expr] ) ?
229
228
$( #[ lints( $( $for_lints: ident) ,* $( , ) ?) ] ) ?
230
229
$name: ident: $ty: ty = $default: expr,
231
230
) * ) => {
@@ -283,7 +282,7 @@ macro_rules! define_Conf {
283
282
// Is this a deprecated field, i.e., is `$dep` set? If so, push a warning.
284
283
$( warnings. push( ConfError :: spanned( self . 0 , format!( "deprecated field `{}`. {}" , name. get_ref( ) , $dep) , None , name. span( ) ) ) ; ) ?
285
284
let ( value, value_span) =
286
- deserialize!( map, $ty, errors, self . 0 $( , $replacements_allowed ) ?) ;
285
+ deserialize!( map, $ty, errors, self . 0 $( , $replaceable ) ?) ;
287
286
// Was this field set previously?
288
287
if $name. is_some( ) {
289
288
errors. push( ConfError :: spanned( self . 0 , format!( "duplicate field `{}`" , name. get_ref( ) ) , None , name. span( ) ) ) ;
@@ -529,9 +528,9 @@ define_Conf! {
529
528
) ]
530
529
avoid_breaking_exported_api: bool = true ,
531
530
/// 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 ]
533
532
#[ lints( await_holding_invalid_type) ]
534
- await_holding_invalid_types: Vec <DisallowedPathWithoutReplacement > = Vec :: new( ) ,
533
+ await_holding_invalid_types: Vec <ConfPathWithoutReplacement > = Vec :: new( ) ,
535
534
/// DEPRECATED LINT: BLACKLISTED_NAME.
536
535
///
537
536
/// Use the Disallowed Names lint instead
@@ -582,9 +581,9 @@ define_Conf! {
582
581
/// - `replacement` (optional): suggested alternative macro
583
582
/// - `allow-invalid` (optional, `false` by default): when set to `true`, it will ignore this entry
584
583
/// if the path doesn't exist, instead of emitting an error
585
- #[ disallowed_paths_allow_replacements = true ]
584
+ #[ conf_paths_allow_replacements = true ]
586
585
#[ lints( disallowed_macros) ]
587
- disallowed_macros: Vec <DisallowedPath > = Vec :: new( ) ,
586
+ disallowed_macros: Vec <ConfPath > = Vec :: new( ) ,
588
587
/// The list of disallowed methods, written as fully qualified paths.
589
588
///
590
589
/// **Fields:**
@@ -593,9 +592,9 @@ define_Conf! {
593
592
/// - `replacement` (optional): suggested alternative method
594
593
/// - `allow-invalid` (optional, `false` by default): when set to `true`, it will ignore this entry
595
594
/// if the path doesn't exist, instead of emitting an error
596
- #[ disallowed_paths_allow_replacements = true ]
595
+ #[ conf_paths_allow_replacements = true ]
597
596
#[ lints( disallowed_methods) ]
598
- disallowed_methods: Vec <DisallowedPath > = Vec :: new( ) ,
597
+ disallowed_methods: Vec <ConfPath > = Vec :: new( ) ,
599
598
/// The list of disallowed names to lint about. NB: `bar` is not here since it has legitimate uses. The value
600
599
/// `".."` can be used as part of the list to indicate that the configured values should be appended to the
601
600
/// default configuration of Clippy. By default, any configuration will replace the default value.
@@ -609,9 +608,9 @@ define_Conf! {
609
608
/// - `replacement` (optional): suggested alternative type
610
609
/// - `allow-invalid` (optional, `false` by default): when set to `true`, it will ignore this entry
611
610
/// if the path doesn't exist, instead of emitting an error
612
- #[ disallowed_paths_allow_replacements = true ]
611
+ #[ conf_paths_allow_replacements = true ]
613
612
#[ lints( disallowed_types) ]
614
- disallowed_types: Vec <DisallowedPath > = Vec :: new( ) ,
613
+ disallowed_types: Vec <ConfPath > = Vec :: new( ) ,
615
614
/// The list of words this lint should not consider as identifiers needing ticks. The value
616
615
/// `".."` can be used as part of the list to indicate, that the configured values should be appended to the
617
616
/// default configuration of Clippy. By default, any configuration will replace the default value. For example:
0 commit comments