]> git.lizzy.rs Git - rust.git/blob - clippy_utils/src/paths.rs
Auto merge of #82122 - bstrie:dep4real, r=dtolnay
[rust.git] / clippy_utils / src / paths.rs
1 //! This module contains paths to types and functions Clippy needs to know
2 //! about.
3 //!
4 //! Whenever possible, please consider diagnostic items over hardcoded paths.
5 //! See <https://github.com/rust-lang/rust-clippy/issues/5393> for more information.
6
7 pub const ANY_TRAIT: [&str; 3] = ["std", "any", "Any"];
8 pub const ARC_PTR_EQ: [&str; 4] = ["alloc", "sync", "Arc", "ptr_eq"];
9 pub const ASMUT_TRAIT: [&str; 3] = ["core", "convert", "AsMut"];
10 pub const ASREF_TRAIT: [&str; 3] = ["core", "convert", "AsRef"];
11 pub(super) const BEGIN_PANIC: [&str; 3] = ["std", "panicking", "begin_panic"];
12 pub(super) const BEGIN_PANIC_FMT: [&str; 3] = ["std", "panicking", "begin_panic_fmt"];
13 pub const BINARY_HEAP: [&str; 4] = ["alloc", "collections", "binary_heap", "BinaryHeap"];
14 pub const BORROW_TRAIT: [&str; 3] = ["core", "borrow", "Borrow"];
15 pub const BTREEMAP: [&str; 5] = ["alloc", "collections", "btree", "map", "BTreeMap"];
16 pub const BTREEMAP_ENTRY: [&str; 6] = ["alloc", "collections", "btree", "map", "entry", "Entry"];
17 pub const BTREESET: [&str; 5] = ["alloc", "collections", "btree", "set", "BTreeSet"];
18 pub const CLONE_TRAIT_METHOD: [&str; 4] = ["core", "clone", "Clone", "clone"];
19 pub const CMP_MAX: [&str; 3] = ["core", "cmp", "max"];
20 pub const CMP_MIN: [&str; 3] = ["core", "cmp", "min"];
21 pub const COPY: [&str; 4] = ["core", "intrinsics", "", "copy_nonoverlapping"];
22 pub const COPY_NONOVERLAPPING: [&str; 4] = ["core", "intrinsics", "", "copy"];
23 pub const COW: [&str; 3] = ["alloc", "borrow", "Cow"];
24 pub const CSTRING_AS_C_STR: [&str; 5] = ["std", "ffi", "c_str", "CString", "as_c_str"];
25 pub const DEFAULT_TRAIT: [&str; 3] = ["core", "default", "Default"];
26 pub const DEFAULT_TRAIT_METHOD: [&str; 4] = ["core", "default", "Default", "default"];
27 pub const DEREF_MUT_TRAIT_METHOD: [&str; 5] = ["core", "ops", "deref", "DerefMut", "deref_mut"];
28 pub const DEREF_TRAIT_METHOD: [&str; 5] = ["core", "ops", "deref", "Deref", "deref"];
29 pub const DISPLAY_FMT_METHOD: [&str; 4] = ["core", "fmt", "Display", "fmt"];
30 pub const DISPLAY_TRAIT: [&str; 3] = ["core", "fmt", "Display"];
31 pub const DOUBLE_ENDED_ITERATOR: [&str; 4] = ["core", "iter", "traits", "DoubleEndedIterator"];
32 pub const DROP: [&str; 3] = ["core", "mem", "drop"];
33 pub const DURATION: [&str; 3] = ["core", "time", "Duration"];
34 #[cfg(feature = "internal-lints")]
35 pub const EARLY_CONTEXT: [&str; 2] = ["rustc_lint", "EarlyContext"];
36 pub const EXIT: [&str; 3] = ["std", "process", "exit"];
37 pub const F32_EPSILON: [&str; 4] = ["core", "f32", "<impl f32>", "EPSILON"];
38 pub const F64_EPSILON: [&str; 4] = ["core", "f64", "<impl f64>", "EPSILON"];
39 pub const FILE: [&str; 3] = ["std", "fs", "File"];
40 pub const FILE_TYPE: [&str; 3] = ["std", "fs", "FileType"];
41 pub const FMT_ARGUMENTS_NEW_V1: [&str; 4] = ["core", "fmt", "Arguments", "new_v1"];
42 pub const FMT_ARGUMENTS_NEW_V1_FORMATTED: [&str; 4] = ["core", "fmt", "Arguments", "new_v1_formatted"];
43 pub const FMT_ARGUMENTV1_NEW: [&str; 4] = ["core", "fmt", "ArgumentV1", "new"];
44 pub const FROM_FROM: [&str; 4] = ["core", "convert", "From", "from"];
45 pub const FROM_ITERATOR: [&str; 5] = ["core", "iter", "traits", "collect", "FromIterator"];
46 pub const FUTURE_FROM_GENERATOR: [&str; 3] = ["core", "future", "from_generator"];
47 pub const HASH: [&str; 3] = ["core", "hash", "Hash"];
48 pub const HASHMAP: [&str; 5] = ["std", "collections", "hash", "map", "HashMap"];
49 pub const HASHMAP_ENTRY: [&str; 5] = ["std", "collections", "hash", "map", "Entry"];
50 pub const HASHSET: [&str; 5] = ["std", "collections", "hash", "set", "HashSet"];
51 #[cfg(feature = "internal-lints")]
52 pub const IDENT: [&str; 3] = ["rustc_span", "symbol", "Ident"];
53 #[cfg(feature = "internal-lints")]
54 pub const IDENT_AS_STR: [&str; 4] = ["rustc_span", "symbol", "Ident", "as_str"];
55 pub const INDEX: [&str; 3] = ["core", "ops", "Index"];
56 pub const INDEX_MUT: [&str; 3] = ["core", "ops", "IndexMut"];
57 pub const INSERT_STR: [&str; 4] = ["alloc", "string", "String", "insert_str"];
58 pub const INTO: [&str; 3] = ["core", "convert", "Into"];
59 pub const INTO_ITERATOR: [&str; 5] = ["core", "iter", "traits", "collect", "IntoIterator"];
60 pub const IO_READ: [&str; 3] = ["std", "io", "Read"];
61 pub const IO_WRITE: [&str; 3] = ["std", "io", "Write"];
62 pub const IPADDR_V4: [&str; 4] = ["std", "net", "IpAddr", "V4"];
63 pub const IPADDR_V6: [&str; 4] = ["std", "net", "IpAddr", "V6"];
64 pub const ITERATOR: [&str; 5] = ["core", "iter", "traits", "iterator", "Iterator"];
65 #[cfg(feature = "internal-lints")]
66 pub const KW_MODULE: [&str; 3] = ["rustc_span", "symbol", "kw"];
67 #[cfg(feature = "internal-lints")]
68 pub const LATE_CONTEXT: [&str; 2] = ["rustc_lint", "LateContext"];
69 pub const LINKED_LIST: [&str; 4] = ["alloc", "collections", "linked_list", "LinkedList"];
70 #[cfg(feature = "internal-lints")]
71 pub const LINT: [&str; 2] = ["rustc_lint_defs", "Lint"];
72 pub const MEM_DISCRIMINANT: [&str; 3] = ["core", "mem", "discriminant"];
73 pub const MEM_FORGET: [&str; 3] = ["core", "mem", "forget"];
74 pub const MEM_MANUALLY_DROP: [&str; 4] = ["core", "mem", "manually_drop", "ManuallyDrop"];
75 pub const MEM_MAYBEUNINIT: [&str; 4] = ["core", "mem", "maybe_uninit", "MaybeUninit"];
76 pub const MEM_MAYBEUNINIT_UNINIT: [&str; 5] = ["core", "mem", "maybe_uninit", "MaybeUninit", "uninit"];
77 pub const MEM_REPLACE: [&str; 3] = ["core", "mem", "replace"];
78 pub const MEM_SIZE_OF: [&str; 3] = ["core", "mem", "size_of"];
79 pub const MEM_SIZE_OF_VAL: [&str; 3] = ["core", "mem", "size_of_val"];
80 pub const MUTEX_GUARD: [&str; 4] = ["std", "sync", "mutex", "MutexGuard"];
81 pub const OPEN_OPTIONS: [&str; 3] = ["std", "fs", "OpenOptions"];
82 pub const OPS_MODULE: [&str; 2] = ["core", "ops"];
83 pub const OPTION: [&str; 3] = ["core", "option", "Option"];
84 pub const OPTION_NONE: [&str; 4] = ["core", "option", "Option", "None"];
85 pub const OPTION_SOME: [&str; 4] = ["core", "option", "Option", "Some"];
86 pub const ORD: [&str; 3] = ["core", "cmp", "Ord"];
87 pub const OS_STRING_AS_OS_STR: [&str; 5] = ["std", "ffi", "os_str", "OsString", "as_os_str"];
88 pub const OS_STR_TO_OS_STRING: [&str; 5] = ["std", "ffi", "os_str", "OsStr", "to_os_string"];
89 pub(super) const PANICKING_PANIC: [&str; 3] = ["core", "panicking", "panic"];
90 pub(super) const PANICKING_PANIC_FMT: [&str; 3] = ["core", "panicking", "panic_fmt"];
91 pub(super) const PANICKING_PANIC_STR: [&str; 3] = ["core", "panicking", "panic_str"];
92 pub(super) const PANIC_ANY: [&str; 3] = ["std", "panic", "panic_any"];
93 pub const PARKING_LOT_MUTEX_GUARD: [&str; 2] = ["parking_lot", "MutexGuard"];
94 pub const PARKING_LOT_RWLOCK_READ_GUARD: [&str; 2] = ["parking_lot", "RwLockReadGuard"];
95 pub const PARKING_LOT_RWLOCK_WRITE_GUARD: [&str; 2] = ["parking_lot", "RwLockWriteGuard"];
96 pub const PATH_BUF: [&str; 3] = ["std", "path", "PathBuf"];
97 pub const PATH_BUF_AS_PATH: [&str; 4] = ["std", "path", "PathBuf", "as_path"];
98 pub const PATH_TO_PATH_BUF: [&str; 4] = ["std", "path", "Path", "to_path_buf"];
99 pub const POLL: [&str; 4] = ["core", "task", "poll", "Poll"];
100 pub const POLL_PENDING: [&str; 5] = ["core", "task", "poll", "Poll", "Pending"];
101 pub const POLL_READY: [&str; 5] = ["core", "task", "poll", "Poll", "Ready"];
102 pub const PTR_EQ: [&str; 3] = ["core", "ptr", "eq"];
103 pub const PTR_NULL: [&str; 3] = ["core", "ptr", "null"];
104 pub const PTR_NULL_MUT: [&str; 3] = ["core", "ptr", "null_mut"];
105 pub const PTR_SLICE_FROM_RAW_PARTS: [&str; 3] = ["core", "ptr", "slice_from_raw_parts"];
106 pub const PTR_SLICE_FROM_RAW_PARTS_MUT: [&str; 3] = ["core", "ptr", "slice_from_raw_parts_mut"];
107 pub const PTR_SWAP_NONOVERLAPPING: [&str; 3] = ["core", "ptr", "swap_nonoverlapping"];
108 pub const PUSH_STR: [&str; 4] = ["alloc", "string", "String", "push_str"];
109 pub const RANGE_ARGUMENT_TRAIT: [&str; 3] = ["core", "ops", "RangeBounds"];
110 pub const RC_PTR_EQ: [&str; 4] = ["alloc", "rc", "Rc", "ptr_eq"];
111 pub const REFCELL_REF: [&str; 3] = ["core", "cell", "Ref"];
112 pub const REFCELL_REFMUT: [&str; 3] = ["core", "cell", "RefMut"];
113 pub const REGEX_BUILDER_NEW: [&str; 5] = ["regex", "re_builder", "unicode", "RegexBuilder", "new"];
114 pub const REGEX_BYTES_BUILDER_NEW: [&str; 5] = ["regex", "re_builder", "bytes", "RegexBuilder", "new"];
115 pub const REGEX_BYTES_NEW: [&str; 4] = ["regex", "re_bytes", "Regex", "new"];
116 pub const REGEX_BYTES_SET_NEW: [&str; 5] = ["regex", "re_set", "bytes", "RegexSet", "new"];
117 pub const REGEX_NEW: [&str; 4] = ["regex", "re_unicode", "Regex", "new"];
118 pub const REGEX_SET_NEW: [&str; 5] = ["regex", "re_set", "unicode", "RegexSet", "new"];
119 pub const REPEAT: [&str; 3] = ["core", "iter", "repeat"];
120 pub const RESULT: [&str; 3] = ["core", "result", "Result"];
121 pub const RESULT_ERR: [&str; 4] = ["core", "result", "Result", "Err"];
122 pub const RESULT_OK: [&str; 4] = ["core", "result", "Result", "Ok"];
123 pub const RWLOCK_READ_GUARD: [&str; 4] = ["std", "sync", "rwlock", "RwLockReadGuard"];
124 pub const RWLOCK_WRITE_GUARD: [&str; 4] = ["std", "sync", "rwlock", "RwLockWriteGuard"];
125 pub const SERDE_DESERIALIZE: [&str; 3] = ["serde", "de", "Deserialize"];
126 pub const SERDE_DE_VISITOR: [&str; 3] = ["serde", "de", "Visitor"];
127 pub const SLICE_FROM_RAW_PARTS: [&str; 4] = ["core", "slice", "raw", "from_raw_parts"];
128 pub const SLICE_FROM_RAW_PARTS_MUT: [&str; 4] = ["core", "slice", "raw", "from_raw_parts_mut"];
129 pub const SLICE_INTO_VEC: [&str; 4] = ["alloc", "slice", "<impl [T]>", "into_vec"];
130 pub const SLICE_ITER: [&str; 4] = ["core", "slice", "iter", "Iter"];
131 pub const STDERR: [&str; 4] = ["std", "io", "stdio", "stderr"];
132 pub const STDOUT: [&str; 4] = ["std", "io", "stdio", "stdout"];
133 pub const STD_CONVERT_IDENTITY: [&str; 3] = ["std", "convert", "identity"];
134 pub const STD_FS_CREATE_DIR: [&str; 3] = ["std", "fs", "create_dir"];
135 pub const STD_MEM_TRANSMUTE: [&str; 3] = ["std", "mem", "transmute"];
136 pub const STD_PTR_NULL: [&str; 3] = ["std", "ptr", "null"];
137 pub const STRING_AS_MUT_STR: [&str; 4] = ["alloc", "string", "String", "as_mut_str"];
138 pub const STRING_AS_STR: [&str; 4] = ["alloc", "string", "String", "as_str"];
139 pub const STR_ENDS_WITH: [&str; 4] = ["core", "str", "<impl str>", "ends_with"];
140 pub const STR_FROM_UTF8: [&str; 4] = ["core", "str", "converts", "from_utf8"];
141 pub const STR_LEN: [&str; 4] = ["core", "str", "<impl str>", "len"];
142 pub const STR_STARTS_WITH: [&str; 4] = ["core", "str", "<impl str>", "starts_with"];
143 #[cfg(feature = "internal-lints")]
144 pub const SYMBOL: [&str; 3] = ["rustc_span", "symbol", "Symbol"];
145 #[cfg(feature = "internal-lints")]
146 pub const SYMBOL_AS_STR: [&str; 4] = ["rustc_span", "symbol", "Symbol", "as_str"];
147 #[cfg(feature = "internal-lints")]
148 pub const SYMBOL_INTERN: [&str; 4] = ["rustc_span", "symbol", "Symbol", "intern"];
149 #[cfg(feature = "internal-lints")]
150 pub const SYMBOL_TO_IDENT_STRING: [&str; 4] = ["rustc_span", "symbol", "Symbol", "to_ident_string"];
151 #[cfg(feature = "internal-lints")]
152 pub const SYM_MODULE: [&str; 3] = ["rustc_span", "symbol", "sym"];
153 #[cfg(feature = "internal-lints")]
154 pub const SYNTAX_CONTEXT: [&str; 3] = ["rustc_span", "hygiene", "SyntaxContext"];
155 pub const TO_OWNED_METHOD: [&str; 4] = ["alloc", "borrow", "ToOwned", "to_owned"];
156 pub const TO_STRING_METHOD: [&str; 4] = ["alloc", "string", "ToString", "to_string"];
157 pub const TRANSMUTE: [&str; 4] = ["core", "intrinsics", "", "transmute"];
158 pub const TRY_FROM: [&str; 4] = ["core", "convert", "TryFrom", "try_from"];
159 pub const TRY_INTO_TRAIT: [&str; 3] = ["core", "convert", "TryInto"];
160 pub const VEC: [&str; 3] = ["alloc", "vec", "Vec"];
161 pub const VEC_AS_MUT_SLICE: [&str; 4] = ["alloc", "vec", "Vec", "as_mut_slice"];
162 pub const VEC_AS_SLICE: [&str; 4] = ["alloc", "vec", "Vec", "as_slice"];
163 pub const VEC_DEQUE: [&str; 4] = ["alloc", "collections", "vec_deque", "VecDeque"];
164 pub const VEC_FROM_ELEM: [&str; 3] = ["alloc", "vec", "from_elem"];
165 pub const VEC_NEW: [&str; 4] = ["alloc", "vec", "Vec", "new"];
166 pub const VEC_RESIZE: [&str; 4] = ["alloc", "vec", "Vec", "resize"];
167 pub const WEAK_ARC: [&str; 3] = ["alloc", "sync", "Weak"];
168 pub const WEAK_RC: [&str; 3] = ["alloc", "rc", "Weak"];
169 pub const WRITE_BYTES: [&str; 3] = ["core", "intrinsics", "write_bytes"];