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_str,
245    parse,
246    partition,
247    paths,
248    peek,
249    peek_mut,
250    peekable,
251    pow,
252    powf,
253    powi,
254    product,
255    push,
256    read,
257    read_exact,
258    read_line,
259    read_to_end,
260    read_to_string,
261    read_unaligned,
262    redundant_imports,
263    redundant_pub_crate,
264    regex,
265    rem_euclid,
266    repeat,
267    replace,
268    replacen,
269    reserve,
270    resize,
271    restriction,
272    rev,
273    rfind,
274    rmatch_indices,
275    rmatches,
276    round,
277    rposition,
278    rsplit,
279    rsplit_once,
280    rsplit_terminator,
281    rsplitn,
282    rsplitn_mut,
283    rustc_lint,
284    rustc_lint_defs,
285    rustc_span,
286    rustfmt_skip,
287    rwlock,
288    saturating_abs,
289    saturating_pow,
290    scan,
291    seek,
292    serde,
293    set_len,
294    set_mode,
295    set_readonly,
296    signum,
297    single_component_path_imports,
298    skip_while,
299    slice_mut_unchecked,
300    slice_unchecked,
301    sort,
302    sort_by,
303    sort_unstable_by,
304    span_lint_and_then,
305    split,
306    split_at,
307    split_at_checked,
308    split_at_mut,
309    split_at_mut_checked,
310    split_inclusive,
311    split_once,
312    split_terminator,
313    split_whitespace,
314    splitn,
315    splitn_mut,
316    sqrt,
317    starts_with,
318    step_by,
319    strlen,
320    style,
321    subsec_micros,
322    subsec_nanos,
323    sum,
324    symbol,
325    take,
326    take_while,
327    then,
328    then_some,
329    to_ascii_lowercase,
330    to_ascii_uppercase,
331    to_be_bytes,
332    to_digit,
333    to_le_bytes,
334    to_lowercase,
335    to_ne_bytes,
336    to_os_string,
337    to_owned,
338    to_path_buf,
339    to_uppercase,
340    tokio,
341    trim,
342    trim_end,
343    trim_end_matches,
344    trim_start,
345    trim_start_matches,
346    truncate,
347    unreachable_pub,
348    unsafe_removed_from_name,
349    unused,
350    unused_braces,
351    unused_extern_crates,
352    unused_import_braces,
353    unused_trait_names,
354    unwrap_err,
355    unwrap_err_unchecked,
356    unwrap_or_default,
357    unwrap_or_else,
358    unwrap_unchecked,
359    unzip,
360    utils,
361    visit_str,
362    visit_string,
363    wake,
364    warnings,
365    wildcard_imports,
366    with_capacity,
367    wrapping_offset,
368    write,
369    write_unaligned,
370    writeln,
371    zip,
372}