]> git.lizzy.rs Git - rust.git/blob - clippy_lints/src/utils/sym.rs
Merge remote-tracking branch 'origin/rust-1.31.0' into HEAD
[rust.git] / clippy_lints / src / utils / sym.rs
1 #![allow(default_hash_types, non_upper_case_globals)]
2
3 use lazy_static::lazy_static;
4 use syntax::symbol::Symbol;
5
6 macro_rules! symbols_simple {
7     ($($ident:ident,)*) => {
8         $(
9             lazy_static! {
10                 pub(crate) static ref $ident: Symbol = Symbol::intern(stringify!($ident));
11             }
12         )*
13     };
14 }
15
16 macro_rules! symbols_init {
17     ($($ident:ident: $expr:expr,)*) => {
18         $(
19             lazy_static! {
20                 pub(crate) static ref $ident: Symbol = Symbol::intern($expr);
21             }
22         )*
23     };
24 }
25
26 // exists because concat_idents is flaky
27 pub mod assign {
28     pub(crate) use super::AddAssign as Add;
29     pub(crate) use super::AndAssign as And;
30     pub(crate) use super::BitAndAssign as BitAnd;
31     pub(crate) use super::BitOrAssign as BitOr;
32     pub(crate) use super::BitXorAssign as BitXor;
33     pub(crate) use super::DivAssign as Div;
34     pub(crate) use super::MulAssign as Mul;
35     pub(crate) use super::OrAssign as Or;
36     pub(crate) use super::RemAssign as Rem;
37     pub(crate) use super::ShlAssign as Shl;
38     pub(crate) use super::ShrAssign as Shr;
39     pub(crate) use super::SubAssign as Sub;
40 }
41
42 symbols_simple! {
43     Option,
44     rustc,
45     AsMut,
46     AsRef,
47     Clone,
48     Default,
49     DoubleEndedIterator,
50     Drop,
51     From,
52     Into,
53     IntoIterator,
54     Iterator,
55     Ord,
56     PartialOrd,
57     Any,
58     add,
59     Add,
60     AddAssign,
61     AndAssign,
62     OrAssign,
63     all,
64     alloc,
65     always,
66     any,
67     Arc,
68     Arguments,
69     array,
70     as_bytes,
71     as_mut,
72     as_ref,
73     assert,
74     as_str,
75     automatically_derived,
76     begin_panic,
77     begin_panic_fmt,
78     binary_heap,
79     BinaryHeap,
80     bitand,
81     BitAndAssign,
82     bitor,
83     BitOrAssign,
84     bitxor,
85     BitXorAssign,
86     bool,
87     borrow,
88     Borrow,
89     borrow_mut,
90     btree,
91     BTreeMap,
92     BTreeSet,
93     by_ref,
94     bytes,
95     capacity,
96     cfg,
97     cfg_attr,
98     chain,
99     chars,
100     clone,
101     cloned,
102     cmp,
103     collect,
104     collections,
105     conf_file,
106     contains,
107     contains_key,
108     context,
109     convert,
110     core,
111     count,
112     Cow,
113     c_str,
114     CString,
115     cycle,
116     dbg,
117     de,
118     debug_assert,
119     default,
120     deprecated,
121     deref,
122     Deref,
123     deref_mut,
124     discriminant,
125     Display,
126     div,
127     Div,
128     DivAssign,
129     doc,
130     drop,
131     Duration,
132     E,
133     EarlyContext,
134     end,
135     ends_with,
136     Entry,
137     enumerate,
138     eq,
139     Err,
140     extend,
141     ffi,
142     filter,
143     filter_map,
144     find,
145     flat_map,
146     fmt,
147     fold,
148     for_each,
149     forget,
150     format,
151     FRAC_1_PI,
152     FRAC_1_SQRT_2,
153     FRAC_2_PI,
154     FRAC_2_SQRT_PI,
155     FRAC_PI_2,
156     FRAC_PI_3,
157     FRAC_PI_4,
158     FRAC_PI_6,
159     FRAC_PI_8,
160     from,
161     from_elem,
162     from_iter,
163     from_str,
164     fs,
165     fuse,
166     hash,
167     Hash,
168     HashMap,
169     HashSet,
170     hidden,
171     i128,
172     i16,
173     i32,
174     i64,
175     i8,
176     Implied,
177     index,
178     Index,
179     index_mut,
180     IndexMut,
181     init,
182     inline,
183     insert,
184     inspect,
185     into_iter,
186     into_result,
187     into_vec,
188     intrinsics,
189     io,
190     is_empty,
191     is_err,
192     isize,
193     is_none,
194     is_ok,
195     is_some,
196     iter,
197     Iter,
198     iterator,
199     iter_mut,
200     last,
201     LateContext,
202     len,
203     linked_list,
204     LinkedList,
205     lint,
206     Lint,
207     LintPass,
208     LN_10,
209     LN_2,
210     LOG10_E,
211     LOG2_E,
212     macro_use,
213     main,
214     map,
215     matches,
216     match_indices,
217     max,
218     MAX,
219     max_by,
220     max_by_key,
221     mem,
222     min,
223     MIN,
224     min_by,
225     min_by_key,
226     mpsc,
227     mul,
228     Mul,
229     MulAssign,
230     mutex,
231     Mutex,
232     NAN,
233     ne,
234     neg,
235     new,
236     new_v1,
237     new_v1_formatted,
238     next,
239     next_back,
240     None,
241     not,
242     null,
243     null_mut,
244     offset,
245     ok,
246     Ok,
247     ONCE_INIT,
248     open,
249     OpenOptions,
250     ops,
251     option,
252     os_str,
253     OsStr,
254     OsString,
255     panic,
256     panicking,
257     partition,
258     path,
259     Path,
260     PathBuf,
261     paths,
262     peekable,
263     PI,
264     position,
265     precision,
266     print,
267     println,
268     proc_macro,
269     proc_macro_attribute,
270     proc_macro_derive,
271     product,
272     ptr,
273     push,
274     Range,
275     RangeBounds,
276     RangeFrom,
277     RangeFull,
278     RangeInclusive,
279     RangeTo,
280     RangeToInclusive,
281     rc,
282     Rc,
283     Read,
284     re_builder,
285     re_bytes,
286     Receiver,
287     regex,
288     Regex,
289     RegexBuilder,
290     RegexSet,
291     rem,
292     RemAssign,
293     repeat,
294     replace,
295     re_set,
296     resize,
297     result,
298     Result,
299     re_unicode,
300     rev,
301     rfind,
302     rmatches,
303     rmatch_indices,
304     rplit_terminator,
305     rposition,
306     rsplit,
307     rsplitn,
308     rsplit_terminator,
309     rustfmt,
310     rustfmt_skip,
311     scan,
312     serde,
313     set,
314     shl,
315     ShlAssign,
316     shr,
317     ShrAssign,
318     since,
319     skip,
320     skip_while,
321     slice,
322     Some,
323     split,
324     splitn,
325     split_terminator,
326     SQRT_2,
327     start,
328     starts_with,
329     std,
330     stderr,
331     stdin,
332     stdio,
333     stdout,
334     string,
335     String,
336     sub,
337     Sub,
338     SubAssign,
339     sum,
340     sync,
341     take,
342     take_while,
343     test,
344     time,
345     to_os_string,
346     to_owned,
347     ToOwned,
348     to_path_buf,
349     to_string,
350     ToString,
351     traits,
352     transmute,
353     trim_end_matches,
354     trim_start_matches,
355     Try,
356     u128,
357     u16,
358     u32,
359     u64,
360     u8,
361     unicode,
362     unimplemented,
363     uninit,
364     uninitialized,
365     unreachable,
366     unused_extern_crates,
367     unused_imports,
368     unwrap,
369     unwrap_err,
370     unzip,
371     usize,
372     utils,
373     vec,
374     Vec,
375     vec_deque,
376     VecDeque,
377     Visitor,
378     Weak,
379     width,
380     with_capacity,
381     wrapping_offset,
382     write,
383     Write,
384     write_fmt,
385     writeln,
386     zeroed,
387     zip,
388 }
389
390 symbols_init! {
391     impl_slice_t: "<impl [T]>",
392     empty_symbol: "",
393 }