]> git.lizzy.rs Git - rust.git/blob - clippy_lints/src/utils/paths.rs
Merge remote-tracking branch 'origin/beta_backport' into HEAD
[rust.git] / clippy_lints / src / utils / paths.rs
1 //! This module contains paths to types and functions Clippy needs to know
2 //! about.
3
4 #![allow(default_hash_types)] // we just look at symbol names, which is good enough everywhere else
5
6 use super::sym::{self, *};
7 use lazy_static::lazy_static;
8 use syntax::symbol::Symbol;
9
10 lazy_static! {
11     pub static ref ANY_TRAIT: [Symbol; 3] = [*std, *any, *Any];
12     pub static ref ARC: [Symbol; 3] = [*alloc, *sync, *Arc];
13     pub static ref ASMUT_TRAIT: [Symbol; 3] = [*core, *convert, *sym::AsMut];
14     pub static ref ASREF_TRAIT: [Symbol; 3] = [*core, *convert, *sym::AsRef];
15     pub static ref BEGIN_PANIC: [Symbol; 3] = [*std, *panicking, *begin_panic];
16     pub static ref BEGIN_PANIC_FMT: [Symbol; 3] = [*std, *panicking, *begin_panic_fmt];
17     pub static ref BINARY_HEAP: [Symbol; 4] = [*alloc, *collections, *binary_heap, *BinaryHeap];
18     pub static ref BORROW_TRAIT: [Symbol; 3] = [*core, *borrow, *Borrow];
19     pub static ref BTREEMAP: [Symbol; 5] = [*alloc, *collections, *btree, *map, *BTreeMap];
20     pub static ref BTREEMAP_ENTRY: [Symbol; 5] = [*alloc, *collections, *btree, *map, *Entry];
21     pub static ref BTREESET: [Symbol; 5] = [*alloc, *collections, *btree, *set, *BTreeSet];
22     pub static ref CLONE_TRAIT: [Symbol; 3] = [*core, *clone, *sym::Clone];
23     pub static ref CLONE_TRAIT_METHOD: [Symbol; 4] = [*core, *clone, *sym::Clone, *clone];
24     pub static ref CMP_MAX: [Symbol; 3] = [*core, *cmp, *max];
25     pub static ref CMP_MIN: [Symbol; 3] = [*core, *cmp, *min];
26     pub static ref COW: [Symbol; 3] = [*alloc, *borrow, *Cow];
27     pub static ref CSTRING_NEW: [Symbol; 5] = [*std, *ffi, *c_str, *CString, *new];
28     pub static ref DEFAULT_TRAIT: [Symbol; 3] = [*core, *default, *sym::Default];
29     pub static ref DEFAULT_TRAIT_METHOD: [Symbol; 4] = [*core, *default, *sym::Default, *default];
30     pub static ref DEREF_TRAIT_METHOD: [Symbol; 5] = [*core, *ops, *deref, *Deref, *deref];
31     pub static ref DISPLAY_FMT_METHOD: [Symbol; 4] = [*core, *fmt, *Display, *fmt];
32     pub static ref DOUBLE_ENDED_ITERATOR: [Symbol; 4] = [*core, *iter, *traits, *sym::DoubleEndedIterator];
33     pub static ref DROP: [Symbol; 3] = [*core, *mem, *drop];
34     pub static ref DROP_TRAIT: [Symbol; 4] = [*core, *ops, *drop, *sym::Drop];
35     pub static ref DURATION: [Symbol; 3] = [*core, *time, *Duration];
36     pub static ref EARLY_CONTEXT: [Symbol; 4] = [*rustc, *lint, *context, *EarlyContext];
37     pub static ref FMT_ARGUMENTS_NEWV1: [Symbol; 4] = [*core, *fmt, *Arguments, *new_v1];
38     pub static ref FMT_ARGUMENTS_NEWV1FORMATTED: [Symbol; 4] = [*core, *fmt, *Arguments, *new_v1_formatted];
39     pub static ref FROM_FROM: [Symbol; 4] = [*core, *convert, *sym::From, *from];
40     pub static ref FROM_TRAIT: [Symbol; 3] = [*core, *convert, *sym::From];
41     pub static ref HASH: [Symbol; 2] = [*hash, *Hash];
42     pub static ref HASHMAP: [Symbol; 5] = [*std, *collections, *hash, *map, *HashMap];
43     pub static ref HASHMAP_ENTRY: [Symbol; 5] = [*std, *collections, *hash, *map, *Entry];
44     pub static ref HASHSET: [Symbol; 5] = [*std, *collections, *hash, *set, *HashSet];
45     pub static ref INDEX: [Symbol; 3] = [*core, *ops, *Index];
46     pub static ref INDEX_MUT: [Symbol; 3] = [*core, *ops, *IndexMut];
47     pub static ref INIT: [Symbol; 4] = [*core, *intrinsics, *empty_symbol, *init];
48     pub static ref INTO: [Symbol; 3] = [*core, *convert, *sym::Into];
49     pub static ref INTO_ITERATOR: [Symbol; 5] = [*core, *iter, *traits, *collect, *sym::IntoIterator];
50     pub static ref IO_READ: [Symbol; 3] = [*std, *io, *Read];
51     pub static ref IO_WRITE: [Symbol; 3] = [*std, *io, *Write];
52     pub static ref ITERATOR: [Symbol; 5] = [*core, *iter, *traits, *iterator, *sym::Iterator];
53     pub static ref LATE_CONTEXT: [Symbol; 4] = [*rustc, *lint, *context, *LateContext];
54     pub static ref LINKED_LIST: [Symbol; 4] = [*alloc, *collections, *linked_list, *LinkedList];
55     pub static ref LINT: [Symbol; 3] = [*rustc, *lint, *Lint];
56     pub static ref LINT_PASS: [Symbol; 3] = [*rustc, *lint, *LintPass];
57     pub static ref MEM_DISCRIMINANT: [Symbol; 3] = [*core, *mem, *discriminant];
58     pub static ref MEM_FORGET: [Symbol; 3] = [*core, *mem, *forget];
59     pub static ref MEM_REPLACE: [Symbol; 3] = [*core, *mem, *replace];
60     pub static ref MEM_UNINIT: [Symbol; 3] = [*core, *mem, *uninitialized];
61     pub static ref MEM_ZEROED: [Symbol; 3] = [*core, *mem, *zeroed];
62     pub static ref MUTEX: [Symbol; 4] = [*std, *sync, *mutex, *Mutex];
63     pub static ref OPEN_OPTIONS: [Symbol; 3] = [*std, *fs, *OpenOptions];
64     pub static ref OPS_MODULE: [Symbol; 2] = [*core, *ops];
65     pub static ref OPTION: [Symbol; 3] = [*core, *option, *sym::Option];
66     pub static ref OPTION_NONE: [Symbol; 4] = [*core, *option, *sym::Option, *sym::None];
67     pub static ref OPTION_SOME: [Symbol; 4] = [*core, *option, *sym::Option, *sym::Some];
68     pub static ref ORD: [Symbol; 3] = [*core, *cmp, *sym::Ord];
69     pub static ref OS_STRING: [Symbol; 4] = [*std, *ffi, *os_str, *OsString];
70     pub static ref OS_STR_TO_OS_STRING: [Symbol; 5] = [*std, *ffi, *os_str, *OsStr, *to_os_string];
71     pub static ref PARTIAL_ORD: [Symbol; 3] = [*core, *cmp, *sym::PartialOrd];
72     pub static ref PATH: [Symbol; 3] = [*std, *path, *Path];
73     pub static ref PATH_BUF: [Symbol; 3] = [*std, *path, *PathBuf];
74     pub static ref PATH_TO_PATH_BUF: [Symbol; 4] = [*std, *path, *Path, *to_path_buf];
75     pub static ref PTR_NULL: [Symbol; 2] = [*ptr, *null];
76     pub static ref PTR_NULL_MUT: [Symbol; 2] = [*ptr, *null_mut];
77     pub static ref RANGE: [Symbol; 3] = [*core, *ops, *Range];
78     pub static ref RANGE_ARGUMENT_TRAIT: [Symbol; 3] = [*core, *ops, *RangeBounds];
79     pub static ref RANGE_FROM: [Symbol; 3] = [*core, *ops, *RangeFrom];
80     pub static ref RANGE_FROM_STD: [Symbol; 3] = [*std, *ops, *RangeFrom];
81     pub static ref RANGE_FULL: [Symbol; 3] = [*core, *ops, *RangeFull];
82     pub static ref RANGE_FULL_STD: [Symbol; 3] = [*std, *ops, *RangeFull];
83     pub static ref RANGE_INCLUSIVE_NEW: [Symbol; 4] = [*core, *ops, *RangeInclusive, *new];
84     pub static ref RANGE_INCLUSIVE_STD_NEW: [Symbol; 4] = [*std, *ops, *RangeInclusive, *new];
85     pub static ref RANGE_STD: [Symbol; 3] = [*std, *ops, *Range];
86     pub static ref RANGE_TO: [Symbol; 3] = [*core, *ops, *RangeTo];
87     pub static ref RANGE_TO_INCLUSIVE: [Symbol; 3] = [*core, *ops, *RangeToInclusive];
88     pub static ref RANGE_TO_INCLUSIVE_STD: [Symbol; 3] = [*std, *ops, *RangeToInclusive];
89     pub static ref RANGE_TO_STD: [Symbol; 3] = [*std, *ops, *RangeTo];
90     pub static ref RC: [Symbol; 3] = [*alloc, *rc, *Rc];
91     pub static ref RECEIVER: [Symbol; 4] = [*std, *sync, *mpsc, *Receiver];
92     pub static ref REGEX: [Symbol; 3] = [*regex, *re_unicode, *Regex];
93     pub static ref REGEX_BUILDER_NEW: [Symbol; 5] = [*regex, *re_builder, *unicode, *RegexBuilder, *new];
94     pub static ref REGEX_BYTES_BUILDER_NEW: [Symbol; 5] = [*regex, *re_builder, *bytes, *RegexBuilder, *new];
95     pub static ref REGEX_BYTES_NEW: [Symbol; 4] = [*regex, *re_bytes, *Regex, *new];
96     pub static ref REGEX_BYTES_SET_NEW: [Symbol; 5] = [*regex, *re_set, *bytes, *RegexSet, *new];
97     pub static ref REGEX_NEW: [Symbol; 4] = [*regex, *re_unicode, *Regex, *new];
98     pub static ref REGEX_SET_NEW: [Symbol; 5] = [*regex, *re_set, *unicode, *RegexSet, *new];
99     pub static ref REPEAT: [Symbol; 3] = [*core, *iter, *repeat];
100     pub static ref RESULT: [Symbol; 3] = [*core, *result, *sym::Result];
101     pub static ref RESULT_ERR: [Symbol; 4] = [*core, *result, *sym::Result, *sym::Err];
102     pub static ref RESULT_OK: [Symbol; 4] = [*core, *result, *sym::Result, *sym::Ok];
103     pub static ref SERDE_DE_VISITOR: [Symbol; 3] = [*serde, *de, *Visitor];
104     pub static ref SLICE_INTO_VEC: [Symbol; 4] = [*alloc, *slice, *impl_slice_t, *into_vec];
105     pub static ref SLICE_ITER: [Symbol; 3] = [*core, *slice, *Iter];
106     pub static ref STD_MEM_TRANSMUTE: [Symbol; 3] = [*std, *mem, *transmute];
107     pub static ref STD_PTR_NULL: [Symbol; 3] = [*std, *ptr, *null];
108     pub static ref STDERR: [Symbol; 4] = [*std, *io, *stdio, *stderr];
109     pub static ref STDOUT: [Symbol; 4] = [*std, *io, *stdio, *stdout];
110     pub static ref STRING: [Symbol; 3] = [*alloc, *string, *sym::String];
111     pub static ref TO_OWNED: [Symbol; 3] = [*alloc, *borrow, *sym::ToOwned];
112     pub static ref TO_OWNED_METHOD: [Symbol; 4] = [*alloc, *borrow, *sym::ToOwned, *to_owned];
113     pub static ref TO_STRING: [Symbol; 3] = [*alloc, *string, *sym::ToString];
114     pub static ref TO_STRING_METHOD: [Symbol; 4] = [*alloc, *string, *sym::ToString, *to_string];
115     pub static ref TRANSMUTE: [Symbol; 4] = [*core, *intrinsics, *empty_symbol, *transmute];
116     pub static ref TRY_INTO_RESULT: [Symbol; 4] = [*std, *ops, *Try, *into_result];
117     pub static ref UNINIT: [Symbol; 4] = [*core, *intrinsics, *empty_symbol, *uninit];
118     pub static ref VEC: [Symbol; 3] = [*alloc, *vec, *sym::Vec];
119     pub static ref VEC_DEQUE: [Symbol; 4] = [*alloc, *collections, *vec_deque, *VecDeque];
120     pub static ref VEC_FROM_ELEM: [Symbol; 3] = [*alloc, *vec, *from_elem];
121     pub static ref WEAK_ARC: [Symbol; 3] = [*alloc, *sync, *Weak];
122     pub static ref WEAK_RC: [Symbol; 3] = [*alloc, *rc, *Weak];
123 }