clippy_utils/
sym.rs

1#![allow(non_upper_case_globals)]
2
3use rustc_span::symbol::PREDEFINED_SYMBOLS_COUNT;
4
5#[doc(no_inline)]
6pub use rustc_span::sym::*;
7
8macro_rules! val {
9    ($name:ident) => {
10        stringify!($name)
11    };
12    ($name:ident $value:literal) => {
13        $value
14    };
15}
16
17macro_rules! generate {
18    ($($name:ident $(: $value:literal)? ,)*) => {
19        /// To be supplied to `rustc_interface::Config`
20        pub const EXTRA_SYMBOLS: &[&str] = &[
21            $(
22                val!($name $($value)?),
23            )*
24        ];
25
26        $(
27            pub const $name: rustc_span::Symbol = rustc_span::Symbol::new(PREDEFINED_SYMBOLS_COUNT + ${index()});
28        )*
29    };
30}
31
32// List of extra symbols to be included in Clippy (for example, as `sym::ambiguous_glob_reexports`).
33// An alternative content can be specified using a colon after the symbol name.
34//
35// `cargo dev fmt` ensures that the content of the `generate!()` macro call stays sorted.
36generate! {
37    AsyncReadExt,
38    AsyncWriteExt,
39    BACKSLASH_SINGLE_QUOTE: r"\'",
40    Binary,
41    CLIPPY_ARGS,
42    CLIPPY_CONF_DIR,
43    CRLF: "\r\n",
44    Cargo_toml: "Cargo.toml",
45    Current,
46    DOUBLE_QUOTE: "\"",
47    Deserialize,
48    EarlyLintPass,
49    IntoIter,
50    Itertools,
51    LF: "\n",
52    Lazy,
53    Lint,
54    LowerExp,
55    LowerHex,
56    MAX,
57    MIN,
58    MsrvStack,
59    Octal,
60    OpenOptions,
61    Other,
62    PathLookup,
63    Regex,
64    RegexBuilder,
65    RegexSet,
66    Start,
67    Symbol,
68    SyntaxContext,
69    TBD,
70    UpperExp,
71    UpperHex,
72    V4,
73    V6,
74    Visitor,
75    Weak,
76    abs,
77    ambiguous_glob_reexports,
78    append,
79    arg,
80    as_bytes,
81    as_deref,
82    as_deref_mut,
83    as_mut,
84    as_path,
85    assert_failed,
86    author,
87    borrow,
88    borrow_mut,
89    build_hasher,
90    by_ref,
91    bytes,
92    capacity,
93    cargo_clippy: "cargo-clippy",
94    cast,
95    cast_const,
96    cast_mut,
97    ceil,
98    ceil_char_boundary,
99    chain,
100    chars,
101    check_attributes,
102    checked_abs,
103    checked_add,
104    checked_isqrt,
105    checked_mul,
106    checked_pow,
107    checked_rem_euclid,
108    checked_sub,
109    clamp,
110    clippy_utils,
111    clone_into,
112    cloned,
113    cognitive_complexity,
114    collect,
115    const_ptr,
116    contains,
117    copied,
118    copy_from,
119    copy_from_nonoverlapping,
120    copy_to,
121    copy_to_nonoverlapping,
122    count_ones,
123    create,
124    create_new,
125    cycle,
126    cyclomatic_complexity,
127    de,
128    diagnostics,
129    disallowed_types,
130    drain,
131    dump,
132    ends_with,
133    enum_glob_use,
134    enumerate,
135    err,
136    exp,
137    expect_err,
138    expn_data,
139    extend,
140    filter,
141    filter_map,
142    find,
143    find_map,
144    finish,
145    finish_non_exhaustive,
146    first,
147    flat_map,
148    flatten,
149    floor,
150    floor_char_boundary,
151    fold,
152    for_each,
153    from_be_bytes,
154    from_bytes_with_nul,
155    from_bytes_with_nul_unchecked,
156    from_le_bytes,
157    from_ne_bytes,
158    from_ptr,
159    from_raw,
160    from_str,
161    from_str_radix,
162    fs,
163    fuse,
164    futures_util,
165    get,
166    get_mut,
167    get_or_insert,
168    get_or_insert_with,
169    get_unchecked,
170    get_unchecked_mut,
171    has_significant_drop,
172    hidden_glob_reexports,
173    hygiene,
174    insert,
175    inspect,
176    int_roundings,
177    into,
178    into_bytes,
179    into_ok,
180    into_owned,
181    io,
182    is_ascii,
183    is_char_boundary,
184    is_digit,
185    is_empty,
186    is_err,
187    is_file,
188    is_none,
189    is_none_or,
190    is_ok,
191    is_some,
192    is_some_and,
193    isqrt,
194    itertools,
195    join,
196    kw,
197    last,
198    lazy_static,
199    lint_vec,
200    ln,
201    lock,
202    lock_api,
203    log,
204    log10,
205    log2,
206    macro_use_imports,
207    map_break,
208    map_continue,
209    map_or,
210    map_or_else,
211    match_indices,
212    matches,
213    max,
214    max_by,
215    max_by_key,
216    max_value,
217    maximum,
218    min,
219    min_by,
220    min_by_key,
221    min_value,
222    minimum,
223    mode,
224    module_name_repetitions,
225    msrv,
226    msrvs,
227    mut_ptr,
228    mutex,
229    needless_return,
230    next_back,
231    next_if,
232    next_if_eq,
233    next_tuple,
234    nth,
235    ok,
236    ok_or,
237    once_cell,
238    open,
239    or_default,
240    or_else,
241    or_insert,
242    or_insert_with,
243    outer_expn,
244    panic_cold_display,
245    panic_cold_explicit,
246    panic_display,
247    panic_str,
248    parse,
249    partition,
250    paths,
251    peek,
252    peek_mut,
253    peekable,
254    pow,
255    powf,
256    powi,
257    product,
258    push,
259    read,
260    read_exact,
261    read_line,
262    read_to_end,
263    read_to_string,
264    read_unaligned,
265    redundant_imports,
266    redundant_pub_crate,
267    regex,
268    rem_euclid,
269    repeat,
270    replace,
271    replacen,
272    reserve,
273    resize,
274    restriction,
275    rev,
276    rfind,
277    rmatch_indices,
278    rmatches,
279    round,
280    rposition,
281    rsplit,
282    rsplit_once,
283    rsplit_terminator,
284    rsplitn,
285    rsplitn_mut,
286    rustc_lint,
287    rustc_lint_defs,
288    rustc_span,
289    rustfmt_skip,
290    rwlock,
291    saturating_abs,
292    saturating_pow,
293    scan,
294    seek,
295    serde,
296    set_len,
297    set_mode,
298    set_readonly,
299    signum,
300    single_component_path_imports,
301    skip_while,
302    slice_mut_unchecked,
303    slice_unchecked,
304    sort,
305    sort_by,
306    sort_unstable_by,
307    span_lint_and_then,
308    split,
309    split_at,
310    split_at_checked,
311    split_at_mut,
312    split_at_mut_checked,
313    split_inclusive,
314    split_once,
315    split_terminator,
316    split_whitespace,
317    splitn,
318    splitn_mut,
319    sqrt,
320    starts_with,
321    step_by,
322    strlen,
323    style,
324    subsec_micros,
325    subsec_nanos,
326    sum,
327    symbol,
328    take,
329    take_while,
330    then,
331    then_some,
332    to_ascii_lowercase,
333    to_ascii_uppercase,
334    to_be_bytes,
335    to_digit,
336    to_le_bytes,
337    to_lowercase,
338    to_ne_bytes,
339    to_os_string,
340    to_owned,
341    to_path_buf,
342    to_uppercase,
343    tokio,
344    trim,
345    trim_end,
346    trim_end_matches,
347    trim_start,
348    trim_start_matches,
349    truncate,
350    unreachable_pub,
351    unsafe_removed_from_name,
352    unused,
353    unused_braces,
354    unused_extern_crates,
355    unused_import_braces,
356    unused_trait_names,
357    unwrap_err,
358    unwrap_err_unchecked,
359    unwrap_or_default,
360    unwrap_or_else,
361    unwrap_unchecked,
362    unzip,
363    utils,
364    visit_str,
365    visit_string,
366    wake,
367    warnings,
368    wildcard_imports,
369    with_capacity,
370    wrapping_offset,
371    write,
372    write_unaligned,
373    writeln,
374    zip,
375}