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