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    collapsible_else_if,
115    collapsible_if,
116    collect,
117    const_ptr,
118    consts,
119    contains,
120    copied,
121    copy_from,
122    copy_from_nonoverlapping,
123    copy_to,
124    copy_to_nonoverlapping,
125    count_ones,
126    create,
127    create_new,
128    cycle,
129    cyclomatic_complexity,
130    de,
131    deprecated_in_future,
132    diagnostics,
133    disallowed_types,
134    drain,
135    dump,
136    ends_with,
137    enum_glob_use,
138    enumerate,
139    err,
140    exp,
141    expect_err,
142    expn_data,
143    extend,
144    filter,
145    filter_map,
146    find,
147    find_map,
148    finish,
149    finish_non_exhaustive,
150    first,
151    flat_map,
152    flatten,
153    floor,
154    floor_char_boundary,
155    fold,
156    for_each,
157    from_be_bytes,
158    from_bytes_with_nul,
159    from_bytes_with_nul_unchecked,
160    from_le_bytes,
161    from_ne_bytes,
162    from_ptr,
163    from_raw,
164    from_str,
165    from_str_radix,
166    fs,
167    fuse,
168    futures_util,
169    get,
170    get_mut,
171    get_or_insert,
172    get_or_insert_with,
173    get_unchecked,
174    get_unchecked_mut,
175    has_significant_drop,
176    hidden_glob_reexports,
177    hygiene,
178    insert,
179    inspect,
180    int_roundings,
181    into,
182    into_bytes,
183    into_ok,
184    into_owned,
185    io,
186    is_ascii,
187    is_char_boundary,
188    is_digit,
189    is_empty,
190    is_err,
191    is_file,
192    is_none,
193    is_none_or,
194    is_ok,
195    is_partitioned,
196    is_some,
197    is_some_and,
198    is_sorted_by_key,
199    isqrt,
200    itertools,
201    join,
202    kw,
203    lazy_static,
204    lint_vec,
205    ln,
206    lock,
207    lock_api,
208    log,
209    log10,
210    log2,
211    macro_use_imports,
212    map_break,
213    map_continue,
214    map_or,
215    map_or_else,
216    map_while,
217    match_indices,
218    matches,
219    max,
220    max_by,
221    max_by_key,
222    max_value,
223    maximum,
224    min,
225    min_by,
226    min_by_key,
227    min_value,
228    minimum,
229    mode,
230    module_name_repetitions,
231    msrv,
232    msrvs,
233    mut_ptr,
234    mutex,
235    needless_return,
236    next_back,
237    next_if,
238    next_if_eq,
239    next_tuple,
240    nth,
241    ok,
242    ok_or,
243    once_cell,
244    open,
245    or_default,
246    or_else,
247    or_insert,
248    or_insert_with,
249    outer_expn,
250    panic_str,
251    parse,
252    partition,
253    paths,
254    peek,
255    peek_mut,
256    peekable,
257    pow,
258    powf,
259    powi,
260    product,
261    push,
262    read,
263    read_exact,
264    read_line,
265    read_to_end,
266    read_to_string,
267    read_unaligned,
268    redundant_imports,
269    redundant_pub_crate,
270    regex,
271    rem_euclid,
272    repeat,
273    replace,
274    replacen,
275    reserve,
276    resize,
277    restriction,
278    rev,
279    rfind,
280    rmatch_indices,
281    rmatches,
282    round,
283    rposition,
284    rsplit,
285    rsplit_once,
286    rsplit_terminator,
287    rsplitn,
288    rsplitn_mut,
289    rustc_lint,
290    rustc_lint_defs,
291    rustc_span,
292    rustfmt_skip,
293    rwlock,
294    saturating_abs,
295    saturating_pow,
296    scan,
297    seek,
298    serde,
299    set_len,
300    set_mode,
301    set_readonly,
302    signum,
303    single_component_path_imports,
304    skip_while,
305    slice_mut_unchecked,
306    slice_unchecked,
307    sort,
308    sort_by,
309    sort_unstable_by,
310    span_lint_and_then,
311    split,
312    split_at,
313    split_at_checked,
314    split_at_mut,
315    split_at_mut_checked,
316    split_inclusive,
317    split_once,
318    split_terminator,
319    split_whitespace,
320    splitn,
321    splitn_mut,
322    sqrt,
323    starts_with,
324    step_by,
325    strlen,
326    style,
327    subsec_micros,
328    subsec_nanos,
329    sum,
330    symbol,
331    take,
332    take_while,
333    then,
334    then_some,
335    to_ascii_lowercase,
336    to_ascii_uppercase,
337    to_be_bytes,
338    to_digit,
339    to_le_bytes,
340    to_lowercase,
341    to_ne_bytes,
342    to_os_string,
343    to_owned,
344    to_path_buf,
345    to_uppercase,
346    tokio,
347    trim,
348    trim_end,
349    trim_end_matches,
350    trim_start,
351    trim_start_matches,
352    truncate,
353    try_for_each,
354    unreachable_pub,
355    unsafe_removed_from_name,
356    unused,
357    unused_braces,
358    unused_extern_crates,
359    unused_import_braces,
360    unused_trait_names,
361    unwrap_err,
362    unwrap_err_unchecked,
363    unwrap_or_default,
364    unwrap_or_else,
365    unwrap_unchecked,
366    unzip,
367    utils,
368    visit_str,
369    visit_string,
370    wake,
371    warnings,
372    wildcard_imports,
373    with_capacity,
374    wrapping_offset,
375    write,
376    write_unaligned,
377    writeln,
378    zip,
379}