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    if_chain,
175    insert,
176    inspect,
177    int_roundings,
178    into,
179    into_bytes,
180    into_ok,
181    into_owned,
182    io,
183    is_ascii,
184    is_char_boundary,
185    is_digit,
186    is_empty,
187    is_err,
188    is_file,
189    is_none,
190    is_none_or,
191    is_ok,
192    is_some,
193    is_some_and,
194    isqrt,
195    itertools,
196    join,
197    kw,
198    last,
199    lazy_static,
200    lint_vec,
201    ln,
202    lock,
203    lock_api,
204    log,
205    log10,
206    log2,
207    macro_use_imports,
208    map_break,
209    map_continue,
210    map_or,
211    map_or_else,
212    match_indices,
213    matches,
214    max,
215    max_by,
216    max_by_key,
217    max_value,
218    maximum,
219    min,
220    min_by,
221    min_by_key,
222    min_value,
223    minimum,
224    mode,
225    module_name_repetitions,
226    msrv,
227    msrvs,
228    mut_ptr,
229    mutex,
230    needless_return,
231    next_back,
232    next_if,
233    next_if_eq,
234    next_tuple,
235    nth,
236    ok,
237    ok_or,
238    once_cell,
239    open,
240    or_default,
241    or_else,
242    or_insert,
243    or_insert_with,
244    outer_expn,
245    panic_cold_display,
246    panic_cold_explicit,
247    panic_display,
248    panic_str,
249    parse,
250    partition,
251    paths,
252    peek,
253    peek_mut,
254    peekable,
255    pow,
256    powf,
257    powi,
258    product,
259    push,
260    read,
261    read_exact,
262    read_line,
263    read_to_end,
264    read_to_string,
265    read_unaligned,
266    redundant_imports,
267    redundant_pub_crate,
268    regex,
269    rem_euclid,
270    repeat,
271    replace,
272    replacen,
273    reserve,
274    resize,
275    restriction,
276    rev,
277    rfind,
278    rmatch_indices,
279    rmatches,
280    round,
281    rposition,
282    rsplit,
283    rsplit_once,
284    rsplit_terminator,
285    rsplitn,
286    rsplitn_mut,
287    rustc_lint,
288    rustc_lint_defs,
289    rustc_span,
290    rustfmt_skip,
291    rwlock,
292    saturating_abs,
293    saturating_pow,
294    scan,
295    seek,
296    serde,
297    set_len,
298    set_mode,
299    set_readonly,
300    signum,
301    single_component_path_imports,
302    skip_while,
303    slice_mut_unchecked,
304    slice_unchecked,
305    sort,
306    sort_by,
307    sort_unstable_by,
308    span_lint_and_then,
309    split,
310    split_at,
311    split_at_checked,
312    split_at_mut,
313    split_at_mut_checked,
314    split_inclusive,
315    split_once,
316    split_terminator,
317    split_whitespace,
318    splitn,
319    splitn_mut,
320    sqrt,
321    starts_with,
322    step_by,
323    strlen,
324    style,
325    subsec_micros,
326    subsec_nanos,
327    sum,
328    symbol,
329    take,
330    take_while,
331    then,
332    then_some,
333    to_ascii_lowercase,
334    to_ascii_uppercase,
335    to_be_bytes,
336    to_digit,
337    to_le_bytes,
338    to_lowercase,
339    to_ne_bytes,
340    to_os_string,
341    to_owned,
342    to_path_buf,
343    to_uppercase,
344    tokio,
345    trim,
346    trim_end,
347    trim_end_matches,
348    trim_start,
349    trim_start_matches,
350    truncate,
351    unreachable_pub,
352    unsafe_removed_from_name,
353    unused,
354    unused_braces,
355    unused_extern_crates,
356    unused_import_braces,
357    unused_trait_names,
358    unwrap_err,
359    unwrap_err_unchecked,
360    unwrap_or_default,
361    unwrap_or_else,
362    unwrap_unchecked,
363    unzip,
364    utils,
365    visit_str,
366    visit_string,
367    wake,
368    warnings,
369    wildcard_imports,
370    with_capacity,
371    wrapping_offset,
372    write,
373    write_unaligned,
374    writeln,
375    zip,
376}