2017-08-09 02:30:56 -05:00
|
|
|
//! This module contains paths to types and functions Clippy needs to know
|
|
|
|
//! about.
|
2020-04-10 16:16:48 -05:00
|
|
|
//!
|
|
|
|
//! Whenever possible, please consider diagnostic items over hardcoded paths.
|
|
|
|
//! See <https://github.com/rust-lang/rust-clippy/issues/5393> for more information.
|
2016-04-14 11:13:15 -05:00
|
|
|
|
2021-05-06 04:51:22 -05:00
|
|
|
pub const APPLICABILITY: [&str; 2] = ["rustc_lint_defs", "Applicability"];
|
|
|
|
pub const APPLICABILITY_VALUES: [[&str; 3]; 4] = [
|
|
|
|
["rustc_lint_defs", "Applicability", "Unspecified"],
|
|
|
|
["rustc_lint_defs", "Applicability", "HasPlaceholders"],
|
|
|
|
["rustc_lint_defs", "Applicability", "MaybeIncorrect"],
|
|
|
|
["rustc_lint_defs", "Applicability", "MachineApplicable"],
|
|
|
|
];
|
2024-02-27 08:25:18 -06:00
|
|
|
pub const DIAGNOSTIC_BUILDER: [&str; 2] = ["rustc_errors", "DiagnosticBuilder"];
|
2023-08-24 14:32:12 -05:00
|
|
|
pub const BINARYHEAP_ITER: [&str; 5] = ["alloc", "collections", "binary_heap", "BinaryHeap", "iter"];
|
2021-04-22 04:31:13 -05:00
|
|
|
pub const BTREEMAP_CONTAINS_KEY: [&str; 6] = ["alloc", "collections", "btree", "map", "BTreeMap", "contains_key"];
|
|
|
|
pub const BTREEMAP_INSERT: [&str; 6] = ["alloc", "collections", "btree", "map", "BTreeMap", "insert"];
|
2022-06-30 03:50:09 -05:00
|
|
|
pub const BTREESET_ITER: [&str; 6] = ["alloc", "collections", "btree", "set", "BTreeSet", "iter"];
|
2019-05-17 16:53:54 -05:00
|
|
|
pub const CLONE_TRAIT_METHOD: [&str; 4] = ["core", "clone", "Clone", "clone"];
|
2022-06-30 03:50:09 -05:00
|
|
|
pub const CORE_ITER_CLONED: [&str; 6] = ["core", "iter", "traits", "iterator", "Iterator", "cloned"];
|
|
|
|
pub const CORE_ITER_COPIED: [&str; 6] = ["core", "iter", "traits", "iterator", "Iterator", "copied"];
|
|
|
|
pub const CORE_ITER_FILTER: [&str; 6] = ["core", "iter", "traits", "iterator", "Iterator", "filter"];
|
2023-04-11 08:31:08 -05:00
|
|
|
pub const CORE_RESULT_OK_METHOD: [&str; 4] = ["core", "result", "Result", "ok"];
|
2022-04-15 08:52:58 -05:00
|
|
|
pub const CSTRING_AS_C_STR: [&str; 5] = ["alloc", "ffi", "c_str", "CString", "as_c_str"];
|
2020-10-28 17:36:07 -05:00
|
|
|
pub const EARLY_CONTEXT: [&str; 2] = ["rustc_lint", "EarlyContext"];
|
2022-03-14 06:02:53 -05:00
|
|
|
pub const EARLY_LINT_PASS: [&str; 3] = ["rustc_lint", "passes", "EarlyLintPass"];
|
2020-10-28 17:36:07 -05:00
|
|
|
pub const F32_EPSILON: [&str; 4] = ["core", "f32", "<impl f32>", "EPSILON"];
|
|
|
|
pub const F64_EPSILON: [&str; 4] = ["core", "f64", "<impl f64>", "EPSILON"];
|
2024-01-25 12:17:36 -06:00
|
|
|
pub const FILE_OPTIONS: [&str; 4] = ["std", "fs", "File", "options"];
|
2022-05-21 06:24:00 -05:00
|
|
|
#[expect(clippy::invalid_paths)] // internal lints do not know about all external crates
|
2022-01-13 06:18:19 -06:00
|
|
|
pub const FUTURES_IO_ASYNCREADEXT: [&str; 3] = ["futures_util", "io", "AsyncReadExt"];
|
2022-05-21 06:24:00 -05:00
|
|
|
#[expect(clippy::invalid_paths)] // internal lints do not know about all external crates
|
2022-01-13 06:18:19 -06:00
|
|
|
pub const FUTURES_IO_ASYNCWRITEEXT: [&str; 3] = ["futures_util", "io", "AsyncWriteExt"];
|
2021-04-22 04:31:13 -05:00
|
|
|
pub const HASHMAP_CONTAINS_KEY: [&str; 6] = ["std", "collections", "hash", "map", "HashMap", "contains_key"];
|
|
|
|
pub const HASHMAP_INSERT: [&str; 6] = ["std", "collections", "hash", "map", "HashMap", "insert"];
|
2023-11-16 12:13:24 -06:00
|
|
|
pub const HASHMAP_ITER: [&str; 5] = ["std", "collections", "hash", "map", "Iter"];
|
|
|
|
pub const HASHMAP_ITER_MUT: [&str; 5] = ["std", "collections", "hash", "map", "IterMut"];
|
|
|
|
pub const HASHMAP_KEYS: [&str; 5] = ["std", "collections", "hash", "map", "Keys"];
|
|
|
|
pub const HASHMAP_VALUES: [&str; 5] = ["std", "collections", "hash", "map", "Values"];
|
|
|
|
pub const HASHMAP_DRAIN: [&str; 5] = ["std", "collections", "hash", "map", "Drain"];
|
|
|
|
pub const HASHMAP_VALUES_MUT: [&str; 5] = ["std", "collections", "hash", "map", "ValuesMut"];
|
|
|
|
pub const HASHSET_ITER_TY: [&str; 5] = ["std", "collections", "hash", "set", "Iter"];
|
2022-06-30 03:50:09 -05:00
|
|
|
pub const HASHSET_ITER: [&str; 6] = ["std", "collections", "hash", "set", "HashSet", "iter"];
|
2023-11-16 12:13:24 -06:00
|
|
|
pub const HASHSET_DRAIN: [&str; 5] = ["std", "collections", "hash", "set", "Drain"];
|
2021-01-15 03:56:44 -06:00
|
|
|
pub const IDENT: [&str; 3] = ["rustc_span", "symbol", "Ident"];
|
|
|
|
pub const IDENT_AS_STR: [&str; 4] = ["rustc_span", "symbol", "Ident", "as_str"];
|
2020-11-05 07:29:48 -06:00
|
|
|
pub const INSERT_STR: [&str; 4] = ["alloc", "string", "String", "insert_str"];
|
2021-09-08 09:31:47 -05:00
|
|
|
pub const ITERTOOLS_NEXT_TUPLE: [&str; 3] = ["itertools", "Itertools", "next_tuple"];
|
2021-01-15 03:56:44 -06:00
|
|
|
pub const KW_MODULE: [&str; 3] = ["rustc_span", "symbol", "kw"];
|
2020-10-28 17:36:07 -05:00
|
|
|
pub const LATE_CONTEXT: [&str; 2] = ["rustc_lint", "LateContext"];
|
2022-03-14 06:02:53 -05:00
|
|
|
pub const LATE_LINT_PASS: [&str; 3] = ["rustc_lint", "passes", "LateLintPass"];
|
2020-10-30 20:41:16 -05:00
|
|
|
pub const LINT: [&str; 2] = ["rustc_lint_defs", "Lint"];
|
2023-11-02 11:35:56 -05:00
|
|
|
pub const MSRV: [&str; 3] = ["clippy_config", "msrvs", "Msrv"];
|
2024-01-25 12:17:36 -06:00
|
|
|
pub const OPEN_OPTIONS_NEW: [&str; 4] = ["std", "fs", "OpenOptions", "new"];
|
2019-12-22 22:48:15 -06:00
|
|
|
pub const OS_STRING_AS_OS_STR: [&str; 5] = ["std", "ffi", "os_str", "OsString", "as_os_str"];
|
2019-05-17 16:53:54 -05:00
|
|
|
pub const OS_STR_TO_OS_STRING: [&str; 5] = ["std", "ffi", "os_str", "OsStr", "to_os_string"];
|
2022-02-26 07:26:21 -06:00
|
|
|
pub const PARKING_LOT_MUTEX_GUARD: [&str; 3] = ["lock_api", "mutex", "MutexGuard"];
|
|
|
|
pub const PARKING_LOT_RWLOCK_READ_GUARD: [&str; 3] = ["lock_api", "rwlock", "RwLockReadGuard"];
|
|
|
|
pub const PARKING_LOT_RWLOCK_WRITE_GUARD: [&str; 3] = ["lock_api", "rwlock", "RwLockWriteGuard"];
|
2019-12-22 22:48:15 -06:00
|
|
|
pub const PATH_BUF_AS_PATH: [&str; 4] = ["std", "path", "PathBuf", "as_path"];
|
2023-03-24 08:04:35 -05:00
|
|
|
pub const PATH_MAIN_SEPARATOR: [&str; 3] = ["std", "path", "MAIN_SEPARATOR"];
|
2019-05-17 16:53:54 -05:00
|
|
|
pub const PATH_TO_PATH_BUF: [&str; 4] = ["std", "path", "Path", "to_path_buf"];
|
2022-01-13 06:18:19 -06:00
|
|
|
#[cfg_attr(not(unix), allow(clippy::invalid_paths))]
|
2021-09-13 14:27:53 -05:00
|
|
|
pub const PERMISSIONS_FROM_MODE: [&str; 6] = ["std", "os", "unix", "fs", "PermissionsExt", "from_mode"];
|
2020-08-28 09:10:16 -05:00
|
|
|
pub const PUSH_STR: [&str; 4] = ["alloc", "string", "String", "push_str"];
|
2023-07-17 03:19:29 -05:00
|
|
|
pub const REGEX_BUILDER_NEW: [&str; 3] = ["regex", "RegexBuilder", "new"];
|
|
|
|
pub const REGEX_BYTES_BUILDER_NEW: [&str; 4] = ["regex", "bytes", "RegexBuilder", "new"];
|
|
|
|
pub const REGEX_BYTES_NEW: [&str; 4] = ["regex", "bytes", "Regex", "new"];
|
|
|
|
pub const REGEX_BYTES_SET_NEW: [&str; 4] = ["regex", "bytes", "RegexSet", "new"];
|
|
|
|
pub const REGEX_NEW: [&str; 3] = ["regex", "Regex", "new"];
|
|
|
|
pub const REGEX_SET_NEW: [&str; 3] = ["regex", "RegexSet", "new"];
|
2020-10-28 17:36:07 -05:00
|
|
|
pub const SERDE_DESERIALIZE: [&str; 3] = ["serde", "de", "Deserialize"];
|
2019-05-17 16:53:54 -05:00
|
|
|
pub const SERDE_DE_VISITOR: [&str; 3] = ["serde", "de", "Visitor"];
|
2022-06-04 06:34:07 -05:00
|
|
|
pub const SLICE_GET: [&str; 4] = ["core", "slice", "<impl [T]>", "get"];
|
2019-05-17 16:53:54 -05:00
|
|
|
pub const SLICE_INTO_VEC: [&str; 4] = ["alloc", "slice", "<impl [T]>", "into_vec"];
|
2022-06-30 03:50:09 -05:00
|
|
|
pub const SLICE_INTO: [&str; 4] = ["core", "slice", "<impl [T]>", "iter"];
|
2022-11-21 13:34:47 -06:00
|
|
|
pub const STD_IO_SEEK_FROM_CURRENT: [&str; 4] = ["std", "io", "SeekFrom", "Current"];
|
|
|
|
pub const STD_IO_SEEKFROM_START: [&str; 4] = ["std", "io", "SeekFrom", "Start"];
|
2019-12-22 22:48:15 -06:00
|
|
|
pub const STRING_AS_MUT_STR: [&str; 4] = ["alloc", "string", "String", "as_mut_str"];
|
|
|
|
pub const STRING_AS_STR: [&str; 4] = ["alloc", "string", "String", "as_str"];
|
2022-05-05 09:12:52 -05:00
|
|
|
pub const STRING_NEW: [&str; 4] = ["alloc", "string", "String", "new"];
|
|
|
|
pub const STR_BYTES: [&str; 4] = ["core", "str", "<impl str>", "bytes"];
|
2022-06-30 03:50:09 -05:00
|
|
|
pub const STR_CHARS: [&str; 4] = ["core", "str", "<impl str>", "chars"];
|
2020-09-24 07:49:22 -05:00
|
|
|
pub const STR_ENDS_WITH: [&str; 4] = ["core", "str", "<impl str>", "ends_with"];
|
|
|
|
pub const STR_LEN: [&str; 4] = ["core", "str", "<impl str>", "len"];
|
|
|
|
pub const STR_STARTS_WITH: [&str; 4] = ["core", "str", "<impl str>", "starts_with"];
|
2020-12-20 10:19:49 -06:00
|
|
|
pub const SYMBOL: [&str; 3] = ["rustc_span", "symbol", "Symbol"];
|
2021-01-15 03:56:44 -06:00
|
|
|
pub const SYMBOL_AS_STR: [&str; 4] = ["rustc_span", "symbol", "Symbol", "as_str"];
|
2020-12-20 10:19:49 -06:00
|
|
|
pub const SYMBOL_INTERN: [&str; 4] = ["rustc_span", "symbol", "Symbol", "intern"];
|
2021-01-15 03:56:44 -06:00
|
|
|
pub const SYMBOL_TO_IDENT_STRING: [&str; 4] = ["rustc_span", "symbol", "Symbol", "to_ident_string"];
|
2020-12-20 10:19:49 -06:00
|
|
|
pub const SYM_MODULE: [&str; 3] = ["rustc_span", "symbol", "sym"];
|
2019-12-30 18:17:56 -06:00
|
|
|
pub const SYNTAX_CONTEXT: [&str; 3] = ["rustc_span", "hygiene", "SyntaxContext"];
|
2022-05-21 06:24:00 -05:00
|
|
|
#[expect(clippy::invalid_paths)] // internal lints do not know about all external crates
|
2024-01-25 12:17:36 -06:00
|
|
|
pub const TOKIO_FILE_OPTIONS: [&str; 5] = ["tokio", "fs", "file", "File", "options"];
|
|
|
|
#[expect(clippy::invalid_paths)] // internal lints do not know about all external crates
|
2022-01-13 06:18:19 -06:00
|
|
|
pub const TOKIO_IO_ASYNCREADEXT: [&str; 5] = ["tokio", "io", "util", "async_read_ext", "AsyncReadExt"];
|
2022-05-21 06:24:00 -05:00
|
|
|
#[expect(clippy::invalid_paths)] // internal lints do not know about all external crates
|
2022-01-13 06:18:19 -06:00
|
|
|
pub const TOKIO_IO_ASYNCWRITEEXT: [&str; 5] = ["tokio", "io", "util", "async_write_ext", "AsyncWriteExt"];
|
2024-01-25 12:17:36 -06:00
|
|
|
#[expect(clippy::invalid_paths)] // internal lints do not know about all external crates
|
|
|
|
pub const TOKIO_IO_OPEN_OPTIONS: [&str; 4] = ["tokio", "fs", "open_options", "OpenOptions"];
|
|
|
|
#[expect(clippy::invalid_paths)] // internal lints do not know about all external crates
|
|
|
|
pub const TOKIO_IO_OPEN_OPTIONS_NEW: [&str; 5] = ["tokio", "fs", "open_options", "OpenOptions", "new"];
|
2019-12-22 22:48:15 -06:00
|
|
|
pub const VEC_AS_MUT_SLICE: [&str; 4] = ["alloc", "vec", "Vec", "as_mut_slice"];
|
|
|
|
pub const VEC_AS_SLICE: [&str; 4] = ["alloc", "vec", "Vec", "as_slice"];
|
2022-06-30 03:50:09 -05:00
|
|
|
pub const VEC_DEQUE_ITER: [&str; 5] = ["alloc", "collections", "vec_deque", "VecDeque", "iter"];
|
2019-05-17 16:53:54 -05:00
|
|
|
pub const VEC_FROM_ELEM: [&str; 3] = ["alloc", "vec", "from_elem"];
|
2020-04-01 13:14:05 -05:00
|
|
|
pub const VEC_NEW: [&str; 4] = ["alloc", "vec", "Vec", "new"];
|
2023-07-31 16:53:53 -05:00
|
|
|
pub const VEC_WITH_CAPACITY: [&str; 4] = ["alloc", "vec", "Vec", "with_capacity"];
|
2020-06-09 09:36:01 -05:00
|
|
|
pub const VEC_RESIZE: [&str; 4] = ["alloc", "vec", "Vec", "resize"];
|
2022-08-11 12:42:16 -05:00
|
|
|
pub const INSTANT_NOW: [&str; 4] = ["std", "time", "Instant", "now"];
|
2023-05-05 10:45:49 -05:00
|
|
|
pub const VEC_IS_EMPTY: [&str; 4] = ["alloc", "vec", "Vec", "is_empty"];
|
|
|
|
pub const VEC_POP: [&str; 4] = ["alloc", "vec", "Vec", "pop"];
|
2023-11-02 11:35:56 -05:00
|
|
|
pub const WAKER: [&str; 4] = ["core", "task", "wake", "Waker"];
|
2023-05-05 10:45:49 -05:00
|
|
|
pub const OPTION_UNWRAP: [&str; 4] = ["core", "option", "Option", "unwrap"];
|
|
|
|
pub const OPTION_EXPECT: [&str; 4] = ["core", "option", "Option", "expect"];
|
2023-08-11 07:05:13 -05:00
|
|
|
#[expect(clippy::invalid_paths)] // not sure why it thinks this, it works so
|
|
|
|
pub const BOOL_THEN: [&str; 4] = ["core", "bool", "<impl bool>", "then"];
|
2023-11-16 12:13:24 -06:00
|
|
|
pub const ALLOCATOR_GLOBAL: [&str; 3] = ["alloc", "alloc", "Global"];
|