about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorCaleb Cartwright <calebcartwright@users.noreply.github.com>2020-07-14 00:03:13 -0500
committerCaleb Cartwright <calebcartwright@users.noreply.github.com>2022-04-07 17:30:50 -0500
commit2d9bc460108df4e3587be82e36a58f2fb3f4813f (patch)
tree612c95de348bd7d34b1908fb4f1a51d7ec6a4221 /src
parent91995b6142faf1a5e56e1b7b1cb922504726197c (diff)
downloadrust-2d9bc460108df4e3587be82e36a58f2fb3f4813f.tar.gz
rust-2d9bc460108df4e3587be82e36a58f2fb3f4813f.zip
Backport 4326
refactor: rename some private whitelist names
Diffstat (limited to 'src')
-rw-r--r--src/overflow.rs12
-rw-r--r--src/test/mod.rs4
2 files changed, 8 insertions, 8 deletions
diff --git a/src/overflow.rs b/src/overflow.rs
index 80aed998d73..c296961d1f0 100644
--- a/src/overflow.rs
+++ b/src/overflow.rs
@@ -32,7 +32,7 @@ use crate::utils::{count_newlines, extra_offset, first_line_width, last_line_wid
 /// Organized as a list of `(&str, usize)` tuples, giving the name of the macro and the number of
 /// arguments before the format string (none for `format!("format", ...)`, one for `assert!(result,
 /// "format", ...)`, two for `assert_eq!(left, right, "format", ...)`).
-const SPECIAL_MACRO_WHITELIST: &[(&str, usize)] = &[
+const SPECIAL_CASE_MACROS: &[(&str, usize)] = &[
     // format! like macros
     // From the Rust Standard Library.
     ("eprint!", 0),
@@ -60,7 +60,7 @@ const SPECIAL_MACRO_WHITELIST: &[(&str, usize)] = &[
     ("debug_assert_ne!", 2),
 ];
 
-const SPECIAL_ATTR_WHITELIST: &[(&str, usize)] = &[
+const SPECIAL_CASE_ATTR: &[(&str, usize)] = &[
     // From the `failure` crate.
     ("fail", 0),
 ];
@@ -182,10 +182,10 @@ impl<'a> OverflowableItem<'a> {
         }
     }
 
-    fn whitelist(&self) -> &'static [(&'static str, usize)] {
+    fn special_cases(&self) -> &'static [(&'static str, usize)] {
         match self {
-            OverflowableItem::MacroArg(..) => SPECIAL_MACRO_WHITELIST,
-            OverflowableItem::NestedMetaItem(..) => SPECIAL_ATTR_WHITELIST,
+            OverflowableItem::MacroArg(..) => SPECIAL_CASE_MACROS,
+            OverflowableItem::NestedMetaItem(..) => SPECIAL_CASE_ATTR,
             _ => &[],
         }
     }
@@ -770,7 +770,7 @@ pub(crate) fn maybe_get_args_offset(
 ) -> Option<(bool, usize)> {
     if let Some(&(_, num_args_before)) = args
         .get(0)?
-        .whitelist()
+        .special_cases()
         .iter()
         .find(|&&(s, _)| s == callee_str)
     {
diff --git a/src/test/mod.rs b/src/test/mod.rs
index ab966d4a360..4bad8e71481 100644
--- a/src/test/mod.rs
+++ b/src/test/mod.rs
@@ -24,7 +24,7 @@ mod parser;
 const DIFF_CONTEXT_SIZE: usize = 3;
 
 // A list of files on which we want to skip testing.
-const SKIP_FILE_WHITE_LIST: &[&str] = &[
+const FILE_SKIP_LIST: &[&str] = &[
     // We want to make sure that the `skip_children` is correctly working,
     // so we do not want to test this file directly.
     "configs/skip_children/foo/mod.rs",
@@ -90,7 +90,7 @@ where
 }
 
 fn is_file_skip(path: &Path) -> bool {
-    SKIP_FILE_WHITE_LIST
+    FILE_SKIP_LIST
         .iter()
         .any(|file_path| is_subpath(path, file_path))
 }