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
|
|
|
|
2022-01-13 06:18:19 -06:00
|
|
|
#[cfg(feature = "internal")]
|
2021-05-06 04:51:22 -05:00
|
|
|
pub const APPLICABILITY: [&str; 2] = ["rustc_lint_defs", "Applicability"];
|
2022-01-13 06:18:19 -06:00
|
|
|
#[cfg(feature = "internal")]
|
2021-05-06 04:51:22 -05:00
|
|
|
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"],
|
|
|
|
];
|
2022-01-13 06:18:19 -06:00
|
|
|
#[cfg(feature = "internal")]
|
2021-05-06 04:51:22 -05:00
|
|
|
pub const DIAGNOSTIC_BUILDER: [&str; 3] = ["rustc_errors", "diagnostic_builder", "DiagnosticBuilder"];
|
2020-03-11 19:00:00 -05:00
|
|
|
pub const ARC_PTR_EQ: [&str; 4] = ["alloc", "sync", "Arc", "ptr_eq"];
|
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"];
|
2022-04-15 08:52:58 -05:00
|
|
|
pub const CSTRING_AS_C_STR: [&str; 5] = ["alloc", "ffi", "c_str", "CString", "as_c_str"];
|
2019-05-17 16:53:54 -05:00
|
|
|
pub const DEFAULT_TRAIT_METHOD: [&str; 4] = ["core", "default", "Default", "default"];
|
2019-12-22 22:48:15 -06:00
|
|
|
pub const DEREF_MUT_TRAIT_METHOD: [&str; 5] = ["core", "ops", "deref", "DerefMut", "deref_mut"];
|
2022-01-13 06:18:19 -06:00
|
|
|
#[cfg(feature = "internal")]
|
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
|
|
|
#[cfg(feature = "internal")]
|
|
|
|
pub const EARLY_LINT_PASS: [&str; 3] = ["rustc_lint", "passes", "EarlyLintPass"];
|
2019-10-18 14:09:42 -05:00
|
|
|
pub const EXIT: [&str; 3] = ["std", "process", "exit"];
|
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"];
|
2021-04-22 04:31:13 -05:00
|
|
|
pub const FROM_ITERATOR_METHOD: [&str; 6] = ["core", "iter", "traits", "collect", "FromIterator", "from_iter"];
|
|
|
|
pub const FROM_STR_METHOD: [&str; 5] = ["core", "str", "traits", "FromStr", "from_str"];
|
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"];
|
2022-06-30 03:50:09 -05:00
|
|
|
pub const HASHSET_ITER: [&str; 6] = ["std", "collections", "hash", "set", "HashSet", "iter"];
|
2022-01-13 06:18:19 -06:00
|
|
|
#[cfg(feature = "internal")]
|
2021-01-15 03:56:44 -06:00
|
|
|
pub const IDENT: [&str; 3] = ["rustc_span", "symbol", "Ident"];
|
2022-01-13 06:18:19 -06:00
|
|
|
#[cfg(feature = "internal")]
|
2021-01-15 03:56:44 -06:00
|
|
|
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"];
|
2022-06-30 03:50:09 -05:00
|
|
|
pub const ITER_EMPTY: [&str; 5] = ["core", "iter", "sources", "empty", "Empty"];
|
2021-09-08 09:31:47 -05:00
|
|
|
pub const ITERTOOLS_NEXT_TUPLE: [&str; 3] = ["itertools", "Itertools", "next_tuple"];
|
2022-01-13 06:18:19 -06:00
|
|
|
#[cfg(feature = "internal")]
|
2021-01-15 03:56:44 -06:00
|
|
|
pub const KW_MODULE: [&str; 3] = ["rustc_span", "symbol", "kw"];
|
2022-01-13 06:18:19 -06:00
|
|
|
#[cfg(feature = "internal")]
|
2020-10-28 17:36:07 -05:00
|
|
|
pub const LATE_CONTEXT: [&str; 2] = ["rustc_lint", "LateContext"];
|
2022-01-13 06:18:19 -06:00
|
|
|
#[cfg(feature = "internal")]
|
2022-03-14 06:02:53 -05:00
|
|
|
pub const LATE_LINT_PASS: [&str; 3] = ["rustc_lint", "passes", "LateLintPass"];
|
|
|
|
#[cfg(feature = "internal")]
|
2020-10-30 20:41:16 -05:00
|
|
|
pub const LINT: [&str; 2] = ["rustc_lint_defs", "Lint"];
|
2022-06-04 06:34:07 -05:00
|
|
|
pub const MEM_SWAP: [&str; 3] = ["core", "mem", "swap"];
|
2022-12-01 11:29:38 -06:00
|
|
|
#[cfg(feature = "internal")]
|
|
|
|
pub const MSRV: [&str; 3] = ["clippy_utils", "msrvs", "Msrv"];
|
2019-05-17 16:53:54 -05:00
|
|
|
pub const OPEN_OPTIONS: [&str; 3] = ["std", "fs", "OpenOptions"];
|
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-11 03:20:44 -06: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-08-31 08:24:45 -05:00
|
|
|
pub const PEEKABLE: [&str; 5] = ["core", "iter", "adapters", "peekable", "Peekable"];
|
2021-04-08 10:50:13 -05:00
|
|
|
pub const PERMISSIONS: [&str; 3] = ["std", "fs", "Permissions"];
|
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"];
|
2021-06-04 15:14:03 -05:00
|
|
|
pub const PTR_COPY: [&str; 3] = ["core", "intrinsics", "copy"];
|
|
|
|
pub const PTR_COPY_NONOVERLAPPING: [&str; 3] = ["core", "intrinsics", "copy_nonoverlapping"];
|
2020-03-11 19:00:00 -05:00
|
|
|
pub const PTR_EQ: [&str; 3] = ["core", "ptr", "eq"];
|
2020-12-06 08:01:03 -06:00
|
|
|
pub const PTR_SLICE_FROM_RAW_PARTS: [&str; 3] = ["core", "ptr", "slice_from_raw_parts"];
|
|
|
|
pub const PTR_SLICE_FROM_RAW_PARTS_MUT: [&str; 3] = ["core", "ptr", "slice_from_raw_parts_mut"];
|
|
|
|
pub const PTR_SWAP_NONOVERLAPPING: [&str; 3] = ["core", "ptr", "swap_nonoverlapping"];
|
2021-04-22 04:31:13 -05:00
|
|
|
pub const PTR_READ: [&str; 3] = ["core", "ptr", "read"];
|
|
|
|
pub const PTR_READ_UNALIGNED: [&str; 3] = ["core", "ptr", "read_unaligned"];
|
|
|
|
pub const PTR_READ_VOLATILE: [&str; 3] = ["core", "ptr", "read_volatile"];
|
|
|
|
pub const PTR_REPLACE: [&str; 3] = ["core", "ptr", "replace"];
|
|
|
|
pub const PTR_SWAP: [&str; 3] = ["core", "ptr", "swap"];
|
2022-04-07 12:39:59 -05:00
|
|
|
pub const PTR_UNALIGNED_VOLATILE_LOAD: [&str; 3] = ["core", "intrinsics", "unaligned_volatile_load"];
|
|
|
|
pub const PTR_UNALIGNED_VOLATILE_STORE: [&str; 3] = ["core", "intrinsics", "unaligned_volatile_store"];
|
2021-04-22 04:31:13 -05:00
|
|
|
pub const PTR_WRITE: [&str; 3] = ["core", "ptr", "write"];
|
|
|
|
pub const PTR_WRITE_BYTES: [&str; 3] = ["core", "intrinsics", "write_bytes"];
|
|
|
|
pub const PTR_WRITE_UNALIGNED: [&str; 3] = ["core", "ptr", "write_unaligned"];
|
|
|
|
pub const PTR_WRITE_VOLATILE: [&str; 3] = ["core", "ptr", "write_volatile"];
|
2020-08-28 09:10:16 -05:00
|
|
|
pub const PUSH_STR: [&str; 4] = ["alloc", "string", "String", "push_str"];
|
2019-05-17 16:53:54 -05:00
|
|
|
pub const RANGE_ARGUMENT_TRAIT: [&str; 3] = ["core", "ops", "RangeBounds"];
|
2020-03-11 19:00:00 -05:00
|
|
|
pub const RC_PTR_EQ: [&str; 4] = ["alloc", "rc", "Rc", "ptr_eq"];
|
2020-10-28 17:36:07 -05:00
|
|
|
pub const REFCELL_REF: [&str; 3] = ["core", "cell", "Ref"];
|
|
|
|
pub const REFCELL_REFMUT: [&str; 3] = ["core", "cell", "RefMut"];
|
2019-05-17 16:53:54 -05:00
|
|
|
pub const REGEX_BUILDER_NEW: [&str; 5] = ["regex", "re_builder", "unicode", "RegexBuilder", "new"];
|
|
|
|
pub const REGEX_BYTES_BUILDER_NEW: [&str; 5] = ["regex", "re_builder", "bytes", "RegexBuilder", "new"];
|
|
|
|
pub const REGEX_BYTES_NEW: [&str; 4] = ["regex", "re_bytes", "Regex", "new"];
|
|
|
|
pub const REGEX_BYTES_SET_NEW: [&str; 5] = ["regex", "re_set", "bytes", "RegexSet", "new"];
|
|
|
|
pub const REGEX_NEW: [&str; 4] = ["regex", "re_unicode", "Regex", "new"];
|
|
|
|
pub const REGEX_SET_NEW: [&str; 5] = ["regex", "re_set", "unicode", "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"];
|
2020-12-06 08:01:03 -06:00
|
|
|
pub const SLICE_FROM_RAW_PARTS: [&str; 4] = ["core", "slice", "raw", "from_raw_parts"];
|
|
|
|
pub const SLICE_FROM_RAW_PARTS_MUT: [&str; 4] = ["core", "slice", "raw", "from_raw_parts_mut"];
|
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"];
|
2020-09-15 05:21:40 -05:00
|
|
|
pub const SLICE_ITER: [&str; 4] = ["core", "slice", "iter", "Iter"];
|
2019-05-17 16:53:54 -05:00
|
|
|
pub const STDERR: [&str; 4] = ["std", "io", "stdio", "stderr"];
|
|
|
|
pub const STDOUT: [&str; 4] = ["std", "io", "stdio", "stdout"];
|
2021-04-22 04:31:13 -05:00
|
|
|
pub const CONVERT_IDENTITY: [&str; 3] = ["core", "convert", "identity"];
|
2020-09-10 10:47:07 -05:00
|
|
|
pub const STD_FS_CREATE_DIR: [&str; 3] = ["std", "fs", "create_dir"];
|
2022-11-21 13:34:47 -06:00
|
|
|
pub const STD_IO_SEEK: [&str; 3] = ["std", "io", "Seek"];
|
|
|
|
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"];
|
2023-02-10 09:59:04 -06:00
|
|
|
pub const STD_PROCESS_COMMAND: [&str; 3] = ["std", "process", "Command"];
|
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"];
|
2020-11-23 06:51:04 -06:00
|
|
|
pub const STR_FROM_UTF8: [&str; 4] = ["core", "str", "converts", "from_utf8"];
|
2022-07-18 02:39:37 -05:00
|
|
|
pub const STR_FROM_UTF8_UNCHECKED: [&str; 4] = ["core", "str", "converts", "from_utf8_unchecked"];
|
2020-09-24 07:49:22 -05:00
|
|
|
pub const STR_LEN: [&str; 4] = ["core", "str", "<impl str>", "len"];
|
|
|
|
pub const STR_STARTS_WITH: [&str; 4] = ["core", "str", "<impl str>", "starts_with"];
|
2022-01-13 06:18:19 -06:00
|
|
|
#[cfg(feature = "internal")]
|
2020-12-20 10:19:49 -06:00
|
|
|
pub const SYMBOL: [&str; 3] = ["rustc_span", "symbol", "Symbol"];
|
2022-01-13 06:18:19 -06:00
|
|
|
#[cfg(feature = "internal")]
|
2021-01-15 03:56:44 -06:00
|
|
|
pub const SYMBOL_AS_STR: [&str; 4] = ["rustc_span", "symbol", "Symbol", "as_str"];
|
2022-01-13 06:18:19 -06:00
|
|
|
#[cfg(feature = "internal")]
|
2020-12-20 10:19:49 -06:00
|
|
|
pub const SYMBOL_INTERN: [&str; 4] = ["rustc_span", "symbol", "Symbol", "intern"];
|
2022-01-13 06:18:19 -06:00
|
|
|
#[cfg(feature = "internal")]
|
2021-01-15 03:56:44 -06:00
|
|
|
pub const SYMBOL_TO_IDENT_STRING: [&str; 4] = ["rustc_span", "symbol", "Symbol", "to_ident_string"];
|
2022-01-13 06:18:19 -06:00
|
|
|
#[cfg(feature = "internal")]
|
2020-12-20 10:19:49 -06:00
|
|
|
pub const SYM_MODULE: [&str; 3] = ["rustc_span", "symbol", "sym"];
|
2022-01-13 06:18:19 -06:00
|
|
|
#[cfg(feature = "internal")]
|
2019-12-30 18:17:56 -06:00
|
|
|
pub const SYNTAX_CONTEXT: [&str; 3] = ["rustc_span", "hygiene", "SyntaxContext"];
|
2019-05-17 16:53:54 -05:00
|
|
|
pub const TO_OWNED_METHOD: [&str; 4] = ["alloc", "borrow", "ToOwned", "to_owned"];
|
|
|
|
pub const TO_STRING_METHOD: [&str; 4] = ["alloc", "string", "ToString", "to_string"];
|
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_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"];
|
2020-05-28 08:45:24 -05:00
|
|
|
pub const TRY_FROM: [&str; 4] = ["core", "convert", "TryFrom", "try_from"];
|
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"];
|
2020-06-09 09:36:01 -05:00
|
|
|
pub const VEC_RESIZE: [&str; 4] = ["alloc", "vec", "Vec", "resize"];
|
2019-05-17 16:53:54 -05:00
|
|
|
pub const WEAK_ARC: [&str; 3] = ["alloc", "sync", "Weak"];
|
|
|
|
pub const WEAK_RC: [&str; 3] = ["alloc", "rc", "Weak"];
|
2021-12-06 05:33:31 -06:00
|
|
|
pub const PTR_NON_NULL: [&str; 4] = ["core", "ptr", "non_null", "NonNull"];
|
2022-08-11 12:42:16 -05:00
|
|
|
pub const INSTANT_NOW: [&str; 4] = ["std", "time", "Instant", "now"];
|
|
|
|
pub const INSTANT: [&str; 3] = ["std", "time", "Instant"];
|