@@ -78,7 +78,7 @@ struct ExistingName {
7878 interned : SymbolStr ,
7979 span : Span ,
8080 len : usize ,
81- whitelist : & ' static [ & ' static str ] ,
81+ exemptions : & ' static [ & ' static str ] ,
8282}
8383
8484struct SimilarNamesLocalVisitor < ' a , ' tcx > {
@@ -117,7 +117,7 @@ impl<'a, 'tcx> SimilarNamesLocalVisitor<'a, 'tcx> {
117117// this list contains lists of names that are allowed to be similar
118118// the assumption is that no name is ever contained in multiple lists.
119119#[ rustfmt:: skip]
120- const WHITELIST : & [ & [ & str ] ] = & [
120+ const ALLOWED_TO_BE_SIMILAR : & [ & [ & str ] ] = & [
121121 & [ "parsed" , "parser" ] ,
122122 & [ "lhs" , "rhs" ] ,
123123 & [ "tx" , "rx" ] ,
@@ -156,17 +156,17 @@ impl<'a, 'tcx, 'b> Visitor<'tcx> for SimilarNamesNameVisitor<'a, 'tcx, 'b> {
156156}
157157
158158#[ must_use]
159- fn get_whitelist ( interned_name : & str ) -> Option < & ' static [ & ' static str ] > {
160- for & allow in WHITELIST {
161- if whitelisted ( interned_name, allow ) {
162- return Some ( allow ) ;
159+ fn get_exemptions ( interned_name : & str ) -> Option < & ' static [ & ' static str ] > {
160+ for & list in ALLOWED_TO_BE_SIMILAR {
161+ if allowed_to_be_similar ( interned_name, list ) {
162+ return Some ( list ) ;
163163 }
164164 }
165165 None
166166}
167167
168168#[ must_use]
169- fn whitelisted ( interned_name : & str , list : & [ & str ] ) -> bool {
169+ fn allowed_to_be_similar ( interned_name : & str , list : & [ & str ] ) -> bool {
170170 list. iter ( )
171171 . any ( |& name| interned_name. starts_with ( name) || interned_name. ends_with ( name) )
172172}
@@ -212,7 +212,7 @@ impl<'a, 'tcx, 'b> SimilarNamesNameVisitor<'a, 'tcx, 'b> {
212212 return ;
213213 }
214214 for existing_name in & self . 0 . names {
215- if whitelisted ( & interned_name, existing_name. whitelist ) {
215+ if allowed_to_be_similar ( & interned_name, existing_name. exemptions ) {
216216 continue ;
217217 }
218218 let mut split_at = None ;
@@ -301,7 +301,7 @@ impl<'a, 'tcx, 'b> SimilarNamesNameVisitor<'a, 'tcx, 'b> {
301301 return ;
302302 }
303303 self . 0 . names . push ( ExistingName {
304- whitelist : get_whitelist ( & interned_name) . unwrap_or ( & [ ] ) ,
304+ exemptions : get_exemptions ( & interned_name) . unwrap_or ( & [ ] ) ,
305305 interned : interned_name,
306306 span : ident. span ,
307307 len : count,
0 commit comments