@@ -23,12 +23,12 @@ pub struct DisallowedPath<const REPLACEMENT_ALLOWED: bool = true> {
2323 path : String ,
2424 reason : Option < String > ,
2525 replacement : Option < String > ,
26- /// Setting `may_not_refer_to_existing_definition ` to true suppresses a warning if `path` does
27- /// not refer to an existing definition.
26+ /// Setting `allow_invalid ` to true suppresses a warning if `path` does not refer to an existing
27+ /// definition.
2828 ///
2929 /// This could be useful when conditional compilation is used, or when a clippy.toml file is
3030 /// shared among multiple projects.
31- may_not_refer_to_existing_definition : bool ,
31+ allow_invalid : bool ,
3232 /// The span of the `DisallowedPath`.
3333 ///
3434 /// Used for diagnostics.
@@ -49,7 +49,7 @@ impl<'de, const REPLACEMENT_ALLOWED: bool> Deserialize<'de> for DisallowedPath<R
4949 path : enum_. path ( ) . to_owned ( ) ,
5050 reason : enum_. reason ( ) . map ( ToOwned :: to_owned) ,
5151 replacement : enum_. replacement ( ) . map ( ToOwned :: to_owned) ,
52- may_not_refer_to_existing_definition : enum_. may_not_refer_to_existing_definition ( ) ,
52+ allow_invalid : enum_. allow_invalid ( ) ,
5353 span : Span :: default ( ) ,
5454 } )
5555 }
@@ -65,8 +65,8 @@ enum DisallowedPathEnum {
6565 path : String ,
6666 reason : Option < String > ,
6767 replacement : Option < String > ,
68- #[ serde( rename = "may-not-refer-to-existing-definition " ) ]
69- may_not_refer_to_existing_definition : Option < bool > ,
68+ #[ serde( rename = "allow-invalid " ) ]
69+ allow_invalid : Option < bool > ,
7070 } ,
7171}
7272
@@ -120,12 +120,9 @@ impl DisallowedPathEnum {
120120 }
121121 }
122122
123- fn may_not_refer_to_existing_definition ( & self ) -> bool {
123+ fn allow_invalid ( & self ) -> bool {
124124 match & self {
125- Self :: WithReason {
126- may_not_refer_to_existing_definition,
127- ..
128- } => may_not_refer_to_existing_definition. unwrap_or_default ( ) ,
125+ Self :: WithReason { allow_invalid, .. } => allow_invalid. unwrap_or_default ( ) ,
129126 Self :: Simple ( _) => false ,
130127 }
131128 }
@@ -181,7 +178,7 @@ pub fn create_disallowed_map<const REPLACEMENT_ALLOWED: bool>(
181178 span,
182179 format ! ( "expected a {predicate_description}, found a primitive type" , ) ,
183180 ) ;
184- } else if !disallowed_path. may_not_refer_to_existing_definition {
181+ } else if !disallowed_path. allow_invalid {
185182 tcx. sess . dcx ( ) . span_warn (
186183 span,
187184 format ! ( "`{path}` does not refer to an existing {predicate_description}" ) ,
0 commit comments