1use span::Edition;
4
5use crate::Severity;
6
7#[derive(Clone)]
8pub struct Lint {
9 pub label: &'static str,
10 pub description: &'static str,
11 pub default_severity: Severity,
12 pub warn_since: Option<Edition>,
13 pub deny_since: Option<Edition>,
14}
15
16pub struct LintGroup {
17 pub lint: Lint,
18 pub children: &'static [&'static str],
19}
20
21pub const DEFAULT_LINTS: &[Lint] = &[
22 Lint {
23 label: "aarch64_softfloat_neon",
24 description: r##"detects code that could be affected by ABI issues on aarch64 softfloat targets"##,
25 default_severity: Severity::Warning,
26 warn_since: None,
27 deny_since: None,
28 },
29 Lint {
30 label: "absolute_paths_not_starting_with_crate",
31 description: r##"fully qualified paths that start with a module name instead of `crate`, `self`, or an extern crate name"##,
32 default_severity: Severity::Allow,
33 warn_since: None,
34 deny_since: None,
35 },
36 Lint {
37 label: "ambiguous_associated_items",
38 description: r##"ambiguous associated items"##,
39 default_severity: Severity::Error,
40 warn_since: None,
41 deny_since: None,
42 },
43 Lint {
44 label: "ambiguous_derive_helpers",
45 description: r##"detects derive helper attributes that are ambiguous with built-in attributes"##,
46 default_severity: Severity::Warning,
47 warn_since: None,
48 deny_since: None,
49 },
50 Lint {
51 label: "ambiguous_glob_imported_traits",
52 description: r##"detects uses of ambiguously glob imported traits"##,
53 default_severity: Severity::Warning,
54 warn_since: None,
55 deny_since: None,
56 },
57 Lint {
58 label: "ambiguous_glob_imports",
59 description: r##"detects certain glob imports that require reporting an ambiguity error"##,
60 default_severity: Severity::Error,
61 warn_since: None,
62 deny_since: None,
63 },
64 Lint {
65 label: "ambiguous_glob_reexports",
66 description: r##"ambiguous glob re-exports"##,
67 default_severity: Severity::Warning,
68 warn_since: None,
69 deny_since: None,
70 },
71 Lint {
72 label: "ambiguous_import_visibilities",
73 description: r##"detects certain glob imports that require reporting an ambiguity error"##,
74 default_severity: Severity::Warning,
75 warn_since: None,
76 deny_since: None,
77 },
78 Lint {
79 label: "ambiguous_negative_literals",
80 description: r##"ambiguous negative literals operations"##,
81 default_severity: Severity::Allow,
82 warn_since: None,
83 deny_since: None,
84 },
85 Lint {
86 label: "ambiguous_panic_imports",
87 description: r##"detects ambiguous core and std panic imports"##,
88 default_severity: Severity::Warning,
89 warn_since: None,
90 deny_since: None,
91 },
92 Lint {
93 label: "ambiguous_wide_pointer_comparisons",
94 description: r##"detects ambiguous wide pointer comparisons"##,
95 default_severity: Severity::Warning,
96 warn_since: None,
97 deny_since: None,
98 },
99 Lint {
100 label: "anonymous_parameters",
101 description: r##"detects anonymous parameters"##,
102 default_severity: Severity::Warning,
103 warn_since: None,
104 deny_since: None,
105 },
106 Lint {
107 label: "arithmetic_overflow",
108 description: r##"arithmetic operation overflows"##,
109 default_severity: Severity::Error,
110 warn_since: None,
111 deny_since: None,
112 },
113 Lint {
114 label: "array_into_iter",
115 description: r##"detects calling `into_iter` on arrays in Rust 2015 and 2018"##,
116 default_severity: Severity::Warning,
117 warn_since: None,
118 deny_since: None,
119 },
120 Lint {
121 label: "asm_sub_register",
122 description: r##"using only a subset of a register for inline asm inputs"##,
123 default_severity: Severity::Warning,
124 warn_since: None,
125 deny_since: None,
126 },
127 Lint {
128 label: "async_fn_in_trait",
129 description: r##"use of `async fn` in definition of a publicly-reachable trait"##,
130 default_severity: Severity::Warning,
131 warn_since: None,
132 deny_since: None,
133 },
134 Lint {
135 label: "bad_asm_style",
136 description: r##"incorrect use of inline assembly"##,
137 default_severity: Severity::Warning,
138 warn_since: None,
139 deny_since: None,
140 },
141 Lint {
142 label: "bare_trait_objects",
143 description: r##"suggest using `dyn Trait` for trait objects"##,
144 default_severity: Severity::Warning,
145 warn_since: None,
146 deny_since: None,
147 },
148 Lint {
149 label: "binary_asm_labels",
150 description: r##"labels in inline assembly containing only 0 or 1 digits"##,
151 default_severity: Severity::Error,
152 warn_since: None,
153 deny_since: None,
154 },
155 Lint {
156 label: "bindings_with_variant_name",
157 description: r##"detects pattern bindings with the same name as one of the matched variants"##,
158 default_severity: Severity::Error,
159 warn_since: None,
160 deny_since: None,
161 },
162 Lint {
163 label: "boxed_slice_into_iter",
164 description: r##"detects calling `into_iter` on boxed slices in Rust 2015, 2018, and 2021"##,
165 default_severity: Severity::Warning,
166 warn_since: None,
167 deny_since: None,
168 },
169 Lint {
170 label: "break_with_label_and_loop",
171 description: r##"`break` expression with label and unlabeled loop as value expression"##,
172 default_severity: Severity::Warning,
173 warn_since: None,
174 deny_since: None,
175 },
176 Lint {
177 label: "clashing_extern_declarations",
178 description: r##"detects when an extern fn has been declared with the same name but different types"##,
179 default_severity: Severity::Warning,
180 warn_since: None,
181 deny_since: None,
182 },
183 Lint {
184 label: "closure_returning_async_block",
185 description: r##"closure that returns `async {}` could be rewritten as an async closure"##,
186 default_severity: Severity::Allow,
187 warn_since: None,
188 deny_since: None,
189 },
190 Lint {
191 label: "coherence_leak_check",
192 description: r##"distinct impls distinguished only by the leak-check code"##,
193 default_severity: Severity::Warning,
194 warn_since: None,
195 deny_since: None,
196 },
197 Lint {
198 label: "conflicting_repr_hints",
199 description: r##"conflicts between `#[repr(..)]` hints that were previously accepted and used in practice"##,
200 default_severity: Severity::Error,
201 warn_since: None,
202 deny_since: None,
203 },
204 Lint {
205 label: "confusable_idents",
206 description: r##"detects visually confusable pairs between identifiers"##,
207 default_severity: Severity::Warning,
208 warn_since: None,
209 deny_since: None,
210 },
211 Lint {
212 label: "const_evaluatable_unchecked",
213 description: r##"detects a generic constant is used in a type without a emitting a warning"##,
214 default_severity: Severity::Warning,
215 warn_since: None,
216 deny_since: None,
217 },
218 Lint {
219 label: "const_item_interior_mutations",
220 description: r##"checks for calls which mutates a interior mutable const-item"##,
221 default_severity: Severity::Warning,
222 warn_since: None,
223 deny_since: None,
224 },
225 Lint {
226 label: "const_item_mutation",
227 description: r##"detects attempts to mutate a `const` item"##,
228 default_severity: Severity::Warning,
229 warn_since: None,
230 deny_since: None,
231 },
232 Lint {
233 label: "dangerous_implicit_autorefs",
234 description: r##"implicit reference to a dereference of a raw pointer"##,
235 default_severity: Severity::Error,
236 warn_since: None,
237 deny_since: None,
238 },
239 Lint {
240 label: "dangling_pointers_from_locals",
241 description: r##"detects returning a pointer from a local variable"##,
242 default_severity: Severity::Warning,
243 warn_since: None,
244 deny_since: None,
245 },
246 Lint {
247 label: "dangling_pointers_from_temporaries",
248 description: r##"detects getting a pointer from a temporary"##,
249 default_severity: Severity::Warning,
250 warn_since: None,
251 deny_since: None,
252 },
253 Lint {
254 label: "dead_code",
255 description: r##"detect unused, unexported items"##,
256 default_severity: Severity::Warning,
257 warn_since: None,
258 deny_since: None,
259 },
260 Lint {
261 label: "dead_code_pub_in_binary",
262 description: r##"detect public items in executable crates that are never used"##,
263 default_severity: Severity::Allow,
264 warn_since: None,
265 deny_since: None,
266 },
267 Lint {
268 label: "default_overrides_default_fields",
269 description: r##"detect `Default` impl that should use the type's default field values"##,
270 default_severity: Severity::Error,
271 warn_since: None,
272 deny_since: None,
273 },
274 Lint {
275 label: "dependency_on_unit_never_type_fallback",
276 description: r##"never type fallback affecting unsafe function calls"##,
277 default_severity: Severity::Error,
278 warn_since: None,
279 deny_since: None,
280 },
281 Lint {
282 label: "deprecated",
283 description: r##"detects use of deprecated items"##,
284 default_severity: Severity::Warning,
285 warn_since: None,
286 deny_since: None,
287 },
288 Lint {
289 label: "deprecated_in_future",
290 description: r##"detects use of items that will be deprecated in a future version"##,
291 default_severity: Severity::Allow,
292 warn_since: None,
293 deny_since: None,
294 },
295 Lint {
296 label: "deprecated_llvm_intrinsic",
297 description: r##"detects uses of deprecated LLVM intrinsics"##,
298 default_severity: Severity::Allow,
299 warn_since: None,
300 deny_since: None,
301 },
302 Lint {
303 label: "deprecated_safe_2024",
304 description: r##"detects unsafe functions being used as safe functions"##,
305 default_severity: Severity::Allow,
306 warn_since: None,
307 deny_since: None,
308 },
309 Lint {
310 label: "deprecated_where_clause_location",
311 description: r##"deprecated where clause location"##,
312 default_severity: Severity::Warning,
313 warn_since: None,
314 deny_since: None,
315 },
316 Lint {
317 label: "deref_into_dyn_supertrait",
318 description: r##"`Deref` implementation with a supertrait trait object for output is shadowed by trait upcasting"##,
319 default_severity: Severity::Allow,
320 warn_since: None,
321 deny_since: None,
322 },
323 Lint {
324 label: "deref_nullptr",
325 description: r##"detects when an null pointer is dereferenced"##,
326 default_severity: Severity::Error,
327 warn_since: None,
328 deny_since: None,
329 },
330 Lint {
331 label: "double_negations",
332 description: r##"detects expressions of the form `--x`"##,
333 default_severity: Severity::Warning,
334 warn_since: None,
335 deny_since: None,
336 },
337 Lint {
338 label: "drop_bounds",
339 description: r##"bounds of the form `T: Drop` are most likely incorrect"##,
340 default_severity: Severity::Warning,
341 warn_since: None,
342 deny_since: None,
343 },
344 Lint {
345 label: "dropping_copy_types",
346 description: r##"calls to `std::mem::drop` with a value that implements Copy"##,
347 default_severity: Severity::Warning,
348 warn_since: None,
349 deny_since: None,
350 },
351 Lint {
352 label: "dropping_references",
353 description: r##"calls to `std::mem::drop` with a reference instead of an owned value"##,
354 default_severity: Severity::Warning,
355 warn_since: None,
356 deny_since: None,
357 },
358 Lint {
359 label: "duplicate_features",
360 description: r##"duplicate features found in crate-level `#[feature]` directives"##,
361 default_severity: Severity::Error,
362 warn_since: None,
363 deny_since: None,
364 },
365 Lint {
366 label: "duplicate_macro_attributes",
367 description: r##"duplicated attribute"##,
368 default_severity: Severity::Warning,
369 warn_since: None,
370 deny_since: None,
371 },
372 Lint {
373 label: "dyn_drop",
374 description: r##"trait objects of the form `dyn Drop` are useless"##,
375 default_severity: Severity::Warning,
376 warn_since: None,
377 deny_since: None,
378 },
379 Lint {
380 label: "edition_2024_expr_fragment_specifier",
381 description: r##"The `expr` fragment specifier will accept more expressions in the 2024 edition. To keep the existing behavior, use the `expr_2021` fragment specifier."##,
382 default_severity: Severity::Allow,
383 warn_since: None,
384 deny_since: None,
385 },
386 Lint {
387 label: "elided_lifetimes_in_associated_constant",
388 description: r##"elided lifetimes cannot be used in associated constants in impls"##,
389 default_severity: Severity::Error,
390 warn_since: None,
391 deny_since: None,
392 },
393 Lint {
394 label: "elided_lifetimes_in_paths",
395 description: r##"hidden lifetime parameters in types are deprecated"##,
396 default_severity: Severity::Allow,
397 warn_since: None,
398 deny_since: None,
399 },
400 Lint {
401 label: "ellipsis_inclusive_range_patterns",
402 description: r##"`...` range patterns are deprecated"##,
403 default_severity: Severity::Warning,
404 warn_since: None,
405 deny_since: None,
406 },
407 Lint {
408 label: "enum_intrinsics_non_enums",
409 description: r##"detects calls to `core::mem::discriminant` and `core::mem::variant_count` with non-enum types"##,
410 default_severity: Severity::Error,
411 warn_since: None,
412 deny_since: None,
413 },
414 Lint {
415 label: "explicit_builtin_cfgs_in_flags",
416 description: r##"detects builtin cfgs set via the `--cfg`"##,
417 default_severity: Severity::Error,
418 warn_since: None,
419 deny_since: None,
420 },
421 Lint {
422 label: "explicit_outlives_requirements",
423 description: r##"outlives requirements can be inferred"##,
424 default_severity: Severity::Allow,
425 warn_since: None,
426 deny_since: None,
427 },
428 Lint {
429 label: "exported_private_dependencies",
430 description: r##"public interface leaks type from a private dependency"##,
431 default_severity: Severity::Warning,
432 warn_since: None,
433 deny_since: None,
434 },
435 Lint {
436 label: "ffi_unwind_calls",
437 description: r##"call to foreign functions or function pointers with FFI-unwind ABI"##,
438 default_severity: Severity::Allow,
439 warn_since: None,
440 deny_since: None,
441 },
442 Lint {
443 label: "float_literal_f32_fallback",
444 description: r##"detects unsuffixed floating point literals whose type fallback to `f32`"##,
445 default_severity: Severity::Warning,
446 warn_since: None,
447 deny_since: None,
448 },
449 Lint {
450 label: "for_loops_over_fallibles",
451 description: r##"for-looping over an `Option` or a `Result`, which is more clearly expressed as an `if let`"##,
452 default_severity: Severity::Warning,
453 warn_since: None,
454 deny_since: None,
455 },
456 Lint {
457 label: "forbidden_lint_groups",
458 description: r##"applying forbid to lint-groups"##,
459 default_severity: Severity::Warning,
460 warn_since: None,
461 deny_since: None,
462 },
463 Lint {
464 label: "forgetting_copy_types",
465 description: r##"calls to `std::mem::forget` with a value that implements Copy"##,
466 default_severity: Severity::Warning,
467 warn_since: None,
468 deny_since: None,
469 },
470 Lint {
471 label: "forgetting_references",
472 description: r##"calls to `std::mem::forget` with a reference instead of an owned value"##,
473 default_severity: Severity::Warning,
474 warn_since: None,
475 deny_since: None,
476 },
477 Lint {
478 label: "function_casts_as_integer",
479 description: r##"casting a function into an integer"##,
480 default_severity: Severity::Warning,
481 warn_since: None,
482 deny_since: None,
483 },
484 Lint {
485 label: "function_item_references",
486 description: r##"suggest casting to a function pointer when attempting to take references to function items"##,
487 default_severity: Severity::Warning,
488 warn_since: None,
489 deny_since: None,
490 },
491 Lint {
492 label: "fuzzy_provenance_casts",
493 description: r##"a fuzzy integer to pointer cast is used"##,
494 default_severity: Severity::Allow,
495 warn_since: None,
496 deny_since: None,
497 },
498 Lint {
499 label: "hidden_glob_reexports",
500 description: r##"name introduced by a private item shadows a name introduced by a public glob re-export"##,
501 default_severity: Severity::Warning,
502 warn_since: None,
503 deny_since: None,
504 },
505 Lint {
506 label: "if_let_rescope",
507 description: r##"`if let` assigns a shorter lifetime to temporary values being pattern-matched against in Edition 2024 and rewriting in `match` is an option to preserve the semantics up to Edition 2021"##,
508 default_severity: Severity::Allow,
509 warn_since: None,
510 deny_since: None,
511 },
512 Lint {
513 label: "ill_formed_attribute_input",
514 description: r##"ill-formed attribute inputs that were previously accepted and used in practice"##,
515 default_severity: Severity::Error,
516 warn_since: None,
517 deny_since: None,
518 },
519 Lint {
520 label: "impl_trait_overcaptures",
521 description: r##"`impl Trait` will capture more lifetimes than possibly intended in edition 2024"##,
522 default_severity: Severity::Allow,
523 warn_since: None,
524 deny_since: None,
525 },
526 Lint {
527 label: "impl_trait_redundant_captures",
528 description: r##"redundant precise-capturing `use<...>` syntax on an `impl Trait`"##,
529 default_severity: Severity::Allow,
530 warn_since: None,
531 deny_since: None,
532 },
533 Lint {
534 label: "improper_ctypes",
535 description: r##"proper use of libc types in foreign modules"##,
536 default_severity: Severity::Warning,
537 warn_since: None,
538 deny_since: None,
539 },
540 Lint {
541 label: "improper_ctypes_definitions",
542 description: r##"proper use of libc types in foreign item definitions"##,
543 default_severity: Severity::Warning,
544 warn_since: None,
545 deny_since: None,
546 },
547 Lint {
548 label: "improper_gpu_kernel_arg",
549 description: r##"GPU kernel entry points have a limited ABI"##,
550 default_severity: Severity::Warning,
551 warn_since: None,
552 deny_since: None,
553 },
554 Lint {
555 label: "incomplete_features",
556 description: r##"incomplete features that may function improperly in some or all cases"##,
557 default_severity: Severity::Warning,
558 warn_since: None,
559 deny_since: None,
560 },
561 Lint {
562 label: "incomplete_include",
563 description: r##"trailing content in included file"##,
564 default_severity: Severity::Error,
565 warn_since: None,
566 deny_since: None,
567 },
568 Lint {
569 label: "ineffective_unstable_trait_impl",
570 description: r##"detects `#[unstable]` on stable trait implementations for stable types"##,
571 default_severity: Severity::Error,
572 warn_since: None,
573 deny_since: None,
574 },
575 Lint {
576 label: "inline_no_sanitize",
577 description: r##"detects incompatible use of `#[inline(always)]` and `#[sanitize(... = "off")]`"##,
578 default_severity: Severity::Warning,
579 warn_since: None,
580 deny_since: None,
581 },
582 Lint {
583 label: "integer_to_ptr_transmutes",
584 description: r##"detects integer to pointer transmutes"##,
585 default_severity: Severity::Warning,
586 warn_since: None,
587 deny_since: None,
588 },
589 Lint {
590 label: "internal_eq_trait_method_impls",
591 description: r##"manual implementation of the internal `Eq::assert_receiver_is_total_eq` method"##,
592 default_severity: Severity::Warning,
593 warn_since: None,
594 deny_since: None,
595 },
596 Lint {
597 label: "internal_features",
598 description: r##"internal features are not supposed to be used"##,
599 default_severity: Severity::Warning,
600 warn_since: None,
601 deny_since: None,
602 },
603 Lint {
604 label: "invalid_atomic_ordering",
605 description: r##"usage of invalid atomic ordering in atomic operations and memory fences"##,
606 default_severity: Severity::Error,
607 warn_since: None,
608 deny_since: None,
609 },
610 Lint {
611 label: "invalid_doc_attributes",
612 description: r##"detects invalid `#[doc(...)]` attributes"##,
613 default_severity: Severity::Warning,
614 warn_since: None,
615 deny_since: None,
616 },
617 Lint {
618 label: "invalid_from_utf8",
619 description: r##"using a non UTF-8 literal in `std::str::from_utf8`"##,
620 default_severity: Severity::Warning,
621 warn_since: None,
622 deny_since: None,
623 },
624 Lint {
625 label: "invalid_from_utf8_unchecked",
626 description: r##"using a non UTF-8 literal in `std::str::from_utf8_unchecked`"##,
627 default_severity: Severity::Error,
628 warn_since: None,
629 deny_since: None,
630 },
631 Lint {
632 label: "invalid_macro_export_arguments",
633 description: r##""invalid_parameter" isn't a valid argument for `#[macro_export]`"##,
634 default_severity: Severity::Error,
635 warn_since: None,
636 deny_since: None,
637 },
638 Lint {
639 label: "invalid_nan_comparisons",
640 description: r##"detects invalid floating point NaN comparisons"##,
641 default_severity: Severity::Warning,
642 warn_since: None,
643 deny_since: None,
644 },
645 Lint {
646 label: "invalid_null_arguments",
647 description: r##"invalid null pointer in arguments"##,
648 default_severity: Severity::Error,
649 warn_since: None,
650 deny_since: None,
651 },
652 Lint {
653 label: "invalid_reference_casting",
654 description: r##"casts of `&T` to `&mut T` without interior mutability"##,
655 default_severity: Severity::Error,
656 warn_since: None,
657 deny_since: None,
658 },
659 Lint {
660 label: "invalid_type_param_default",
661 description: r##"type parameter default erroneously allowed in invalid location"##,
662 default_severity: Severity::Error,
663 warn_since: None,
664 deny_since: None,
665 },
666 Lint {
667 label: "invalid_value",
668 description: r##"an invalid value is being created (such as a null reference)"##,
669 default_severity: Severity::Warning,
670 warn_since: None,
671 deny_since: None,
672 },
673 Lint {
674 label: "irrefutable_let_patterns",
675 description: r##"detects irrefutable patterns in `if let` and `while let` statements"##,
676 default_severity: Severity::Warning,
677 warn_since: None,
678 deny_since: None,
679 },
680 Lint {
681 label: "keyword_idents_2018",
682 description: r##"detects edition keywords being used as an identifier"##,
683 default_severity: Severity::Allow,
684 warn_since: None,
685 deny_since: None,
686 },
687 Lint {
688 label: "keyword_idents_2024",
689 description: r##"detects edition keywords being used as an identifier"##,
690 default_severity: Severity::Allow,
691 warn_since: None,
692 deny_since: None,
693 },
694 Lint {
695 label: "large_assignments",
696 description: r##"detects large moves or copies"##,
697 default_severity: Severity::Warning,
698 warn_since: None,
699 deny_since: None,
700 },
701 Lint {
702 label: "late_bound_lifetime_arguments",
703 description: r##"detects generic lifetime arguments in path segments with late bound lifetime parameters"##,
704 default_severity: Severity::Warning,
705 warn_since: None,
706 deny_since: None,
707 },
708 Lint {
709 label: "legacy_derive_helpers",
710 description: r##"detects derive helper attributes that are used before they are introduced"##,
711 default_severity: Severity::Error,
712 warn_since: None,
713 deny_since: None,
714 },
715 Lint {
716 label: "let_underscore_drop",
717 description: r##"non-binding let on a type that has a destructor"##,
718 default_severity: Severity::Allow,
719 warn_since: None,
720 deny_since: None,
721 },
722 Lint {
723 label: "let_underscore_lock",
724 description: r##"non-binding let on a synchronization lock"##,
725 default_severity: Severity::Error,
726 warn_since: None,
727 deny_since: None,
728 },
729 Lint {
730 label: "linker_info",
731 description: r##"linker warnings known to be informational-only and not indicative of a problem"##,
732 default_severity: Severity::Allow,
733 warn_since: None,
734 deny_since: None,
735 },
736 Lint {
737 label: "linker_messages",
738 description: r##"warnings emitted at runtime by the target-specific linker program"##,
739 default_severity: Severity::Warning,
740 warn_since: None,
741 deny_since: None,
742 },
743 Lint {
744 label: "long_running_const_eval",
745 description: r##"detects long const eval operations"##,
746 default_severity: Severity::Error,
747 warn_since: None,
748 deny_since: None,
749 },
750 Lint {
751 label: "lossy_provenance_casts",
752 description: r##"a lossy pointer to integer cast is used"##,
753 default_severity: Severity::Allow,
754 warn_since: None,
755 deny_since: None,
756 },
757 Lint {
758 label: "macro_expanded_macro_exports_accessed_by_absolute_paths",
759 description: r##"macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths"##,
760 default_severity: Severity::Error,
761 warn_since: None,
762 deny_since: None,
763 },
764 Lint {
765 label: "macro_use_extern_crate",
766 description: r##"the `#[macro_use]` attribute is now deprecated in favor of using macros via the module system"##,
767 default_severity: Severity::Allow,
768 warn_since: None,
769 deny_since: None,
770 },
771 Lint {
772 label: "malformed_diagnostic_attributes",
773 description: r##"detects malformed diagnostic attributes"##,
774 default_severity: Severity::Warning,
775 warn_since: None,
776 deny_since: None,
777 },
778 Lint {
779 label: "malformed_diagnostic_format_literals",
780 description: r##"detects diagnostic attribute with malformed diagnostic format literals"##,
781 default_severity: Severity::Warning,
782 warn_since: None,
783 deny_since: None,
784 },
785 Lint {
786 label: "map_unit_fn",
787 description: r##"`Iterator::map` call that discard the iterator's values"##,
788 default_severity: Severity::Warning,
789 warn_since: None,
790 deny_since: None,
791 },
792 Lint {
793 label: "meta_variable_misuse",
794 description: r##"possible meta-variable misuse at macro definition"##,
795 default_severity: Severity::Allow,
796 warn_since: None,
797 deny_since: None,
798 },
799 Lint {
800 label: "mismatched_lifetime_syntaxes",
801 description: r##"detects when a lifetime uses different syntax between arguments and return values"##,
802 default_severity: Severity::Warning,
803 warn_since: None,
804 deny_since: None,
805 },
806 Lint {
807 label: "misplaced_diagnostic_attributes",
808 description: r##"detects diagnostic attributes that are placed on the wrong item"##,
809 default_severity: Severity::Warning,
810 warn_since: None,
811 deny_since: None,
812 },
813 Lint {
814 label: "missing_abi",
815 description: r##"No declared ABI for extern declaration"##,
816 default_severity: Severity::Warning,
817 warn_since: None,
818 deny_since: None,
819 },
820 Lint {
821 label: "missing_copy_implementations",
822 description: r##"detects potentially-forgotten implementations of `Copy`"##,
823 default_severity: Severity::Allow,
824 warn_since: None,
825 deny_since: None,
826 },
827 Lint {
828 label: "missing_debug_implementations",
829 description: r##"detects missing implementations of Debug"##,
830 default_severity: Severity::Allow,
831 warn_since: None,
832 deny_since: None,
833 },
834 Lint {
835 label: "missing_docs",
836 description: r##"detects missing documentation for public members"##,
837 default_severity: Severity::Allow,
838 warn_since: None,
839 deny_since: None,
840 },
841 Lint {
842 label: "missing_gpu_kernel_export_name",
843 description: r##"mangled gpu-kernel function"##,
844 default_severity: Severity::Warning,
845 warn_since: None,
846 deny_since: None,
847 },
848 Lint {
849 label: "missing_unsafe_on_extern",
850 description: r##"detects missing unsafe keyword on extern declarations"##,
851 default_severity: Severity::Allow,
852 warn_since: None,
853 deny_since: None,
854 },
855 Lint {
856 label: "mixed_script_confusables",
857 description: r##"detects Unicode scripts whose mixed script confusables codepoints are solely used"##,
858 default_severity: Severity::Warning,
859 warn_since: None,
860 deny_since: None,
861 },
862 Lint {
863 label: "multiple_supertrait_upcastable",
864 description: r##"detect when a dyn-compatible trait has multiple supertraits"##,
865 default_severity: Severity::Allow,
866 warn_since: None,
867 deny_since: None,
868 },
869 Lint {
870 label: "must_not_suspend",
871 description: r##"use of a `#[must_not_suspend]` value across a yield point"##,
872 default_severity: Severity::Allow,
873 warn_since: None,
874 deny_since: None,
875 },
876 Lint {
877 label: "mutable_transmutes",
878 description: r##"transmuting &T to &mut T is undefined behavior, even if the reference is unused"##,
879 default_severity: Severity::Error,
880 warn_since: None,
881 deny_since: None,
882 },
883 Lint {
884 label: "named_arguments_used_positionally",
885 description: r##"named arguments in format used positionally"##,
886 default_severity: Severity::Warning,
887 warn_since: None,
888 deny_since: None,
889 },
890 Lint {
891 label: "named_asm_labels",
892 description: r##"named labels in inline assembly"##,
893 default_severity: Severity::Error,
894 warn_since: None,
895 deny_since: None,
896 },
897 Lint {
898 label: "never_type_fallback_flowing_into_unsafe",
899 description: r##"never type fallback affecting unsafe function calls"##,
900 default_severity: Severity::Error,
901 warn_since: None,
902 deny_since: None,
903 },
904 Lint {
905 label: "no_mangle_const_items",
906 description: r##"const items will not have their symbols exported"##,
907 default_severity: Severity::Error,
908 warn_since: None,
909 deny_since: None,
910 },
911 Lint {
912 label: "no_mangle_generic_items",
913 description: r##"generic items must be mangled"##,
914 default_severity: Severity::Warning,
915 warn_since: None,
916 deny_since: None,
917 },
918 Lint {
919 label: "non_ascii_idents",
920 description: r##"detects non-ASCII identifiers"##,
921 default_severity: Severity::Allow,
922 warn_since: None,
923 deny_since: None,
924 },
925 Lint {
926 label: "non_camel_case_types",
927 description: r##"types, variants, traits and type parameters should have camel case names"##,
928 default_severity: Severity::Warning,
929 warn_since: None,
930 deny_since: None,
931 },
932 Lint {
933 label: "non_contiguous_range_endpoints",
934 description: r##"detects off-by-one errors with exclusive range patterns"##,
935 default_severity: Severity::Warning,
936 warn_since: None,
937 deny_since: None,
938 },
939 Lint {
940 label: "non_exhaustive_omitted_patterns",
941 description: r##"detect when patterns of types marked `non_exhaustive` are missed"##,
942 default_severity: Severity::Allow,
943 warn_since: None,
944 deny_since: None,
945 },
946 Lint {
947 label: "non_fmt_panics",
948 description: r##"detect single-argument panic!() invocations in which the argument is not a format string"##,
949 default_severity: Severity::Warning,
950 warn_since: None,
951 deny_since: None,
952 },
953 Lint {
954 label: "non_local_definitions",
955 description: r##"checks for non-local definitions"##,
956 default_severity: Severity::Warning,
957 warn_since: None,
958 deny_since: None,
959 },
960 Lint {
961 label: "non_shorthand_field_patterns",
962 description: r##"using `Struct { x: x }` instead of `Struct { x }` in a pattern"##,
963 default_severity: Severity::Warning,
964 warn_since: None,
965 deny_since: None,
966 },
967 Lint {
968 label: "non_snake_case",
969 description: r##"variables, methods, functions, lifetime parameters and modules should have snake case names"##,
970 default_severity: Severity::Warning,
971 warn_since: None,
972 deny_since: None,
973 },
974 Lint {
975 label: "non_upper_case_globals",
976 description: r##"static constants should have uppercase identifiers"##,
977 default_severity: Severity::Warning,
978 warn_since: None,
979 deny_since: None,
980 },
981 Lint {
982 label: "noop_method_call",
983 description: r##"detects the use of well-known noop methods"##,
984 default_severity: Severity::Warning,
985 warn_since: None,
986 deny_since: None,
987 },
988 Lint {
989 label: "opaque_hidden_inferred_bound",
990 description: r##"detects the use of nested `impl Trait` types in associated type bounds that are not general enough"##,
991 default_severity: Severity::Warning,
992 warn_since: None,
993 deny_since: None,
994 },
995 Lint {
996 label: "out_of_scope_macro_calls",
997 description: r##"detects out of scope calls to `macro_rules` in key-value attributes"##,
998 default_severity: Severity::Error,
999 warn_since: None,
1000 deny_since: None,
1001 },
1002 Lint {
1003 label: "overflowing_literals",
1004 description: r##"literal out of range for its type"##,
1005 default_severity: Severity::Error,
1006 warn_since: None,
1007 deny_since: None,
1008 },
1009 Lint {
1010 label: "overlapping_range_endpoints",
1011 description: r##"detects range patterns with overlapping endpoints"##,
1012 default_severity: Severity::Warning,
1013 warn_since: None,
1014 deny_since: None,
1015 },
1016 Lint {
1017 label: "path_statements",
1018 description: r##"path statements with no effect"##,
1019 default_severity: Severity::Warning,
1020 warn_since: None,
1021 deny_since: None,
1022 },
1023 Lint {
1024 label: "patterns_in_fns_without_body",
1025 description: r##"patterns in functions without body were erroneously allowed"##,
1026 default_severity: Severity::Error,
1027 warn_since: None,
1028 deny_since: None,
1029 },
1030 Lint {
1031 label: "private_bounds",
1032 description: r##"private type in secondary interface of an item"##,
1033 default_severity: Severity::Warning,
1034 warn_since: None,
1035 deny_since: None,
1036 },
1037 Lint {
1038 label: "private_interfaces",
1039 description: r##"private type in primary interface of an item"##,
1040 default_severity: Severity::Warning,
1041 warn_since: None,
1042 deny_since: None,
1043 },
1044 Lint {
1045 label: "proc_macro_derive_resolution_fallback",
1046 description: r##"detects proc macro derives using inaccessible names from parent modules"##,
1047 default_severity: Severity::Error,
1048 warn_since: None,
1049 deny_since: None,
1050 },
1051 Lint {
1052 label: "ptr_to_integer_transmute_in_consts",
1053 description: r##"detects pointer to integer transmutes in const functions and associated constants"##,
1054 default_severity: Severity::Warning,
1055 warn_since: None,
1056 deny_since: None,
1057 },
1058 Lint {
1059 label: "pub_use_of_private_extern_crate",
1060 description: r##"detect public re-exports of private extern crates"##,
1061 default_severity: Severity::Error,
1062 warn_since: None,
1063 deny_since: None,
1064 },
1065 Lint {
1066 label: "redundant_imports",
1067 description: r##"imports that are redundant due to being imported already"##,
1068 default_severity: Severity::Allow,
1069 warn_since: None,
1070 deny_since: None,
1071 },
1072 Lint {
1073 label: "redundant_lifetimes",
1074 description: r##"detects lifetime parameters that are redundant because they are equal to some other named lifetime"##,
1075 default_severity: Severity::Allow,
1076 warn_since: None,
1077 deny_since: None,
1078 },
1079 Lint {
1080 label: "redundant_semicolons",
1081 description: r##"detects unnecessary trailing semicolons"##,
1082 default_severity: Severity::Warning,
1083 warn_since: None,
1084 deny_since: None,
1085 },
1086 Lint {
1087 label: "refining_impl_trait_internal",
1088 description: r##"impl trait in impl method signature does not match trait method signature"##,
1089 default_severity: Severity::Warning,
1090 warn_since: None,
1091 deny_since: None,
1092 },
1093 Lint {
1094 label: "refining_impl_trait_reachable",
1095 description: r##"impl trait in impl method signature does not match trait method signature"##,
1096 default_severity: Severity::Warning,
1097 warn_since: None,
1098 deny_since: None,
1099 },
1100 Lint {
1101 label: "renamed_and_removed_lints",
1102 description: r##"lints that have been renamed or removed"##,
1103 default_severity: Severity::Warning,
1104 warn_since: None,
1105 deny_since: None,
1106 },
1107 Lint {
1108 label: "repr_c_enums_larger_than_int",
1109 description: r##"repr(C) enums with discriminant values that do not fit into a C int"##,
1110 default_severity: Severity::Warning,
1111 warn_since: None,
1112 deny_since: None,
1113 },
1114 Lint {
1115 label: "repr_transparent_non_zst_fields",
1116 description: r##"transparent type contains an external ZST that is marked #[non_exhaustive] or contains private fields"##,
1117 default_severity: Severity::Error,
1118 warn_since: None,
1119 deny_since: None,
1120 },
1121 Lint {
1122 label: "resolving_to_items_shadowing_supertrait_items",
1123 description: r##"detects when a supertrait item is shadowed by a subtrait item"##,
1124 default_severity: Severity::Allow,
1125 warn_since: None,
1126 deny_since: None,
1127 },
1128 Lint {
1129 label: "rtsan_nonblocking_async",
1130 description: r##"detects incompatible uses of `#[sanitize(realtime = "nonblocking")]` on async functions"##,
1131 default_severity: Severity::Warning,
1132 warn_since: None,
1133 deny_since: None,
1134 },
1135 Lint {
1136 label: "rust_2021_incompatible_closure_captures",
1137 description: r##"detects closures affected by Rust 2021 changes"##,
1138 default_severity: Severity::Allow,
1139 warn_since: None,
1140 deny_since: None,
1141 },
1142 Lint {
1143 label: "rust_2021_incompatible_or_patterns",
1144 description: r##"detects usage of old versions of or-patterns"##,
1145 default_severity: Severity::Allow,
1146 warn_since: None,
1147 deny_since: None,
1148 },
1149 Lint {
1150 label: "rust_2021_prefixes_incompatible_syntax",
1151 description: r##"identifiers that will be parsed as a prefix in Rust 2021"##,
1152 default_severity: Severity::Allow,
1153 warn_since: None,
1154 deny_since: None,
1155 },
1156 Lint {
1157 label: "rust_2021_prelude_collisions",
1158 description: r##"detects the usage of trait methods which are ambiguous with traits added to the prelude in future editions"##,
1159 default_severity: Severity::Allow,
1160 warn_since: None,
1161 deny_since: None,
1162 },
1163 Lint {
1164 label: "rust_2024_guarded_string_incompatible_syntax",
1165 description: r##"will be parsed as a guarded string in Rust 2024"##,
1166 default_severity: Severity::Allow,
1167 warn_since: None,
1168 deny_since: None,
1169 },
1170 Lint {
1171 label: "rust_2024_incompatible_pat",
1172 description: r##"detects patterns whose meaning will change in Rust 2024"##,
1173 default_severity: Severity::Allow,
1174 warn_since: None,
1175 deny_since: None,
1176 },
1177 Lint {
1178 label: "rust_2024_prelude_collisions",
1179 description: r##"detects the usage of trait methods which are ambiguous with traits added to the prelude in future editions"##,
1180 default_severity: Severity::Allow,
1181 warn_since: None,
1182 deny_since: None,
1183 },
1184 Lint {
1185 label: "self_constructor_from_outer_item",
1186 description: r##"detect unsupported use of `Self` from outer item"##,
1187 default_severity: Severity::Warning,
1188 warn_since: None,
1189 deny_since: None,
1190 },
1191 Lint {
1192 label: "semicolon_in_expressions_from_macros",
1193 description: r##"trailing semicolon in macro body used as expression"##,
1194 default_severity: Severity::Error,
1195 warn_since: None,
1196 deny_since: None,
1197 },
1198 Lint {
1199 label: "shadowing_supertrait_items",
1200 description: r##"detects when a supertrait item is shadowed by a subtrait item"##,
1201 default_severity: Severity::Allow,
1202 warn_since: None,
1203 deny_since: None,
1204 },
1205 Lint {
1206 label: "single_use_lifetimes",
1207 description: r##"detects lifetime parameters that are only used once"##,
1208 default_severity: Severity::Allow,
1209 warn_since: None,
1210 deny_since: None,
1211 },
1212 Lint {
1213 label: "special_module_name",
1214 description: r##"module declarations for files with a special meaning"##,
1215 default_severity: Severity::Warning,
1216 warn_since: None,
1217 deny_since: None,
1218 },
1219 Lint {
1220 label: "stable_features",
1221 description: r##"stable features found in `#[feature]` directive"##,
1222 default_severity: Severity::Warning,
1223 warn_since: None,
1224 deny_since: None,
1225 },
1226 Lint {
1227 label: "static_mut_refs",
1228 description: r##"creating a shared reference to mutable static"##,
1229 default_severity: Severity::Warning,
1230 warn_since: None,
1231 deny_since: Some(Edition::Edition2024),
1232 },
1233 Lint {
1234 label: "suspicious_double_ref_op",
1235 description: r##"suspicious call of trait method on `&&T`"##,
1236 default_severity: Severity::Warning,
1237 warn_since: None,
1238 deny_since: None,
1239 },
1240 Lint {
1241 label: "tail_call_track_caller",
1242 description: r##"detects tail calls of functions marked with `#[track_caller]`"##,
1243 default_severity: Severity::Warning,
1244 warn_since: None,
1245 deny_since: None,
1246 },
1247 Lint {
1248 label: "tail_expr_drop_order",
1249 description: r##"Detect and warn on significant change in drop order in tail expression location"##,
1250 default_severity: Severity::Allow,
1251 warn_since: None,
1252 deny_since: None,
1253 },
1254 Lint {
1255 label: "test_unstable_lint",
1256 description: r##"this unstable lint is only for testing"##,
1257 default_severity: Severity::Error,
1258 warn_since: None,
1259 deny_since: None,
1260 },
1261 Lint {
1262 label: "text_direction_codepoint_in_comment",
1263 description: r##"invisible directionality-changing codepoints in comment"##,
1264 default_severity: Severity::Error,
1265 warn_since: None,
1266 deny_since: None,
1267 },
1268 Lint {
1269 label: "text_direction_codepoint_in_literal",
1270 description: r##"detect special Unicode codepoints that affect the visual representation of text on screen, changing the direction in which text flows"##,
1271 default_severity: Severity::Error,
1272 warn_since: None,
1273 deny_since: None,
1274 },
1275 Lint {
1276 label: "trivial_bounds",
1277 description: r##"these bounds don't depend on an type parameters"##,
1278 default_severity: Severity::Warning,
1279 warn_since: None,
1280 deny_since: None,
1281 },
1282 Lint {
1283 label: "trivial_casts",
1284 description: r##"detects trivial casts which could be removed"##,
1285 default_severity: Severity::Allow,
1286 warn_since: None,
1287 deny_since: None,
1288 },
1289 Lint {
1290 label: "trivial_numeric_casts",
1291 description: r##"detects trivial casts of numeric types which could be removed"##,
1292 default_severity: Severity::Allow,
1293 warn_since: None,
1294 deny_since: None,
1295 },
1296 Lint {
1297 label: "type_alias_bounds",
1298 description: r##"bounds in type aliases are not enforced"##,
1299 default_severity: Severity::Warning,
1300 warn_since: None,
1301 deny_since: None,
1302 },
1303 Lint {
1304 label: "tyvar_behind_raw_pointer",
1305 description: r##"raw pointer to an inference variable"##,
1306 default_severity: Severity::Warning,
1307 warn_since: None,
1308 deny_since: None,
1309 },
1310 Lint {
1311 label: "uncommon_codepoints",
1312 description: r##"detects uncommon Unicode codepoints in identifiers"##,
1313 default_severity: Severity::Warning,
1314 warn_since: None,
1315 deny_since: None,
1316 },
1317 Lint {
1318 label: "unconditional_panic",
1319 description: r##"operation will cause a panic at runtime"##,
1320 default_severity: Severity::Error,
1321 warn_since: None,
1322 deny_since: None,
1323 },
1324 Lint {
1325 label: "unconditional_recursion",
1326 description: r##"functions that cannot return without calling themselves"##,
1327 default_severity: Severity::Warning,
1328 warn_since: None,
1329 deny_since: None,
1330 },
1331 Lint {
1332 label: "uncovered_param_in_projection",
1333 description: r##"impl contains type parameters that are not covered"##,
1334 default_severity: Severity::Warning,
1335 warn_since: None,
1336 deny_since: None,
1337 },
1338 Lint {
1339 label: "undropped_manually_drops",
1340 description: r##"calls to `std::mem::drop` with `std::mem::ManuallyDrop` instead of it's inner value"##,
1341 default_severity: Severity::Error,
1342 warn_since: None,
1343 deny_since: None,
1344 },
1345 Lint {
1346 label: "unexpected_cfgs",
1347 description: r##"detects unexpected names and values in `#[cfg]` conditions"##,
1348 default_severity: Severity::Warning,
1349 warn_since: None,
1350 deny_since: None,
1351 },
1352 Lint {
1353 label: "unfulfilled_lint_expectations",
1354 description: r##"unfulfilled lint expectation"##,
1355 default_severity: Severity::Warning,
1356 warn_since: None,
1357 deny_since: None,
1358 },
1359 Lint {
1360 label: "ungated_async_fn_track_caller",
1361 description: r##"enabling track_caller on an async fn is a no-op unless the async_fn_track_caller feature is enabled"##,
1362 default_severity: Severity::Warning,
1363 warn_since: None,
1364 deny_since: None,
1365 },
1366 Lint {
1367 label: "uninhabited_static",
1368 description: r##"uninhabited static"##,
1369 default_severity: Severity::Error,
1370 warn_since: None,
1371 deny_since: None,
1372 },
1373 Lint {
1374 label: "unit_bindings",
1375 description: r##"binding is useless because it has the unit `()` type"##,
1376 default_severity: Severity::Allow,
1377 warn_since: None,
1378 deny_since: None,
1379 },
1380 Lint {
1381 label: "unknown_crate_types",
1382 description: r##"unknown crate type found in `#[crate_type]` directive"##,
1383 default_severity: Severity::Error,
1384 warn_since: None,
1385 deny_since: None,
1386 },
1387 Lint {
1388 label: "unknown_diagnostic_attributes",
1389 description: r##"detects unknown diagnostic attributes"##,
1390 default_severity: Severity::Warning,
1391 warn_since: None,
1392 deny_since: None,
1393 },
1394 Lint {
1395 label: "unknown_lints",
1396 description: r##"unrecognized lint attribute"##,
1397 default_severity: Severity::Warning,
1398 warn_since: None,
1399 deny_since: None,
1400 },
1401 Lint {
1402 label: "unnameable_test_items",
1403 description: r##"detects an item that cannot be named being marked as `#[test_case]`"##,
1404 default_severity: Severity::Warning,
1405 warn_since: None,
1406 deny_since: None,
1407 },
1408 Lint {
1409 label: "unnameable_types",
1410 description: r##"effective visibility of a type is larger than the area in which it can be named"##,
1411 default_severity: Severity::Allow,
1412 warn_since: None,
1413 deny_since: None,
1414 },
1415 Lint {
1416 label: "unnecessary_transmutes",
1417 description: r##"detects transmutes that can also be achieved by other operations"##,
1418 default_severity: Severity::Warning,
1419 warn_since: None,
1420 deny_since: None,
1421 },
1422 Lint {
1423 label: "unpredictable_function_pointer_comparisons",
1424 description: r##"detects unpredictable function pointer comparisons"##,
1425 default_severity: Severity::Warning,
1426 warn_since: None,
1427 deny_since: None,
1428 },
1429 Lint {
1430 label: "unqualified_local_imports",
1431 description: r##"`use` of a local item without leading `self::`, `super::`, or `crate::`"##,
1432 default_severity: Severity::Allow,
1433 warn_since: None,
1434 deny_since: None,
1435 },
1436 Lint {
1437 label: "unreachable_cfg_select_predicates",
1438 description: r##"detects unreachable configuration predicates in the cfg_select macro"##,
1439 default_severity: Severity::Warning,
1440 warn_since: None,
1441 deny_since: None,
1442 },
1443 Lint {
1444 label: "unreachable_code",
1445 description: r##"detects unreachable code paths"##,
1446 default_severity: Severity::Warning,
1447 warn_since: None,
1448 deny_since: None,
1449 },
1450 Lint {
1451 label: "unreachable_patterns",
1452 description: r##"detects unreachable patterns"##,
1453 default_severity: Severity::Warning,
1454 warn_since: None,
1455 deny_since: None,
1456 },
1457 Lint {
1458 label: "unreachable_pub",
1459 description: r##"`pub` items not reachable from crate root"##,
1460 default_severity: Severity::Allow,
1461 warn_since: None,
1462 deny_since: None,
1463 },
1464 Lint {
1465 label: "unsafe_attr_outside_unsafe",
1466 description: r##"detects unsafe attributes outside of unsafe"##,
1467 default_severity: Severity::Allow,
1468 warn_since: None,
1469 deny_since: None,
1470 },
1471 Lint {
1472 label: "unsafe_code",
1473 description: r##"usage of `unsafe` code and other potentially unsound constructs"##,
1474 default_severity: Severity::Allow,
1475 warn_since: None,
1476 deny_since: None,
1477 },
1478 Lint {
1479 label: "unsafe_op_in_unsafe_fn",
1480 description: r##"unsafe operations in unsafe functions without an explicit unsafe block are deprecated"##,
1481 default_severity: Severity::Allow,
1482 warn_since: Some(Edition::Edition2024),
1483 deny_since: None,
1484 },
1485 Lint {
1486 label: "unstable_features",
1487 description: r##"enabling unstable features"##,
1488 default_severity: Severity::Allow,
1489 warn_since: None,
1490 deny_since: None,
1491 },
1492 Lint {
1493 label: "unstable_name_collisions",
1494 description: r##"detects name collision with an existing but unstable method"##,
1495 default_severity: Severity::Warning,
1496 warn_since: None,
1497 deny_since: None,
1498 },
1499 Lint {
1500 label: "unstable_syntax_pre_expansion",
1501 description: r##"unstable syntax can change at any point in the future, causing a hard error!"##,
1502 default_severity: Severity::Warning,
1503 warn_since: None,
1504 deny_since: None,
1505 },
1506 Lint {
1507 label: "unsupported_calling_conventions",
1508 description: r##"use of unsupported calling convention"##,
1509 default_severity: Severity::Warning,
1510 warn_since: None,
1511 deny_since: None,
1512 },
1513 Lint {
1514 label: "unused_allocation",
1515 description: r##"detects unnecessary allocations that can be eliminated"##,
1516 default_severity: Severity::Warning,
1517 warn_since: None,
1518 deny_since: None,
1519 },
1520 Lint {
1521 label: "unused_assignments",
1522 description: r##"detect assignments that will never be read"##,
1523 default_severity: Severity::Warning,
1524 warn_since: None,
1525 deny_since: None,
1526 },
1527 Lint {
1528 label: "unused_associated_type_bounds",
1529 description: r##"detects unused `Foo = Bar` bounds in `dyn Trait<Foo = Bar>`"##,
1530 default_severity: Severity::Warning,
1531 warn_since: None,
1532 deny_since: None,
1533 },
1534 Lint {
1535 label: "unused_attributes",
1536 description: r##"detects attributes that were not used by the compiler"##,
1537 default_severity: Severity::Warning,
1538 warn_since: None,
1539 deny_since: None,
1540 },
1541 Lint {
1542 label: "unused_braces",
1543 description: r##"unnecessary braces around an expression"##,
1544 default_severity: Severity::Warning,
1545 warn_since: None,
1546 deny_since: None,
1547 },
1548 Lint {
1549 label: "unused_comparisons",
1550 description: r##"comparisons made useless by limits of the types involved"##,
1551 default_severity: Severity::Warning,
1552 warn_since: None,
1553 deny_since: None,
1554 },
1555 Lint {
1556 label: "unused_crate_dependencies",
1557 description: r##"crate dependencies that are never used"##,
1558 default_severity: Severity::Allow,
1559 warn_since: None,
1560 deny_since: None,
1561 },
1562 Lint {
1563 label: "unused_doc_comments",
1564 description: r##"detects doc comments that aren't used by rustdoc"##,
1565 default_severity: Severity::Warning,
1566 warn_since: None,
1567 deny_since: None,
1568 },
1569 Lint {
1570 label: "unused_extern_crates",
1571 description: r##"extern crates that are never used"##,
1572 default_severity: Severity::Allow,
1573 warn_since: None,
1574 deny_since: None,
1575 },
1576 Lint {
1577 label: "unused_features",
1578 description: r##"unused features found in crate-level `#[feature]` directives"##,
1579 default_severity: Severity::Warning,
1580 warn_since: None,
1581 deny_since: None,
1582 },
1583 Lint {
1584 label: "unused_import_braces",
1585 description: r##"unnecessary braces around an imported item"##,
1586 default_severity: Severity::Allow,
1587 warn_since: None,
1588 deny_since: None,
1589 },
1590 Lint {
1591 label: "unused_imports",
1592 description: r##"imports that are never used"##,
1593 default_severity: Severity::Warning,
1594 warn_since: None,
1595 deny_since: None,
1596 },
1597 Lint {
1598 label: "unused_labels",
1599 description: r##"detects labels that are never used"##,
1600 default_severity: Severity::Warning,
1601 warn_since: None,
1602 deny_since: None,
1603 },
1604 Lint {
1605 label: "unused_lifetimes",
1606 description: r##"detects lifetime parameters that are never used"##,
1607 default_severity: Severity::Allow,
1608 warn_since: None,
1609 deny_since: None,
1610 },
1611 Lint {
1612 label: "unused_macro_rules",
1613 description: r##"detects macro rules that were not used"##,
1614 default_severity: Severity::Allow,
1615 warn_since: None,
1616 deny_since: None,
1617 },
1618 Lint {
1619 label: "unused_macros",
1620 description: r##"detects macros that were not used"##,
1621 default_severity: Severity::Warning,
1622 warn_since: None,
1623 deny_since: None,
1624 },
1625 Lint {
1626 label: "unused_must_use",
1627 description: r##"unused result of a type flagged as `#[must_use]`"##,
1628 default_severity: Severity::Warning,
1629 warn_since: None,
1630 deny_since: None,
1631 },
1632 Lint {
1633 label: "unused_mut",
1634 description: r##"detect mut variables which don't need to be mutable"##,
1635 default_severity: Severity::Warning,
1636 warn_since: None,
1637 deny_since: None,
1638 },
1639 Lint {
1640 label: "unused_parens",
1641 description: r##"`if`, `match`, `while` and `return` do not need parentheses"##,
1642 default_severity: Severity::Warning,
1643 warn_since: None,
1644 deny_since: None,
1645 },
1646 Lint {
1647 label: "unused_qualifications",
1648 description: r##"detects unnecessarily qualified names"##,
1649 default_severity: Severity::Allow,
1650 warn_since: None,
1651 deny_since: None,
1652 },
1653 Lint {
1654 label: "unused_results",
1655 description: r##"unused result of an expression in a statement"##,
1656 default_severity: Severity::Allow,
1657 warn_since: None,
1658 deny_since: None,
1659 },
1660 Lint {
1661 label: "unused_unsafe",
1662 description: r##"unnecessary use of an `unsafe` block"##,
1663 default_severity: Severity::Warning,
1664 warn_since: None,
1665 deny_since: None,
1666 },
1667 Lint {
1668 label: "unused_variables",
1669 description: r##"detect variables which are not used in any way"##,
1670 default_severity: Severity::Warning,
1671 warn_since: None,
1672 deny_since: None,
1673 },
1674 Lint {
1675 label: "unused_visibilities",
1676 description: r##"detect visibility qualifiers on `const _` items"##,
1677 default_severity: Severity::Warning,
1678 warn_since: None,
1679 deny_since: None,
1680 },
1681 Lint {
1682 label: "useless_deprecated",
1683 description: r##"detects deprecation attributes with no effect"##,
1684 default_severity: Severity::Error,
1685 warn_since: None,
1686 deny_since: None,
1687 },
1688 Lint {
1689 label: "useless_ptr_null_checks",
1690 description: r##"useless checking of non-null-typed pointer"##,
1691 default_severity: Severity::Warning,
1692 warn_since: None,
1693 deny_since: None,
1694 },
1695 Lint {
1696 label: "uses_power_alignment",
1697 description: r##"Structs do not follow the power alignment rule under repr(C)"##,
1698 default_severity: Severity::Warning,
1699 warn_since: None,
1700 deny_since: None,
1701 },
1702 Lint {
1703 label: "varargs_without_pattern",
1704 description: r##"detects usage of `...` arguments without a pattern in non-foreign items"##,
1705 default_severity: Severity::Error,
1706 warn_since: None,
1707 deny_since: None,
1708 },
1709 Lint {
1710 label: "variant_size_differences",
1711 description: r##"detects enums with widely varying variant sizes"##,
1712 default_severity: Severity::Allow,
1713 warn_since: None,
1714 deny_since: None,
1715 },
1716 Lint {
1717 label: "warnings",
1718 description: r##"mass-change the level for lints which produce warnings"##,
1719 default_severity: Severity::Warning,
1720 warn_since: None,
1721 deny_since: None,
1722 },
1723 Lint {
1724 label: "while_true",
1725 description: r##"suggest using `loop { }` instead of `while true { }`"##,
1726 default_severity: Severity::Warning,
1727 warn_since: None,
1728 deny_since: None,
1729 },
1730 Lint {
1731 label: "deprecated_safe",
1732 description: r##"lint group for: deprecated-safe-2024"##,
1733 default_severity: Severity::Allow,
1734 warn_since: None,
1735 deny_since: None,
1736 },
1737 Lint {
1738 label: "future_incompatible",
1739 description: r##"lint group for: internal-eq-trait-method-impls, aarch64-softfloat-neon, ambiguous-associated-items, ambiguous-derive-helpers, ambiguous-glob-imported-traits, ambiguous-glob-imports, ambiguous-import-visibilities, ambiguous-panic-imports, coherence-leak-check, conflicting-repr-hints, const-evaluatable-unchecked, elided-lifetimes-in-associated-constant, float-literal-f32-fallback, forbidden-lint-groups, ill-formed-attribute-input, invalid-macro-export-arguments, invalid-type-param-default, late-bound-lifetime-arguments, legacy-derive-helpers, macro-expanded-macro-exports-accessed-by-absolute-paths, out-of-scope-macro-calls, patterns-in-fns-without-body, proc-macro-derive-resolution-fallback, pub-use-of-private-extern-crate, repr-c-enums-larger-than-int, repr-transparent-non-zst-fields, self-constructor-from-outer-item, semicolon-in-expressions-from-macros, uncovered-param-in-projection, uninhabited-static, unstable-name-collisions, unstable-syntax-pre-expansion, unsupported-calling-conventions, varargs-without-pattern"##,
1740 default_severity: Severity::Allow,
1741 warn_since: None,
1742 deny_since: None,
1743 },
1744 Lint {
1745 label: "keyword_idents",
1746 description: r##"lint group for: keyword-idents-2018, keyword-idents-2024"##,
1747 default_severity: Severity::Allow,
1748 warn_since: None,
1749 deny_since: None,
1750 },
1751 Lint {
1752 label: "let_underscore",
1753 description: r##"lint group for: let-underscore-drop, let-underscore-lock"##,
1754 default_severity: Severity::Allow,
1755 warn_since: None,
1756 deny_since: None,
1757 },
1758 Lint {
1759 label: "nonstandard_style",
1760 description: r##"lint group for: non-camel-case-types, non-snake-case, non-upper-case-globals"##,
1761 default_severity: Severity::Allow,
1762 warn_since: None,
1763 deny_since: None,
1764 },
1765 Lint {
1766 label: "refining_impl_trait",
1767 description: r##"lint group for: refining-impl-trait-reachable, refining-impl-trait-internal"##,
1768 default_severity: Severity::Allow,
1769 warn_since: None,
1770 deny_since: None,
1771 },
1772 Lint {
1773 label: "rust_2018_compatibility",
1774 description: r##"lint group for: keyword-idents-2018, anonymous-parameters, absolute-paths-not-starting-with-crate, tyvar-behind-raw-pointer"##,
1775 default_severity: Severity::Allow,
1776 warn_since: None,
1777 deny_since: None,
1778 },
1779 Lint {
1780 label: "rust_2018_idioms",
1781 description: r##"lint group for: bare-trait-objects, unused-extern-crates, ellipsis-inclusive-range-patterns, elided-lifetimes-in-paths, explicit-outlives-requirements"##,
1782 default_severity: Severity::Allow,
1783 warn_since: None,
1784 deny_since: None,
1785 },
1786 Lint {
1787 label: "rust_2021_compatibility",
1788 description: r##"lint group for: ellipsis-inclusive-range-patterns, array-into-iter, non-fmt-panics, bare-trait-objects, rust-2021-incompatible-closure-captures, rust-2021-incompatible-or-patterns, rust-2021-prefixes-incompatible-syntax, rust-2021-prelude-collisions"##,
1789 default_severity: Severity::Allow,
1790 warn_since: None,
1791 deny_since: None,
1792 },
1793 Lint {
1794 label: "rust_2024_compatibility",
1795 description: r##"lint group for: keyword-idents-2024, edition-2024-expr-fragment-specifier, boxed-slice-into-iter, impl-trait-overcaptures, if-let-rescope, static-mut-refs, dependency-on-unit-never-type-fallback, deprecated-safe-2024, missing-unsafe-on-extern, never-type-fallback-flowing-into-unsafe, rust-2024-guarded-string-incompatible-syntax, rust-2024-incompatible-pat, rust-2024-prelude-collisions, tail-expr-drop-order, unsafe-attr-outside-unsafe, unsafe-op-in-unsafe-fn"##,
1796 default_severity: Severity::Allow,
1797 warn_since: None,
1798 deny_since: None,
1799 },
1800 Lint {
1801 label: "unknown_or_malformed_diagnostic_attributes",
1802 description: r##"lint group for: malformed-diagnostic-attributes, malformed-diagnostic-format-literals, misplaced-diagnostic-attributes, unknown-diagnostic-attributes"##,
1803 default_severity: Severity::Allow,
1804 warn_since: None,
1805 deny_since: None,
1806 },
1807 Lint {
1808 label: "unused",
1809 description: r##"lint group for: unused-imports, unused-variables, unused-visibilities, unused-assignments, dead-code, unused-mut, unreachable-code, unreachable-patterns, unused-must-use, unused-unsafe, path-statements, unused-attributes, unused-macros, unused-macro-rules, unused-allocation, unused-doc-comments, unused-extern-crates, unused-features, unused-labels, unused-parens, unused-braces, redundant-semicolons, map-unit-fn"##,
1810 default_severity: Severity::Allow,
1811 warn_since: None,
1812 deny_since: None,
1813 },
1814];
1815
1816pub const DEFAULT_LINT_GROUPS: &[LintGroup] = &[
1817 LintGroup {
1818 lint: Lint {
1819 label: "deprecated_safe",
1820 description: r##"lint group for: deprecated-safe-2024"##,
1821 default_severity: Severity::Allow,
1822 warn_since: None,
1823 deny_since: None,
1824 },
1825 children: &["deprecated_safe_2024"],
1826 },
1827 LintGroup {
1828 lint: Lint {
1829 label: "future_incompatible",
1830 description: r##"lint group for: internal-eq-trait-method-impls, aarch64-softfloat-neon, ambiguous-associated-items, ambiguous-derive-helpers, ambiguous-glob-imported-traits, ambiguous-glob-imports, ambiguous-import-visibilities, ambiguous-panic-imports, coherence-leak-check, conflicting-repr-hints, const-evaluatable-unchecked, elided-lifetimes-in-associated-constant, float-literal-f32-fallback, forbidden-lint-groups, ill-formed-attribute-input, invalid-macro-export-arguments, invalid-type-param-default, late-bound-lifetime-arguments, legacy-derive-helpers, macro-expanded-macro-exports-accessed-by-absolute-paths, out-of-scope-macro-calls, patterns-in-fns-without-body, proc-macro-derive-resolution-fallback, pub-use-of-private-extern-crate, repr-c-enums-larger-than-int, repr-transparent-non-zst-fields, self-constructor-from-outer-item, semicolon-in-expressions-from-macros, uncovered-param-in-projection, uninhabited-static, unstable-name-collisions, unstable-syntax-pre-expansion, unsupported-calling-conventions, varargs-without-pattern"##,
1831 default_severity: Severity::Allow,
1832 warn_since: None,
1833 deny_since: None,
1834 },
1835 children: &[
1836 "internal_eq_trait_method_impls",
1837 "aarch64_softfloat_neon",
1838 "ambiguous_associated_items",
1839 "ambiguous_derive_helpers",
1840 "ambiguous_glob_imported_traits",
1841 "ambiguous_glob_imports",
1842 "ambiguous_import_visibilities",
1843 "ambiguous_panic_imports",
1844 "coherence_leak_check",
1845 "conflicting_repr_hints",
1846 "const_evaluatable_unchecked",
1847 "elided_lifetimes_in_associated_constant",
1848 "float_literal_f32_fallback",
1849 "forbidden_lint_groups",
1850 "ill_formed_attribute_input",
1851 "invalid_macro_export_arguments",
1852 "invalid_type_param_default",
1853 "late_bound_lifetime_arguments",
1854 "legacy_derive_helpers",
1855 "macro_expanded_macro_exports_accessed_by_absolute_paths",
1856 "out_of_scope_macro_calls",
1857 "patterns_in_fns_without_body",
1858 "proc_macro_derive_resolution_fallback",
1859 "pub_use_of_private_extern_crate",
1860 "repr_c_enums_larger_than_int",
1861 "repr_transparent_non_zst_fields",
1862 "self_constructor_from_outer_item",
1863 "semicolon_in_expressions_from_macros",
1864 "uncovered_param_in_projection",
1865 "uninhabited_static",
1866 "unstable_name_collisions",
1867 "unstable_syntax_pre_expansion",
1868 "unsupported_calling_conventions",
1869 "varargs_without_pattern",
1870 ],
1871 },
1872 LintGroup {
1873 lint: Lint {
1874 label: "keyword_idents",
1875 description: r##"lint group for: keyword-idents-2018, keyword-idents-2024"##,
1876 default_severity: Severity::Allow,
1877 warn_since: None,
1878 deny_since: None,
1879 },
1880 children: &["keyword_idents_2018", "keyword_idents_2024"],
1881 },
1882 LintGroup {
1883 lint: Lint {
1884 label: "let_underscore",
1885 description: r##"lint group for: let-underscore-drop, let-underscore-lock"##,
1886 default_severity: Severity::Allow,
1887 warn_since: None,
1888 deny_since: None,
1889 },
1890 children: &["let_underscore_drop", "let_underscore_lock"],
1891 },
1892 LintGroup {
1893 lint: Lint {
1894 label: "nonstandard_style",
1895 description: r##"lint group for: non-camel-case-types, non-snake-case, non-upper-case-globals"##,
1896 default_severity: Severity::Allow,
1897 warn_since: None,
1898 deny_since: None,
1899 },
1900 children: &["non_camel_case_types", "non_snake_case", "non_upper_case_globals"],
1901 },
1902 LintGroup {
1903 lint: Lint {
1904 label: "refining_impl_trait",
1905 description: r##"lint group for: refining-impl-trait-reachable, refining-impl-trait-internal"##,
1906 default_severity: Severity::Allow,
1907 warn_since: None,
1908 deny_since: None,
1909 },
1910 children: &["refining_impl_trait_reachable", "refining_impl_trait_internal"],
1911 },
1912 LintGroup {
1913 lint: Lint {
1914 label: "rust_2018_compatibility",
1915 description: r##"lint group for: keyword-idents-2018, anonymous-parameters, absolute-paths-not-starting-with-crate, tyvar-behind-raw-pointer"##,
1916 default_severity: Severity::Allow,
1917 warn_since: None,
1918 deny_since: None,
1919 },
1920 children: &[
1921 "keyword_idents_2018",
1922 "anonymous_parameters",
1923 "absolute_paths_not_starting_with_crate",
1924 "tyvar_behind_raw_pointer",
1925 ],
1926 },
1927 LintGroup {
1928 lint: Lint {
1929 label: "rust_2018_idioms",
1930 description: r##"lint group for: bare-trait-objects, unused-extern-crates, ellipsis-inclusive-range-patterns, elided-lifetimes-in-paths, explicit-outlives-requirements"##,
1931 default_severity: Severity::Allow,
1932 warn_since: None,
1933 deny_since: None,
1934 },
1935 children: &[
1936 "bare_trait_objects",
1937 "unused_extern_crates",
1938 "ellipsis_inclusive_range_patterns",
1939 "elided_lifetimes_in_paths",
1940 "explicit_outlives_requirements",
1941 ],
1942 },
1943 LintGroup {
1944 lint: Lint {
1945 label: "rust_2021_compatibility",
1946 description: r##"lint group for: ellipsis-inclusive-range-patterns, array-into-iter, non-fmt-panics, bare-trait-objects, rust-2021-incompatible-closure-captures, rust-2021-incompatible-or-patterns, rust-2021-prefixes-incompatible-syntax, rust-2021-prelude-collisions"##,
1947 default_severity: Severity::Allow,
1948 warn_since: None,
1949 deny_since: None,
1950 },
1951 children: &[
1952 "ellipsis_inclusive_range_patterns",
1953 "array_into_iter",
1954 "non_fmt_panics",
1955 "bare_trait_objects",
1956 "rust_2021_incompatible_closure_captures",
1957 "rust_2021_incompatible_or_patterns",
1958 "rust_2021_prefixes_incompatible_syntax",
1959 "rust_2021_prelude_collisions",
1960 ],
1961 },
1962 LintGroup {
1963 lint: Lint {
1964 label: "rust_2024_compatibility",
1965 description: r##"lint group for: keyword-idents-2024, edition-2024-expr-fragment-specifier, boxed-slice-into-iter, impl-trait-overcaptures, if-let-rescope, static-mut-refs, dependency-on-unit-never-type-fallback, deprecated-safe-2024, missing-unsafe-on-extern, never-type-fallback-flowing-into-unsafe, rust-2024-guarded-string-incompatible-syntax, rust-2024-incompatible-pat, rust-2024-prelude-collisions, tail-expr-drop-order, unsafe-attr-outside-unsafe, unsafe-op-in-unsafe-fn"##,
1966 default_severity: Severity::Allow,
1967 warn_since: None,
1968 deny_since: None,
1969 },
1970 children: &[
1971 "keyword_idents_2024",
1972 "edition_2024_expr_fragment_specifier",
1973 "boxed_slice_into_iter",
1974 "impl_trait_overcaptures",
1975 "if_let_rescope",
1976 "static_mut_refs",
1977 "dependency_on_unit_never_type_fallback",
1978 "deprecated_safe_2024",
1979 "missing_unsafe_on_extern",
1980 "never_type_fallback_flowing_into_unsafe",
1981 "rust_2024_guarded_string_incompatible_syntax",
1982 "rust_2024_incompatible_pat",
1983 "rust_2024_prelude_collisions",
1984 "tail_expr_drop_order",
1985 "unsafe_attr_outside_unsafe",
1986 "unsafe_op_in_unsafe_fn",
1987 ],
1988 },
1989 LintGroup {
1990 lint: Lint {
1991 label: "unknown_or_malformed_diagnostic_attributes",
1992 description: r##"lint group for: malformed-diagnostic-attributes, malformed-diagnostic-format-literals, misplaced-diagnostic-attributes, unknown-diagnostic-attributes"##,
1993 default_severity: Severity::Allow,
1994 warn_since: None,
1995 deny_since: None,
1996 },
1997 children: &[
1998 "malformed_diagnostic_attributes",
1999 "malformed_diagnostic_format_literals",
2000 "misplaced_diagnostic_attributes",
2001 "unknown_diagnostic_attributes",
2002 ],
2003 },
2004 LintGroup {
2005 lint: Lint {
2006 label: "unused",
2007 description: r##"lint group for: unused-imports, unused-variables, unused-visibilities, unused-assignments, dead-code, unused-mut, unreachable-code, unreachable-patterns, unused-must-use, unused-unsafe, path-statements, unused-attributes, unused-macros, unused-macro-rules, unused-allocation, unused-doc-comments, unused-extern-crates, unused-features, unused-labels, unused-parens, unused-braces, redundant-semicolons, map-unit-fn"##,
2008 default_severity: Severity::Allow,
2009 warn_since: None,
2010 deny_since: None,
2011 },
2012 children: &[
2013 "unused_imports",
2014 "unused_variables",
2015 "unused_visibilities",
2016 "unused_assignments",
2017 "dead_code",
2018 "unused_mut",
2019 "unreachable_code",
2020 "unreachable_patterns",
2021 "unused_must_use",
2022 "unused_unsafe",
2023 "path_statements",
2024 "unused_attributes",
2025 "unused_macros",
2026 "unused_macro_rules",
2027 "unused_allocation",
2028 "unused_doc_comments",
2029 "unused_extern_crates",
2030 "unused_features",
2031 "unused_labels",
2032 "unused_parens",
2033 "unused_braces",
2034 "redundant_semicolons",
2035 "map_unit_fn",
2036 ],
2037 },
2038];
2039
2040pub const RUSTDOC_LINTS: &[Lint] = &[
2041 Lint {
2042 label: "rustdoc::bare_urls",
2043 description: r##"detects URLs that are not hyperlinks"##,
2044 default_severity: Severity::Warning,
2045 warn_since: None,
2046 deny_since: None,
2047 },
2048 Lint {
2049 label: "rustdoc::broken_intra_doc_links",
2050 description: r##"failures in resolving intra-doc link targets"##,
2051 default_severity: Severity::Warning,
2052 warn_since: None,
2053 deny_since: None,
2054 },
2055 Lint {
2056 label: "rustdoc::invalid_codeblock_attributes",
2057 description: r##"codeblock attribute looks a lot like a known one"##,
2058 default_severity: Severity::Warning,
2059 warn_since: None,
2060 deny_since: None,
2061 },
2062 Lint {
2063 label: "rustdoc::invalid_html_tags",
2064 description: r##"detects invalid HTML tags in doc comments"##,
2065 default_severity: Severity::Warning,
2066 warn_since: None,
2067 deny_since: None,
2068 },
2069 Lint {
2070 label: "rustdoc::invalid_rust_codeblocks",
2071 description: r##"codeblock could not be parsed as valid Rust or is empty"##,
2072 default_severity: Severity::Warning,
2073 warn_since: None,
2074 deny_since: None,
2075 },
2076 Lint {
2077 label: "rustdoc::missing_crate_level_docs",
2078 description: r##"detects crates with no crate-level documentation"##,
2079 default_severity: Severity::Allow,
2080 warn_since: None,
2081 deny_since: None,
2082 },
2083 Lint {
2084 label: "rustdoc::missing_doc_code_examples",
2085 description: r##"detects publicly-exported items without code samples in their documentation"##,
2086 default_severity: Severity::Allow,
2087 warn_since: None,
2088 deny_since: None,
2089 },
2090 Lint {
2091 label: "rustdoc::private_doc_tests",
2092 description: r##"detects code samples in docs of private items not documented by rustdoc"##,
2093 default_severity: Severity::Allow,
2094 warn_since: None,
2095 deny_since: None,
2096 },
2097 Lint {
2098 label: "rustdoc::private_intra_doc_links",
2099 description: r##"linking from a public item to a private one"##,
2100 default_severity: Severity::Warning,
2101 warn_since: None,
2102 deny_since: None,
2103 },
2104 Lint {
2105 label: "rustdoc::redundant_explicit_links",
2106 description: r##"detects redundant explicit links in doc comments"##,
2107 default_severity: Severity::Warning,
2108 warn_since: None,
2109 deny_since: None,
2110 },
2111 Lint {
2112 label: "rustdoc::unescaped_backticks",
2113 description: r##"detects unescaped backticks in doc comments"##,
2114 default_severity: Severity::Allow,
2115 warn_since: None,
2116 deny_since: None,
2117 },
2118 Lint {
2119 label: "rustdoc::all",
2120 description: r##"lint group for: rustdoc::broken-intra-doc-links, rustdoc::private-intra-doc-links, rustdoc::private-doc-tests, rustdoc::invalid-codeblock-attributes, rustdoc::invalid-rust-codeblocks, rustdoc::invalid-html-tags, rustdoc::bare-urls, rustdoc::missing-crate-level-docs, rustdoc::unescaped-backticks, rustdoc::redundant-explicit-links"##,
2121 default_severity: Severity::Allow,
2122 warn_since: None,
2123 deny_since: None,
2124 },
2125];
2126
2127pub const RUSTDOC_LINT_GROUPS: &[LintGroup] = &[LintGroup {
2128 lint: Lint {
2129 label: "rustdoc::all",
2130 description: r##"lint group for: rustdoc::broken-intra-doc-links, rustdoc::private-intra-doc-links, rustdoc::private-doc-tests, rustdoc::invalid-codeblock-attributes, rustdoc::invalid-rust-codeblocks, rustdoc::invalid-html-tags, rustdoc::bare-urls, rustdoc::missing-crate-level-docs, rustdoc::unescaped-backticks, rustdoc::redundant-explicit-links"##,
2131 default_severity: Severity::Allow,
2132 warn_since: None,
2133 deny_since: None,
2134 },
2135 children: &[
2136 "rustdoc::broken_intra_doc_links",
2137 "rustdoc::private_intra_doc_links",
2138 "rustdoc::private_doc_tests",
2139 "rustdoc::invalid_codeblock_attributes",
2140 "rustdoc::invalid_rust_codeblocks",
2141 "rustdoc::invalid_html_tags",
2142 "rustdoc::bare_urls",
2143 "rustdoc::missing_crate_level_docs",
2144 "rustdoc::unescaped_backticks",
2145 "rustdoc::redundant_explicit_links",
2146 ],
2147}];
2148
2149pub const FEATURES: &[Lint] = &[
2150 Lint {
2151 label: "aarch64_unstable_target_feature",
2152 description: r##"# `aarch64_unstable_target_feature`
2153
2154The remaining unstable target features on aarch64.
2155
2156The tracking issue for this feature is: [#150244]
2157
2158[#150244]: https://github.com/rust-lang/rust/issues/150244
2159
2160------------------------
2161"##,
2162 default_severity: Severity::Allow,
2163 warn_since: None,
2164 deny_since: None,
2165 },
2166 Lint {
2167 label: "aarch64_ver_target_feature",
2168 description: r##"# `aarch64_ver_target_feature`
2169
2170Instruction set "version" target features on aarch64.
2171
2172The tracking issue for this feature is: [#150245]
2173
2174[#150245]: https://github.com/rust-lang/rust/issues/150245
2175
2176------------------------
2177"##,
2178 default_severity: Severity::Allow,
2179 warn_since: None,
2180 deny_since: None,
2181 },
2182 Lint {
2183 label: "abi_avr_interrupt",
2184 description: r##"# `abi_avr_interrupt`
2185
2186Allows `extern "avr-interrupt" fn()` and `extern "avr-non-blocking-interrupt" fn()`.
2187
2188The tracking issue for this feature is: [#69664]
2189
2190[#69664]: https://github.com/rust-lang/rust/issues/69664
2191
2192------------------------
2193"##,
2194 default_severity: Severity::Allow,
2195 warn_since: None,
2196 deny_since: None,
2197 },
2198 Lint {
2199 label: "abi_cmse_nonsecure_call",
2200 description: r##"# `abi_cmse_nonsecure_call`
2201
2202The tracking issue for this feature is: [#81391]
2203
2204[#81391]: https://github.com/rust-lang/rust/issues/81391
2205
2206------------------------
2207
2208The [TrustZone-M
2209feature](https://developer.arm.com/documentation/100690/latest/) is available
2210for targets with the Armv8-M architecture profile (`thumbv8m` in their target
2211name).
2212LLVM, the Rust compiler and the linker are providing
2213[support](https://developer.arm.com/documentation/ecm0359818/latest/) for the
2214TrustZone-M feature.
2215
2216One of the things provided with this unstable feature is the "cmse-nonsecure-call" function ABI.
2217This ABI is used on function pointers to non-secure code to mark a non-secure function call
2218(see [section 5.5](https://developer.arm.com/documentation/ecm0359818/latest/) for details).
2219
2220With this ABI, the compiler will do the following to perform the call:
2221* save registers needed after the call to Secure memory
2222* clear all registers that might contain confidential information
2223* clear the Least Significant Bit of the function address
2224* branches using the BLXNS instruction
2225
2226To avoid using the non-secure stack, the compiler will constrain the number and
2227type of parameters/return value.
2228
2229<!-- NOTE(ignore) this example is specific to thumbv8m targets -->
2230
2231``` rust,ignore
2232#![no_std]
2233#![feature(abi_cmse_nonsecure_call)]
2234
2235#[no_mangle]
2236pub fn call_nonsecure_function(addr: usize) -> u32 {
2237 let non_secure_function =
2238 unsafe { core::mem::transmute::<usize, extern "cmse-nonsecure-call" fn() -> u32>(addr) };
2239 non_secure_function()
2240}
2241```
2242
2243``` text
2244$ rustc --emit asm --crate-type lib --target thumbv8m.main-none-eabi function.rs
2245
2246call_nonsecure_function:
2247 .fnstart
2248 .save {r7, lr}
2249 push {r7, lr}
2250 .setfp r7, sp
2251 mov r7, sp
2252 .pad #16
2253 sub sp, #16
2254 str r0, [sp, #12]
2255 ldr r0, [sp, #12]
2256 str r0, [sp, #8]
2257 b .LBB0_1
2258.LBB0_1:
2259 ldr r0, [sp, #8]
2260 push.w {r4, r5, r6, r7, r8, r9, r10, r11}
2261 bic r0, r0, #1
2262 mov r1, r0
2263 mov r2, r0
2264 mov r3, r0
2265 mov r4, r0
2266 mov r5, r0
2267 mov r6, r0
2268 mov r7, r0
2269 mov r8, r0
2270 mov r9, r0
2271 mov r10, r0
2272 mov r11, r0
2273 mov r12, r0
2274 msr apsr_nzcvq, r0
2275 blxns r0
2276 pop.w {r4, r5, r6, r7, r8, r9, r10, r11}
2277 str r0, [sp, #4]
2278 b .LBB0_2
2279.LBB0_2:
2280 ldr r0, [sp, #4]
2281 add sp, #16
2282 pop {r7, pc}
2283```
2284"##,
2285 default_severity: Severity::Allow,
2286 warn_since: None,
2287 deny_since: None,
2288 },
2289 Lint {
2290 label: "abi_custom",
2291 description: r##"# `abi_custom`
2292
2293Allows `extern "custom" fn()`.
2294
2295The tracking issue for this feature is: [#140829]
2296
2297[#140829]: https://github.com/rust-lang/rust/issues/140829
2298
2299------------------------
2300"##,
2301 default_severity: Severity::Allow,
2302 warn_since: None,
2303 deny_since: None,
2304 },
2305 Lint {
2306 label: "abi_gpu_kernel",
2307 description: r##"# `abi_gpu_kernel`
2308
2309Allows `extern "gpu-kernel" fn()`.
2310
2311The tracking issue for this feature is: [#135467]
2312
2313[#135467]: https://github.com/rust-lang/rust/issues/135467
2314
2315------------------------
2316"##,
2317 default_severity: Severity::Allow,
2318 warn_since: None,
2319 deny_since: None,
2320 },
2321 Lint {
2322 label: "abi_msp430_interrupt",
2323 description: r##"# `abi_msp430_interrupt`
2324
2325The tracking issue for this feature is: [#38487]
2326
2327[#38487]: https://github.com/rust-lang/rust/issues/38487
2328
2329------------------------
2330
2331In the MSP430 architecture, interrupt handlers have a special calling
2332convention. You can use the `"msp430-interrupt"` ABI to make the compiler apply
2333the right calling convention to the interrupt handlers you define.
2334
2335<!-- NOTE(ignore) this example is specific to the msp430 target -->
2336
2337``` rust,ignore
2338#![feature(abi_msp430_interrupt)]
2339#![no_std]
2340
2341// Place the interrupt handler at the appropriate memory address
2342// (Alternatively, you can use `#[used]` and remove `pub` and `#[no_mangle]`)
2343#[link_section = "__interrupt_vector_10"]
2344#[no_mangle]
2345pub static TIM0_VECTOR: extern "msp430-interrupt" fn() = tim0;
2346
2347// The interrupt handler
2348extern "msp430-interrupt" fn tim0() {
2349 // ..
2350}
2351```
2352
2353``` text
2354$ msp430-elf-objdump -CD ./target/msp430/release/app
2355Disassembly of section __interrupt_vector_10:
2356
23570000fff2 <TIM0_VECTOR>:
2358 fff2: 00 c0 interrupt service routine at 0xc000
2359
2360Disassembly of section .text:
2361
23620000c000 <int::tim0>:
2363 c000: 00 13 reti
2364```
2365"##,
2366 default_severity: Severity::Allow,
2367 warn_since: None,
2368 deny_since: None,
2369 },
2370 Lint {
2371 label: "abi_ptx",
2372 description: r##"# `abi_ptx`
2373
2374The tracking issue for this feature is: [#38788]
2375
2376[#38788]: https://github.com/rust-lang/rust/issues/38788
2377
2378------------------------
2379
2380When emitting PTX code, all vanilla Rust functions (`fn`) get translated to
2381"device" functions. These functions are *not* callable from the host via the
2382CUDA API so a crate with only device functions is not too useful!
2383
2384OTOH, "global" functions *can* be called by the host; you can think of them
2385as the real public API of your crate. To produce a global function use the
2386`"ptx-kernel"` ABI.
2387
2388<!-- NOTE(ignore) this example is specific to the nvptx targets -->
2389
2390``` rust,ignore
2391#![feature(abi_ptx)]
2392#![no_std]
2393
2394pub unsafe extern "ptx-kernel" fn global_function() {
2395 device_function();
2396}
2397
2398pub fn device_function() {
2399 // ..
2400}
2401```
2402
2403``` text
2404$ xargo rustc --target nvptx64-nvidia-cuda --release -- --emit=asm
2405
2406$ cat $(find -name '*.s')
2407//
2408// Generated by LLVM NVPTX Back-End
2409//
2410
2411.version 3.2
2412.target sm_20
2413.address_size 64
2414
2415 // .globl _ZN6kernel15global_function17h46111ebe6516b382E
2416
2417.visible .entry _ZN6kernel15global_function17h46111ebe6516b382E()
2418{
2419
2420
2421 ret;
2422}
2423
2424 // .globl _ZN6kernel15device_function17hd6a0e4993bbf3f78E
2425.visible .func _ZN6kernel15device_function17hd6a0e4993bbf3f78E()
2426{
2427
2428
2429 ret;
2430}
2431```
2432"##,
2433 default_severity: Severity::Allow,
2434 warn_since: None,
2435 deny_since: None,
2436 },
2437 Lint {
2438 label: "abi_riscv_interrupt",
2439 description: r##"# `abi_riscv_interrupt`
2440
2441Allows `extern "riscv-interrupt-m" fn()` and `extern "riscv-interrupt-s" fn()`.
2442
2443The tracking issue for this feature is: [#111889]
2444
2445[#111889]: https://github.com/rust-lang/rust/issues/111889
2446
2447------------------------
2448"##,
2449 default_severity: Severity::Allow,
2450 warn_since: None,
2451 deny_since: None,
2452 },
2453 Lint {
2454 label: "abi_swift",
2455 description: r##"# `abi_swift`
2456
2457Allows `extern "Swift" fn()`.
2458
2459The tracking issue for this feature is: [#156481]
2460
2461[#156481]: https://github.com/rust-lang/rust/issues/156481
2462
2463------------------------
2464"##,
2465 default_severity: Severity::Allow,
2466 warn_since: None,
2467 deny_since: None,
2468 },
2469 Lint {
2470 label: "abi_unadjusted",
2471 description: r##"# `abi_unadjusted`
2472
2473Allows using the `unadjusted` ABI; perma-unstable.
2474
2475This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
2476
2477------------------------
2478"##,
2479 default_severity: Severity::Allow,
2480 warn_since: None,
2481 deny_since: None,
2482 },
2483 Lint {
2484 label: "abi_vectorcall",
2485 description: r##"# `abi_vectorcall`
2486
2487The tracking issue for this feature is: [#124485]
2488
2489[#124485]: https://github.com/rust-lang/rust/issues/124485
2490
2491------------------------
2492
2493Adds support for the Windows `"vectorcall"` ABI, the equivalent of `__vectorcall` in MSVC.
2494
2495```rust,ignore (only-windows-or-x86-or-x86-64)
2496extern "vectorcall" {
2497 fn add_f64s(x: f64, y: f64) -> f64;
2498}
2499
2500fn main() {
2501 println!("{}", add_f64s(2.0, 4.0));
2502}
2503```
2504"##,
2505 default_severity: Severity::Allow,
2506 warn_since: None,
2507 deny_since: None,
2508 },
2509 Lint {
2510 label: "abi_x86_interrupt",
2511 description: r##"# `abi_x86_interrupt`
2512
2513Allows `extern "x86-interrupt" fn()`.
2514
2515The tracking issue for this feature is: [#40180]
2516
2517[#40180]: https://github.com/rust-lang/rust/issues/40180
2518
2519------------------------
2520"##,
2521 default_severity: Severity::Allow,
2522 warn_since: None,
2523 deny_since: None,
2524 },
2525 Lint {
2526 label: "abort_immediate",
2527 description: r##"# `abort_immediate`
2528
2529
2530
2531The tracking issue for this feature is: [#154601]
2532
2533[#154601]: https://github.com/rust-lang/rust/issues/154601
2534
2535------------------------
2536"##,
2537 default_severity: Severity::Allow,
2538 warn_since: None,
2539 deny_since: None,
2540 },
2541 Lint {
2542 label: "abort_unwind",
2543 description: r##"# `abort_unwind`
2544
2545
2546
2547The tracking issue for this feature is: [#130338]
2548
2549[#130338]: https://github.com/rust-lang/rust/issues/130338
2550
2551------------------------
2552"##,
2553 default_severity: Severity::Allow,
2554 warn_since: None,
2555 deny_since: None,
2556 },
2557 Lint {
2558 label: "acceptfilter",
2559 description: r##"# `acceptfilter`
2560
2561
2562
2563The tracking issue for this feature is: [#121891]
2564
2565[#121891]: https://github.com/rust-lang/rust/issues/121891
2566
2567------------------------
2568"##,
2569 default_severity: Severity::Allow,
2570 warn_since: None,
2571 deny_since: None,
2572 },
2573 Lint {
2574 label: "addr_parse_ascii",
2575 description: r##"# `addr_parse_ascii`
2576
2577
2578
2579The tracking issue for this feature is: [#101035]
2580
2581[#101035]: https://github.com/rust-lang/rust/issues/101035
2582
2583------------------------
2584"##,
2585 default_severity: Severity::Allow,
2586 warn_since: None,
2587 deny_since: None,
2588 },
2589 Lint {
2590 label: "adt_const_params",
2591 description: r##"# `adt_const_params`
2592
2593The tracking issue for this feature is: [#95174]
2594
2595[#95174]: https://github.com/rust-lang/rust/issues/95174
2596
2597------------------------
2598
2599Allows for using more complex types for const parameters, such as structs or enums.
2600
2601```rust
2602#![feature(adt_const_params)]
2603#![allow(incomplete_features)]
2604
2605use std::marker::ConstParamTy;
2606
2607#[derive(ConstParamTy, PartialEq, Eq)]
2608enum Foo {
2609 A,
2610 B,
2611 C,
2612}
2613
2614#[derive(ConstParamTy, PartialEq, Eq)]
2615struct Bar {
2616 flag: bool,
2617}
2618
2619fn is_foo_a_and_bar_true<const F: Foo, const B: Bar>() -> bool {
2620 match (F, B.flag) {
2621 (Foo::A, true) => true,
2622 _ => false,
2623 }
2624}
2625```
2626"##,
2627 default_severity: Severity::Allow,
2628 warn_since: None,
2629 deny_since: None,
2630 },
2631 Lint {
2632 label: "align_to_uninit_mut",
2633 description: r##"# `align_to_uninit_mut`
2634
2635
2636
2637The tracking issue for this feature is: [#139062]
2638
2639[#139062]: https://github.com/rust-lang/rust/issues/139062
2640
2641------------------------
2642"##,
2643 default_severity: Severity::Allow,
2644 warn_since: None,
2645 deny_since: None,
2646 },
2647 Lint {
2648 label: "alloc_error_handler",
2649 description: r##"# `alloc_error_handler`
2650
2651Allows defining an `#[alloc_error_handler]`.
2652
2653The tracking issue for this feature is: [#51540]
2654
2655[#51540]: https://github.com/rust-lang/rust/issues/51540
2656
2657------------------------
2658"##,
2659 default_severity: Severity::Allow,
2660 warn_since: None,
2661 deny_since: None,
2662 },
2663 Lint {
2664 label: "alloc_error_hook",
2665 description: r##"# `alloc_error_hook`
2666
2667
2668
2669The tracking issue for this feature is: [#51245]
2670
2671[#51245]: https://github.com/rust-lang/rust/issues/51245
2672
2673------------------------
2674"##,
2675 default_severity: Severity::Allow,
2676 warn_since: None,
2677 deny_since: None,
2678 },
2679 Lint {
2680 label: "alloc_internals",
2681 description: r##"# `alloc_internals`
2682
2683
2684
2685This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
2686
2687------------------------
2688"##,
2689 default_severity: Severity::Allow,
2690 warn_since: None,
2691 deny_since: None,
2692 },
2693 Lint {
2694 label: "alloc_slice_into_array",
2695 description: r##"# `alloc_slice_into_array`
2696
2697
2698
2699The tracking issue for this feature is: [#148082]
2700
2701[#148082]: https://github.com/rust-lang/rust/issues/148082
2702
2703------------------------
2704"##,
2705 default_severity: Severity::Allow,
2706 warn_since: None,
2707 deny_since: None,
2708 },
2709 Lint {
2710 label: "allocator_api",
2711 description: r##"# `allocator_api`
2712
2713The tracking issue for this feature is [#32838]
2714
2715[#32838]: https://github.com/rust-lang/rust/issues/32838
2716
2717------------------------
2718
2719Sometimes you want the memory for one collection to use a different
2720allocator than the memory for another collection. In this case,
2721replacing the global allocator is not a workable option. Instead,
2722you need to pass in an instance of an `AllocRef` to each collection
2723for which you want a custom allocator.
2724
2725TBD
2726"##,
2727 default_severity: Severity::Allow,
2728 warn_since: None,
2729 deny_since: None,
2730 },
2731 Lint {
2732 label: "allocator_internals",
2733 description: r##"# `allocator_internals`
2734
2735This feature does not have a tracking issue, it is an unstable implementation
2736detail of the `global_allocator` feature not intended for use outside the
2737compiler.
2738
2739------------------------
2740"##,
2741 default_severity: Severity::Allow,
2742 warn_since: None,
2743 deny_since: None,
2744 },
2745 Lint {
2746 label: "alloctests",
2747 description: r##"# `alloctests`
2748
2749
2750
2751This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
2752
2753------------------------
2754"##,
2755 default_severity: Severity::Allow,
2756 warn_since: None,
2757 deny_since: None,
2758 },
2759 Lint {
2760 label: "allow_internal_unsafe",
2761 description: r##"# `allow_internal_unsafe`
2762
2763Allows using `#[allow_internal_unsafe]`. This is an attribute on `macro_rules!` and can't use the attribute handling below (it has to be checked before expansion possibly makes macros disappear).
2764
2765This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
2766
2767------------------------
2768"##,
2769 default_severity: Severity::Allow,
2770 warn_since: None,
2771 deny_since: None,
2772 },
2773 Lint {
2774 label: "allow_internal_unstable",
2775 description: r##"# `allow_internal_unstable`
2776
2777Allows using `#[allow_internal_unstable]`. This is an attribute on `macro_rules!` and can't use the attribute handling below (it has to be checked before expansion possibly makes macros disappear).
2778
2779This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
2780
2781------------------------
2782"##,
2783 default_severity: Severity::Allow,
2784 warn_since: None,
2785 deny_since: None,
2786 },
2787 Lint {
2788 label: "anonymous_lifetime_in_impl_trait",
2789 description: r##"# `anonymous_lifetime_in_impl_trait`
2790
2791Allows using anonymous lifetimes in argument-position impl-trait.
2792
2793This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
2794
2795------------------------
2796"##,
2797 default_severity: Severity::Allow,
2798 warn_since: None,
2799 deny_since: None,
2800 },
2801 Lint {
2802 label: "apx_target_feature",
2803 description: r##"# `apx_target_feature`
2804
2805The `apxf` target feature on x86
2806
2807The tracking issue for this feature is: [#139284]
2808
2809[#139284]: https://github.com/rust-lang/rust/issues/139284
2810
2811------------------------
2812"##,
2813 default_severity: Severity::Allow,
2814 warn_since: None,
2815 deny_since: None,
2816 },
2817 Lint {
2818 label: "arbitrary_self_types",
2819 description: r##"# `arbitrary_self_types`
2820
2821The tracking issue for this feature is: [#44874]
2822
2823[#44874]: https://github.com/rust-lang/rust/issues/44874
2824
2825------------------------
2826
2827Allows any type implementing `core::ops::Receiver<Target=T>` to be used as the type
2828of `self` in a method belonging to `T`.
2829
2830For example,
2831
2832```rust
2833#![feature(arbitrary_self_types)]
2834
2835struct A;
2836
2837impl A {
2838 fn f(self: SmartPtr<Self>) -> i32 { 1 } // note self type
2839}
2840
2841struct SmartPtr<T>(T);
2842
2843impl<T> core::ops::Receiver for SmartPtr<T> {
2844 type Target = T;
2845}
2846
2847fn main() {
2848 let smart_ptr = SmartPtr(A);
2849 assert_eq!(smart_ptr.f(), 1);
2850}
2851```
2852
2853The `Receiver` trait has a blanket implementation for all `T: Deref`, so in fact
2854things like this work too:
2855
2856```rust
2857#![feature(arbitrary_self_types)]
2858
2859use std::rc::Rc;
2860
2861struct A;
2862
2863impl A {
2864 fn f(self: Rc<Self>) -> i32 { 1 } // Rc implements Deref
2865}
2866
2867fn main() {
2868 let smart_ptr = Rc::new(A);
2869 assert_eq!(smart_ptr.f(), 1);
2870}
2871```
2872
2873Interestingly, that works even without the `arbitrary_self_types` feature
2874- but that's because certain types are _effectively_ hard coded, including
2875`Rc`. ("Hard coding" isn't quite true; they use a lang-item called
2876`LegacyReceiver` to denote their special-ness in this way). With the
2877`arbitrary_self_types` feature, their special-ness goes away, and custom
2878smart pointers can achieve the same.
2879
2880## Changes to method lookup
2881
2882Method lookup previously used to work by stepping through the `Deref`
2883chain then using the resulting list of steps in two different ways:
2884
2885* To identify types that might contribute methods via their `impl`
2886 blocks (inherent methods) or via traits
2887* To identify the types that the method receiver (`a` in the above
2888 examples) can be converted to.
2889
2890With this feature, these lists are created by instead stepping through
2891the `Receiver` chain. However, a note is kept about whether the type
2892can be reached also via the `Deref` chain.
2893
2894The full chain (via `Receiver` hops) is used for the first purpose
2895(identifying relevant `impl` blocks and traits); whereas the shorter
2896list (reachable via `Deref`) is used for the second purpose. That's
2897because, to convert the method target (`a` in `a.b()`) to the self
2898type, Rust may need to be able to use `Deref::deref`. Type conversions,
2899then, can only proceed as far as the end of the `Deref` chain whereas
2900the longer `Receiver` chain can be used to explore more places where
2901useful methods might reside.
2902
2903## Types suitable for use as smart pointers
2904
2905This feature allows the creation of customised smart pointers - for example
2906your own equivalent to `Rc` or `Box` with whatever capabilities you like.
2907Those smart pointers can either implement `Deref` (if it's safe to
2908create a reference to the referent) or `Receiver` (if it isn't).
2909
2910Either way, smart pointer types should mostly _avoid having methods_.
2911Calling methods on a smart pointer leads to ambiguity about whether you're
2912aiming for a method on the pointer, or on the referent.
2913
2914Best practice is therefore to put smart pointer functionality into
2915associated functions instead - that's what's done in all the smart pointer
2916types within Rust's standard library which implement `Receiver`.
2917
2918If you choose to add any methods to your smart pointer type, your users
2919may run into errors from deshadowing, as described in the next section.
2920
2921## Avoiding shadowing
2922
2923With or without this feature, Rust emits an error if it finds two method
2924candidates, like this:
2925
2926```rust,compile_fail
2927use std::pin::Pin;
2928use std::pin::pin;
2929
2930struct A;
2931
2932impl A {
2933 fn get_ref(self: Pin<&A>) {}
2934}
2935
2936fn main() {
2937 let pinned_a: Pin<&A> = pin!(A).as_ref();
2938 let pinned_a: Pin<&A> = pinned_a.as_ref();
2939 pinned_a.get_ref(); // error[E0034]: multiple applicable items in scope
2940}
2941```
2942
2943(this is why Rust's smart pointers are mostly carefully designed to avoid
2944having methods at all, and shouldn't add new methods in future.)
2945
2946With `arbitrary_self_types`, we take care to spot some other kinds of
2947conflict:
2948
2949```rust,compile_fail
2950#![feature(arbitrary_self_types)]
2951
2952use std::pin::Pin;
2953use std::pin::pin;
2954
2955struct A;
2956
2957impl A {
2958 fn get_ref(self: &Pin<&A>) {} // note &Pin
2959}
2960
2961fn main() {
2962 let pinned_a: Pin<&mut A> = pin!(A);
2963 let pinned_a: Pin<&A> = pinned_a.as_ref();
2964 pinned_a.get_ref();
2965}
2966```
2967
2968This is to guard against the case where an inner (referent) type has a
2969method of a given name, taking the smart pointer by reference, and then
2970the smart pointer implementer adds a similar method taking self by value.
2971As noted in the previous section, the safe option is simply
2972not to add methods to smart pointers, and then these errors can't occur.
2973"##,
2974 default_severity: Severity::Allow,
2975 warn_since: None,
2976 deny_since: None,
2977 },
2978 Lint {
2979 label: "arbitrary_self_types_pointers",
2980 description: r##"# `arbitrary_self_types_pointers`
2981
2982The tracking issue for this feature is: [#44874]
2983
2984[#38788]: https://github.com/rust-lang/rust/issues/44874
2985
2986------------------------
2987
2988This extends the [arbitrary self types] feature to allow methods to
2989receive `self` by pointer. For example:
2990
2991```rust
2992#![feature(arbitrary_self_types_pointers)]
2993
2994struct A;
2995
2996impl A {
2997 fn m(self: *const Self) {}
2998}
2999
3000fn main() {
3001 let a = A;
3002 let a_ptr: *const A = &a as *const A;
3003 a_ptr.m();
3004}
3005```
3006
3007In general this is not advised: it's thought to be better practice to wrap
3008raw pointers in a newtype wrapper which implements the `core::ops::Receiver`
3009trait, then you need "only" the `arbitrary_self_types` feature. For example:
3010
3011```rust
3012#![feature(arbitrary_self_types)]
3013#![allow(dead_code)]
3014
3015struct A;
3016
3017impl A {
3018 fn m(self: Wrapper<Self>) {} // can extract the pointer and do
3019 // what it needs
3020}
3021
3022struct Wrapper<T>(*const T);
3023
3024impl<T> core::ops::Receiver for Wrapper<T> {
3025 type Target = T;
3026}
3027
3028fn main() {
3029 let a = A;
3030 let a_ptr: *const A = &a as *const A;
3031 let a_wrapper = Wrapper(a_ptr);
3032 a_wrapper.m();
3033}
3034```
3035
3036[arbitrary self types]: arbitrary-self-types.md
3037"##,
3038 default_severity: Severity::Allow,
3039 warn_since: None,
3040 deny_since: None,
3041 },
3042 Lint {
3043 label: "arc_is_unique",
3044 description: r##"# `arc_is_unique`
3045
3046
3047
3048The tracking issue for this feature is: [#138938]
3049
3050[#138938]: https://github.com/rust-lang/rust/issues/138938
3051
3052------------------------
3053"##,
3054 default_severity: Severity::Allow,
3055 warn_since: None,
3056 deny_since: None,
3057 },
3058 Lint {
3059 label: "arm_target_feature",
3060 description: r##"# `arm_target_feature`
3061
3062Target features on arm.
3063
3064The tracking issue for this feature is: [#150246]
3065
3066[#150246]: https://github.com/rust-lang/rust/issues/150246
3067
3068------------------------
3069"##,
3070 default_severity: Severity::Allow,
3071 warn_since: None,
3072 deny_since: None,
3073 },
3074 Lint {
3075 label: "array_into_iter_constructors",
3076 description: r##"# `array_into_iter_constructors`
3077
3078
3079
3080The tracking issue for this feature is: [#91583]
3081
3082[#91583]: https://github.com/rust-lang/rust/issues/91583
3083
3084------------------------
3085"##,
3086 default_severity: Severity::Allow,
3087 warn_since: None,
3088 deny_since: None,
3089 },
3090 Lint {
3091 label: "array_ptr_get",
3092 description: r##"# `array_ptr_get`
3093
3094
3095
3096The tracking issue for this feature is: [#119834]
3097
3098[#119834]: https://github.com/rust-lang/rust/issues/119834
3099
3100------------------------
3101"##,
3102 default_severity: Severity::Allow,
3103 warn_since: None,
3104 deny_since: None,
3105 },
3106 Lint {
3107 label: "array_try_from_fn",
3108 description: r##"# `array_try_from_fn`
3109
3110
3111
3112The tracking issue for this feature is: [#89379]
3113
3114[#89379]: https://github.com/rust-lang/rust/issues/89379
3115
3116------------------------
3117"##,
3118 default_severity: Severity::Allow,
3119 warn_since: None,
3120 deny_since: None,
3121 },
3122 Lint {
3123 label: "array_try_map",
3124 description: r##"# `array_try_map`
3125
3126
3127
3128The tracking issue for this feature is: [#79711]
3129
3130[#79711]: https://github.com/rust-lang/rust/issues/79711
3131
3132------------------------
3133"##,
3134 default_severity: Severity::Allow,
3135 warn_since: None,
3136 deny_since: None,
3137 },
3138 Lint {
3139 label: "ascii_char",
3140 description: r##"# `ascii_char`
3141
3142
3143
3144The tracking issue for this feature is: [#110998]
3145
3146[#110998]: https://github.com/rust-lang/rust/issues/110998
3147
3148------------------------
3149"##,
3150 default_severity: Severity::Allow,
3151 warn_since: None,
3152 deny_since: None,
3153 },
3154 Lint {
3155 label: "ascii_char_variants",
3156 description: r##"# `ascii_char_variants`
3157
3158
3159
3160The tracking issue for this feature is: [#110998]
3161
3162[#110998]: https://github.com/rust-lang/rust/issues/110998
3163
3164------------------------
3165"##,
3166 default_severity: Severity::Allow,
3167 warn_since: None,
3168 deny_since: None,
3169 },
3170 Lint {
3171 label: "asm_experimental_arch",
3172 description: r##"# `asm_experimental_arch`
3173
3174The tracking issue for this feature is: [#93335]
3175
3176[#93335]: https://github.com/rust-lang/rust/issues/93335
3177
3178------------------------
3179
3180This feature tracks `asm!` and `global_asm!` support for the following architectures:
3181- NVPTX
3182- Hexagon
3183- MIPS32r2 and MIPS64r2
3184- wasm32
3185- BPF
3186- SPIR-V
3187- AVR
3188- MSP430
3189- M68k
3190- CSKY
3191- SPARC
3192
3193## Register classes
3194
3195| Architecture | Register class | Registers | LLVM constraint code |
3196| ------------ | -------------- | ---------------------------------- | -------------------- |
3197| MIPS | `reg` | `$[2-25]` | `r` |
3198| MIPS | `freg` | `$f[0-31]` | `f` |
3199| NVPTX | `reg16` | None\* | `h` |
3200| NVPTX | `reg32` | None\* | `r` |
3201| NVPTX | `reg64` | None\* | `l` |
3202| Hexagon | `reg` | `r[0-28]` | `r` |
3203| Hexagon | `preg` | `p[0-3]` | Only clobbers |
3204| wasm32 | `local` | None\* | `r` |
3205| BPF | `reg` | `r[0-10]` | `r` |
3206| BPF | `wreg` | `w[0-10]` | `w` |
3207| AVR | `reg` | `r[2-25]`, `XH`, `XL`, `ZH`, `ZL` | `r` |
3208| AVR | `reg_upper` | `r[16-25]`, `XH`, `XL`, `ZH`, `ZL` | `d` |
3209| AVR | `reg_pair` | `r3r2` .. `r25r24`, `X`, `Z` | `r` |
3210| AVR | `reg_iw` | `r25r24`, `X`, `Z` | `w` |
3211| AVR | `reg_ptr` | `X`, `Z` | `e` |
3212| MSP430 | `reg` | `r[0-15]` | `r` |
3213| M68k | `reg` | `d[0-7]`, `a[0-7]` | `r` |
3214| M68k | `reg_data` | `d[0-7]` | `d` |
3215| M68k | `reg_addr` | `a[0-3]` | `a` |
3216| CSKY | `reg` | `r[0-31]` | `r` |
3217| CSKY | `freg` | `f[0-31]` | `f` |
3218| SPARC | `reg` | `r[2-29]` | `r` |
3219| SPARC | `yreg` | `y` | Only clobbers |
3220
3221> **Notes**:
3222> - NVPTX doesn't have a fixed register set, so named registers are not supported.
3223>
3224> - WebAssembly doesn't have registers, so named registers are not supported.
3225
3226# Register class supported types
3227
3228| Architecture | Register class | Target feature | Allowed types |
3229| ------------ | ------------------------------- | -------------- | --------------------------------------- |
3230| MIPS32 | `reg` | None | `i8`, `i16`, `i32`, `f32` |
3231| MIPS32 | `freg` | None | `f32`, `f64` |
3232| MIPS64 | `reg` | None | `i8`, `i16`, `i32`, `i64`, `f32`, `f64` |
3233| MIPS64 | `freg` | None | `f32`, `f64` |
3234| NVPTX | `reg16` | None | `i8`, `i16` |
3235| NVPTX | `reg32` | None | `i8`, `i16`, `i32`, `f32` |
3236| NVPTX | `reg64` | None | `i8`, `i16`, `i32`, `f32`, `i64`, `f64` |
3237| Hexagon | `reg` | None | `i8`, `i16`, `i32`, `f32` |
3238| Hexagon | `preg` | N/A | Only clobbers |
3239| wasm32 | `local` | None | `i8` `i16` `i32` `i64` `f32` `f64` |
3240| BPF | `reg` | None | `i8` `i16` `i32` `i64` |
3241| BPF | `wreg` | `alu32` | `i8` `i16` `i32` |
3242| AVR | `reg`, `reg_upper` | None | `i8` |
3243| AVR | `reg_pair`, `reg_iw`, `reg_ptr` | None | `i16` |
3244| MSP430 | `reg` | None | `i8`, `i16` |
3245| M68k | `reg`, `reg_addr` | None | `i16`, `i32` |
3246| M68k | `reg_data` | None | `i8`, `i16`, `i32` |
3247| CSKY | `reg` | None | `i8`, `i16`, `i32` |
3248| CSKY | `freg` | None | `f32`, |
3249| SPARC | `reg` | None | `i8`, `i16`, `i32`, `i64` (SPARC64 only) |
3250| SPARC | `yreg` | N/A | Only clobbers |
3251
3252## Register aliases
3253
3254| Architecture | Base register | Aliases |
3255| ------------ | ------------- | --------- |
3256| Hexagon | `r29` | `sp` |
3257| Hexagon | `r30` | `fr` |
3258| Hexagon | `r31` | `lr` |
3259| BPF | `r[0-10]` | `w[0-10]` |
3260| AVR | `XH` | `r27` |
3261| AVR | `XL` | `r26` |
3262| AVR | `ZH` | `r31` |
3263| AVR | `ZL` | `r30` |
3264| MSP430 | `r0` | `pc` |
3265| MSP430 | `r1` | `sp` |
3266| MSP430 | `r2` | `sr` |
3267| MSP430 | `r3` | `cg` |
3268| MSP430 | `r4` | `fp` |
3269| M68k | `a5` | `bp` |
3270| M68k | `a6` | `fp` |
3271| M68k | `a7` | `sp`, `usp`, `ssp`, `isp` |
3272| CSKY | `r[0-3]` | `a[0-3]` |
3273| CSKY | `r[4-11]` | `l[0-7]` |
3274| CSKY | `r[12-13]` | `t[0-1]` |
3275| CSKY | `r14` | `sp` |
3276| CSKY | `r15` | `lr` |
3277| CSKY | `r[16-17]` | `l[8-9]` |
3278| CSKY | `r[18-25]` | `t[2-9]` |
3279| CSKY | `r28` | `rgb` |
3280| CSKY | `r29` | `rtb` |
3281| CSKY | `r30` | `svbr` |
3282| CSKY | `r31` | `tls` |
3283| SPARC | `r[0-7]` | `g[0-7]` |
3284| SPARC | `r[8-15]` | `o[0-7]` |
3285| SPARC | `r[16-23]` | `l[0-7]` |
3286| SPARC | `r[24-31]` | `i[0-7]` |
3287
3288> **Notes**:
3289> - TI does not mandate a frame pointer for MSP430, but toolchains are allowed
3290 to use one; LLVM uses `r4`.
3291
3292## Unsupported registers
3293
3294| Architecture | Unsupported register | Reason |
3295| ------------ | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
3296| All | `sp`, `r14`/`o6` (SPARC) | The stack pointer must be restored to its original value at the end of an asm code block. |
3297| All | `fr` (Hexagon) `$fp` (MIPS), `Y` (AVR), `r4` (MSP430), `a6` (M68k), `r30`/`i6` (SPARC) | The frame pointer cannot be used as an input or output. |
3298| All | `r19` (Hexagon) | These are used internally by LLVM as "base pointer" for functions with complex stack frames. |
3299| MIPS | `$0` or `$zero` | This is a constant zero register which can't be modified. |
3300| MIPS | `$1` or `$at` | Reserved for assembler. |
3301| MIPS | `$26`/`$k0`, `$27`/`$k1` | OS-reserved registers. |
3302| MIPS | `$28`/`$gp` | Global pointer cannot be used as inputs or outputs. |
3303| MIPS | `$ra` | Return address cannot be used as inputs or outputs. |
3304| Hexagon | `lr` | This is the link register which cannot be used as an input or output. |
3305| AVR | `r0`, `r1`, `r1r0` | Due to an issue in LLVM, the `r0` and `r1` registers cannot be used as inputs or outputs. If modified, they must be restored to their original values before the end of the block. |
3306|MSP430 | `r0`, `r2`, `r3` | These are the program counter, status register, and constant generator respectively. Neither the status register nor constant generator can be written to. |
3307| M68k | `a4`, `a5` | Used internally by LLVM for the base pointer and global base pointer. |
3308| CSKY | `r7`, `r28` | Used internally by LLVM for the base pointer and global base pointer. |
3309| CSKY | `r8` | Used internally by LLVM for the frame pointer. |
3310| CSKY | `r14` | Used internally by LLVM for the stack pointer. |
3311| CSKY | `r15` | This is the link register. |
3312| CSKY | `r[26-30]` | Reserved by its ABI. |
3313| CSKY | `r31` | This is the TLS register. |
3314| SPARC | `r0`/`g0` | This is always zero and cannot be used as inputs or outputs. |
3315| SPARC | `r1`/`g1` | Used internally by LLVM. |
3316| SPARC | `r5`/`g5` | Reserved for system. (SPARC32 only) |
3317| SPARC | `r6`/`g6`, `r7`/`g7` | Reserved for system. |
3318| SPARC | `r31`/`i7` | Return address cannot be used as inputs or outputs. |
3319
3320
3321## Template modifiers
3322
3323| Architecture | Register class | Modifier | Example output | LLVM modifier |
3324| ------------ | -------------- | -------- | -------------- | ------------- |
3325| MIPS | `reg` | None | `$2` | None |
3326| MIPS | `freg` | None | `$f0` | None |
3327| NVPTX | `reg16` | None | `rs0` | None |
3328| NVPTX | `reg32` | None | `r0` | None |
3329| NVPTX | `reg64` | None | `rd0` | None |
3330| Hexagon | `reg` | None | `r0` | None |
3331| SPARC | `reg` | None | `%o0` | None |
3332| CSKY | `reg` | None | `r0` | None |
3333| CSKY | `freg` | None | `f0` | None |
3334
3335# Flags covered by `preserves_flags`
3336
3337These flags registers must be restored upon exiting the asm block if the `preserves_flags` option is set:
3338- AVR
3339 - The status register `SREG`.
3340- MSP430
3341 - The status register `r2`.
3342- M68k
3343 - The condition code register `ccr`.
3344- SPARC
3345 - Integer condition codes (`icc` and `xcc`)
3346 - Floating-point condition codes (`fcc[0-3]`)
3347- CSKY
3348 - Condition/carry bit (C) in `PSR`.
3349"##,
3350 default_severity: Severity::Allow,
3351 warn_since: None,
3352 deny_since: None,
3353 },
3354 Lint {
3355 label: "asm_experimental_reg",
3356 description: r##"# `asm_experimental_arch`
3357
3358The tracking issue for this feature is: [#133416]
3359
3360[#133416]: https://github.com/rust-lang/rust/issues/133416
3361
3362------------------------
3363
3364This tracks support for additional registers in architectures where inline assembly is already stable.
3365
3366## Register classes
3367
3368| Architecture | Register class | Registers | LLVM constraint code |
3369| ------------ | -------------- | --------- | -------------------- |
3370
3371## Register class supported types
3372
3373| Architecture | Register class | Target feature | Allowed types |
3374| ------------ | -------------- | -------------- | ------------- |
3375| x86 | `xmm_reg` | `sse` | `i128` |
3376| x86 | `ymm_reg` | `avx` | `i128` |
3377| x86 | `zmm_reg` | `avx512f` | `i128` |
3378
3379## Register aliases
3380
3381| Architecture | Base register | Aliases |
3382| ------------ | ------------- | ------- |
3383
3384## Unsupported registers
3385
3386| Architecture | Unsupported register | Reason |
3387| ------------ | -------------------- | ------ |
3388
3389## Template modifiers
3390
3391| Architecture | Register class | Modifier | Example output | LLVM modifier |
3392| ------------ | -------------- | -------- | -------------- | ------------- |
3393"##,
3394 default_severity: Severity::Allow,
3395 warn_since: None,
3396 deny_since: None,
3397 },
3398 Lint {
3399 label: "asm_goto_with_outputs",
3400 description: r##"# `asm_goto_with_outputs`
3401
3402The tracking issue for this feature is: [#119364]
3403
3404[#119364]: https://github.com/rust-lang/rust/issues/119364
3405
3406------------------------
3407
3408This feature allows label operands to be used together with output operands.
3409
3410Example:
3411```rust,ignore (partial-example, x86-only)
3412
3413unsafe {
3414 let a: usize;
3415 asm!(
3416 "mov {}, 1"
3417 "jmp {}",
3418 out(reg) a,
3419 label {
3420 println!("Jumped from asm {}!", a);
3421 }
3422 );
3423}
3424```
3425
3426The output operands are assigned before the label blocks are executed.
3427"##,
3428 default_severity: Severity::Allow,
3429 warn_since: None,
3430 deny_since: None,
3431 },
3432 Lint {
3433 label: "asm_unwind",
3434 description: r##"# `asm_unwind`
3435
3436The tracking issue for this feature is: [#93334]
3437
3438[#93334]: https://github.com/rust-lang/rust/issues/93334
3439
3440------------------------
3441
3442This feature adds a `may_unwind` option to `asm!` which allows an `asm` block to unwind stack and be part of the stack unwinding process. This option is only supported by the LLVM backend right now.
3443"##,
3444 default_severity: Severity::Allow,
3445 warn_since: None,
3446 deny_since: None,
3447 },
3448 Lint {
3449 label: "associated_type_defaults",
3450 description: r##"# `associated_type_defaults`
3451
3452Allows associated type defaults.
3453
3454The tracking issue for this feature is: [#29661]
3455
3456[#29661]: https://github.com/rust-lang/rust/issues/29661
3457
3458------------------------
3459"##,
3460 default_severity: Severity::Allow,
3461 warn_since: None,
3462 deny_since: None,
3463 },
3464 Lint {
3465 label: "async_drop",
3466 description: r##"# `async_drop`
3467
3468Allows implementing `AsyncDrop`.
3469
3470The tracking issue for this feature is: [#126482]
3471
3472[#126482]: https://github.com/rust-lang/rust/issues/126482
3473
3474------------------------
3475"##,
3476 default_severity: Severity::Allow,
3477 warn_since: None,
3478 deny_since: None,
3479 },
3480 Lint {
3481 label: "async_fn_in_dyn_trait",
3482 description: r##"# `async_fn_in_dyn_trait`
3483
3484Allows async functions to be called from `dyn Trait`.
3485
3486The tracking issue for this feature is: [#133119]
3487
3488[#133119]: https://github.com/rust-lang/rust/issues/133119
3489
3490------------------------
3491"##,
3492 default_severity: Severity::Allow,
3493 warn_since: None,
3494 deny_since: None,
3495 },
3496 Lint {
3497 label: "async_fn_track_caller",
3498 description: r##"# `async_fn_track_caller`
3499
3500Allows `#[track_caller]` on async functions.
3501
3502The tracking issue for this feature is: [#110011]
3503
3504[#110011]: https://github.com/rust-lang/rust/issues/110011
3505
3506------------------------
3507"##,
3508 default_severity: Severity::Allow,
3509 warn_since: None,
3510 deny_since: None,
3511 },
3512 Lint {
3513 label: "async_fn_traits",
3514 description: r##"# `async_fn_traits`
3515
3516See Also: [`fn_traits`](../library-features/fn-traits.md)
3517
3518----
3519
3520The `async_fn_traits` feature allows for implementation of the [`AsyncFn*`] traits
3521for creating custom closure-like types that return futures.
3522
3523[`AsyncFn*`]: ../../std/ops/trait.AsyncFn.html
3524
3525The main difference to the `Fn*` family of traits is that `AsyncFn` can return a future
3526that borrows from itself (`FnOnce::Output` has no lifetime parameters, while `AsyncFnMut::CallRefFuture` does).
3527"##,
3528 default_severity: Severity::Allow,
3529 warn_since: None,
3530 deny_since: None,
3531 },
3532 Lint {
3533 label: "async_for_loop",
3534 description: r##"# `async_for_loop`
3535
3536Allows `for await` loops.
3537
3538The tracking issue for this feature is: [#118898]
3539
3540[#118898]: https://github.com/rust-lang/rust/issues/118898
3541
3542------------------------
3543"##,
3544 default_severity: Severity::Allow,
3545 warn_since: None,
3546 deny_since: None,
3547 },
3548 Lint {
3549 label: "async_gen_internals",
3550 description: r##"# `async_gen_internals`
3551
3552
3553
3554This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
3555
3556------------------------
3557"##,
3558 default_severity: Severity::Allow,
3559 warn_since: None,
3560 deny_since: None,
3561 },
3562 Lint {
3563 label: "async_iter_from_iter",
3564 description: r##"# `async_iter_from_iter`
3565
3566
3567
3568The tracking issue for this feature is: [#81798]
3569
3570[#81798]: https://github.com/rust-lang/rust/issues/81798
3571
3572------------------------
3573"##,
3574 default_severity: Severity::Allow,
3575 warn_since: None,
3576 deny_since: None,
3577 },
3578 Lint {
3579 label: "async_iterator",
3580 description: r##"# `async_iterator`
3581
3582
3583
3584The tracking issue for this feature is: [#79024]
3585
3586[#79024]: https://github.com/rust-lang/rust/issues/79024
3587
3588------------------------
3589"##,
3590 default_severity: Severity::Allow,
3591 warn_since: None,
3592 deny_since: None,
3593 },
3594 Lint {
3595 label: "async_trait_bounds",
3596 description: r##"# `async_trait_bounds`
3597
3598Allows `async` trait bound modifier.
3599
3600The tracking issue for this feature is: [#62290]
3601
3602[#62290]: https://github.com/rust-lang/rust/issues/62290
3603
3604------------------------
3605"##,
3606 default_severity: Severity::Allow,
3607 warn_since: None,
3608 deny_since: None,
3609 },
3610 Lint {
3611 label: "atomic_from_mut",
3612 description: r##"# `atomic_from_mut`
3613
3614
3615
3616The tracking issue for this feature is: [#76314]
3617
3618[#76314]: https://github.com/rust-lang/rust/issues/76314
3619
3620------------------------
3621"##,
3622 default_severity: Severity::Allow,
3623 warn_since: None,
3624 deny_since: None,
3625 },
3626 Lint {
3627 label: "atomic_internals",
3628 description: r##"# `atomic_internals`
3629
3630
3631
3632This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
3633
3634------------------------
3635"##,
3636 default_severity: Severity::Allow,
3637 warn_since: None,
3638 deny_since: None,
3639 },
3640 Lint {
3641 label: "atomic_ptr_null",
3642 description: r##"# `atomic_ptr_null`
3643
3644
3645
3646The tracking issue for this feature is: [#150733]
3647
3648[#150733]: https://github.com/rust-lang/rust/issues/150733
3649
3650------------------------
3651"##,
3652 default_severity: Severity::Allow,
3653 warn_since: None,
3654 deny_since: None,
3655 },
3656 Lint {
3657 label: "auto_traits",
3658 description: r##"# `auto_traits`
3659
3660The tracking issue for this feature is [#13231]
3661
3662[#13231]: https://github.com/rust-lang/rust/issues/13231
3663
3664----
3665
3666The `auto_traits` feature gate allows you to define auto traits.
3667
3668Auto traits, like [`Send`] or [`Sync`] in the standard library, are marker traits
3669that are automatically implemented for every type, unless the type, or a type it contains,
3670has explicitly opted out via a negative impl. (Negative impls are separately controlled
3671by the `negative_impls` feature.)
3672
3673[`Send`]: ../../std/marker/trait.Send.html
3674[`Sync`]: ../../std/marker/trait.Sync.html
3675
3676```rust,ignore (partial-example)
3677impl !Trait for Type {}
3678```
3679
3680Example:
3681
3682```rust
3683#![feature(negative_impls)]
3684#![feature(auto_traits)]
3685
3686auto trait Valid {}
3687
3688struct True;
3689struct False;
3690
3691impl !Valid for False {}
3692
3693struct MaybeValid<T>(T);
3694
3695fn must_be_valid<T: Valid>(_t: T) { }
3696
3697fn main() {
3698 // works
3699 must_be_valid( MaybeValid(True) );
3700
3701 // compiler error - trait bound not satisfied
3702 // must_be_valid( MaybeValid(False) );
3703}
3704```
3705
3706## Automatic trait implementations
3707
3708When a type is declared as an `auto trait`, we will automatically
3709create impls for every struct/enum/union, unless an explicit impl is
3710provided. These automatic impls contain a where clause for each field
3711of the form `T: AutoTrait`, where `T` is the type of the field and
3712`AutoTrait` is the auto trait in question. As an example, consider the
3713struct `List` and the auto trait `Send`:
3714
3715```rust
3716struct List<T> {
3717 data: T,
3718 next: Option<Box<List<T>>>,
3719}
3720```
3721
3722Presuming that there is no explicit impl of `Send` for `List`, the
3723compiler will supply an automatic impl of the form:
3724
3725```rust
3726struct List<T> {
3727 data: T,
3728 next: Option<Box<List<T>>>,
3729}
3730
3731unsafe impl<T> Send for List<T>
3732where
3733 T: Send, // from the field `data`
3734 Option<Box<List<T>>>: Send, // from the field `next`
3735{ }
3736```
3737
3738Explicit impls may be either positive or negative. They take the form:
3739
3740```rust,ignore (partial-example)
3741impl<...> AutoTrait for StructName<..> { }
3742impl<...> !AutoTrait for StructName<..> { }
3743```
3744
3745## Coinduction: Auto traits permit cyclic matching
3746
3747Unlike ordinary trait matching, auto traits are **coinductive**. This
3748means, in short, that cycles which occur in trait matching are
3749considered ok. As an example, consider the recursive struct `List`
3750introduced in the previous section. In attempting to determine whether
3751`List: Send`, we would wind up in a cycle: to apply the impl, we must
3752show that `Option<Box<List>>: Send`, which will in turn require
3753`Box<List>: Send` and then finally `List: Send` again. Under ordinary
3754trait matching, this cycle would be an error, but for an auto trait it
3755is considered a successful match.
3756
3757## Items
3758
3759Auto traits cannot have any trait items, such as methods or associated types. This ensures that we can generate default implementations.
3760
3761## Supertraits
3762
3763Auto traits cannot have supertraits. This is for soundness reasons, as the interaction of coinduction with implied bounds is difficult to reconcile.
3764"##,
3765 default_severity: Severity::Allow,
3766 warn_since: None,
3767 deny_since: None,
3768 },
3769 Lint {
3770 label: "autodiff",
3771 description: r##"# `autodiff`
3772
3773
3774
3775The tracking issue for this feature is: [#124509]
3776
3777[#124509]: https://github.com/rust-lang/rust/issues/124509
3778
3779------------------------
3780"##,
3781 default_severity: Severity::Allow,
3782 warn_since: None,
3783 deny_since: None,
3784 },
3785 Lint {
3786 label: "avr_target_feature",
3787 description: r##"# `avr_target_feature`
3788
3789Target features on avr.
3790
3791The tracking issue for this feature is: [#146889]
3792
3793[#146889]: https://github.com/rust-lang/rust/issues/146889
3794
3795------------------------
3796"##,
3797 default_severity: Severity::Allow,
3798 warn_since: None,
3799 deny_since: None,
3800 },
3801 Lint {
3802 label: "avx10_target_feature",
3803 description: r##"# `avx10_target_feature`
3804
3805Allows using Intel AVX10 target features and intrinsics
3806
3807The tracking issue for this feature is: [#138843]
3808
3809[#138843]: https://github.com/rust-lang/rust/issues/138843
3810
3811------------------------
3812"##,
3813 default_severity: Severity::Allow,
3814 warn_since: None,
3815 deny_since: None,
3816 },
3817 Lint {
3818 label: "backtrace_frames",
3819 description: r##"# `backtrace_frames`
3820
3821
3822
3823The tracking issue for this feature is: [#79676]
3824
3825[#79676]: https://github.com/rust-lang/rust/issues/79676
3826
3827------------------------
3828"##,
3829 default_severity: Severity::Allow,
3830 warn_since: None,
3831 deny_since: None,
3832 },
3833 Lint {
3834 label: "bikeshed_guaranteed_no_drop",
3835 description: r##"# `bikeshed_guaranteed_no_drop`
3836
3837
3838
3839This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
3840
3841------------------------
3842"##,
3843 default_severity: Severity::Allow,
3844 warn_since: None,
3845 deny_since: None,
3846 },
3847 Lint {
3848 label: "binary_heap_as_mut_slice",
3849 description: r##"# `binary_heap_as_mut_slice`
3850
3851
3852
3853The tracking issue for this feature is: [#154009]
3854
3855[#154009]: https://github.com/rust-lang/rust/issues/154009
3856
3857------------------------
3858"##,
3859 default_severity: Severity::Allow,
3860 warn_since: None,
3861 deny_since: None,
3862 },
3863 Lint {
3864 label: "binary_heap_drain_sorted",
3865 description: r##"# `binary_heap_drain_sorted`
3866
3867
3868
3869The tracking issue for this feature is: [#59278]
3870
3871[#59278]: https://github.com/rust-lang/rust/issues/59278
3872
3873------------------------
3874"##,
3875 default_severity: Severity::Allow,
3876 warn_since: None,
3877 deny_since: None,
3878 },
3879 Lint {
3880 label: "binary_heap_from_raw_vec",
3881 description: r##"# `binary_heap_from_raw_vec`
3882
3883
3884
3885The tracking issue for this feature is: [#152500]
3886
3887[#152500]: https://github.com/rust-lang/rust/issues/152500
3888
3889------------------------
3890"##,
3891 default_severity: Severity::Allow,
3892 warn_since: None,
3893 deny_since: None,
3894 },
3895 Lint {
3896 label: "binary_heap_into_iter_sorted",
3897 description: r##"# `binary_heap_into_iter_sorted`
3898
3899
3900
3901The tracking issue for this feature is: [#59278]
3902
3903[#59278]: https://github.com/rust-lang/rust/issues/59278
3904
3905------------------------
3906"##,
3907 default_severity: Severity::Allow,
3908 warn_since: None,
3909 deny_since: None,
3910 },
3911 Lint {
3912 label: "binary_heap_peek_mut_refresh",
3913 description: r##"# `binary_heap_peek_mut_refresh`
3914
3915
3916
3917The tracking issue for this feature is: [#138355]
3918
3919[#138355]: https://github.com/rust-lang/rust/issues/138355
3920
3921------------------------
3922"##,
3923 default_severity: Severity::Allow,
3924 warn_since: None,
3925 deny_since: None,
3926 },
3927 Lint {
3928 label: "binary_heap_pop_if",
3929 description: r##"# `binary_heap_pop_if`
3930
3931
3932
3933The tracking issue for this feature is: [#151828]
3934
3935[#151828]: https://github.com/rust-lang/rust/issues/151828
3936
3937------------------------
3938"##,
3939 default_severity: Severity::Allow,
3940 warn_since: None,
3941 deny_since: None,
3942 },
3943 Lint {
3944 label: "borrowed_buf_init",
3945 description: r##"# `borrowed_buf_init`
3946
3947
3948
3949The tracking issue for this feature is: [#78485]
3950
3951[#78485]: https://github.com/rust-lang/rust/issues/78485
3952
3953------------------------
3954"##,
3955 default_severity: Severity::Allow,
3956 warn_since: None,
3957 deny_since: None,
3958 },
3959 Lint {
3960 label: "bound_as_ref",
3961 description: r##"# `bound_as_ref`
3962
3963
3964
3965The tracking issue for this feature is: [#80996]
3966
3967[#80996]: https://github.com/rust-lang/rust/issues/80996
3968
3969------------------------
3970"##,
3971 default_severity: Severity::Allow,
3972 warn_since: None,
3973 deny_since: None,
3974 },
3975 Lint {
3976 label: "bound_copied",
3977 description: r##"# `bound_copied`
3978
3979
3980
3981The tracking issue for this feature is: [#145966]
3982
3983[#145966]: https://github.com/rust-lang/rust/issues/145966
3984
3985------------------------
3986"##,
3987 default_severity: Severity::Allow,
3988 warn_since: None,
3989 deny_since: None,
3990 },
3991 Lint {
3992 label: "box_as_ptr",
3993 description: r##"# `box_as_ptr`
3994
3995
3996
3997The tracking issue for this feature is: [#129090]
3998
3999[#129090]: https://github.com/rust-lang/rust/issues/129090
4000
4001------------------------
4002"##,
4003 default_severity: Severity::Allow,
4004 warn_since: None,
4005 deny_since: None,
4006 },
4007 Lint {
4008 label: "box_into_boxed_slice",
4009 description: r##"# `box_into_boxed_slice`
4010
4011
4012
4013The tracking issue for this feature is: [#71582]
4014
4015[#71582]: https://github.com/rust-lang/rust/issues/71582
4016
4017------------------------
4018"##,
4019 default_severity: Severity::Allow,
4020 warn_since: None,
4021 deny_since: None,
4022 },
4023 Lint {
4024 label: "box_into_inner",
4025 description: r##"# `box_into_inner`
4026
4027
4028
4029The tracking issue for this feature is: [#80437]
4030
4031[#80437]: https://github.com/rust-lang/rust/issues/80437
4032
4033------------------------
4034"##,
4035 default_severity: Severity::Allow,
4036 warn_since: None,
4037 deny_since: None,
4038 },
4039 Lint {
4040 label: "box_patterns",
4041 description: r##"# `box_patterns`
4042
4043The tracking issue for this feature is: [#29641]
4044
4045[#29641]: https://github.com/rust-lang/rust/issues/29641
4046
4047------------------------
4048
4049> **Note**: This feature will be superseded by [`deref_patterns`] in the future.
4050
4051Box patterns let you match on `Box<T>`s:
4052
4053
4054```rust
4055#![feature(box_patterns)]
4056
4057fn main() {
4058 let b = Some(Box::new(5));
4059 match b {
4060 Some(box n) if n < 0 => {
4061 println!("Box contains negative number {n}");
4062 },
4063 Some(box n) if n >= 0 => {
4064 println!("Box contains non-negative number {n}");
4065 },
4066 None => {
4067 println!("No box");
4068 },
4069 _ => unreachable!()
4070 }
4071}
4072```
4073
4074[`deref_patterns`]: ./deref-patterns.md
4075"##,
4076 default_severity: Severity::Allow,
4077 warn_since: None,
4078 deny_since: None,
4079 },
4080 Lint {
4081 label: "box_take",
4082 description: r##"# `box_take`
4083
4084
4085
4086The tracking issue for this feature is: [#147212]
4087
4088[#147212]: https://github.com/rust-lang/rust/issues/147212
4089
4090------------------------
4091"##,
4092 default_severity: Severity::Allow,
4093 warn_since: None,
4094 deny_since: None,
4095 },
4096 Lint {
4097 label: "box_vec_non_null",
4098 description: r##"# `box_vec_non_null`
4099
4100
4101
4102The tracking issue for this feature is: [#130364]
4103
4104[#130364]: https://github.com/rust-lang/rust/issues/130364
4105
4106------------------------
4107"##,
4108 default_severity: Severity::Allow,
4109 warn_since: None,
4110 deny_since: None,
4111 },
4112 Lint {
4113 label: "bpf_target_feature",
4114 description: r##"# `bpf_target_feature`
4115
4116Target features on bpf.
4117
4118The tracking issue for this feature is: [#150247]
4119
4120[#150247]: https://github.com/rust-lang/rust/issues/150247
4121
4122------------------------
4123"##,
4124 default_severity: Severity::Allow,
4125 warn_since: None,
4126 deny_since: None,
4127 },
4128 Lint {
4129 label: "breakpoint",
4130 description: r##"# `breakpoint`
4131
4132
4133
4134The tracking issue for this feature is: [#133724]
4135
4136[#133724]: https://github.com/rust-lang/rust/issues/133724
4137
4138------------------------
4139"##,
4140 default_severity: Severity::Allow,
4141 warn_since: None,
4142 deny_since: None,
4143 },
4144 Lint {
4145 label: "bstr",
4146 description: r##"# `bstr`
4147
4148
4149
4150The tracking issue for this feature is: [#134915]
4151
4152[#134915]: https://github.com/rust-lang/rust/issues/134915
4153
4154------------------------
4155"##,
4156 default_severity: Severity::Allow,
4157 warn_since: None,
4158 deny_since: None,
4159 },
4160 Lint {
4161 label: "bstr_internals",
4162 description: r##"# `bstr_internals`
4163
4164
4165
4166This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
4167
4168------------------------
4169"##,
4170 default_severity: Severity::Allow,
4171 warn_since: None,
4172 deny_since: None,
4173 },
4174 Lint {
4175 label: "btree_cursors",
4176 description: r##"# `btree_cursors`
4177
4178
4179
4180The tracking issue for this feature is: [#107540]
4181
4182[#107540]: https://github.com/rust-lang/rust/issues/107540
4183
4184------------------------
4185"##,
4186 default_severity: Severity::Allow,
4187 warn_since: None,
4188 deny_since: None,
4189 },
4190 Lint {
4191 label: "btree_merge",
4192 description: r##"# `btree_merge`
4193
4194
4195
4196The tracking issue for this feature is: [#152152]
4197
4198[#152152]: https://github.com/rust-lang/rust/issues/152152
4199
4200------------------------
4201"##,
4202 default_severity: Severity::Allow,
4203 warn_since: None,
4204 deny_since: None,
4205 },
4206 Lint {
4207 label: "btree_set_entry",
4208 description: r##"# `btree_set_entry`
4209
4210
4211
4212The tracking issue for this feature is: [#133549]
4213
4214[#133549]: https://github.com/rust-lang/rust/issues/133549
4215
4216------------------------
4217"##,
4218 default_severity: Severity::Allow,
4219 warn_since: None,
4220 deny_since: None,
4221 },
4222 Lint {
4223 label: "btreemap_alloc",
4224 description: r##"# `btreemap_alloc`
4225
4226
4227
4228The tracking issue for this feature is: [#32838]
4229
4230[#32838]: https://github.com/rust-lang/rust/issues/32838
4231
4232------------------------
4233"##,
4234 default_severity: Severity::Allow,
4235 warn_since: None,
4236 deny_since: None,
4237 },
4238 Lint {
4239 label: "buf_read_has_data_left",
4240 description: r##"# `buf_read_has_data_left`
4241
4242
4243
4244The tracking issue for this feature is: [#86423]
4245
4246[#86423]: https://github.com/rust-lang/rust/issues/86423
4247
4248------------------------
4249"##,
4250 default_severity: Severity::Allow,
4251 warn_since: None,
4252 deny_since: None,
4253 },
4254 Lint {
4255 label: "bufreader_peek",
4256 description: r##"# `bufreader_peek`
4257
4258
4259
4260The tracking issue for this feature is: [#128405]
4261
4262[#128405]: https://github.com/rust-lang/rust/issues/128405
4263
4264------------------------
4265"##,
4266 default_severity: Severity::Allow,
4267 warn_since: None,
4268 deny_since: None,
4269 },
4270 Lint {
4271 label: "builtin_syntax",
4272 description: r##"# `builtin_syntax`
4273
4274Allows builtin # foo() syntax
4275
4276The tracking issue for this feature is: [#110680]
4277
4278[#110680]: https://github.com/rust-lang/rust/issues/110680
4279
4280------------------------
4281"##,
4282 default_severity: Severity::Allow,
4283 warn_since: None,
4284 deny_since: None,
4285 },
4286 Lint {
4287 label: "c_size_t",
4288 description: r##"# `c_size_t`
4289
4290
4291
4292The tracking issue for this feature is: [#88345]
4293
4294[#88345]: https://github.com/rust-lang/rust/issues/88345
4295
4296------------------------
4297"##,
4298 default_severity: Severity::Allow,
4299 warn_since: None,
4300 deny_since: None,
4301 },
4302 Lint {
4303 label: "c_variadic",
4304 description: r##"# `c_variadic`
4305
4306The tracking issue for this feature is: [#44930]
4307
4308[#44930]: https://github.com/rust-lang/rust/issues/44930
4309
4310------------------------
4311
4312The `c_variadic` language feature enables C-variadic functions to be
4313defined in Rust. They may be called both from within Rust and via FFI.
4314
4315## Examples
4316
4317```rust
4318#![feature(c_variadic)]
4319
4320pub unsafe extern "C" fn add(n: usize, mut args: ...) -> usize {
4321 let mut sum = 0;
4322 for _ in 0..n {
4323 sum += args.next_arg::<usize>();
4324 }
4325 sum
4326}
4327```
4328"##,
4329 default_severity: Severity::Allow,
4330 warn_since: None,
4331 deny_since: None,
4332 },
4333 Lint {
4334 label: "c_variadic_experimental_arch",
4335 description: r##"# `c_variadic_experimental_arch`
4336
4337Allows defining c-variadic functions on targets where this feature has not yet undergone sufficient testing for stabilization.
4338
4339The tracking issue for this feature is: [#155973]
4340
4341[#155973]: https://github.com/rust-lang/rust/issues/155973
4342
4343------------------------
4344"##,
4345 default_severity: Severity::Allow,
4346 warn_since: None,
4347 deny_since: None,
4348 },
4349 Lint {
4350 label: "c_variadic_naked_functions",
4351 description: r##"# `c_variadic_naked_functions`
4352
4353Allows defining c-variadic naked functions with any extern ABI that is allowed on c-variadic foreign functions.
4354
4355The tracking issue for this feature is: [#148767]
4356
4357[#148767]: https://github.com/rust-lang/rust/issues/148767
4358
4359------------------------
4360"##,
4361 default_severity: Severity::Allow,
4362 warn_since: None,
4363 deny_since: None,
4364 },
4365 Lint {
4366 label: "c_void_variant",
4367 description: r##"# `c_void_variant`
4368
4369This feature is internal to the Rust compiler and is not intended for general use.
4370
4371------------------------
4372"##,
4373 default_severity: Severity::Allow,
4374 warn_since: None,
4375 deny_since: None,
4376 },
4377 Lint {
4378 label: "can_vector",
4379 description: r##"# `can_vector`
4380
4381
4382
4383The tracking issue for this feature is: [#69941]
4384
4385[#69941]: https://github.com/rust-lang/rust/issues/69941
4386
4387------------------------
4388"##,
4389 default_severity: Severity::Allow,
4390 warn_since: None,
4391 deny_since: None,
4392 },
4393 Lint {
4394 label: "case_ignorable",
4395 description: r##"# `case_ignorable`
4396
4397
4398
4399The tracking issue for this feature is: [#154848]
4400
4401[#154848]: https://github.com/rust-lang/rust/issues/154848
4402
4403------------------------
4404"##,
4405 default_severity: Severity::Allow,
4406 warn_since: None,
4407 deny_since: None,
4408 },
4409 Lint {
4410 label: "cast_maybe_uninit",
4411 description: r##"# `cast_maybe_uninit`
4412
4413
4414
4415The tracking issue for this feature is: [#145036]
4416
4417[#145036]: https://github.com/rust-lang/rust/issues/145036
4418
4419------------------------
4420"##,
4421 default_severity: Severity::Allow,
4422 warn_since: None,
4423 deny_since: None,
4424 },
4425 Lint {
4426 label: "cell_get_cloned",
4427 description: r##"# `cell_get_cloned`
4428
4429
4430
4431The tracking issue for this feature is: [#145329]
4432
4433[#145329]: https://github.com/rust-lang/rust/issues/145329
4434
4435------------------------
4436"##,
4437 default_severity: Severity::Allow,
4438 warn_since: None,
4439 deny_since: None,
4440 },
4441 Lint {
4442 label: "cell_leak",
4443 description: r##"# `cell_leak`
4444
4445
4446
4447The tracking issue for this feature is: [#69099]
4448
4449[#69099]: https://github.com/rust-lang/rust/issues/69099
4450
4451------------------------
4452"##,
4453 default_severity: Severity::Allow,
4454 warn_since: None,
4455 deny_since: None,
4456 },
4457 Lint {
4458 label: "cfg_accessible",
4459 description: r##"# `cfg_accessible`
4460
4461
4462
4463The tracking issue for this feature is: [#64797]
4464
4465[#64797]: https://github.com/rust-lang/rust/issues/64797
4466
4467------------------------
4468"##,
4469 default_severity: Severity::Allow,
4470 warn_since: None,
4471 deny_since: None,
4472 },
4473 Lint {
4474 label: "cfg_contract_checks",
4475 description: r##"# `cfg_contract_checks`
4476
4477Allows the use of `#[cfg(contract_checks)` to check if contract checks are enabled.
4478
4479The tracking issue for this feature is: [#128044]
4480
4481[#128044]: https://github.com/rust-lang/rust/issues/128044
4482
4483------------------------
4484"##,
4485 default_severity: Severity::Allow,
4486 warn_since: None,
4487 deny_since: None,
4488 },
4489 Lint {
4490 label: "cfg_eval",
4491 description: r##"# `cfg_eval`
4492
4493
4494
4495The tracking issue for this feature is: [#82679]
4496
4497[#82679]: https://github.com/rust-lang/rust/issues/82679
4498
4499------------------------
4500"##,
4501 default_severity: Severity::Allow,
4502 warn_since: None,
4503 deny_since: None,
4504 },
4505 Lint {
4506 label: "cfg_overflow_checks",
4507 description: r##"# `cfg_overflow_checks`
4508
4509Allows the use of `#[cfg(overflow_checks)` to check if integer overflow behaviour.
4510
4511The tracking issue for this feature is: [#111466]
4512
4513[#111466]: https://github.com/rust-lang/rust/issues/111466
4514
4515------------------------
4516"##,
4517 default_severity: Severity::Allow,
4518 warn_since: None,
4519 deny_since: None,
4520 },
4521 Lint {
4522 label: "cfg_relocation_model",
4523 description: r##"# `cfg_relocation_model`
4524
4525Provides the relocation model information as cfg entry
4526
4527The tracking issue for this feature is: [#114929]
4528
4529[#114929]: https://github.com/rust-lang/rust/issues/114929
4530
4531------------------------
4532"##,
4533 default_severity: Severity::Allow,
4534 warn_since: None,
4535 deny_since: None,
4536 },
4537 Lint {
4538 label: "cfg_sanitize",
4539 description: r##"# `cfg_sanitize`
4540
4541The tracking issue for this feature is: [#39699]
4542
4543[#39699]: https://github.com/rust-lang/rust/issues/39699
4544
4545------------------------
4546
4547The `cfg_sanitize` feature makes it possible to execute different code
4548depending on whether a particular sanitizer is enabled or not.
4549
4550## Examples
4551
4552```rust
4553#![feature(cfg_sanitize)]
4554
4555#[cfg(sanitize = "thread")]
4556fn a() {
4557 // ...
4558}
4559
4560#[cfg(not(sanitize = "thread"))]
4561fn a() {
4562 // ...
4563}
4564
4565fn b() {
4566 if cfg!(sanitize = "leak") {
4567 // ...
4568 } else {
4569 // ...
4570 }
4571}
4572```
4573"##,
4574 default_severity: Severity::Allow,
4575 warn_since: None,
4576 deny_since: None,
4577 },
4578 Lint {
4579 label: "cfg_sanitizer_cfi",
4580 description: r##"# `cfg_sanitizer_cfi`
4581
4582Allows `cfg(sanitizer_cfi_generalize_pointers)` and `cfg(sanitizer_cfi_normalize_integers)`.
4583
4584The tracking issue for this feature is: [#89653]
4585
4586[#89653]: https://github.com/rust-lang/rust/issues/89653
4587
4588------------------------
4589"##,
4590 default_severity: Severity::Allow,
4591 warn_since: None,
4592 deny_since: None,
4593 },
4594 Lint {
4595 label: "cfg_target_compact",
4596 description: r##"# `cfg_target_compact`
4597
4598Allows `cfg(target(abi = "..."))`.
4599
4600The tracking issue for this feature is: [#96901]
4601
4602[#96901]: https://github.com/rust-lang/rust/issues/96901
4603
4604------------------------
4605"##,
4606 default_severity: Severity::Allow,
4607 warn_since: None,
4608 deny_since: None,
4609 },
4610 Lint {
4611 label: "cfg_target_has_atomic",
4612 description: r##"# `cfg_target_has_atomic`
4613
4614Allows `cfg(target_has_atomic_load_store = "...")`.
4615
4616The tracking issue for this feature is: [#94039]
4617
4618[#94039]: https://github.com/rust-lang/rust/issues/94039
4619
4620------------------------
4621"##,
4622 default_severity: Severity::Allow,
4623 warn_since: None,
4624 deny_since: None,
4625 },
4626 Lint {
4627 label: "cfg_target_has_reliable_f16_f128",
4628 description: r##"# `cfg_target_has_reliable_f16_f128`
4629
4630Allows checking whether or not the backend correctly supports unstable float types.
4631
4632This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
4633
4634------------------------
4635"##,
4636 default_severity: Severity::Allow,
4637 warn_since: None,
4638 deny_since: None,
4639 },
4640 Lint {
4641 label: "cfg_target_object_format",
4642 description: r##"# `cfg_target_object_format`
4643
4644The tracking issue for this feature is: [#152586]
4645
4646[#152586]: https://github.com/rust-lang/rust/issues/152586
4647
4648------------------------
4649
4650The `cfg_target_object_format` feature makes it possible to execute different code
4651depending on the current target's object file format.
4652
4653## Examples
4654
4655```rust
4656#![feature(cfg_target_object_format)]
4657
4658#[cfg(target_object_format = "elf")]
4659fn a() {
4660 // ...
4661}
4662
4663#[cfg(target_object_format = "mach-o")]
4664fn a() {
4665 // ...
4666}
4667
4668fn b() {
4669 if cfg!(target_object_format = "wasm") {
4670 // ...
4671 } else {
4672 // ...
4673 }
4674}
4675```
4676"##,
4677 default_severity: Severity::Allow,
4678 warn_since: None,
4679 deny_since: None,
4680 },
4681 Lint {
4682 label: "cfg_target_thread_local",
4683 description: r##"# `cfg_target_thread_local`
4684
4685Allows `cfg(target_thread_local)`.
4686
4687The tracking issue for this feature is: [#29594]
4688
4689[#29594]: https://github.com/rust-lang/rust/issues/29594
4690
4691------------------------
4692"##,
4693 default_severity: Severity::Allow,
4694 warn_since: None,
4695 deny_since: None,
4696 },
4697 Lint {
4698 label: "cfg_ub_checks",
4699 description: r##"# `cfg_ub_checks`
4700
4701Allows the use of `#[cfg(ub_checks)` to check if UB checks are enabled.
4702
4703The tracking issue for this feature is: [#123499]
4704
4705[#123499]: https://github.com/rust-lang/rust/issues/123499
4706
4707------------------------
4708"##,
4709 default_severity: Severity::Allow,
4710 warn_since: None,
4711 deny_since: None,
4712 },
4713 Lint {
4714 label: "cfg_version",
4715 description: r##"# `cfg_version`
4716
4717The tracking issue for this feature is: [#64796]
4718
4719[#64796]: https://github.com/rust-lang/rust/issues/64796
4720
4721------------------------
4722
4723The `cfg_version` feature makes it possible to execute different code
4724depending on the compiler version. It will return true if the compiler
4725version is greater than or equal to the specified version.
4726
4727## Examples
4728
4729```rust
4730#![feature(cfg_version)]
4731
4732#[cfg(version("1.42"))] // 1.42 and above
4733fn a() {
4734 // ...
4735}
4736
4737#[cfg(not(version("1.42")))] // 1.41 and below
4738fn a() {
4739 // ...
4740}
4741
4742fn b() {
4743 if cfg!(version("1.42")) {
4744 // ...
4745 } else {
4746 // ...
4747 }
4748}
4749```
4750"##,
4751 default_severity: Severity::Allow,
4752 warn_since: None,
4753 deny_since: None,
4754 },
4755 Lint {
4756 label: "cfi_encoding",
4757 description: r##"# `cfi_encoding`
4758
4759The tracking issue for this feature is: [#89653]
4760
4761[#89653]: https://github.com/rust-lang/rust/issues/89653
4762
4763------------------------
4764
4765The `cfi_encoding` feature allows the user to define a CFI encoding for a type.
4766It allows the user to use a different names for types that otherwise would be
4767required to have the same name as used in externally defined C functions.
4768
4769## Examples
4770
4771```rust
4772#![feature(cfi_encoding, extern_types)]
4773
4774#[cfi_encoding = "3Foo"]
4775pub struct Type1(i32);
4776
4777extern {
4778 #[cfi_encoding = "3Bar"]
4779 type Type2;
4780}
4781```
4782"##,
4783 default_severity: Severity::Allow,
4784 warn_since: None,
4785 deny_since: None,
4786 },
4787 Lint {
4788 label: "char_internals",
4789 description: r##"# `char_internals`
4790
4791
4792
4793This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
4794
4795------------------------
4796"##,
4797 default_severity: Severity::Allow,
4798 warn_since: None,
4799 deny_since: None,
4800 },
4801 Lint {
4802 label: "clamp_magnitude",
4803 description: r##"# `clamp_magnitude`
4804
4805
4806
4807The tracking issue for this feature is: [#148519]
4808
4809[#148519]: https://github.com/rust-lang/rust/issues/148519
4810
4811------------------------
4812"##,
4813 default_severity: Severity::Allow,
4814 warn_since: None,
4815 deny_since: None,
4816 },
4817 Lint {
4818 label: "clflushopt_target_feature",
4819 description: r##"# `clflushopt_target_feature`
4820
4821The `clflushopt` target feature on x86.
4822
4823The tracking issue for this feature is: [#157096]
4824
4825[#157096]: https://github.com/rust-lang/rust/issues/157096
4826
4827------------------------
4828"##,
4829 default_severity: Severity::Allow,
4830 warn_since: None,
4831 deny_since: None,
4832 },
4833 Lint {
4834 label: "clone_from_ref",
4835 description: r##"# `clone_from_ref`
4836
4837
4838
4839The tracking issue for this feature is: [#149075]
4840
4841[#149075]: https://github.com/rust-lang/rust/issues/149075
4842
4843------------------------
4844"##,
4845 default_severity: Severity::Allow,
4846 warn_since: None,
4847 deny_since: None,
4848 },
4849 Lint {
4850 label: "clone_to_uninit",
4851 description: r##"# `clone_to_uninit`
4852
4853
4854
4855The tracking issue for this feature is: [#126799]
4856
4857[#126799]: https://github.com/rust-lang/rust/issues/126799
4858
4859------------------------
4860"##,
4861 default_severity: Severity::Allow,
4862 warn_since: None,
4863 deny_since: None,
4864 },
4865 Lint {
4866 label: "closure_lifetime_binder",
4867 description: r##"# `closure_lifetime_binder`
4868
4869Allows `for<...>` on closures and coroutines.
4870
4871The tracking issue for this feature is: [#97362]
4872
4873[#97362]: https://github.com/rust-lang/rust/issues/97362
4874
4875------------------------
4876"##,
4877 default_severity: Severity::Allow,
4878 warn_since: None,
4879 deny_since: None,
4880 },
4881 Lint {
4882 label: "closure_track_caller",
4883 description: r##"# `closure_track_caller`
4884
4885The tracking issue for this feature is: [#87417]
4886
4887[#87417]: https://github.com/rust-lang/rust/issues/87417
4888
4889------------------------
4890
4891Allows using the `#[track_caller]` attribute on closures and coroutines.
4892Calls made to the closure or coroutine will have caller information
4893available through `std::panic::Location::caller()`, just like using
4894`#[track_caller]` on a function.
4895"##,
4896 default_severity: Severity::Allow,
4897 warn_since: None,
4898 deny_since: None,
4899 },
4900 Lint {
4901 label: "cmp_minmax",
4902 description: r##"# `cmp_minmax`
4903
4904
4905
4906The tracking issue for this feature is: [#115939]
4907
4908[#115939]: https://github.com/rust-lang/rust/issues/115939
4909
4910------------------------
4911"##,
4912 default_severity: Severity::Allow,
4913 warn_since: None,
4914 deny_since: None,
4915 },
4916 Lint {
4917 label: "cmse_nonsecure_entry",
4918 description: r##"# `cmse_nonsecure_entry`
4919
4920The tracking issue for this feature is: [#75835]
4921
4922[#75835]: https://github.com/rust-lang/rust/issues/75835
4923
4924------------------------
4925
4926The [TrustZone-M
4927feature](https://developer.arm.com/documentation/100690/latest/) is available
4928for targets with the Armv8-M architecture profile (`thumbv8m` in their target
4929name).
4930LLVM, the Rust compiler and the linker are providing
4931[support](https://developer.arm.com/documentation/ecm0359818/latest/) for the
4932TrustZone-M feature.
4933
4934One of the things provided with this unstable feature is the "cmse-nonsecure-entry" ABI.
4935This ABI marks a Secure function as an entry function (see
4936[section 5.4](https://developer.arm.com/documentation/ecm0359818/latest/) for details).
4937With this ABI, the compiler will do the following:
4938* add a special symbol on the function which is the `__acle_se_` prefix and the
4939 standard function name
4940* constrain the number of parameters to avoid using the Non-Secure stack
4941* before returning from the function, clear registers that might contain Secure
4942 information
4943* use the `BXNS` instruction to return
4944
4945Because the stack can not be used to pass parameters, there will be compilation
4946errors if:
4947* the total size of all parameters is too big (for example, more than four 32-bit integers)
4948
4949The special symbol `__acle_se_` will be used by the linker to generate a secure
4950gateway veneer.
4951
4952<!-- NOTE(ignore) this example is specific to thumbv8m targets -->
4953
4954``` rust,ignore
4955#![no_std]
4956#![feature(cmse_nonsecure_entry)]
4957
4958#[no_mangle]
4959pub extern "cmse-nonsecure-entry" fn entry_function(input: u32) -> u32 {
4960 input + 6
4961}
4962```
4963
4964``` text
4965$ rustc --emit obj --crate-type lib --target thumbv8m.main-none-eabi function.rs
4966$ arm-none-eabi-objdump -D function.o
4967
496800000000 <entry_function>:
4969 0: b580 push {r7, lr}
4970 2: 466f mov r7, sp
4971 4: b082 sub sp, #8
4972 6: 9001 str r0, [sp, #4]
4973 8: 1d81 adds r1, r0, #6
4974 a: 460a mov r2, r1
4975 c: 4281 cmp r1, r0
4976 e: 9200 str r2, [sp, #0]
4977 10: d30b bcc.n 2a <entry_function+0x2a>
4978 12: e7ff b.n 14 <entry_function+0x14>
4979 14: 9800 ldr r0, [sp, #0]
4980 16: b002 add sp, #8
4981 18: e8bd 4080 ldmia.w sp!, {r7, lr}
4982 1c: 4671 mov r1, lr
4983 1e: 4672 mov r2, lr
4984 20: 4673 mov r3, lr
4985 22: 46f4 mov ip, lr
4986 24: f38e 8800 msr CPSR_f, lr
4987 28: 4774 bxns lr
4988 2a: f240 0000 movw r0, #0
4989 2e: f2c0 0000 movt r0, #0
4990 32: f240 0200 movw r2, #0
4991 36: f2c0 0200 movt r2, #0
4992 3a: 211c movs r1, #28
4993 3c: f7ff fffe bl 0 <_ZN4core9panicking5panic17h5c028258ca2fb3f5E>
4994 40: defe udf #254 ; 0xfe
4995```
4996"##,
4997 default_severity: Severity::Allow,
4998 warn_since: None,
4999 deny_since: None,
5000 },
5001 Lint {
5002 label: "coerce_pointee_validated",
5003 description: r##"# `coerce_pointee_validated`
5004
5005
5006
5007This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
5008
5009------------------------
5010"##,
5011 default_severity: Severity::Allow,
5012 warn_since: None,
5013 deny_since: None,
5014 },
5015 Lint {
5016 label: "coerce_unsized",
5017 description: r##"# `coerce_unsized`
5018
5019
5020
5021The tracking issue for this feature is: [#18598]
5022
5023[#18598]: https://github.com/rust-lang/rust/issues/18598
5024
5025------------------------
5026"##,
5027 default_severity: Severity::Allow,
5028 warn_since: None,
5029 deny_since: None,
5030 },
5031 Lint {
5032 label: "command_resolved_envs",
5033 description: r##"# `command_resolved_envs`
5034
5035
5036
5037The tracking issue for this feature is: [#149070]
5038
5039[#149070]: https://github.com/rust-lang/rust/issues/149070
5040
5041------------------------
5042"##,
5043 default_severity: Severity::Allow,
5044 warn_since: None,
5045 deny_since: None,
5046 },
5047 Lint {
5048 label: "compiler_builtins",
5049 description: r##"# `compiler_builtins`
5050
5051This feature is internal to the Rust compiler and is not intended for general use.
5052
5053------------------------
5054"##,
5055 default_severity: Severity::Allow,
5056 warn_since: None,
5057 deny_since: None,
5058 },
5059 Lint {
5060 label: "concat_bytes",
5061 description: r##"# `concat_bytes`
5062
5063
5064
5065The tracking issue for this feature is: [#87555]
5066
5067[#87555]: https://github.com/rust-lang/rust/issues/87555
5068
5069------------------------
5070"##,
5071 default_severity: Severity::Allow,
5072 warn_since: None,
5073 deny_since: None,
5074 },
5075 Lint {
5076 label: "const_alloc_error",
5077 description: r##"# `const_alloc_error`
5078
5079
5080
5081The tracking issue for this feature is: [#92523]
5082
5083[#92523]: https://github.com/rust-lang/rust/issues/92523
5084
5085------------------------
5086"##,
5087 default_severity: Severity::Allow,
5088 warn_since: None,
5089 deny_since: None,
5090 },
5091 Lint {
5092 label: "const_array",
5093 description: r##"# `const_array`
5094
5095
5096
5097The tracking issue for this feature is: [#147606]
5098
5099[#147606]: https://github.com/rust-lang/rust/issues/147606
5100
5101------------------------
5102"##,
5103 default_severity: Severity::Allow,
5104 warn_since: None,
5105 deny_since: None,
5106 },
5107 Lint {
5108 label: "const_async_blocks",
5109 description: r##"# `const_async_blocks`
5110
5111Allows `async {}` expressions in const contexts.
5112
5113The tracking issue for this feature is: [#85368]
5114
5115[#85368]: https://github.com/rust-lang/rust/issues/85368
5116
5117------------------------
5118"##,
5119 default_severity: Severity::Allow,
5120 warn_since: None,
5121 deny_since: None,
5122 },
5123 Lint {
5124 label: "const_block_items",
5125 description: r##"# `const_block_items`
5126
5127Allows `const { ... }` as a shorthand for `const _: () = const { ... };` for module items.
5128
5129The tracking issue for this feature is: [#149226]
5130
5131[#149226]: https://github.com/rust-lang/rust/issues/149226
5132
5133------------------------
5134"##,
5135 default_severity: Severity::Allow,
5136 warn_since: None,
5137 deny_since: None,
5138 },
5139 Lint {
5140 label: "const_bool",
5141 description: r##"# `const_bool`
5142
5143
5144
5145The tracking issue for this feature is: [#151531]
5146
5147[#151531]: https://github.com/rust-lang/rust/issues/151531
5148
5149------------------------
5150"##,
5151 default_severity: Severity::Allow,
5152 warn_since: None,
5153 deny_since: None,
5154 },
5155 Lint {
5156 label: "const_btree_len",
5157 description: r##"# `const_btree_len`
5158
5159
5160
5161This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
5162
5163------------------------
5164"##,
5165 default_severity: Severity::Allow,
5166 warn_since: None,
5167 deny_since: None,
5168 },
5169 Lint {
5170 label: "const_c_variadic",
5171 description: r##"# `const_c_variadic`
5172
5173Allows defining and calling c-variadic functions in const contexts.
5174
5175The tracking issue for this feature is: [#151787]
5176
5177[#151787]: https://github.com/rust-lang/rust/issues/151787
5178
5179------------------------
5180"##,
5181 default_severity: Severity::Allow,
5182 warn_since: None,
5183 deny_since: None,
5184 },
5185 Lint {
5186 label: "const_carrying_mul_add",
5187 description: r##"# `const_carrying_mul_add`
5188
5189
5190
5191The tracking issue for this feature is: [#85532]
5192
5193[#85532]: https://github.com/rust-lang/rust/issues/85532
5194
5195------------------------
5196"##,
5197 default_severity: Severity::Allow,
5198 warn_since: None,
5199 deny_since: None,
5200 },
5201 Lint {
5202 label: "const_cell_traits",
5203 description: r##"# `const_cell_traits`
5204
5205
5206
5207The tracking issue for this feature is: [#147787]
5208
5209[#147787]: https://github.com/rust-lang/rust/issues/147787
5210
5211------------------------
5212"##,
5213 default_severity: Severity::Allow,
5214 warn_since: None,
5215 deny_since: None,
5216 },
5217 Lint {
5218 label: "const_clone",
5219 description: r##"# `const_clone`
5220
5221
5222
5223The tracking issue for this feature is: [#142757]
5224
5225[#142757]: https://github.com/rust-lang/rust/issues/142757
5226
5227------------------------
5228"##,
5229 default_severity: Severity::Allow,
5230 warn_since: None,
5231 deny_since: None,
5232 },
5233 Lint {
5234 label: "const_closures",
5235 description: r##"# `const_closures`
5236
5237Allows `const || {}` closures in const contexts.
5238
5239The tracking issue for this feature is: [#106003]
5240
5241[#106003]: https://github.com/rust-lang/rust/issues/106003
5242
5243------------------------
5244"##,
5245 default_severity: Severity::Allow,
5246 warn_since: None,
5247 deny_since: None,
5248 },
5249 Lint {
5250 label: "const_cmp",
5251 description: r##"# `const_cmp`
5252
5253
5254
5255The tracking issue for this feature is: [#143800]
5256
5257[#143800]: https://github.com/rust-lang/rust/issues/143800
5258
5259------------------------
5260"##,
5261 default_severity: Severity::Allow,
5262 warn_since: None,
5263 deny_since: None,
5264 },
5265 Lint {
5266 label: "const_control_flow",
5267 description: r##"# `const_control_flow`
5268
5269
5270
5271The tracking issue for this feature is: [#148739]
5272
5273[#148739]: https://github.com/rust-lang/rust/issues/148739
5274
5275------------------------
5276"##,
5277 default_severity: Severity::Allow,
5278 warn_since: None,
5279 deny_since: None,
5280 },
5281 Lint {
5282 label: "const_convert",
5283 description: r##"# `const_convert`
5284
5285
5286
5287The tracking issue for this feature is: [#143773]
5288
5289[#143773]: https://github.com/rust-lang/rust/issues/143773
5290
5291------------------------
5292"##,
5293 default_severity: Severity::Allow,
5294 warn_since: None,
5295 deny_since: None,
5296 },
5297 Lint {
5298 label: "const_default",
5299 description: r##"# `const_default`
5300
5301
5302
5303The tracking issue for this feature is: [#143894]
5304
5305[#143894]: https://github.com/rust-lang/rust/issues/143894
5306
5307------------------------
5308"##,
5309 default_severity: Severity::Allow,
5310 warn_since: None,
5311 deny_since: None,
5312 },
5313 Lint {
5314 label: "const_destruct",
5315 description: r##"# `const_destruct`
5316
5317Allows using `[const] Destruct` bounds and calling drop impls in const contexts.
5318
5319The tracking issue for this feature is: [#133214]
5320
5321[#133214]: https://github.com/rust-lang/rust/issues/133214
5322
5323------------------------
5324"##,
5325 default_severity: Severity::Allow,
5326 warn_since: None,
5327 deny_since: None,
5328 },
5329 Lint {
5330 label: "const_drop_guard",
5331 description: r##"# `const_drop_guard`
5332
5333
5334
5335This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
5336
5337------------------------
5338"##,
5339 default_severity: Severity::Allow,
5340 warn_since: None,
5341 deny_since: None,
5342 },
5343 Lint {
5344 label: "const_drop_in_place",
5345 description: r##"# `const_drop_in_place`
5346
5347
5348
5349The tracking issue for this feature is: [#109342]
5350
5351[#109342]: https://github.com/rust-lang/rust/issues/109342
5352
5353------------------------
5354"##,
5355 default_severity: Severity::Allow,
5356 warn_since: None,
5357 deny_since: None,
5358 },
5359 Lint {
5360 label: "const_eval_select",
5361 description: r##"# `const_eval_select`
5362
5363
5364
5365The tracking issue for this feature is: [#124625]
5366
5367[#124625]: https://github.com/rust-lang/rust/issues/124625
5368
5369------------------------
5370"##,
5371 default_severity: Severity::Allow,
5372 warn_since: None,
5373 deny_since: None,
5374 },
5375 Lint {
5376 label: "const_for",
5377 description: r##"# `const_for`
5378
5379Allows `for _ in _` loops in const contexts.
5380
5381The tracking issue for this feature is: [#87575]
5382
5383[#87575]: https://github.com/rust-lang/rust/issues/87575
5384
5385------------------------
5386"##,
5387 default_severity: Severity::Allow,
5388 warn_since: None,
5389 deny_since: None,
5390 },
5391 Lint {
5392 label: "const_format_args",
5393 description: r##"# `const_format_args`
5394
5395
5396
5397This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
5398
5399------------------------
5400"##,
5401 default_severity: Severity::Allow,
5402 warn_since: None,
5403 deny_since: None,
5404 },
5405 Lint {
5406 label: "const_heap",
5407 description: r##"# `const_heap`
5408
5409
5410
5411The tracking issue for this feature is: [#79597]
5412
5413[#79597]: https://github.com/rust-lang/rust/issues/79597
5414
5415------------------------
5416"##,
5417 default_severity: Severity::Allow,
5418 warn_since: None,
5419 deny_since: None,
5420 },
5421 Lint {
5422 label: "const_index",
5423 description: r##"# `const_index`
5424
5425
5426
5427The tracking issue for this feature is: [#143775]
5428
5429[#143775]: https://github.com/rust-lang/rust/issues/143775
5430
5431------------------------
5432"##,
5433 default_severity: Severity::Allow,
5434 warn_since: None,
5435 deny_since: None,
5436 },
5437 Lint {
5438 label: "const_iter",
5439 description: r##"# `const_iter`
5440
5441
5442
5443The tracking issue for this feature is: [#92476]
5444
5445[#92476]: https://github.com/rust-lang/rust/issues/92476
5446
5447------------------------
5448"##,
5449 default_severity: Severity::Allow,
5450 warn_since: None,
5451 deny_since: None,
5452 },
5453 Lint {
5454 label: "const_manually_drop_take",
5455 description: r##"# `const_manually_drop_take`
5456
5457
5458
5459The tracking issue for this feature is: [#148773]
5460
5461[#148773]: https://github.com/rust-lang/rust/issues/148773
5462
5463------------------------
5464"##,
5465 default_severity: Severity::Allow,
5466 warn_since: None,
5467 deny_since: None,
5468 },
5469 Lint {
5470 label: "const_never_short_circuit",
5471 description: r##"# `const_never_short_circuit`
5472
5473
5474
5475This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
5476
5477------------------------
5478"##,
5479 default_severity: Severity::Allow,
5480 warn_since: None,
5481 deny_since: None,
5482 },
5483 Lint {
5484 label: "const_nonnull_with_exposed_provenance",
5485 description: r##"# `const_nonnull_with_exposed_provenance`
5486
5487
5488
5489The tracking issue for this feature is: [#154215]
5490
5491[#154215]: https://github.com/rust-lang/rust/issues/154215
5492
5493------------------------
5494"##,
5495 default_severity: Severity::Allow,
5496 warn_since: None,
5497 deny_since: None,
5498 },
5499 Lint {
5500 label: "const_ops",
5501 description: r##"# `const_ops`
5502
5503
5504
5505The tracking issue for this feature is: [#143802]
5506
5507[#143802]: https://github.com/rust-lang/rust/issues/143802
5508
5509------------------------
5510"##,
5511 default_severity: Severity::Allow,
5512 warn_since: None,
5513 deny_since: None,
5514 },
5515 Lint {
5516 label: "const_option_ops",
5517 description: r##"# `const_option_ops`
5518
5519
5520
5521The tracking issue for this feature is: [#143956]
5522
5523[#143956]: https://github.com/rust-lang/rust/issues/143956
5524
5525------------------------
5526"##,
5527 default_severity: Severity::Allow,
5528 warn_since: None,
5529 deny_since: None,
5530 },
5531 Lint {
5532 label: "const_param_ty_trait",
5533 description: r##"# `const_param_ty_trait`
5534
5535
5536
5537The tracking issue for this feature is: [#95174]
5538
5539[#95174]: https://github.com/rust-lang/rust/issues/95174
5540
5541------------------------
5542"##,
5543 default_severity: Severity::Allow,
5544 warn_since: None,
5545 deny_since: None,
5546 },
5547 Lint {
5548 label: "const_param_ty_unchecked",
5549 description: r##"# `const_param_ty_unchecked`
5550
5551Allows skipping `ConstParamTy_` trait implementation checks
5552
5553This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
5554
5555------------------------
5556"##,
5557 default_severity: Severity::Allow,
5558 warn_since: None,
5559 deny_since: None,
5560 },
5561 Lint {
5562 label: "const_path_separators",
5563 description: r##"# `const_path_separators`
5564
5565
5566
5567The tracking issue for this feature is: [#153106]
5568
5569[#153106]: https://github.com/rust-lang/rust/issues/153106
5570
5571------------------------
5572"##,
5573 default_severity: Severity::Allow,
5574 warn_since: None,
5575 deny_since: None,
5576 },
5577 Lint {
5578 label: "const_precise_live_drops",
5579 description: r##"# `const_precise_live_drops`
5580
5581Be more precise when looking for live drops in a const context.
5582
5583The tracking issue for this feature is: [#73255]
5584
5585[#73255]: https://github.com/rust-lang/rust/issues/73255
5586
5587------------------------
5588"##,
5589 default_severity: Severity::Allow,
5590 warn_since: None,
5591 deny_since: None,
5592 },
5593 Lint {
5594 label: "const_range",
5595 description: r##"# `const_range`
5596
5597
5598
5599This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
5600
5601------------------------
5602"##,
5603 default_severity: Severity::Allow,
5604 warn_since: None,
5605 deny_since: None,
5606 },
5607 Lint {
5608 label: "const_range_bounds",
5609 description: r##"# `const_range_bounds`
5610
5611
5612
5613The tracking issue for this feature is: [#108082]
5614
5615[#108082]: https://github.com/rust-lang/rust/issues/108082
5616
5617------------------------
5618"##,
5619 default_severity: Severity::Allow,
5620 warn_since: None,
5621 deny_since: None,
5622 },
5623 Lint {
5624 label: "const_raw_ptr_comparison",
5625 description: r##"# `const_raw_ptr_comparison`
5626
5627
5628
5629The tracking issue for this feature is: [#53020]
5630
5631[#53020]: https://github.com/rust-lang/rust/issues/53020
5632
5633------------------------
5634"##,
5635 default_severity: Severity::Allow,
5636 warn_since: None,
5637 deny_since: None,
5638 },
5639 Lint {
5640 label: "const_ref_cell",
5641 description: r##"# `const_ref_cell`
5642
5643
5644
5645The tracking issue for this feature is: [#137844]
5646
5647[#137844]: https://github.com/rust-lang/rust/issues/137844
5648
5649------------------------
5650"##,
5651 default_severity: Severity::Allow,
5652 warn_since: None,
5653 deny_since: None,
5654 },
5655 Lint {
5656 label: "const_result_trait_fn",
5657 description: r##"# `const_result_trait_fn`
5658
5659
5660
5661The tracking issue for this feature is: [#144211]
5662
5663[#144211]: https://github.com/rust-lang/rust/issues/144211
5664
5665------------------------
5666"##,
5667 default_severity: Severity::Allow,
5668 warn_since: None,
5669 deny_since: None,
5670 },
5671 Lint {
5672 label: "const_result_unwrap_unchecked",
5673 description: r##"# `const_result_unwrap_unchecked`
5674
5675
5676
5677The tracking issue for this feature is: [#148714]
5678
5679[#148714]: https://github.com/rust-lang/rust/issues/148714
5680
5681------------------------
5682"##,
5683 default_severity: Severity::Allow,
5684 warn_since: None,
5685 deny_since: None,
5686 },
5687 Lint {
5688 label: "const_select_unpredictable",
5689 description: r##"# `const_select_unpredictable`
5690
5691
5692
5693The tracking issue for this feature is: [#145938]
5694
5695[#145938]: https://github.com/rust-lang/rust/issues/145938
5696
5697------------------------
5698"##,
5699 default_severity: Severity::Allow,
5700 warn_since: None,
5701 deny_since: None,
5702 },
5703 Lint {
5704 label: "const_slice_from_mut_ptr_range",
5705 description: r##"# `const_slice_from_mut_ptr_range`
5706
5707
5708
5709The tracking issue for this feature is: [#89792]
5710
5711[#89792]: https://github.com/rust-lang/rust/issues/89792
5712
5713------------------------
5714"##,
5715 default_severity: Severity::Allow,
5716 warn_since: None,
5717 deny_since: None,
5718 },
5719 Lint {
5720 label: "const_slice_from_ptr_range",
5721 description: r##"# `const_slice_from_ptr_range`
5722
5723
5724
5725The tracking issue for this feature is: [#89792]
5726
5727[#89792]: https://github.com/rust-lang/rust/issues/89792
5728
5729------------------------
5730"##,
5731 default_severity: Severity::Allow,
5732 warn_since: None,
5733 deny_since: None,
5734 },
5735 Lint {
5736 label: "const_slice_make_iter",
5737 description: r##"# `const_slice_make_iter`
5738
5739
5740
5741The tracking issue for this feature is: [#137737]
5742
5743[#137737]: https://github.com/rust-lang/rust/issues/137737
5744
5745------------------------
5746"##,
5747 default_severity: Severity::Allow,
5748 warn_since: None,
5749 deny_since: None,
5750 },
5751 Lint {
5752 label: "const_split_off_first_last",
5753 description: r##"# `const_split_off_first_last`
5754
5755
5756
5757The tracking issue for this feature is: [#138539]
5758
5759[#138539]: https://github.com/rust-lang/rust/issues/138539
5760
5761------------------------
5762"##,
5763 default_severity: Severity::Allow,
5764 warn_since: None,
5765 deny_since: None,
5766 },
5767 Lint {
5768 label: "const_swap_with_slice",
5769 description: r##"# `const_swap_with_slice`
5770
5771
5772
5773The tracking issue for this feature is: [#142204]
5774
5775[#142204]: https://github.com/rust-lang/rust/issues/142204
5776
5777------------------------
5778"##,
5779 default_severity: Severity::Allow,
5780 warn_since: None,
5781 deny_since: None,
5782 },
5783 Lint {
5784 label: "const_trait_impl",
5785 description: r##"# `const_trait_impl`
5786
5787Allows `impl const Trait for T` syntax.
5788
5789The tracking issue for this feature is: [#143874]
5790
5791[#143874]: https://github.com/rust-lang/rust/issues/143874
5792
5793------------------------
5794"##,
5795 default_severity: Severity::Allow,
5796 warn_since: None,
5797 deny_since: None,
5798 },
5799 Lint {
5800 label: "const_try",
5801 description: r##"# `const_try`
5802
5803Allows the `?` operator in const contexts.
5804
5805The tracking issue for this feature is: [#74935]
5806
5807[#74935]: https://github.com/rust-lang/rust/issues/74935
5808
5809------------------------
5810"##,
5811 default_severity: Severity::Allow,
5812 warn_since: None,
5813 deny_since: None,
5814 },
5815 Lint {
5816 label: "const_try_residual",
5817 description: r##"# `const_try_residual`
5818
5819
5820
5821The tracking issue for this feature is: [#91285]
5822
5823[#91285]: https://github.com/rust-lang/rust/issues/91285
5824
5825------------------------
5826"##,
5827 default_severity: Severity::Allow,
5828 warn_since: None,
5829 deny_since: None,
5830 },
5831 Lint {
5832 label: "const_type_name",
5833 description: r##"# `const_type_name`
5834
5835
5836
5837The tracking issue for this feature is: [#63084]
5838
5839[#63084]: https://github.com/rust-lang/rust/issues/63084
5840
5841------------------------
5842"##,
5843 default_severity: Severity::Allow,
5844 warn_since: None,
5845 deny_since: None,
5846 },
5847 Lint {
5848 label: "const_unsigned_bigint_helpers",
5849 description: r##"# `const_unsigned_bigint_helpers`
5850
5851
5852
5853The tracking issue for this feature is: [#152015]
5854
5855[#152015]: https://github.com/rust-lang/rust/issues/152015
5856
5857------------------------
5858"##,
5859 default_severity: Severity::Allow,
5860 warn_since: None,
5861 deny_since: None,
5862 },
5863 Lint {
5864 label: "container_error_extra",
5865 description: r##"# `container_error_extra`
5866
5867
5868
5869This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
5870
5871------------------------
5872"##,
5873 default_severity: Severity::Allow,
5874 warn_since: None,
5875 deny_since: None,
5876 },
5877 Lint {
5878 label: "context_ext",
5879 description: r##"# `context_ext`
5880
5881
5882
5883The tracking issue for this feature is: [#123392]
5884
5885[#123392]: https://github.com/rust-lang/rust/issues/123392
5886
5887------------------------
5888"##,
5889 default_severity: Severity::Allow,
5890 warn_since: None,
5891 deny_since: None,
5892 },
5893 Lint {
5894 label: "contracts",
5895 description: r##"# `contracts`
5896
5897Allows use of contracts attributes.
5898
5899The tracking issue for this feature is: [#128044]
5900
5901[#128044]: https://github.com/rust-lang/rust/issues/128044
5902
5903------------------------
5904"##,
5905 default_severity: Severity::Allow,
5906 warn_since: None,
5907 deny_since: None,
5908 },
5909 Lint {
5910 label: "contracts_internals",
5911 description: r##"# `contracts_internals`
5912
5913Allows access to internal machinery used to implement contracts.
5914
5915The tracking issue for this feature is: [#128044]
5916
5917[#128044]: https://github.com/rust-lang/rust/issues/128044
5918
5919------------------------
5920"##,
5921 default_severity: Severity::Allow,
5922 warn_since: None,
5923 deny_since: None,
5924 },
5925 Lint {
5926 label: "control_flow_into_value",
5927 description: r##"# `control_flow_into_value`
5928
5929
5930
5931The tracking issue for this feature is: [#137461]
5932
5933[#137461]: https://github.com/rust-lang/rust/issues/137461
5934
5935------------------------
5936"##,
5937 default_severity: Severity::Allow,
5938 warn_since: None,
5939 deny_since: None,
5940 },
5941 Lint {
5942 label: "convert_float_to_int",
5943 description: r##"# `convert_float_to_int`
5944
5945
5946
5947The tracking issue for this feature is: [#67057]
5948
5949[#67057]: https://github.com/rust-lang/rust/issues/67057
5950
5951------------------------
5952"##,
5953 default_severity: Severity::Allow,
5954 warn_since: None,
5955 deny_since: None,
5956 },
5957 Lint {
5958 label: "copied_into_inner",
5959 description: r##"# `copied_into_inner`
5960
5961
5962
5963This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
5964
5965------------------------
5966"##,
5967 default_severity: Severity::Allow,
5968 warn_since: None,
5969 deny_since: None,
5970 },
5971 Lint {
5972 label: "core_float_math",
5973 description: r##"# `core_float_math`
5974
5975
5976
5977The tracking issue for this feature is: [#137578]
5978
5979[#137578]: https://github.com/rust-lang/rust/issues/137578
5980
5981------------------------
5982"##,
5983 default_severity: Severity::Allow,
5984 warn_since: None,
5985 deny_since: None,
5986 },
5987 Lint {
5988 label: "core_intrinsics",
5989 description: r##"# `core_intrinsics`
5990
5991This feature is internal to the Rust compiler and is not intended for general use.
5992
5993------------------------
5994"##,
5995 default_severity: Severity::Allow,
5996 warn_since: None,
5997 deny_since: None,
5998 },
5999 Lint {
6000 label: "core_intrinsics_fallbacks",
6001 description: r##"# `core_intrinsics_fallbacks`
6002
6003
6004
6005This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
6006
6007------------------------
6008"##,
6009 default_severity: Severity::Allow,
6010 warn_since: None,
6011 deny_since: None,
6012 },
6013 Lint {
6014 label: "core_io",
6015 description: r##"# `core_io`
6016
6017
6018
6019The tracking issue for this feature is: [#154046]
6020
6021[#154046]: https://github.com/rust-lang/rust/issues/154046
6022
6023------------------------
6024"##,
6025 default_severity: Severity::Allow,
6026 warn_since: None,
6027 deny_since: None,
6028 },
6029 Lint {
6030 label: "core_io_borrowed_buf",
6031 description: r##"# `core_io_borrowed_buf`
6032
6033
6034
6035The tracking issue for this feature is: [#117693]
6036
6037[#117693]: https://github.com/rust-lang/rust/issues/117693
6038
6039------------------------
6040"##,
6041 default_severity: Severity::Allow,
6042 warn_since: None,
6043 deny_since: None,
6044 },
6045 Lint {
6046 label: "core_io_internals",
6047 description: r##"# `core_io_internals`
6048
6049
6050
6051This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
6052
6053------------------------
6054"##,
6055 default_severity: Severity::Allow,
6056 warn_since: None,
6057 deny_since: None,
6058 },
6059 Lint {
6060 label: "core_private_bignum",
6061 description: r##"# `core_private_bignum`
6062
6063This feature is internal to the Rust compiler and is not intended for general use.
6064
6065------------------------
6066"##,
6067 default_severity: Severity::Allow,
6068 warn_since: None,
6069 deny_since: None,
6070 },
6071 Lint {
6072 label: "core_private_diy_float",
6073 description: r##"# `core_private_diy_float`
6074
6075This feature is internal to the Rust compiler and is not intended for general use.
6076
6077------------------------
6078"##,
6079 default_severity: Severity::Allow,
6080 warn_since: None,
6081 deny_since: None,
6082 },
6083 Lint {
6084 label: "coroutine_clone",
6085 description: r##"# `coroutine_clone`
6086
6087Allows coroutines to be cloned.
6088
6089The tracking issue for this feature is: [#95360]
6090
6091[#95360]: https://github.com/rust-lang/rust/issues/95360
6092
6093------------------------
6094"##,
6095 default_severity: Severity::Allow,
6096 warn_since: None,
6097 deny_since: None,
6098 },
6099 Lint {
6100 label: "coroutine_trait",
6101 description: r##"# `coroutine_trait`
6102
6103
6104
6105The tracking issue for this feature is: [#43122]
6106
6107[#43122]: https://github.com/rust-lang/rust/issues/43122
6108
6109------------------------
6110"##,
6111 default_severity: Severity::Allow,
6112 warn_since: None,
6113 deny_since: None,
6114 },
6115 Lint {
6116 label: "coroutines",
6117 description: r##"# `coroutines`
6118
6119The tracking issue for this feature is: [#43122]
6120
6121[#43122]: https://github.com/rust-lang/rust/issues/43122
6122
6123------------------------
6124
6125The `coroutines` feature gate in Rust allows you to define coroutine or
6126coroutine literals. A coroutine is a "resumable function" that syntactically
6127resembles a closure but compiles to much different semantics in the compiler
6128itself. The primary feature of a coroutine is that it can be suspended during
6129execution to be resumed at a later date. Coroutines use the `yield` keyword to
6130"return", and then the caller can `resume` a coroutine to resume execution just
6131after the `yield` keyword.
6132
6133Coroutines are an extra-unstable feature in the compiler right now. Added in
6134[RFC 2033] they're mostly intended right now as a information/constraint
6135gathering phase. The intent is that experimentation can happen on the nightly
6136compiler before actual stabilization. A further RFC will be required to
6137stabilize coroutines and will likely contain at least a few small
6138tweaks to the overall design.
6139
6140[RFC 2033]: https://github.com/rust-lang/rfcs/pull/2033
6141
6142A syntactical example of a coroutine is:
6143
6144```rust
6145#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
6146
6147use std::ops::{Coroutine, CoroutineState};
6148use std::pin::Pin;
6149
6150fn main() {
6151 let mut coroutine = #[coroutine] || {
6152 yield 1;
6153 return "foo"
6154 };
6155
6156 match Pin::new(&mut coroutine).resume(()) {
6157 CoroutineState::Yielded(1) => {}
6158 _ => panic!("unexpected value from resume"),
6159 }
6160 match Pin::new(&mut coroutine).resume(()) {
6161 CoroutineState::Complete("foo") => {}
6162 _ => panic!("unexpected value from resume"),
6163 }
6164}
6165```
6166
6167Coroutines are closure-like literals which are annotated with `#[coroutine]`
6168and can contain a `yield` statement. The
6169`yield` statement takes an optional expression of a value to yield out of the
6170coroutine. All coroutine literals implement the `Coroutine` trait in the
6171`std::ops` module. The `Coroutine` trait has one main method, `resume`, which
6172resumes execution of the coroutine at the previous suspension point.
6173
6174An example of the control flow of coroutines is that the following example
6175prints all numbers in order:
6176
6177```rust
6178#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
6179
6180use std::ops::Coroutine;
6181use std::pin::Pin;
6182
6183fn main() {
6184 let mut coroutine = #[coroutine] || {
6185 println!("2");
6186 yield;
6187 println!("4");
6188 };
6189
6190 println!("1");
6191 Pin::new(&mut coroutine).resume(());
6192 println!("3");
6193 Pin::new(&mut coroutine).resume(());
6194 println!("5");
6195}
6196```
6197
6198At this time the main use case of coroutines is an implementation
6199primitive for `async`/`await` and `gen` syntax, but coroutines
6200will likely be extended to other primitives in the future.
6201Feedback on the design and usage is always appreciated!
6202
6203### The `Coroutine` trait
6204
6205The `Coroutine` trait in `std::ops` currently looks like:
6206
6207```rust
6208# #![feature(arbitrary_self_types, coroutine_trait)]
6209# use std::ops::CoroutineState;
6210# use std::pin::Pin;
6211
6212pub trait Coroutine<R = ()> {
6213 type Yield;
6214 type Return;
6215 fn resume(self: Pin<&mut Self>, resume: R) -> CoroutineState<Self::Yield, Self::Return>;
6216}
6217```
6218
6219The `Coroutine::Yield` type is the type of values that can be yielded with the
6220`yield` statement. The `Coroutine::Return` type is the returned type of the
6221coroutine. This is typically the last expression in a coroutine's definition or
6222any value passed to `return` in a coroutine. The `resume` function is the entry
6223point for executing the `Coroutine` itself.
6224
6225The return value of `resume`, `CoroutineState`, looks like:
6226
6227```rust
6228pub enum CoroutineState<Y, R> {
6229 Yielded(Y),
6230 Complete(R),
6231}
6232```
6233
6234The `Yielded` variant indicates that the coroutine can later be resumed. This
6235corresponds to a `yield` point in a coroutine. The `Complete` variant indicates
6236that the coroutine is complete and cannot be resumed again. Calling `resume`
6237after a coroutine has returned `Complete` will likely result in a panic of the
6238program.
6239
6240### Closure-like semantics
6241
6242The closure-like syntax for coroutines alludes to the fact that they also have
6243closure-like semantics. Namely:
6244
6245* When created, a coroutine executes no code. A closure literal does not
6246 actually execute any of the closure's code on construction, and similarly a
6247 coroutine literal does not execute any code inside the coroutine when
6248 constructed.
6249
6250* Coroutines can capture outer variables by reference or by move, and this can
6251 be tweaked with the `move` keyword at the beginning of the closure. Like
6252 closures all coroutines will have an implicit environment which is inferred by
6253 the compiler. Outer variables can be moved into a coroutine for use as the
6254 coroutine progresses.
6255
6256* Coroutine literals produce a value with a unique type which implements the
6257 `std::ops::Coroutine` trait. This allows actual execution of the coroutine
6258 through the `Coroutine::resume` method as well as also naming it in return
6259 types and such.
6260
6261* Traits like `Send` and `Sync` are automatically implemented for a `Coroutine`
6262 depending on the captured variables of the environment. Unlike closures,
6263 coroutines also depend on variables live across suspension points. This means
6264 that although the ambient environment may be `Send` or `Sync`, the coroutine
6265 itself may not be due to internal variables live across `yield` points being
6266 not-`Send` or not-`Sync`. Note that coroutines do
6267 not implement traits like `Copy` or `Clone` automatically.
6268
6269* Whenever a coroutine is dropped it will drop all captured environment
6270 variables.
6271
6272### Coroutines as state machines
6273
6274In the compiler, coroutines are currently compiled as state machines. Each
6275`yield` expression will correspond to a different state that stores all live
6276variables over that suspension point. Resumption of a coroutine will dispatch on
6277the current state and then execute internally until a `yield` is reached, at
6278which point all state is saved off in the coroutine and a value is returned.
6279
6280Let's take a look at an example to see what's going on here:
6281
6282```rust
6283#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
6284
6285use std::ops::Coroutine;
6286use std::pin::Pin;
6287
6288fn main() {
6289 let ret = "foo";
6290 let mut coroutine = #[coroutine] move || {
6291 yield 1;
6292 return ret
6293 };
6294
6295 Pin::new(&mut coroutine).resume(());
6296 Pin::new(&mut coroutine).resume(());
6297}
6298```
6299
6300This coroutine literal will compile down to something similar to:
6301
6302```rust
6303#![feature(arbitrary_self_types, coroutine_trait)]
6304
6305use std::ops::{Coroutine, CoroutineState};
6306use std::pin::Pin;
6307
6308fn main() {
6309 let ret = "foo";
6310 let mut coroutine = {
6311 enum __Coroutine {
6312 Start(&'static str),
6313 Yield1(&'static str),
6314 Done,
6315 }
6316
6317 impl Coroutine for __Coroutine {
6318 type Yield = i32;
6319 type Return = &'static str;
6320
6321 fn resume(mut self: Pin<&mut Self>, resume: ()) -> CoroutineState<i32, &'static str> {
6322 use std::mem;
6323 match mem::replace(&mut *self, __Coroutine::Done) {
6324 __Coroutine::Start(s) => {
6325 *self = __Coroutine::Yield1(s);
6326 CoroutineState::Yielded(1)
6327 }
6328
6329 __Coroutine::Yield1(s) => {
6330 *self = __Coroutine::Done;
6331 CoroutineState::Complete(s)
6332 }
6333
6334 __Coroutine::Done => {
6335 panic!("coroutine resumed after completion")
6336 }
6337 }
6338 }
6339 }
6340
6341 __Coroutine::Start(ret)
6342 };
6343
6344 Pin::new(&mut coroutine).resume(());
6345 Pin::new(&mut coroutine).resume(());
6346}
6347```
6348
6349Notably here we can see that the compiler is generating a fresh type,
6350`__Coroutine` in this case. This type has a number of states (represented here
6351as an `enum`) corresponding to each of the conceptual states of the coroutine.
6352At the beginning we're closing over our outer variable `foo` and then that
6353variable is also live over the `yield` point, so it's stored in both states.
6354
6355When the coroutine starts it'll immediately yield 1, but it saves off its state
6356just before it does so indicating that it has reached the yield point. Upon
6357resuming again we'll execute the `return ret` which returns the `Complete`
6358state.
6359
6360Here we can also note that the `Done` state, if resumed, panics immediately as
6361it's invalid to resume a completed coroutine. It's also worth noting that this
6362is just a rough desugaring, not a normative specification for what the compiler
6363does.
6364"##,
6365 default_severity: Severity::Allow,
6366 warn_since: None,
6367 deny_since: None,
6368 },
6369 Lint {
6370 label: "coverage_attribute",
6371 description: r##"# `coverage_attribute`
6372
6373The tracking issue for this feature is: [#84605]
6374
6375[#84605]: https://github.com/rust-lang/rust/issues/84605
6376
6377---
6378
6379The `coverage` attribute can be used to selectively disable coverage
6380instrumentation in an annotated function. This might be useful to:
6381
6382- Avoid instrumentation overhead in a performance critical function
6383- Avoid generating coverage for a function that is not meant to be executed,
6384 but still target 100% coverage for the rest of the program.
6385
6386## Example
6387
6388```rust
6389#![feature(coverage_attribute)]
6390
6391// `foo()` will get coverage instrumentation (by default)
6392fn foo() {
6393 // ...
6394}
6395
6396#[coverage(off)]
6397fn bar() {
6398 // ...
6399}
6400```
6401"##,
6402 default_severity: Severity::Allow,
6403 warn_since: None,
6404 deny_since: None,
6405 },
6406 Lint {
6407 label: "cow_is_borrowed",
6408 description: r##"# `cow_is_borrowed`
6409
6410
6411
6412The tracking issue for this feature is: [#65143]
6413
6414[#65143]: https://github.com/rust-lang/rust/issues/65143
6415
6416------------------------
6417"##,
6418 default_severity: Severity::Allow,
6419 warn_since: None,
6420 deny_since: None,
6421 },
6422 Lint {
6423 label: "csky_target_feature",
6424 description: r##"# `csky_target_feature`
6425
6426Target features on csky.
6427
6428The tracking issue for this feature is: [#150248]
6429
6430[#150248]: https://github.com/rust-lang/rust/issues/150248
6431
6432------------------------
6433"##,
6434 default_severity: Severity::Allow,
6435 warn_since: None,
6436 deny_since: None,
6437 },
6438 Lint {
6439 label: "cstr_bytes",
6440 description: r##"# `cstr_bytes`
6441
6442
6443
6444The tracking issue for this feature is: [#112115]
6445
6446[#112115]: https://github.com/rust-lang/rust/issues/112115
6447
6448------------------------
6449"##,
6450 default_severity: Severity::Allow,
6451 warn_since: None,
6452 deny_since: None,
6453 },
6454 Lint {
6455 label: "cstr_display",
6456 description: r##"# `cstr_display`
6457
6458
6459
6460The tracking issue for this feature is: [#139984]
6461
6462[#139984]: https://github.com/rust-lang/rust/issues/139984
6463
6464------------------------
6465"##,
6466 default_severity: Severity::Allow,
6467 warn_since: None,
6468 deny_since: None,
6469 },
6470 Lint {
6471 label: "cstr_internals",
6472 description: r##"# `cstr_internals`
6473
6474
6475
6476This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
6477
6478------------------------
6479"##,
6480 default_severity: Severity::Allow,
6481 warn_since: None,
6482 deny_since: None,
6483 },
6484 Lint {
6485 label: "current_thread_id",
6486 description: r##"# `current_thread_id`
6487
6488
6489
6490The tracking issue for this feature is: [#147194]
6491
6492[#147194]: https://github.com/rust-lang/rust/issues/147194
6493
6494------------------------
6495"##,
6496 default_severity: Severity::Allow,
6497 warn_since: None,
6498 deny_since: None,
6499 },
6500 Lint {
6501 label: "cursor_split",
6502 description: r##"# `cursor_split`
6503
6504
6505
6506The tracking issue for this feature is: [#86369]
6507
6508[#86369]: https://github.com/rust-lang/rust/issues/86369
6509
6510------------------------
6511"##,
6512 default_severity: Severity::Allow,
6513 warn_since: None,
6514 deny_since: None,
6515 },
6516 Lint {
6517 label: "custom_inner_attributes",
6518 description: r##"# `custom_inner_attributes`
6519
6520Allows non-builtin attributes in inner attribute position.
6521
6522The tracking issue for this feature is: [#54726]
6523
6524[#54726]: https://github.com/rust-lang/rust/issues/54726
6525
6526------------------------
6527"##,
6528 default_severity: Severity::Allow,
6529 warn_since: None,
6530 deny_since: None,
6531 },
6532 Lint {
6533 label: "custom_mir",
6534 description: r##"# `custom_mir`
6535
6536Allows writing custom MIR
6537
6538This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
6539
6540------------------------
6541"##,
6542 default_severity: Severity::Allow,
6543 warn_since: None,
6544 deny_since: None,
6545 },
6546 Lint {
6547 label: "custom_test_frameworks",
6548 description: r##"# `custom_test_frameworks`
6549
6550The tracking issue for this feature is: [#50297]
6551
6552[#50297]: https://github.com/rust-lang/rust/issues/50297
6553
6554------------------------
6555
6556The `custom_test_frameworks` feature allows the use of `#[test_case]` and `#![test_runner]`.
6557Any function, const, or static can be annotated with `#[test_case]` causing it to be aggregated (like `#[test]`)
6558and be passed to the test runner determined by the `#![test_runner]` crate attribute.
6559
6560```rust
6561#![feature(custom_test_frameworks)]
6562#![test_runner(my_runner)]
6563
6564fn my_runner(tests: &[&i32]) {
6565 for t in tests {
6566 if **t == 0 {
6567 println!("PASSED");
6568 } else {
6569 println!("FAILED");
6570 }
6571 }
6572}
6573
6574#[test_case]
6575const WILL_PASS: i32 = 0;
6576
6577#[test_case]
6578const WILL_FAIL: i32 = 4;
6579```
6580"##,
6581 default_severity: Severity::Allow,
6582 warn_since: None,
6583 deny_since: None,
6584 },
6585 Lint {
6586 label: "darwin_objc",
6587 description: r##"# `darwin_objc`
6588
6589
6590
6591The tracking issue for this feature is: [#145496]
6592
6593[#145496]: https://github.com/rust-lang/rust/issues/145496
6594
6595------------------------
6596"##,
6597 default_severity: Severity::Allow,
6598 warn_since: None,
6599 deny_since: None,
6600 },
6601 Lint {
6602 label: "deadline_api",
6603 description: r##"# `deadline_api`
6604
6605
6606
6607The tracking issue for this feature is: [#46316]
6608
6609[#46316]: https://github.com/rust-lang/rust/issues/46316
6610
6611------------------------
6612"##,
6613 default_severity: Severity::Allow,
6614 warn_since: None,
6615 deny_since: None,
6616 },
6617 Lint {
6618 label: "debug_closure_helpers",
6619 description: r##"# `debug_closure_helpers`
6620
6621
6622
6623The tracking issue for this feature is: [#117729]
6624
6625[#117729]: https://github.com/rust-lang/rust/issues/117729
6626
6627------------------------
6628"##,
6629 default_severity: Severity::Allow,
6630 warn_since: None,
6631 deny_since: None,
6632 },
6633 Lint {
6634 label: "dec2flt",
6635 description: r##"# `dec2flt`
6636
6637This feature is internal to the Rust compiler and is not intended for general use.
6638
6639------------------------
6640"##,
6641 default_severity: Severity::Allow,
6642 warn_since: None,
6643 deny_since: None,
6644 },
6645 Lint {
6646 label: "decl_macro",
6647 description: r##"# `decl_macro`
6648
6649Allows declarative macros 2.0 (`macro`).
6650
6651The tracking issue for this feature is: [#39412]
6652
6653[#39412]: https://github.com/rust-lang/rust/issues/39412
6654
6655------------------------
6656"##,
6657 default_severity: Severity::Allow,
6658 warn_since: None,
6659 deny_since: None,
6660 },
6661 Lint {
6662 label: "default_field_values",
6663 description: r##"# `default_field_values`
6664
6665The tracking issue for this feature is: [#132162]
6666
6667[#132162]: https://github.com/rust-lang/rust/issues/132162
6668
6669The RFC for this feature is: [#3681]
6670
6671[#3681]: https://github.com/rust-lang/rfcs/blob/master/text/3681-default-field-values.md
6672
6673------------------------
6674
6675The `default_field_values` feature allows users to specify a const value for
6676individual fields in struct definitions, allowing those to be omitted from
6677initializers.
6678
6679## Examples
6680
6681```rust
6682#![feature(default_field_values)]
6683
6684#[derive(Default)]
6685struct Pet {
6686 name: Option<String>, // impl Default for Pet will use Default::default() for name
6687 age: i128 = 42, // impl Default for Pet will use the literal 42 for age
6688}
6689
6690fn main() {
6691 let a = Pet { name: Some(String::new()), .. }; // Pet { name: Some(""), age: 42 }
6692 let b = Pet::default(); // Pet { name: None, age: 42 }
6693 assert_eq!(a.age, b.age);
6694 // The following would be a compilation error: `name` needs to be specified
6695 // let _ = Pet { .. };
6696}
6697```
6698
6699## `#[derive(Default)]`
6700
6701When deriving Default, the provided values are then used. On enum variants,
6702the variant must still be marked with `#[default]` and have all its fields
6703with default values.
6704
6705```rust
6706#![feature(default_field_values)]
6707
6708#[derive(Default)]
6709enum A {
6710 #[default]
6711 B {
6712 x: i32 = 0,
6713 y: i32 = 0,
6714 },
6715 C,
6716}
6717```
6718
6719## Enum variants
6720
6721This feature also supports enum variants for both specifying default values
6722and `#[derive(Default)]`.
6723
6724## Interaction with `#[non_exhaustive]`
6725
6726A struct or enum variant marked with `#[non_exhaustive]` is not allowed to
6727have default field values.
6728
6729## Lints
6730
6731When manually implementing the `Default` trait for a type that has default
6732field values, if any of these are overridden in the impl the
6733`default_overrides_default_fields` lint will trigger. This lint is in place
6734to avoid surprising diverging behavior between `S { .. }` and
6735`S::default()`, where using the same type in both ways could result in
6736different values. The appropriate way to write a manual `Default`
6737implementation is to use the functional update syntax:
6738
6739```rust
6740#![feature(default_field_values)]
6741
6742struct Pet {
6743 name: String,
6744 age: i128 = 42, // impl Default for Pet will use the literal 42 for age
6745}
6746
6747impl Default for Pet {
6748 fn default() -> Pet {
6749 Pet {
6750 name: "no-name".to_string(),
6751 ..
6752 }
6753 }
6754}
6755```
6756"##,
6757 default_severity: Severity::Allow,
6758 warn_since: None,
6759 deny_since: None,
6760 },
6761 Lint {
6762 label: "deprecated_suggestion",
6763 description: r##"# `deprecated_suggestion`
6764
6765Allows having using `suggestion` in the `#[deprecated]` attribute.
6766
6767The tracking issue for this feature is: [#94785]
6768
6769[#94785]: https://github.com/rust-lang/rust/issues/94785
6770
6771------------------------
6772"##,
6773 default_severity: Severity::Allow,
6774 warn_since: None,
6775 deny_since: None,
6776 },
6777 Lint {
6778 label: "deque_extend_front",
6779 description: r##"# `deque_extend_front`
6780
6781
6782
6783The tracking issue for this feature is: [#146975]
6784
6785[#146975]: https://github.com/rust-lang/rust/issues/146975
6786
6787------------------------
6788"##,
6789 default_severity: Severity::Allow,
6790 warn_since: None,
6791 deny_since: None,
6792 },
6793 Lint {
6794 label: "deref_patterns",
6795 description: r##"# `deref_patterns`
6796
6797The tracking issue for this feature is: [#87121]
6798
6799[#87121]: https://github.com/rust-lang/rust/issues/87121
6800
6801------------------------
6802
6803> **Note**: This feature supersedes [`box_patterns`].
6804
6805This feature permits pattern matching on [smart pointers in the standard library] through their
6806`Deref` target types, either implicitly or with explicit `deref!(_)` patterns (the syntax of which
6807is currently a placeholder).
6808
6809```rust
6810#![feature(deref_patterns)]
6811
6812let mut v = vec![Box::new(Some(0))];
6813
6814// Implicit dereferences are inserted when a pattern can match against the
6815// result of repeatedly dereferencing but can't match against a smart
6816// pointer itself. This works alongside match ergonomics for references.
6817if let [Some(x)] = &mut v {
6818 *x += 1;
6819}
6820
6821// Explicit `deref!(_)` patterns may instead be used when finer control is
6822// needed, e.g. to dereference only a single smart pointer, or to bind the
6823// the result of dereferencing to a variable.
6824if let deref!([deref!(opt_x @ Some(1))]) = &mut v {
6825 opt_x.as_mut().map(|x| *x += 1);
6826}
6827
6828assert_eq!(v, [Box::new(Some(2))]);
6829```
6830
6831Without this feature, it may be necessary to introduce temporaries to represent dereferenced places
6832when matching on nested structures:
6833
6834```rust
6835let mut v = vec![Box::new(Some(0))];
6836if let [b] = &mut *v {
6837 if let Some(x) = &mut **b {
6838 *x += 1;
6839 }
6840}
6841if let [b] = &mut *v {
6842 if let opt_x @ Some(1) = &mut **b {
6843 opt_x.as_mut().map(|x| *x += 1);
6844 }
6845}
6846assert_eq!(v, [Box::new(Some(2))]);
6847```
6848
6849Like [`box_patterns`], deref patterns may move out of boxes:
6850
6851```rust
6852# #![feature(deref_patterns)]
6853struct NoCopy;
6854let deref!(x) = Box::new(NoCopy);
6855drop::<NoCopy>(x);
6856```
6857
6858Additionally, `deref_patterns` implements changes to string and byte string literal patterns,
6859allowing then to be used in deref patterns:
6860
6861```rust
6862# #![feature(deref_patterns)]
6863match ("test".to_string(), Box::from("test"), b"test".to_vec()) {
6864 ("test", "test", b"test") => {}
6865 _ => panic!(),
6866}
6867
6868// This works through multiple layers of reference and smart pointer:
6869match (&Box::new(&"test".to_string()), &&&"test") {
6870 ("test", "test") => {}
6871 _ => panic!(),
6872}
6873
6874// `deref!("...")` syntax may also be used:
6875match "test".to_string() {
6876 deref!("test") => {}
6877 _ => panic!(),
6878}
6879
6880// Matching on slices and arrays using literals is possible elsewhere as well:
6881match *"test" {
6882 "test" => {}
6883 _ => panic!(),
6884}
6885match *b"test" {
6886 b"test" => {}
6887 _ => panic!(),
6888}
6889match *(b"test" as &[u8]) {
6890 b"test" => {}
6891 _ => panic!(),
6892}
6893```
6894
6895[`box_patterns`]: ./box-patterns.md
6896[smart pointers in the standard library]: https://doc.rust-lang.org/std/ops/trait.DerefPure.html#implementors
6897"##,
6898 default_severity: Severity::Allow,
6899 warn_since: None,
6900 deny_since: None,
6901 },
6902 Lint {
6903 label: "deref_pure_trait",
6904 description: r##"# `deref_pure_trait`
6905
6906
6907
6908The tracking issue for this feature is: [#87121]
6909
6910[#87121]: https://github.com/rust-lang/rust/issues/87121
6911
6912------------------------
6913"##,
6914 default_severity: Severity::Allow,
6915 warn_since: None,
6916 deny_since: None,
6917 },
6918 Lint {
6919 label: "derive_clone_copy_internals",
6920 description: r##"# `derive_clone_copy_internals`
6921
6922This feature is internal to the Rust compiler and is not intended for general use.
6923
6924------------------------
6925"##,
6926 default_severity: Severity::Allow,
6927 warn_since: None,
6928 deny_since: None,
6929 },
6930 Lint {
6931 label: "derive_coerce_pointee",
6932 description: r##"# `derive_coerce_pointee`
6933
6934
6935
6936The tracking issue for this feature is: [#123430]
6937
6938[#123430]: https://github.com/rust-lang/rust/issues/123430
6939
6940------------------------
6941"##,
6942 default_severity: Severity::Allow,
6943 warn_since: None,
6944 deny_since: None,
6945 },
6946 Lint {
6947 label: "derive_const",
6948 description: r##"# `derive_const`
6949
6950
6951
6952The tracking issue for this feature is: [#118304]
6953
6954[#118304]: https://github.com/rust-lang/rust/issues/118304
6955
6956------------------------
6957"##,
6958 default_severity: Severity::Allow,
6959 warn_since: None,
6960 deny_since: None,
6961 },
6962 Lint {
6963 label: "derive_eq_internals",
6964 description: r##"# `derive_eq_internals`
6965
6966This feature is internal to the Rust compiler and is not intended for general use.
6967
6968------------------------
6969"##,
6970 default_severity: Severity::Allow,
6971 warn_since: None,
6972 deny_since: None,
6973 },
6974 Lint {
6975 label: "derive_from",
6976 description: r##"# `derive_from`
6977
6978Allows deriving the From trait on single-field structs.
6979
6980The tracking issue for this feature is: [#144889]
6981
6982[#144889]: https://github.com/rust-lang/rust/issues/144889
6983
6984------------------------
6985"##,
6986 default_severity: Severity::Allow,
6987 warn_since: None,
6988 deny_since: None,
6989 },
6990 Lint {
6991 label: "derive_macro_global_path",
6992 description: r##"# `derive_macro_global_path`
6993
6994
6995
6996The tracking issue for this feature is: [#154645]
6997
6998[#154645]: https://github.com/rust-lang/rust/issues/154645
6999
7000------------------------
7001"##,
7002 default_severity: Severity::Allow,
7003 warn_since: None,
7004 deny_since: None,
7005 },
7006 Lint {
7007 label: "diagnostic_on_const",
7008 description: r##"# `diagnostic_on_const`
7009
7010Allows giving non-const impls custom diagnostic messages if attempted to be used as const
7011
7012The tracking issue for this feature is: [#143874]
7013
7014[#143874]: https://github.com/rust-lang/rust/issues/143874
7015
7016------------------------
7017"##,
7018 default_severity: Severity::Allow,
7019 warn_since: None,
7020 deny_since: None,
7021 },
7022 Lint {
7023 label: "diagnostic_on_move",
7024 description: r##"# `diagnostic_on_move`
7025
7026The tracking issue for this feature is: [#154181]
7027
7028------------------------
7029
7030The `diagnostic_on_move` feature allows use of the `#[diagnostic::on_move]` attribute. It should be
7031placed on struct, enum and union declarations, though it is not an error to be located in other
7032positions. This attribute is a hint to the compiler to supplement the error message when the
7033annotated type is involved in a borrowcheck error.
7034
7035For example, [`File`] is annotated as such:
7036```rust
7037#![feature(diagnostic_on_move)]
7038
7039#[diagnostic::on_move(note = "you can use `File::try_clone` \
7040 to duplicate a `File` instance")]
7041pub struct File {
7042 // ...
7043}
7044```
7045
7046When you try to use a `File` after it's already been moved, it will helpfully tell you about `try_clone`.
7047
7048The message and label can also be customized:
7049
7050```rust
7051#![feature(diagnostic_on_move)]
7052
7053use std::marker::PhantomData;
7054
7055#[diagnostic::on_move(
7056 message = "`{Self}` cannot be used multiple times",
7057 label = "this token may only be used once",
7058 note = "you can create a new `Token` with `Token::conjure()`"
7059)]
7060pub struct Token<'brand> {
7061 spooky: PhantomData<&'brand ()>,
7062}
7063
7064impl Token<'_> {
7065 pub fn conjure<'u>() -> Token<'u> {
7066 Token {
7067 spooky: PhantomData,
7068 }
7069 }
7070}
7071```
7072The user may try to use it like this:
7073```rust,compile_fail,E0382
7074# #![feature(diagnostic_on_move)]
7075#
7076# use std::marker::PhantomData;
7077#
7078# #[diagnostic::on_move(
7079# message = "`{Self}` cannot be used multiple times",
7080# label = "this token may only be used once",
7081# note = "you can create a new `Token` with `Token::conjure()`"
7082# )]
7083# pub struct Token<'brand> {
7084# spooky: PhantomData<&'brand ()>,
7085# }
7086#
7087# impl Token<'_> {
7088# pub fn conjure<'u>() -> Token<'u> {
7089# Token {
7090# spooky: PhantomData,
7091# }
7092# }
7093# }
7094# fn main() {
7095let token = Token::conjure();
7096let _ = (token, token);
7097# }
7098```
7099This will result in the following error:
7100```text
7101error[E0382]: `Token` cannot be used multiple times
7102 --> src/main.rs:24:21
7103 |
7104 1 | let token = Token::conjure();
7105 | ----- this token may only be used once
7106 2 | let _ = (token, token);
7107 | ----- ^^^^^ value used here after move
7108 | |
7109 | value moved here
7110 |
7111 = note: you can create a new `Token` with `Token::conjure()`
7112```
7113
7114[`File`]: https://doc.rust-lang.org/nightly/std/fs/struct.File.html "File in std::fs"
7115[#154181]: https://github.com/rust-lang/rust/issues/154181 "Tracking Issue for #[diagnostic::on_move]"
7116"##,
7117 default_severity: Severity::Allow,
7118 warn_since: None,
7119 deny_since: None,
7120 },
7121 Lint {
7122 label: "diagnostic_on_unknown",
7123 description: r##"# `diagnostic_on_unknown`
7124
7125Allows giving unresolved imports a custom diagnostic message
7126
7127The tracking issue for this feature is: [#152900]
7128
7129[#152900]: https://github.com/rust-lang/rust/issues/152900
7130
7131------------------------
7132"##,
7133 default_severity: Severity::Allow,
7134 warn_since: None,
7135 deny_since: None,
7136 },
7137 Lint {
7138 label: "diagnostic_on_unmatch_args",
7139 description: r##"# `diagnostic_on_unmatch_args`
7140
7141The tracking issue for this feature is: [#155642]
7142
7143[#155642]: https://github.com/rust-lang/rust/issues/155642
7144
7145------------------------
7146
7147The `diagnostic_on_unmatch_args` feature adds the
7148`#[diagnostic::on_unmatch_args(...)]` attribute for declarative macros.
7149It lets a macro definition customize diagnostics for matcher failures after all arms have been
7150tried, such as incomplete invocations or trailing extra arguments.
7151
7152This attribute currently applies to declarative macros such as `macro_rules!` and `pub macro`.
7153It is currently used for errors emitted by declarative macro matching itself; fragment parser
7154errors still use their existing diagnostics.
7155
7156```rust,compile_fail
7157#![feature(diagnostic_on_unmatch_args)]
7158
7159#[diagnostic::on_unmatch_args(
7160 message = "invalid arguments to {This} macro invocation",
7161 label = "expected a type and value here",
7162 note = "this macro expects a type and a value, like `pair!(u8, 0)`",
7163 note = "see <link/to/docs>",
7164)]
7165macro_rules! pair {
7166 ($ty:ty, $value:expr) => {};
7167}
7168
7169pair!(u8);
7170```
7171
7172This emits output like:
7173
7174```text
7175error: invalid arguments to pair macro invocation
7176 --> example.rs:13:9
7177 |
71789 | macro_rules! pair {
7179 | ----------------- when calling this macro
7180...
718113 | pair!(u8);
7182 | ^ expected a type and value here
7183 |
7184note: while trying to match `,`
7185 --> example.rs:10:12
7186 |
718710 | ($ty:ty, $value:expr) => {};
7188 | ^
7189 = note: this macro expects a type and a value, like `pair!(u8, 0)`
7190 = note: see <link/to/docs>
7191```
7192"##,
7193 default_severity: Severity::Allow,
7194 warn_since: None,
7195 deny_since: None,
7196 },
7197 Lint {
7198 label: "dir_entry_ext2",
7199 description: r##"# `dir_entry_ext2`
7200
7201
7202
7203The tracking issue for this feature is: [#85573]
7204
7205[#85573]: https://github.com/rust-lang/rust/issues/85573
7206
7207------------------------
7208"##,
7209 default_severity: Severity::Allow,
7210 warn_since: None,
7211 deny_since: None,
7212 },
7213 Lint {
7214 label: "dirfd",
7215 description: r##"# `dirfd`
7216
7217
7218
7219The tracking issue for this feature is: [#120426]
7220
7221[#120426]: https://github.com/rust-lang/rust/issues/120426
7222
7223------------------------
7224"##,
7225 default_severity: Severity::Allow,
7226 warn_since: None,
7227 deny_since: None,
7228 },
7229 Lint {
7230 label: "dirhandle",
7231 description: r##"# `dirhandle`
7232
7233
7234
7235The tracking issue for this feature is: [#120426]
7236
7237[#120426]: https://github.com/rust-lang/rust/issues/120426
7238
7239------------------------
7240"##,
7241 default_severity: Severity::Allow,
7242 warn_since: None,
7243 deny_since: None,
7244 },
7245 Lint {
7246 label: "discriminant_kind",
7247 description: r##"# `discriminant_kind`
7248
7249
7250
7251This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
7252
7253------------------------
7254"##,
7255 default_severity: Severity::Allow,
7256 warn_since: None,
7257 deny_since: None,
7258 },
7259 Lint {
7260 label: "disjoint_bitor",
7261 description: r##"# `disjoint_bitor`
7262
7263
7264
7265The tracking issue for this feature is: [#135758]
7266
7267[#135758]: https://github.com/rust-lang/rust/issues/135758
7268
7269------------------------
7270"##,
7271 default_severity: Severity::Allow,
7272 warn_since: None,
7273 deny_since: None,
7274 },
7275 Lint {
7276 label: "dispatch_from_dyn",
7277 description: r##"# `dispatch_from_dyn`
7278
7279
7280
7281This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
7282
7283------------------------
7284"##,
7285 default_severity: Severity::Allow,
7286 warn_since: None,
7287 deny_since: None,
7288 },
7289 Lint {
7290 label: "doc_cfg",
7291 description: r##"# `doc_cfg`
7292
7293The tracking issue for this feature is: [#43781]
7294
7295------
7296
7297The `doc_cfg` feature allows an API be documented as only available in some specific platforms.
7298This attribute has two effects:
7299
73001. In the annotated item's documentation, there will be a message saying "Available on
7301 (platform) only".
7302
73032. The item's doc-tests will only run on the specific platform.
7304
7305In addition to allowing the use of the `#[doc(cfg)]` attribute, this feature enables the use of a
7306special conditional compilation flag, `#[cfg(doc)]`, set whenever building documentation on your
7307crate.
7308
7309This feature was introduced as part of PR [#43348] to allow the platform-specific parts of the
7310standard library be documented.
7311
7312```rust
7313#![feature(doc_cfg)]
7314
7315#[cfg(any(windows, doc))]
7316#[doc(cfg(windows))]
7317/// The application's icon in the notification area (a.k.a. system tray).
7318///
7319/// # Examples
7320///
7321/// ```no_run
7322/// extern crate my_awesome_ui_library;
7323/// use my_awesome_ui_library::current_app;
7324/// use my_awesome_ui_library::windows::notification;
7325///
7326/// let icon = current_app().get::<notification::Icon>();
7327/// icon.show();
7328/// icon.show_message("Hello");
7329/// ```
7330pub struct Icon {
7331 // ...
7332}
7333```
7334
7335[#43781]: https://github.com/rust-lang/rust/issues/43781
7336[#43348]: https://github.com/rust-lang/rust/issues/43348
7337"##,
7338 default_severity: Severity::Allow,
7339 warn_since: None,
7340 deny_since: None,
7341 },
7342 Lint {
7343 label: "doc_masked",
7344 description: r##"# `doc_masked`
7345
7346The tracking issue for this feature is: [#44027]
7347
7348-----
7349
7350The `doc_masked` feature allows a crate to exclude types from a given crate from appearing in lists
7351of trait implementations. The specifics of the feature are as follows:
7352
73531. When rustdoc encounters an `extern crate` statement annotated with a `#[doc(masked)]` attribute,
7354 it marks the crate as being masked.
7355
73562. When listing traits a given type implements, rustdoc ensures that traits from masked crates are
7357 not emitted into the documentation.
7358
73593. When listing types that implement a given trait, rustdoc ensures that types from masked crates
7360 are not emitted into the documentation.
7361
7362This feature was introduced in PR [#44026] to ensure that compiler-internal and
7363implementation-specific types and traits were not included in the standard library's documentation.
7364Such types would introduce broken links into the documentation.
7365
7366[#44026]: https://github.com/rust-lang/rust/pull/44026
7367[#44027]: https://github.com/rust-lang/rust/pull/44027
7368"##,
7369 default_severity: Severity::Allow,
7370 warn_since: None,
7371 deny_since: None,
7372 },
7373 Lint {
7374 label: "doc_notable_trait",
7375 description: r##"# `doc_notable_trait`
7376
7377The tracking issue for this feature is: [#45040]
7378
7379The `doc_notable_trait` feature allows the use of the `#[doc(notable_trait)]`
7380attribute, which will display the trait in a "Notable traits" dialog for
7381functions returning types that implement the trait. For example, this attribute
7382is applied to the `Iterator`, `Future`, `io::Read`, and `io::Write` traits in
7383the standard library.
7384
7385You can do this on your own traits like so:
7386
7387```
7388#![feature(doc_notable_trait)]
7389
7390#[doc(notable_trait)]
7391pub trait MyTrait {}
7392
7393pub struct MyStruct;
7394impl MyTrait for MyStruct {}
7395
7396/// The docs for this function will have a button that displays a dialog about
7397/// `MyStruct` implementing `MyTrait`.
7398pub fn my_fn() -> MyStruct { MyStruct }
7399```
7400
7401This feature was originally implemented in PR [#45039].
7402
7403See also its documentation in [the rustdoc book][rustdoc-book-notable_trait].
7404
7405[#45040]: https://github.com/rust-lang/rust/issues/45040
7406[#45039]: https://github.com/rust-lang/rust/pull/45039
7407[rustdoc-book-notable_trait]: ../../rustdoc/unstable-features.html#adding-your-trait-to-the-notable-traits-dialog
7408"##,
7409 default_severity: Severity::Allow,
7410 warn_since: None,
7411 deny_since: None,
7412 },
7413 Lint {
7414 label: "downcast_unchecked",
7415 description: r##"# `downcast_unchecked`
7416
7417
7418
7419The tracking issue for this feature is: [#90850]
7420
7421[#90850]: https://github.com/rust-lang/rust/issues/90850
7422
7423------------------------
7424"##,
7425 default_severity: Severity::Allow,
7426 warn_since: None,
7427 deny_since: None,
7428 },
7429 Lint {
7430 label: "drain_keep_rest",
7431 description: r##"# `drain_keep_rest`
7432
7433
7434
7435The tracking issue for this feature is: [#101122]
7436
7437[#101122]: https://github.com/rust-lang/rust/issues/101122
7438
7439------------------------
7440"##,
7441 default_severity: Severity::Allow,
7442 warn_since: None,
7443 deny_since: None,
7444 },
7445 Lint {
7446 label: "drop_guard",
7447 description: r##"# `drop_guard`
7448
7449
7450
7451The tracking issue for this feature is: [#144426]
7452
7453[#144426]: https://github.com/rust-lang/rust/issues/144426
7454
7455------------------------
7456"##,
7457 default_severity: Severity::Allow,
7458 warn_since: None,
7459 deny_since: None,
7460 },
7461 Lint {
7462 label: "dropck_eyepatch",
7463 description: r##"# `dropck_eyepatch`
7464
7465Allows using the `may_dangle` attribute (RFC 1327).
7466
7467The tracking issue for this feature is: [#34761]
7468
7469[#34761]: https://github.com/rust-lang/rust/issues/34761
7470
7471------------------------
7472"##,
7473 default_severity: Severity::Allow,
7474 warn_since: None,
7475 deny_since: None,
7476 },
7477 Lint {
7478 label: "duration_constants",
7479 description: r##"# `duration_constants`
7480
7481
7482
7483The tracking issue for this feature is: [#57391]
7484
7485[#57391]: https://github.com/rust-lang/rust/issues/57391
7486
7487------------------------
7488"##,
7489 default_severity: Severity::Allow,
7490 warn_since: None,
7491 deny_since: None,
7492 },
7493 Lint {
7494 label: "duration_constructors",
7495 description: r##"# `duration_constructors`
7496
7497The tracking issue for this feature is: [#120301]
7498
7499[#120301]: https://github.com/rust-lang/rust/issues/120301
7500
7501------------------------
7502
7503Add the methods `from_days` and `from_weeks` to `Duration`.
7504"##,
7505 default_severity: Severity::Allow,
7506 warn_since: None,
7507 deny_since: None,
7508 },
7509 Lint {
7510 label: "duration_integer_division",
7511 description: r##"# `duration_integer_division`
7512
7513
7514
7515The tracking issue for this feature is: [#149573]
7516
7517[#149573]: https://github.com/rust-lang/rust/issues/149573
7518
7519------------------------
7520"##,
7521 default_severity: Severity::Allow,
7522 warn_since: None,
7523 deny_since: None,
7524 },
7525 Lint {
7526 label: "duration_millis_float",
7527 description: r##"# `duration_millis_float`
7528
7529
7530
7531The tracking issue for this feature is: [#122451]
7532
7533[#122451]: https://github.com/rust-lang/rust/issues/122451
7534
7535------------------------
7536"##,
7537 default_severity: Severity::Allow,
7538 warn_since: None,
7539 deny_since: None,
7540 },
7541 Lint {
7542 label: "duration_units",
7543 description: r##"# `duration_units`
7544
7545
7546
7547The tracking issue for this feature is: [#120301]
7548
7549[#120301]: https://github.com/rust-lang/rust/issues/120301
7550
7551------------------------
7552"##,
7553 default_severity: Severity::Allow,
7554 warn_since: None,
7555 deny_since: None,
7556 },
7557 Lint {
7558 label: "edition_panic",
7559 description: r##"# `edition_panic`
7560
7561
7562
7563This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
7564
7565------------------------
7566"##,
7567 default_severity: Severity::Allow,
7568 warn_since: None,
7569 deny_since: None,
7570 },
7571 Lint {
7572 label: "effective_target_features",
7573 description: r##"# `effective_target_features`
7574
7575Allows features to allow target_feature to better interact with traits.
7576
7577The tracking issue for this feature is: [#143352]
7578
7579[#143352]: https://github.com/rust-lang/rust/issues/143352
7580
7581------------------------
7582"##,
7583 default_severity: Severity::Allow,
7584 warn_since: None,
7585 deny_since: None,
7586 },
7587 Lint {
7588 label: "eii_internals",
7589 description: r##"# `eii_internals`
7590
7591Implementation details of externally implementable items
7592
7593This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
7594
7595------------------------
7596"##,
7597 default_severity: Severity::Allow,
7598 warn_since: None,
7599 deny_since: None,
7600 },
7601 Lint {
7602 label: "ergonomic_clones",
7603 description: r##"# `ergonomic_clones`
7604
7605Allows the .use postfix syntax `x.use` and use closures `use |x| { ... }`
7606
7607The tracking issue for this feature is: [#132290]
7608
7609[#132290]: https://github.com/rust-lang/rust/issues/132290
7610
7611------------------------
7612"##,
7613 default_severity: Severity::Allow,
7614 warn_since: None,
7615 deny_since: None,
7616 },
7617 Lint {
7618 label: "ermsb_target_feature",
7619 description: r##"# `ermsb_target_feature`
7620
7621ermsb target feature on x86.
7622
7623The tracking issue for this feature is: [#150249]
7624
7625[#150249]: https://github.com/rust-lang/rust/issues/150249
7626
7627------------------------
7628"##,
7629 default_severity: Severity::Allow,
7630 warn_since: None,
7631 deny_since: None,
7632 },
7633 Lint {
7634 label: "error_generic_member_access",
7635 description: r##"# `error_generic_member_access`
7636
7637
7638
7639The tracking issue for this feature is: [#99301]
7640
7641[#99301]: https://github.com/rust-lang/rust/issues/99301
7642
7643------------------------
7644"##,
7645 default_severity: Severity::Allow,
7646 warn_since: None,
7647 deny_since: None,
7648 },
7649 Lint {
7650 label: "error_iter",
7651 description: r##"# `error_iter`
7652
7653
7654
7655The tracking issue for this feature is: [#58520]
7656
7657[#58520]: https://github.com/rust-lang/rust/issues/58520
7658
7659------------------------
7660"##,
7661 default_severity: Severity::Allow,
7662 warn_since: None,
7663 deny_since: None,
7664 },
7665 Lint {
7666 label: "error_reporter",
7667 description: r##"# `error_reporter`
7668
7669
7670
7671The tracking issue for this feature is: [#90172]
7672
7673[#90172]: https://github.com/rust-lang/rust/issues/90172
7674
7675------------------------
7676"##,
7677 default_severity: Severity::Allow,
7678 warn_since: None,
7679 deny_since: None,
7680 },
7681 Lint {
7682 label: "error_type_id",
7683 description: r##"# `error_type_id`
7684
7685
7686
7687The tracking issue for this feature is: [#60784]
7688
7689[#60784]: https://github.com/rust-lang/rust/issues/60784
7690
7691------------------------
7692"##,
7693 default_severity: Severity::Allow,
7694 warn_since: None,
7695 deny_since: None,
7696 },
7697 Lint {
7698 label: "exact_bitshifts",
7699 description: r##"# `exact_bitshifts`
7700
7701
7702
7703The tracking issue for this feature is: [#144336]
7704
7705[#144336]: https://github.com/rust-lang/rust/issues/144336
7706
7707------------------------
7708"##,
7709 default_severity: Severity::Allow,
7710 warn_since: None,
7711 deny_since: None,
7712 },
7713 Lint {
7714 label: "exact_div",
7715 description: r##"# `exact_div`
7716
7717
7718
7719The tracking issue for this feature is: [#139911]
7720
7721[#139911]: https://github.com/rust-lang/rust/issues/139911
7722
7723------------------------
7724"##,
7725 default_severity: Severity::Allow,
7726 warn_since: None,
7727 deny_since: None,
7728 },
7729 Lint {
7730 label: "exact_size_is_empty",
7731 description: r##"# `exact_size_is_empty`
7732
7733
7734
7735The tracking issue for this feature is: [#35428]
7736
7737[#35428]: https://github.com/rust-lang/rust/issues/35428
7738
7739------------------------
7740"##,
7741 default_severity: Severity::Allow,
7742 warn_since: None,
7743 deny_since: None,
7744 },
7745 Lint {
7746 label: "exclusive_wrapper",
7747 description: r##"# `exclusive_wrapper`
7748
7749
7750
7751The tracking issue for this feature is: [#98407]
7752
7753[#98407]: https://github.com/rust-lang/rust/issues/98407
7754
7755------------------------
7756"##,
7757 default_severity: Severity::Allow,
7758 warn_since: None,
7759 deny_since: None,
7760 },
7761 Lint {
7762 label: "exhaustive_patterns",
7763 description: r##"# `exhaustive_patterns`
7764
7765Allows exhaustive pattern matching on types that contain uninhabited types.
7766
7767The tracking issue for this feature is: [#51085]
7768
7769[#51085]: https://github.com/rust-lang/rust/issues/51085
7770
7771------------------------
7772"##,
7773 default_severity: Severity::Allow,
7774 warn_since: None,
7775 deny_since: None,
7776 },
7777 Lint {
7778 label: "exit_status_error",
7779 description: r##"# `exit_status_error`
7780
7781
7782
7783The tracking issue for this feature is: [#84908]
7784
7785[#84908]: https://github.com/rust-lang/rust/issues/84908
7786
7787------------------------
7788"##,
7789 default_severity: Severity::Allow,
7790 warn_since: None,
7791 deny_since: None,
7792 },
7793 Lint {
7794 label: "exitcode_exit_method",
7795 description: r##"# `exitcode_exit_method`
7796
7797
7798
7799The tracking issue for this feature is: [#97100]
7800
7801[#97100]: https://github.com/rust-lang/rust/issues/97100
7802
7803------------------------
7804"##,
7805 default_severity: Severity::Allow,
7806 warn_since: None,
7807 deny_since: None,
7808 },
7809 Lint {
7810 label: "explicit_extern_abis",
7811 description: r##"# `explicit_extern_abis`
7812
7813The tracking issue for this feature is: [#134986]
7814
7815------
7816
7817Disallow `extern` without an explicit ABI. We should write `extern "C"`
7818(or another ABI) instead of just `extern`.
7819
7820By making the ABI explicit, it becomes much clearer that "C" is just one of the
7821possible choices, rather than the "standard" way for external functions.
7822Removing the default makes it easier to add a new ABI on equal footing as "C".
7823
7824```rust,editionfuture,compile_fail
7825#![feature(explicit_extern_abis)]
7826
7827extern fn function1() {} // ERROR `extern` declarations without an explicit ABI
7828 // are disallowed
7829
7830extern "C" fn function2() {} // compiles
7831
7832extern "aapcs" fn function3() {} // compiles
7833```
7834
7835[#134986]: https://github.com/rust-lang/rust/issues/134986
7836"##,
7837 default_severity: Severity::Allow,
7838 warn_since: None,
7839 deny_since: None,
7840 },
7841 Lint {
7842 label: "explicit_tail_calls",
7843 description: r##"# `explicit_tail_calls`
7844
7845Allows explicit tail calls via `become` expression.
7846
7847The tracking issue for this feature is: [#112788]
7848
7849[#112788]: https://github.com/rust-lang/rust/issues/112788
7850
7851------------------------
7852"##,
7853 default_severity: Severity::Allow,
7854 warn_since: None,
7855 deny_since: None,
7856 },
7857 Lint {
7858 label: "export_stable",
7859 description: r##"# `export_stable`
7860
7861Allows using `#[export_stable]` which indicates that an item is exportable.
7862
7863The tracking issue for this feature is: [#139939]
7864
7865[#139939]: https://github.com/rust-lang/rust/issues/139939
7866
7867------------------------
7868"##,
7869 default_severity: Severity::Allow,
7870 warn_since: None,
7871 deny_since: None,
7872 },
7873 Lint {
7874 label: "extend_one",
7875 description: r##"# `extend_one`
7876
7877
7878
7879The tracking issue for this feature is: [#72631]
7880
7881[#72631]: https://github.com/rust-lang/rust/issues/72631
7882
7883------------------------
7884"##,
7885 default_severity: Severity::Allow,
7886 warn_since: None,
7887 deny_since: None,
7888 },
7889 Lint {
7890 label: "extend_one_unchecked",
7891 description: r##"# `extend_one_unchecked`
7892
7893
7894
7895This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
7896
7897------------------------
7898"##,
7899 default_severity: Severity::Allow,
7900 warn_since: None,
7901 deny_since: None,
7902 },
7903 Lint {
7904 label: "extern_item_impls",
7905 description: r##"# `extern_item_impls`
7906
7907Externally implementable items
7908
7909The tracking issue for this feature is: [#125418]
7910
7911[#125418]: https://github.com/rust-lang/rust/issues/125418
7912
7913------------------------
7914"##,
7915 default_severity: Severity::Allow,
7916 warn_since: None,
7917 deny_since: None,
7918 },
7919 Lint {
7920 label: "extern_types",
7921 description: r##"# `extern_types`
7922
7923Allows defining `extern type`s.
7924
7925The tracking issue for this feature is: [#43467]
7926
7927[#43467]: https://github.com/rust-lang/rust/issues/43467
7928
7929------------------------
7930"##,
7931 default_severity: Severity::Allow,
7932 warn_since: None,
7933 deny_since: None,
7934 },
7935 Lint {
7936 label: "f128",
7937 description: r##"# `f128`
7938
7939The tracking issue for this feature is: [#116909]
7940
7941[#116909]: https://github.com/rust-lang/rust/issues/116909
7942
7943---
7944
7945Enable the `f128` type for IEEE 128-bit floating numbers (quad precision).
7946"##,
7947 default_severity: Severity::Allow,
7948 warn_since: None,
7949 deny_since: None,
7950 },
7951 Lint {
7952 label: "f16",
7953 description: r##"# `f16`
7954
7955The tracking issue for this feature is: [#116909]
7956
7957[#116909]: https://github.com/rust-lang/rust/issues/116909
7958
7959---
7960
7961Enable the `f16` type for IEEE 16-bit floating numbers (half precision).
7962"##,
7963 default_severity: Severity::Allow,
7964 warn_since: None,
7965 deny_since: None,
7966 },
7967 Lint {
7968 label: "f32_from_f16",
7969 description: r##"# `f32_from_f16`
7970
7971
7972
7973The tracking issue for this feature is: [#154005]
7974
7975[#154005]: https://github.com/rust-lang/rust/issues/154005
7976
7977------------------------
7978"##,
7979 default_severity: Severity::Allow,
7980 warn_since: None,
7981 deny_since: None,
7982 },
7983 Lint {
7984 label: "fd",
7985 description: r##"# `fd`
7986
7987This feature is internal to the Rust compiler and is not intended for general use.
7988
7989------------------------
7990"##,
7991 default_severity: Severity::Allow,
7992 warn_since: None,
7993 deny_since: None,
7994 },
7995 Lint {
7996 label: "ffi_const",
7997 description: r##"# `ffi_const`
7998
7999The tracking issue for this feature is: [#58328]
8000
8001------
8002
8003The `#[ffi_const]` attribute applies clang's `const` attribute to foreign
8004functions declarations.
8005
8006That is, `#[ffi_const]` functions shall have no effects except for its return
8007value, which can only depend on the values of the function parameters, and is
8008not affected by changes to the observable state of the program.
8009
8010Applying the `#[ffi_const]` attribute to a function that violates these
8011requirements is undefined behaviour.
8012
8013This attribute enables Rust to perform common optimizations, like sub-expression
8014elimination, and it can avoid emitting some calls in repeated invocations of the
8015function with the same argument values regardless of other operations being
8016performed in between these functions calls (as opposed to `#[ffi_pure]`
8017functions).
8018
8019## Pitfalls
8020
8021A `#[ffi_const]` function can only read global memory that would not affect
8022its return value for the whole execution of the program (e.g. immutable global
8023memory). `#[ffi_const]` functions are referentially-transparent and therefore
8024more strict than `#[ffi_pure]` functions.
8025
8026A common pitfall involves applying the `#[ffi_const]` attribute to a
8027function that reads memory through pointer arguments which do not necessarily
8028point to immutable global memory.
8029
8030A `#[ffi_const]` function that returns unit has no effect on the abstract
8031machine's state, and a `#[ffi_const]` function cannot be `#[ffi_pure]`.
8032
8033A `#[ffi_const]` function must not diverge, neither via a side effect (e.g. a
8034call to `abort`) nor by infinite loops.
8035
8036When translating C headers to Rust FFI, it is worth verifying for which targets
8037the `const` attribute is enabled in those headers, and using the appropriate
8038`cfg` macros in the Rust side to match those definitions. While the semantics of
8039`const` are implemented identically by many C and C++ compilers, e.g., clang,
8040[GCC], [ARM C/C++ compiler], [IBM ILE C/C++], etc. they are not necessarily
8041implemented in this way on all of them. It is therefore also worth verifying
8042that the semantics of the C toolchain used to compile the binary being linked
8043against are compatible with those of the `#[ffi_const]`.
8044
8045[#58328]: https://github.com/rust-lang/rust/issues/58328
8046[ARM C/C++ compiler]: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0491c/Cacgigch.html
8047[GCC]: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-const-function-attribute
8048[IBM ILE C/C++]: https://www.ibm.com/support/knowledgecenter/fr/ssw_ibm_i_71/rzarg/fn_attrib_const.htm
8049"##,
8050 default_severity: Severity::Allow,
8051 warn_since: None,
8052 deny_since: None,
8053 },
8054 Lint {
8055 label: "ffi_pure",
8056 description: r##"# `ffi_pure`
8057
8058The tracking issue for this feature is: [#58329]
8059
8060------
8061
8062The `#[ffi_pure]` attribute applies clang's `pure` attribute to foreign
8063functions declarations.
8064
8065That is, `#[ffi_pure]` functions shall have no effects except for its return
8066value, which shall not change across two consecutive function calls with
8067the same parameters.
8068
8069Applying the `#[ffi_pure]` attribute to a function that violates these
8070requirements is undefined behavior.
8071
8072This attribute enables Rust to perform common optimizations, like sub-expression
8073elimination and loop optimizations. Some common examples of pure functions are
8074`strlen` or `memcmp`.
8075
8076These optimizations are only applicable when the compiler can prove that no
8077program state observable by the `#[ffi_pure]` function has changed between calls
8078of the function, which could alter the result. See also the `#[ffi_const]`
8079attribute, which provides stronger guarantees regarding the allowable behavior
8080of a function, enabling further optimization.
8081
8082## Pitfalls
8083
8084A `#[ffi_pure]` function can read global memory through the function
8085parameters (e.g. pointers), globals, etc. `#[ffi_pure]` functions are not
8086referentially-transparent, and are therefore more relaxed than `#[ffi_const]`
8087functions.
8088
8089However, accessing global memory through volatile or atomic reads can violate the
8090requirement that two consecutive function calls shall return the same value.
8091
8092A `pure` function that returns unit has no effect on the abstract machine's
8093state.
8094
8095A `#[ffi_pure]` function must not diverge, neither via a side effect (e.g. a
8096call to `abort`) nor by infinite loops.
8097
8098When translating C headers to Rust FFI, it is worth verifying for which targets
8099the `pure` attribute is enabled in those headers, and using the appropriate
8100`cfg` macros in the Rust side to match those definitions. While the semantics of
8101`pure` are implemented identically by many C and C++ compilers, e.g., clang,
8102[GCC], [ARM C/C++ compiler], [IBM ILE C/C++], etc. they are not necessarily
8103implemented in this way on all of them. It is therefore also worth verifying
8104that the semantics of the C toolchain used to compile the binary being linked
8105against are compatible with those of the `#[ffi_pure]`.
8106
8107
8108[#58329]: https://github.com/rust-lang/rust/issues/58329
8109[ARM C/C++ compiler]: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0491c/Cacigdac.html
8110[GCC]: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-pure-function-attribute
8111[IBM ILE C/C++]: https://www.ibm.com/support/knowledgecenter/fr/ssw_ibm_i_71/rzarg/fn_attrib_pure.htm
8112"##,
8113 default_severity: Severity::Allow,
8114 warn_since: None,
8115 deny_since: None,
8116 },
8117 Lint {
8118 label: "field_projections",
8119 description: r##"# `field_projections`
8120
8121Experimental field projections.
8122
8123The tracking issue for this feature is: [#145383]
8124
8125[#145383]: https://github.com/rust-lang/rust/issues/145383
8126
8127------------------------
8128"##,
8129 default_severity: Severity::Allow,
8130 warn_since: None,
8131 deny_since: None,
8132 },
8133 Lint {
8134 label: "field_representing_type_raw",
8135 description: r##"# `field_representing_type_raw`
8136
8137Implementation details of field representing types.
8138
8139This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
8140
8141------------------------
8142"##,
8143 default_severity: Severity::Allow,
8144 warn_since: None,
8145 deny_since: None,
8146 },
8147 Lint {
8148 label: "file_buffered",
8149 description: r##"# `file_buffered`
8150
8151
8152
8153The tracking issue for this feature is: [#130804]
8154
8155[#130804]: https://github.com/rust-lang/rust/issues/130804
8156
8157------------------------
8158"##,
8159 default_severity: Severity::Allow,
8160 warn_since: None,
8161 deny_since: None,
8162 },
8163 Lint {
8164 label: "final_associated_functions",
8165 description: r##"# `final_associated_functions`
8166
8167Allows marking trait functions as `final` to prevent overriding impls
8168
8169The tracking issue for this feature is: [#131179]
8170
8171[#131179]: https://github.com/rust-lang/rust/issues/131179
8172
8173------------------------
8174"##,
8175 default_severity: Severity::Allow,
8176 warn_since: None,
8177 deny_since: None,
8178 },
8179 Lint {
8180 label: "float_algebraic",
8181 description: r##"# `float_algebraic`
8182
8183
8184
8185The tracking issue for this feature is: [#136469]
8186
8187[#136469]: https://github.com/rust-lang/rust/issues/136469
8188
8189------------------------
8190"##,
8191 default_severity: Severity::Allow,
8192 warn_since: None,
8193 deny_since: None,
8194 },
8195 Lint {
8196 label: "float_bits_const",
8197 description: r##"# `float_bits_const`
8198
8199
8200
8201The tracking issue for this feature is: [#151073]
8202
8203[#151073]: https://github.com/rust-lang/rust/issues/151073
8204
8205------------------------
8206"##,
8207 default_severity: Severity::Allow,
8208 warn_since: None,
8209 deny_since: None,
8210 },
8211 Lint {
8212 label: "float_erf",
8213 description: r##"# `float_erf`
8214
8215
8216
8217The tracking issue for this feature is: [#136321]
8218
8219[#136321]: https://github.com/rust-lang/rust/issues/136321
8220
8221------------------------
8222"##,
8223 default_severity: Severity::Allow,
8224 warn_since: None,
8225 deny_since: None,
8226 },
8227 Lint {
8228 label: "float_exact_integer_constants",
8229 description: r##"# `float_exact_integer_constants`
8230
8231
8232
8233The tracking issue for this feature is: [#152466]
8234
8235[#152466]: https://github.com/rust-lang/rust/issues/152466
8236
8237------------------------
8238"##,
8239 default_severity: Severity::Allow,
8240 warn_since: None,
8241 deny_since: None,
8242 },
8243 Lint {
8244 label: "float_gamma",
8245 description: r##"# `float_gamma`
8246
8247
8248
8249The tracking issue for this feature is: [#99842]
8250
8251[#99842]: https://github.com/rust-lang/rust/issues/99842
8252
8253------------------------
8254"##,
8255 default_severity: Severity::Allow,
8256 warn_since: None,
8257 deny_since: None,
8258 },
8259 Lint {
8260 label: "float_masks",
8261 description: r##"# `float_masks`
8262
8263
8264
8265The tracking issue for this feature is: [#154064]
8266
8267[#154064]: https://github.com/rust-lang/rust/issues/154064
8268
8269------------------------
8270"##,
8271 default_severity: Severity::Allow,
8272 warn_since: None,
8273 deny_since: None,
8274 },
8275 Lint {
8276 label: "float_minimum_maximum",
8277 description: r##"# `float_minimum_maximum`
8278
8279
8280
8281The tracking issue for this feature is: [#91079]
8282
8283[#91079]: https://github.com/rust-lang/rust/issues/91079
8284
8285------------------------
8286"##,
8287 default_severity: Severity::Allow,
8288 warn_since: None,
8289 deny_since: None,
8290 },
8291 Lint {
8292 label: "flt2dec",
8293 description: r##"# `flt2dec`
8294
8295This feature is internal to the Rust compiler and is not intended for general use.
8296
8297------------------------
8298"##,
8299 default_severity: Severity::Allow,
8300 warn_since: None,
8301 deny_since: None,
8302 },
8303 Lint {
8304 label: "fma4_target_feature",
8305 description: r##"# `fma4_target_feature`
8306
8307fma4 target feature on x86.
8308
8309The tracking issue for this feature is: [#155233]
8310
8311[#155233]: https://github.com/rust-lang/rust/issues/155233
8312
8313------------------------
8314"##,
8315 default_severity: Severity::Allow,
8316 warn_since: None,
8317 deny_since: None,
8318 },
8319 Lint {
8320 label: "fmt_arguments_from_str",
8321 description: r##"# `fmt_arguments_from_str`
8322
8323
8324
8325The tracking issue for this feature is: [#148905]
8326
8327[#148905]: https://github.com/rust-lang/rust/issues/148905
8328
8329------------------------
8330"##,
8331 default_severity: Severity::Allow,
8332 warn_since: None,
8333 deny_since: None,
8334 },
8335 Lint {
8336 label: "fmt_debug",
8337 description: r##"# `fmt_debug`
8338
8339Controlling the behavior of fmt::Debug
8340
8341The tracking issue for this feature is: [#129709]
8342
8343[#129709]: https://github.com/rust-lang/rust/issues/129709
8344
8345------------------------
8346"##,
8347 default_severity: Severity::Allow,
8348 warn_since: None,
8349 deny_since: None,
8350 },
8351 Lint {
8352 label: "fmt_helpers_for_derive",
8353 description: r##"# `fmt_helpers_for_derive`
8354
8355
8356
8357This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
8358
8359------------------------
8360"##,
8361 default_severity: Severity::Allow,
8362 warn_since: None,
8363 deny_since: None,
8364 },
8365 Lint {
8366 label: "fmt_internals",
8367 description: r##"# `fmt_internals`
8368
8369This feature is internal to the Rust compiler and is not intended for general use.
8370
8371------------------------
8372"##,
8373 default_severity: Severity::Allow,
8374 warn_since: None,
8375 deny_since: None,
8376 },
8377 Lint {
8378 label: "fn_align",
8379 description: r##"# `fn_align`
8380
8381Allows using `#[align(...)]` on function items
8382
8383The tracking issue for this feature is: [#82232]
8384
8385[#82232]: https://github.com/rust-lang/rust/issues/82232
8386
8387------------------------
8388"##,
8389 default_severity: Severity::Allow,
8390 warn_since: None,
8391 deny_since: None,
8392 },
8393 Lint {
8394 label: "fn_delegation",
8395 description: r##"# `fn_delegation`
8396
8397Support delegating implementation of functions to other already implemented functions.
8398
8399The tracking issue for this feature is: [#118212]
8400
8401[#118212]: https://github.com/rust-lang/rust/issues/118212
8402
8403------------------------
8404"##,
8405 default_severity: Severity::Allow,
8406 warn_since: None,
8407 deny_since: None,
8408 },
8409 Lint {
8410 label: "fn_ptr_trait",
8411 description: r##"# `fn_ptr_trait`
8412
8413
8414
8415This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
8416
8417------------------------
8418"##,
8419 default_severity: Severity::Allow,
8420 warn_since: None,
8421 deny_since: None,
8422 },
8423 Lint {
8424 label: "fn_traits",
8425 description: r##"# `fn_traits`
8426
8427The tracking issue for this feature is [#29625]
8428
8429See Also: [`unboxed_closures`](../language-features/unboxed-closures.md)
8430
8431[#29625]: https://github.com/rust-lang/rust/issues/29625
8432
8433----
8434
8435The `fn_traits` feature allows for implementation of the [`Fn*`] traits
8436for creating custom closure-like types.
8437
8438[`Fn*`]: ../../std/ops/trait.Fn.html
8439
8440```rust
8441#![feature(unboxed_closures)]
8442#![feature(fn_traits)]
8443
8444struct Adder {
8445 a: u32
8446}
8447
8448impl FnOnce<(u32, )> for Adder {
8449 type Output = u32;
8450 extern "rust-call" fn call_once(self, b: (u32, )) -> Self::Output {
8451 self.a + b.0
8452 }
8453}
8454
8455fn main() {
8456 let adder = Adder { a: 3 };
8457 assert_eq!(adder(2), 5);
8458}
8459```
8460"##,
8461 default_severity: Severity::Allow,
8462 warn_since: None,
8463 deny_since: None,
8464 },
8465 Lint {
8466 label: "forget_unsized",
8467 description: r##"# `forget_unsized`
8468
8469
8470
8471This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
8472
8473------------------------
8474"##,
8475 default_severity: Severity::Allow,
8476 warn_since: None,
8477 deny_since: None,
8478 },
8479 Lint {
8480 label: "format_args_nl",
8481 description: r##"# `format_args_nl`
8482
8483
8484
8485This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
8486
8487------------------------
8488"##,
8489 default_severity: Severity::Allow,
8490 warn_since: None,
8491 deny_since: None,
8492 },
8493 Lint {
8494 label: "formatting_options",
8495 description: r##"# `formatting_options`
8496
8497
8498
8499The tracking issue for this feature is: [#118117]
8500
8501[#118117]: https://github.com/rust-lang/rust/issues/118117
8502
8503------------------------
8504"##,
8505 default_severity: Severity::Allow,
8506 warn_since: None,
8507 deny_since: None,
8508 },
8509 Lint {
8510 label: "freeze",
8511 description: r##"# `freeze`
8512
8513
8514
8515The tracking issue for this feature is: [#121675]
8516
8517[#121675]: https://github.com/rust-lang/rust/issues/121675
8518
8519------------------------
8520"##,
8521 default_severity: Severity::Allow,
8522 warn_since: None,
8523 deny_since: None,
8524 },
8525 Lint {
8526 label: "freeze_impls",
8527 description: r##"# `freeze_impls`
8528
8529Allows impls for the Freeze trait.
8530
8531The tracking issue for this feature is: [#121675]
8532
8533[#121675]: https://github.com/rust-lang/rust/issues/121675
8534
8535------------------------
8536"##,
8537 default_severity: Severity::Allow,
8538 warn_since: None,
8539 deny_since: None,
8540 },
8541 Lint {
8542 label: "frontmatter",
8543 description: r##"# `frontmatter`
8544
8545The tracking issue for this feature is: [#136889]
8546
8547------
8548
8549The `frontmatter` feature allows an extra metadata block at the top of files for consumption by
8550external tools. For example, it can be used by [`cargo-script`] files to specify dependencies.
8551
8552```rust
8553#!/usr/bin/env -S cargo -Zscript
8554---
8555[dependencies]
8556libc = "0.2.172"
8557---
8558#![feature(frontmatter)]
8559# mod libc { pub type c_int = i32; }
8560
8561fn main() {
8562 let x: libc::c_int = 1i32;
8563}
8564```
8565
8566[#136889]: https://github.com/rust-lang/rust/issues/136889
8567[`cargo-script`]: https://rust-lang.github.io/rfcs/3502-cargo-script.html
8568"##,
8569 default_severity: Severity::Allow,
8570 warn_since: None,
8571 deny_since: None,
8572 },
8573 Lint {
8574 label: "fs_set_times",
8575 description: r##"# `fs_set_times`
8576
8577
8578
8579The tracking issue for this feature is: [#147455]
8580
8581[#147455]: https://github.com/rust-lang/rust/issues/147455
8582
8583------------------------
8584"##,
8585 default_severity: Severity::Allow,
8586 warn_since: None,
8587 deny_since: None,
8588 },
8589 Lint {
8590 label: "fundamental",
8591 description: r##"# `fundamental`
8592
8593Allows using the `#[fundamental]` attribute.
8594
8595The tracking issue for this feature is: [#29635]
8596
8597[#29635]: https://github.com/rust-lang/rust/issues/29635
8598
8599------------------------
8600"##,
8601 default_severity: Severity::Allow,
8602 warn_since: None,
8603 deny_since: None,
8604 },
8605 Lint {
8606 label: "funnel_shifts",
8607 description: r##"# `funnel_shifts`
8608
8609
8610
8611The tracking issue for this feature is: [#145686]
8612
8613[#145686]: https://github.com/rust-lang/rust/issues/145686
8614
8615------------------------
8616"##,
8617 default_severity: Severity::Allow,
8618 warn_since: None,
8619 deny_since: None,
8620 },
8621 Lint {
8622 label: "future_join",
8623 description: r##"# `future_join`
8624
8625
8626
8627The tracking issue for this feature is: [#91642]
8628
8629[#91642]: https://github.com/rust-lang/rust/issues/91642
8630
8631------------------------
8632"##,
8633 default_severity: Severity::Allow,
8634 warn_since: None,
8635 deny_since: None,
8636 },
8637 Lint {
8638 label: "gen_blocks",
8639 description: r##"# `gen_blocks`
8640
8641Allows defining gen blocks and `gen fn`.
8642
8643The tracking issue for this feature is: [#117078]
8644
8645[#117078]: https://github.com/rust-lang/rust/issues/117078
8646
8647------------------------
8648"##,
8649 default_severity: Severity::Allow,
8650 warn_since: None,
8651 deny_since: None,
8652 },
8653 Lint {
8654 label: "gen_future",
8655 description: r##"# `gen_future`
8656
8657
8658
8659This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
8660
8661------------------------
8662"##,
8663 default_severity: Severity::Allow,
8664 warn_since: None,
8665 deny_since: None,
8666 },
8667 Lint {
8668 label: "generic_assert",
8669 description: r##"# `generic_assert`
8670
8671Outputs useful `assert!` messages
8672
8673This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
8674
8675------------------------
8676"##,
8677 default_severity: Severity::Allow,
8678 warn_since: None,
8679 deny_since: None,
8680 },
8681 Lint {
8682 label: "generic_assert_internals",
8683 description: r##"# `generic_assert_internals`
8684
8685
8686
8687The tracking issue for this feature is: [#44838]
8688
8689[#44838]: https://github.com/rust-lang/rust/issues/44838
8690
8691------------------------
8692"##,
8693 default_severity: Severity::Allow,
8694 warn_since: None,
8695 deny_since: None,
8696 },
8697 Lint {
8698 label: "generic_atomic",
8699 description: r##"# `generic_atomic`
8700
8701
8702
8703The tracking issue for this feature is: [#130539]
8704
8705[#130539]: https://github.com/rust-lang/rust/issues/130539
8706
8707------------------------
8708"##,
8709 default_severity: Severity::Allow,
8710 warn_since: None,
8711 deny_since: None,
8712 },
8713 Lint {
8714 label: "generic_const_args",
8715 description: r##"# generic_const_args
8716
8717Allows using generics in more complex const expressions, based on definitional equality.
8718
8719The tracking issue for this feature is: [#151972]
8720
8721[#151972]: https://github.com/rust-lang/rust/issues/151972
8722
8723------------------------
8724
8725Warning: This feature is incomplete; its design and syntax may change.
8726
8727This feature enables many of the same use cases supported by [generic_const_exprs],
8728but based on the machinery developed for [min_generic_const_args]. In a way, it is
8729meant to be an interim successor for GCE (though it might not currently support all
8730the valid cases that supported by GCE).
8731
8732See also: [generic_const_items]
8733
8734[min_generic_const_args]: min-generic-const-args.md
8735[generic_const_exprs]: generic-const-exprs.md
8736[generic_const_items]: generic-const-items.md
8737
8738## Examples
8739
8740<!-- NOTE(ignore) generic_const_args requires -Znext-solver to compile -->
8741```rust,ignore (requires-Z-next-solver)
8742#![feature(generic_const_items)]
8743#![feature(min_generic_const_args)]
8744#![feature(generic_const_args)]
8745#![expect(incomplete_features)]
8746
8747type const ADD1<const N: usize>: usize = const { N + 1 };
8748
8749type const INC<const N: usize>: usize = ADD1::<N>;
8750
8751const ARR: [(); ADD1::<0>] = [(); INC::<0>];
8752```
8753"##,
8754 default_severity: Severity::Allow,
8755 warn_since: None,
8756 deny_since: None,
8757 },
8758 Lint {
8759 label: "generic_const_exprs",
8760 description: r##"# generic_const_exprs
8761
8762Allows non-trivial generic constants which have to be shown to successfully evaluate
8763to a value by being part of an item signature.
8764
8765The tracking issue for this feature is: [#76560]
8766
8767
8768[#76560]: https://github.com/rust-lang/rust/issues/76560
8769
8770------------------------
8771
8772Warning: This feature is incomplete; its design and syntax may change.
8773
8774See also: [min_generic_const_args], [generic_const_args]
8775
8776[min_generic_const_args]: min-generic-const-args.md
8777[generic_const_args]: generic-const-args.md
8778
8779## Examples
8780
8781```rust
8782#![allow(incomplete_features)]
8783#![feature(generic_const_exprs)]
8784
8785// Use parameters that depend on a generic argument.
8786struct Foo<const N: usize>
8787where
8788 [(); N + 1]:,
8789{
8790 array: [usize; N + 1],
8791}
8792
8793// Use generic parameters in const operations.
8794trait Bar {
8795 const X: usize;
8796 const Y: usize;
8797}
8798
8799// Note `B::X * B::Y`.
8800const fn baz<B: Bar>(x: [usize; B::X], y: [usize; B::Y]) -> [usize; B::X * B::Y] {
8801 let mut out = [0; B::X * B::Y];
8802 let mut i = 0;
8803 while i < B::Y {
8804 let mut j = 0;
8805 while j < B::X {
8806 out[i * B::X + j] = y[i].saturating_mul(x[j]);
8807 j += 1;
8808 }
8809 i += 1;
8810 }
8811 out
8812}
8813
8814
8815// Create a new type based on a generic argument.
8816pub struct Grow<const N: usize> {
8817 arr: [usize; N],
8818}
8819
8820impl<const N: usize> Grow<N> {
8821 pub const fn grow(self, val: usize) -> Grow<{ N + 1 }> {
8822 let mut new_arr = [0; { N + 1 }];
8823 let mut idx = 0;
8824 while idx < N {
8825 new_arr[idx] = self.arr[idx];
8826 idx += 1;
8827 }
8828 new_arr[N] = val;
8829 Grow { arr: new_arr }
8830 }
8831}
8832```
8833"##,
8834 default_severity: Severity::Allow,
8835 warn_since: None,
8836 deny_since: None,
8837 },
8838 Lint {
8839 label: "generic_const_items",
8840 description: r##"# generic_const_items
8841
8842Allows generic parameters and where-clauses on free & associated const items.
8843
8844The tracking issue for this feature is: [#113521]
8845
8846[#113521]: https://github.com/rust-lang/rust/issues/113521
8847
8848------------------------
8849
8850Warning: This feature is an [experiment] and lacks an RFC.
8851There are no guarantees that it will ever be stabilized.
8852
8853See also: [generic_const_exprs], [min_generic_const_args].
8854
8855[experiment]: https://lang-team.rust-lang.org/how_to/experiment.html
8856[generic_const_exprs]: generic-const-exprs.md
8857[min_generic_const_args]: min-generic-const-args.md
8858
8859## Examples
8860
8861### Generic constant values
8862
8863```rust
8864#![allow(incomplete_features)]
8865#![feature(generic_const_items)]
8866
8867const GENERIC_VAL<const ARG: usize>: usize = ARG + 1;
8868
8869#[test]
8870fn generic_const_arg() {
8871 assert_eq!(GENERIC_VAL::<1>, 2);
8872 assert_eq!(GENERIC_VAL::<2>, 3);
8873}
8874```
8875
8876### Conditional constants
8877
8878```rust
8879#![allow(incomplete_features)]
8880#![feature(generic_const_items)]
8881
8882// `GENERIC_VAL::<0>` will fail to compile
8883const GENERIC_VAL<const ARG: usize>: usize = if ARG > 0 { ARG + 1 } else { panic!("0 value") };
8884
8885// Will fail to compile if the `Copy` derive is removed.
8886const COPY_MARKER<C: Copy>: () = ();
8887
8888#[derive(Clone, Copy)]
8889struct Foo;
8890
8891const FOO_IS_COPY: () = COPY_MARKER::<Foo>;
8892```
8893"##,
8894 default_severity: Severity::Allow,
8895 warn_since: None,
8896 deny_since: None,
8897 },
8898 Lint {
8899 label: "generic_const_parameter_types",
8900 description: r##"# `generic_const_parameter_types`
8901
8902Allows the type of const generics to depend on generic parameters
8903
8904The tracking issue for this feature is: [#137626]
8905
8906[#137626]: https://github.com/rust-lang/rust/issues/137626
8907
8908------------------------
8909"##,
8910 default_severity: Severity::Allow,
8911 warn_since: None,
8912 deny_since: None,
8913 },
8914 Lint {
8915 label: "generic_pattern_types",
8916 description: r##"# `generic_pattern_types`
8917
8918Allows any generic constants being used as pattern type range ends
8919
8920The tracking issue for this feature is: [#136574]
8921
8922[#136574]: https://github.com/rust-lang/rust/issues/136574
8923
8924------------------------
8925"##,
8926 default_severity: Severity::Allow,
8927 warn_since: None,
8928 deny_since: None,
8929 },
8930 Lint {
8931 label: "get_disjoint_mut_helpers",
8932 description: r##"# `get_disjoint_mut_helpers`
8933
8934
8935
8936This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
8937
8938------------------------
8939"##,
8940 default_severity: Severity::Allow,
8941 warn_since: None,
8942 deny_since: None,
8943 },
8944 Lint {
8945 label: "get_mut_unchecked",
8946 description: r##"# `get_mut_unchecked`
8947
8948
8949
8950The tracking issue for this feature is: [#63292]
8951
8952[#63292]: https://github.com/rust-lang/rust/issues/63292
8953
8954------------------------
8955"##,
8956 default_severity: Severity::Allow,
8957 warn_since: None,
8958 deny_since: None,
8959 },
8960 Lint {
8961 label: "gethostname",
8962 description: r##"# `gethostname`
8963
8964
8965
8966The tracking issue for this feature is: [#135142]
8967
8968[#135142]: https://github.com/rust-lang/rust/issues/135142
8969
8970------------------------
8971"##,
8972 default_severity: Severity::Allow,
8973 warn_since: None,
8974 deny_since: None,
8975 },
8976 Lint {
8977 label: "global_registration",
8978 description: r##"# `global_registration`
8979
8980Allows registering static items globally, possibly across crates, to iterate over at runtime.
8981
8982The tracking issue for this feature is: [#125119]
8983
8984[#125119]: https://github.com/rust-lang/rust/issues/125119
8985
8986------------------------
8987"##,
8988 default_severity: Severity::Allow,
8989 warn_since: None,
8990 deny_since: None,
8991 },
8992 Lint {
8993 label: "gpu_intrinsics",
8994 description: r##"# `gpu_intrinsics`
8995
8996
8997
8998This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
8999
9000------------------------
9001"##,
9002 default_severity: Severity::Allow,
9003 warn_since: None,
9004 deny_since: None,
9005 },
9006 Lint {
9007 label: "gpu_launch_sized_workgroup_mem",
9008 description: r##"# `gpu_launch_sized_workgroup_mem`
9009
9010
9011
9012The tracking issue for this feature is: [#135513]
9013
9014[#135513]: https://github.com/rust-lang/rust/issues/135513
9015
9016------------------------
9017"##,
9018 default_severity: Severity::Allow,
9019 warn_since: None,
9020 deny_since: None,
9021 },
9022 Lint {
9023 label: "gpu_offload",
9024 description: r##"# `gpu_offload`
9025
9026
9027
9028The tracking issue for this feature is: [#131513]
9029
9030[#131513]: https://github.com/rust-lang/rust/issues/131513
9031
9032------------------------
9033"##,
9034 default_severity: Severity::Allow,
9035 warn_since: None,
9036 deny_since: None,
9037 },
9038 Lint {
9039 label: "guard_patterns",
9040 description: r##"# `guard_patterns`
9041
9042Allows using guards in patterns.
9043
9044The tracking issue for this feature is: [#129967]
9045
9046[#129967]: https://github.com/rust-lang/rust/issues/129967
9047
9048------------------------
9049"##,
9050 default_severity: Severity::Allow,
9051 warn_since: None,
9052 deny_since: None,
9053 },
9054 Lint {
9055 label: "half_open_range_patterns_in_slices",
9056 description: r##"# `half_open_range_patterns_in_slices`
9057
9058The tracking issue for this feature is: [#67264]
9059It is a future part of the `exclusive_range_pattern` feature,
9060tracked at [#37854].
9061
9062[#67264]: https://github.com/rust-lang/rust/issues/67264
9063[#37854]: https://github.com/rust-lang/rust/issues/37854
9064-----
9065
9066This feature allow using top-level half-open range patterns in slices.
9067
9068```rust
9069#![feature(half_open_range_patterns_in_slices)]
9070
9071fn main() {
9072 let xs = [13, 1, 5, 2, 3, 1, 21, 8];
9073 let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs else { return; };
9074}
9075```
9076
9077Note that this feature is not required if the patterns are wrapped between parenthesis.
9078
9079```rust
9080fn main() {
9081 let xs = [13, 1];
9082 let [(a @ 3..), c] = xs else { return; };
9083}
9084```
9085"##,
9086 default_severity: Severity::Allow,
9087 warn_since: None,
9088 deny_since: None,
9089 },
9090 Lint {
9091 label: "hash_map_internals",
9092 description: r##"# `hash_map_internals`
9093
9094
9095
9096This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
9097
9098------------------------
9099"##,
9100 default_severity: Severity::Allow,
9101 warn_since: None,
9102 deny_since: None,
9103 },
9104 Lint {
9105 label: "hash_map_macro",
9106 description: r##"# `hash_map_macro`
9107
9108
9109
9110The tracking issue for this feature is: [#144032]
9111
9112[#144032]: https://github.com/rust-lang/rust/issues/144032
9113
9114------------------------
9115"##,
9116 default_severity: Severity::Allow,
9117 warn_since: None,
9118 deny_since: None,
9119 },
9120 Lint {
9121 label: "hash_set_entry",
9122 description: r##"# `hash_set_entry`
9123
9124
9125
9126The tracking issue for this feature is: [#60896]
9127
9128[#60896]: https://github.com/rust-lang/rust/issues/60896
9129
9130------------------------
9131"##,
9132 default_severity: Severity::Allow,
9133 warn_since: None,
9134 deny_since: None,
9135 },
9136 Lint {
9137 label: "hasher_prefixfree_extras",
9138 description: r##"# `hasher_prefixfree_extras`
9139
9140
9141
9142The tracking issue for this feature is: [#96762]
9143
9144[#96762]: https://github.com/rust-lang/rust/issues/96762
9145
9146------------------------
9147"##,
9148 default_severity: Severity::Allow,
9149 warn_since: None,
9150 deny_since: None,
9151 },
9152 Lint {
9153 label: "hashmap_internals",
9154 description: r##"# `hashmap_internals`
9155
9156
9157
9158This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
9159
9160------------------------
9161"##,
9162 default_severity: Severity::Allow,
9163 warn_since: None,
9164 deny_since: None,
9165 },
9166 Lint {
9167 label: "hexagon_target_feature",
9168 description: r##"# `hexagon_target_feature`
9169
9170Target features on hexagon.
9171
9172The tracking issue for this feature is: [#150250]
9173
9174[#150250]: https://github.com/rust-lang/rust/issues/150250
9175
9176------------------------
9177"##,
9178 default_severity: Severity::Allow,
9179 warn_since: None,
9180 deny_since: None,
9181 },
9182 Lint {
9183 label: "hint_must_use",
9184 description: r##"# `hint_must_use`
9185
9186
9187
9188The tracking issue for this feature is: [#94745]
9189
9190[#94745]: https://github.com/rust-lang/rust/issues/94745
9191
9192------------------------
9193"##,
9194 default_severity: Severity::Allow,
9195 warn_since: None,
9196 deny_since: None,
9197 },
9198 Lint {
9199 label: "hint_prefetch",
9200 description: r##"# `hint_prefetch`
9201
9202
9203
9204The tracking issue for this feature is: [#146941]
9205
9206[#146941]: https://github.com/rust-lang/rust/issues/146941
9207
9208------------------------
9209"##,
9210 default_severity: Severity::Allow,
9211 warn_since: None,
9212 deny_since: None,
9213 },
9214 Lint {
9215 label: "impl_restriction",
9216 description: r##"# `impl_restriction`
9217
9218Allows `impl(crate) trait Foo` restrictions.
9219
9220The tracking issue for this feature is: [#105077]
9221
9222[#105077]: https://github.com/rust-lang/rust/issues/105077
9223
9224------------------------
9225"##,
9226 default_severity: Severity::Allow,
9227 warn_since: None,
9228 deny_since: None,
9229 },
9230 Lint {
9231 label: "impl_trait_in_assoc_type",
9232 description: r##"# `impl_trait_in_assoc_type`
9233
9234Allows `impl Trait` to be used inside associated types (RFC 2515).
9235
9236The tracking issue for this feature is: [#63063]
9237
9238[#63063]: https://github.com/rust-lang/rust/issues/63063
9239
9240------------------------
9241"##,
9242 default_severity: Severity::Allow,
9243 warn_since: None,
9244 deny_since: None,
9245 },
9246 Lint {
9247 label: "impl_trait_in_bindings",
9248 description: r##"# `impl_trait_in_bindings`
9249
9250Allows `impl Trait` in bindings (`let`).
9251
9252The tracking issue for this feature is: [#63065]
9253
9254[#63065]: https://github.com/rust-lang/rust/issues/63065
9255
9256------------------------
9257"##,
9258 default_severity: Severity::Allow,
9259 warn_since: None,
9260 deny_since: None,
9261 },
9262 Lint {
9263 label: "impl_trait_in_fn_trait_return",
9264 description: r##"# `impl_trait_in_fn_trait_return`
9265
9266Allows `impl Trait` as output type in `Fn` traits in return position of functions.
9267
9268The tracking issue for this feature is: [#99697]
9269
9270[#99697]: https://github.com/rust-lang/rust/issues/99697
9271
9272------------------------
9273"##,
9274 default_severity: Severity::Allow,
9275 warn_since: None,
9276 deny_since: None,
9277 },
9278 Lint {
9279 label: "import_trait_associated_functions",
9280 description: r##"# import_trait_associated_functions
9281
9282The tracking issue for this feature is: [#134691]
9283
9284[#134691]: https://github.com/rust-lang/rust/issues/134691
9285
9286------------------------
9287
9288This feature allows importing associated functions and constants from traits and then using them like regular items.
9289
9290```rust
9291#![feature(import_trait_associated_functions)]
9292
9293use std::ops::Add::add;
9294
9295fn main() {
9296 let numbers = vec![1, 2, 3, 4, 5, 6];
9297 let sum = numbers.into_iter().reduce(add); // instead of `.reduce(Add:add)`
9298
9299 assert_eq!(sum, Some(21));
9300}
9301```
9302"##,
9303 default_severity: Severity::Allow,
9304 warn_since: None,
9305 deny_since: None,
9306 },
9307 Lint {
9308 label: "inherent_associated_types",
9309 description: r##"# `inherent_associated_types`
9310
9311Allows associated types in inherent impls.
9312
9313The tracking issue for this feature is: [#8995]
9314
9315[#8995]: https://github.com/rust-lang/rust/issues/8995
9316
9317------------------------
9318"##,
9319 default_severity: Severity::Allow,
9320 warn_since: None,
9321 deny_since: None,
9322 },
9323 Lint {
9324 label: "inplace_iteration",
9325 description: r##"# `inplace_iteration`
9326
9327
9328
9329This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
9330
9331------------------------
9332"##,
9333 default_severity: Severity::Allow,
9334 warn_since: None,
9335 deny_since: None,
9336 },
9337 Lint {
9338 label: "int_format_into",
9339 description: r##"# `int_format_into`
9340
9341
9342
9343The tracking issue for this feature is: [#138215]
9344
9345[#138215]: https://github.com/rust-lang/rust/issues/138215
9346
9347------------------------
9348"##,
9349 default_severity: Severity::Allow,
9350 warn_since: None,
9351 deny_since: None,
9352 },
9353 Lint {
9354 label: "int_from_ascii",
9355 description: r##"# `int_from_ascii`
9356
9357
9358
9359The tracking issue for this feature is: [#134821]
9360
9361[#134821]: https://github.com/rust-lang/rust/issues/134821
9362
9363------------------------
9364"##,
9365 default_severity: Severity::Allow,
9366 warn_since: None,
9367 deny_since: None,
9368 },
9369 Lint {
9370 label: "int_roundings",
9371 description: r##"# `int_roundings`
9372
9373
9374
9375The tracking issue for this feature is: [#88581]
9376
9377[#88581]: https://github.com/rust-lang/rust/issues/88581
9378
9379------------------------
9380"##,
9381 default_severity: Severity::Allow,
9382 warn_since: None,
9383 deny_since: None,
9384 },
9385 Lint {
9386 label: "integer_atomics",
9387 description: r##"# `integer_atomics`
9388
9389
9390
9391The tracking issue for this feature is: [#99069]
9392
9393[#99069]: https://github.com/rust-lang/rust/issues/99069
9394
9395------------------------
9396"##,
9397 default_severity: Severity::Allow,
9398 warn_since: None,
9399 deny_since: None,
9400 },
9401 Lint {
9402 label: "integer_cast_extras",
9403 description: r##"# `integer_cast_extras`
9404
9405
9406
9407The tracking issue for this feature is: [#154650]
9408
9409[#154650]: https://github.com/rust-lang/rust/issues/154650
9410
9411------------------------
9412"##,
9413 default_severity: Severity::Allow,
9414 warn_since: None,
9415 deny_since: None,
9416 },
9417 Lint {
9418 label: "integer_widen_truncate",
9419 description: r##"# `integer_widen_truncate`
9420
9421
9422
9423The tracking issue for this feature is: [#154330]
9424
9425[#154330]: https://github.com/rust-lang/rust/issues/154330
9426
9427------------------------
9428"##,
9429 default_severity: Severity::Allow,
9430 warn_since: None,
9431 deny_since: None,
9432 },
9433 Lint {
9434 label: "internal_output_capture",
9435 description: r##"# `internal_output_capture`
9436
9437This feature is internal to the Rust compiler and is not intended for general use.
9438
9439------------------------
9440"##,
9441 default_severity: Severity::Allow,
9442 warn_since: None,
9443 deny_since: None,
9444 },
9445 Lint {
9446 label: "intra_doc_pointers",
9447 description: r##"# `intra-doc-pointers`
9448
9449The tracking issue for this feature is: [#80896]
9450
9451[#80896]: https://github.com/rust-lang/rust/issues/80896
9452
9453------------------------
9454
9455Rustdoc does not currently allow disambiguating between `*const` and `*mut`, and
9456raw pointers in intra-doc links are unstable until it does.
9457
9458```rust
9459#![feature(intra_doc_pointers)]
9460//! [pointer::add]
9461```
9462"##,
9463 default_severity: Severity::Allow,
9464 warn_since: None,
9465 deny_since: None,
9466 },
9467 Lint {
9468 label: "intrinsics",
9469 description: r##"# `intrinsics`
9470
9471The tracking issue for this feature is: None.
9472
9473Intrinsics are rarely intended to be stable directly, but are usually
9474exported in some sort of stable manner. Prefer using the stable interfaces to
9475the intrinsic directly when you can.
9476
9477------------------------
9478
9479
9480## Intrinsics with fallback logic
9481
9482Many intrinsics can be written in pure rust, albeit inefficiently or without supporting
9483some features that only exist on some backends. Backends can simply not implement those
9484intrinsics without causing any code miscompilations or failures to compile.
9485All intrinsic fallback bodies are automatically made cross-crate inlineable (like `#[inline]`)
9486by the codegen backend, but not the MIR inliner.
9487
9488```rust
9489#![feature(intrinsics)]
9490#![allow(internal_features)]
9491
9492#[rustc_intrinsic]
9493const unsafe fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {}
9494```
9495
9496Since these are just regular functions, it is perfectly ok to create the intrinsic twice:
9497
9498```rust
9499#![feature(intrinsics)]
9500#![allow(internal_features)]
9501
9502#[rustc_intrinsic]
9503const unsafe fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {}
9504
9505mod foo {
9506 #[rustc_intrinsic]
9507 const unsafe fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {
9508 panic!("noisy const dealloc")
9509 }
9510}
9511
9512```
9513
9514The behaviour on backends that override the intrinsic is exactly the same. On other
9515backends, the intrinsic behaviour depends on which implementation is called, just like
9516with any regular function.
9517
9518## Intrinsics lowered to MIR instructions
9519
9520Various intrinsics have native MIR operations that they correspond to. Instead of requiring
9521backends to implement both the intrinsic and the MIR operation, the `lower_intrinsics` pass
9522will convert the calls to the MIR operation. Backends do not need to know about these intrinsics
9523at all. These intrinsics only make sense without a body, and can be declared as a `#[rustc_intrinsic]`.
9524The body is never used as the lowering pass implements support for all backends, so we never have to
9525use the fallback logic.
9526
9527## Intrinsics without fallback logic
9528
9529These must be implemented by all backends.
9530
9531### `#[rustc_intrinsic]` declarations
9532
9533These are written without a body:
9534```rust
9535#![feature(intrinsics)]
9536#![allow(internal_features)]
9537
9538#[rustc_intrinsic]
9539pub fn abort() -> !;
9540```
9541"##,
9542 default_severity: Severity::Allow,
9543 warn_since: None,
9544 deny_since: None,
9545 },
9546 Lint {
9547 label: "io_const_error",
9548 description: r##"# `io_const_error`
9549
9550
9551
9552The tracking issue for this feature is: [#133448]
9553
9554[#133448]: https://github.com/rust-lang/rust/issues/133448
9555
9556------------------------
9557"##,
9558 default_severity: Severity::Allow,
9559 warn_since: None,
9560 deny_since: None,
9561 },
9562 Lint {
9563 label: "io_const_error_internals",
9564 description: r##"# `io_const_error_internals`
9565
9566
9567
9568This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
9569
9570------------------------
9571"##,
9572 default_severity: Severity::Allow,
9573 warn_since: None,
9574 deny_since: None,
9575 },
9576 Lint {
9577 label: "io_error_inprogress",
9578 description: r##"# `io_error_inprogress`
9579
9580
9581
9582The tracking issue for this feature is: [#130840]
9583
9584[#130840]: https://github.com/rust-lang/rust/issues/130840
9585
9586------------------------
9587"##,
9588 default_severity: Severity::Allow,
9589 warn_since: None,
9590 deny_since: None,
9591 },
9592 Lint {
9593 label: "io_error_more",
9594 description: r##"# `io_error_more`
9595
9596
9597
9598The tracking issue for this feature is: [#86442]
9599
9600[#86442]: https://github.com/rust-lang/rust/issues/86442
9601
9602------------------------
9603"##,
9604 default_severity: Severity::Allow,
9605 warn_since: None,
9606 deny_since: None,
9607 },
9608 Lint {
9609 label: "io_error_uncategorized",
9610 description: r##"# `io_error_uncategorized`
9611
9612
9613
9614This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
9615
9616------------------------
9617"##,
9618 default_severity: Severity::Allow,
9619 warn_since: None,
9620 deny_since: None,
9621 },
9622 Lint {
9623 label: "io_slice_as_bytes",
9624 description: r##"# `io_slice_as_bytes`
9625
9626
9627
9628The tracking issue for this feature is: [#132818]
9629
9630[#132818]: https://github.com/rust-lang/rust/issues/132818
9631
9632------------------------
9633"##,
9634 default_severity: Severity::Allow,
9635 warn_since: None,
9636 deny_since: None,
9637 },
9638 Lint {
9639 label: "ip",
9640 description: r##"# `ip`
9641
9642
9643
9644The tracking issue for this feature is: [#27709]
9645
9646[#27709]: https://github.com/rust-lang/rust/issues/27709
9647
9648------------------------
9649"##,
9650 default_severity: Severity::Allow,
9651 warn_since: None,
9652 deny_since: None,
9653 },
9654 Lint {
9655 label: "ip_as_octets",
9656 description: r##"# `ip_as_octets`
9657
9658
9659
9660The tracking issue for this feature is: [#137259]
9661
9662[#137259]: https://github.com/rust-lang/rust/issues/137259
9663
9664------------------------
9665"##,
9666 default_severity: Severity::Allow,
9667 warn_since: None,
9668 deny_since: None,
9669 },
9670 Lint {
9671 label: "ip_multicast_reserved",
9672 description: r##"# `ip_multicast_reserved`
9673
9674
9675
9676This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
9677
9678------------------------
9679"##,
9680 default_severity: Severity::Allow,
9681 warn_since: None,
9682 deny_since: None,
9683 },
9684 Lint {
9685 label: "is_ascii_octdigit",
9686 description: r##"# `is_ascii_octdigit`
9687
9688
9689
9690The tracking issue for this feature is: [#101288]
9691
9692[#101288]: https://github.com/rust-lang/rust/issues/101288
9693
9694------------------------
9695"##,
9696 default_severity: Severity::Allow,
9697 warn_since: None,
9698 deny_since: None,
9699 },
9700 Lint {
9701 label: "is_loongarch_feature_detected",
9702 description: r##"# `is_loongarch_feature_detected`
9703
9704
9705
9706The tracking issue for this feature is: [#117425]
9707
9708[#117425]: https://github.com/rust-lang/rust/issues/117425
9709
9710------------------------
9711"##,
9712 default_severity: Severity::Allow,
9713 warn_since: None,
9714 deny_since: None,
9715 },
9716 Lint {
9717 label: "is_riscv_feature_detected",
9718 description: r##"# `is_riscv_feature_detected`
9719
9720
9721
9722The tracking issue for this feature is: [#111192]
9723
9724[#111192]: https://github.com/rust-lang/rust/issues/111192
9725
9726------------------------
9727"##,
9728 default_severity: Severity::Allow,
9729 warn_since: None,
9730 deny_since: None,
9731 },
9732 Lint {
9733 label: "iter_advance_by",
9734 description: r##"# `iter_advance_by`
9735
9736
9737
9738The tracking issue for this feature is: [#77404]
9739
9740[#77404]: https://github.com/rust-lang/rust/issues/77404
9741
9742------------------------
9743"##,
9744 default_severity: Severity::Allow,
9745 warn_since: None,
9746 deny_since: None,
9747 },
9748 Lint {
9749 label: "iter_array_chunks",
9750 description: r##"# `iter_array_chunks`
9751
9752
9753
9754The tracking issue for this feature is: [#100450]
9755
9756[#100450]: https://github.com/rust-lang/rust/issues/100450
9757
9758------------------------
9759"##,
9760 default_severity: Severity::Allow,
9761 warn_since: None,
9762 deny_since: None,
9763 },
9764 Lint {
9765 label: "iter_collect_into",
9766 description: r##"# `iter_collect_into`
9767
9768
9769
9770The tracking issue for this feature is: [#94780]
9771
9772[#94780]: https://github.com/rust-lang/rust/issues/94780
9773
9774------------------------
9775"##,
9776 default_severity: Severity::Allow,
9777 warn_since: None,
9778 deny_since: None,
9779 },
9780 Lint {
9781 label: "iter_from_coroutine",
9782 description: r##"# `iter_from_coroutine`
9783
9784
9785
9786The tracking issue for this feature is: [#43122]
9787
9788[#43122]: https://github.com/rust-lang/rust/issues/43122
9789
9790------------------------
9791"##,
9792 default_severity: Severity::Allow,
9793 warn_since: None,
9794 deny_since: None,
9795 },
9796 Lint {
9797 label: "iter_intersperse",
9798 description: r##"# `iter_intersperse`
9799
9800
9801
9802The tracking issue for this feature is: [#79524]
9803
9804[#79524]: https://github.com/rust-lang/rust/issues/79524
9805
9806------------------------
9807"##,
9808 default_severity: Severity::Allow,
9809 warn_since: None,
9810 deny_since: None,
9811 },
9812 Lint {
9813 label: "iter_is_partitioned",
9814 description: r##"# `iter_is_partitioned`
9815
9816
9817
9818The tracking issue for this feature is: [#62544]
9819
9820[#62544]: https://github.com/rust-lang/rust/issues/62544
9821
9822------------------------
9823"##,
9824 default_severity: Severity::Allow,
9825 warn_since: None,
9826 deny_since: None,
9827 },
9828 Lint {
9829 label: "iter_macro",
9830 description: r##"# `iter_macro`
9831
9832
9833
9834The tracking issue for this feature is: [#142269]
9835
9836[#142269]: https://github.com/rust-lang/rust/issues/142269
9837
9838------------------------
9839"##,
9840 default_severity: Severity::Allow,
9841 warn_since: None,
9842 deny_since: None,
9843 },
9844 Lint {
9845 label: "iter_map_windows",
9846 description: r##"# `iter_map_windows`
9847
9848
9849
9850The tracking issue for this feature is: [#87155]
9851
9852[#87155]: https://github.com/rust-lang/rust/issues/87155
9853
9854------------------------
9855"##,
9856 default_severity: Severity::Allow,
9857 warn_since: None,
9858 deny_since: None,
9859 },
9860 Lint {
9861 label: "iter_next_chunk",
9862 description: r##"# `iter_next_chunk`
9863
9864
9865
9866The tracking issue for this feature is: [#98326]
9867
9868[#98326]: https://github.com/rust-lang/rust/issues/98326
9869
9870------------------------
9871"##,
9872 default_severity: Severity::Allow,
9873 warn_since: None,
9874 deny_since: None,
9875 },
9876 Lint {
9877 label: "iter_order_by",
9878 description: r##"# `iter_order_by`
9879
9880
9881
9882The tracking issue for this feature is: [#64295]
9883
9884[#64295]: https://github.com/rust-lang/rust/issues/64295
9885
9886------------------------
9887"##,
9888 default_severity: Severity::Allow,
9889 warn_since: None,
9890 deny_since: None,
9891 },
9892 Lint {
9893 label: "iter_partition_in_place",
9894 description: r##"# `iter_partition_in_place`
9895
9896
9897
9898The tracking issue for this feature is: [#62543]
9899
9900[#62543]: https://github.com/rust-lang/rust/issues/62543
9901
9902------------------------
9903"##,
9904 default_severity: Severity::Allow,
9905 warn_since: None,
9906 deny_since: None,
9907 },
9908 Lint {
9909 label: "iterator_try_collect",
9910 description: r##"# `iterator_try_collect`
9911
9912
9913
9914The tracking issue for this feature is: [#94047]
9915
9916[#94047]: https://github.com/rust-lang/rust/issues/94047
9917
9918------------------------
9919"##,
9920 default_severity: Severity::Allow,
9921 warn_since: None,
9922 deny_since: None,
9923 },
9924 Lint {
9925 label: "iterator_try_reduce",
9926 description: r##"# `iterator_try_reduce`
9927
9928
9929
9930The tracking issue for this feature is: [#87053]
9931
9932[#87053]: https://github.com/rust-lang/rust/issues/87053
9933
9934------------------------
9935"##,
9936 default_severity: Severity::Allow,
9937 warn_since: None,
9938 deny_since: None,
9939 },
9940 Lint {
9941 label: "junction_point",
9942 description: r##"# `junction_point`
9943
9944
9945
9946The tracking issue for this feature is: [#121709]
9947
9948[#121709]: https://github.com/rust-lang/rust/issues/121709
9949
9950------------------------
9951"##,
9952 default_severity: Severity::Allow,
9953 warn_since: None,
9954 deny_since: None,
9955 },
9956 Lint {
9957 label: "lahfsahf_target_feature",
9958 description: r##"# `lahfsahf_target_feature`
9959
9960lahfsahf target feature on x86.
9961
9962The tracking issue for this feature is: [#150251]
9963
9964[#150251]: https://github.com/rust-lang/rust/issues/150251
9965
9966------------------------
9967"##,
9968 default_severity: Severity::Allow,
9969 warn_since: None,
9970 deny_since: None,
9971 },
9972 Lint {
9973 label: "lang_items",
9974 description: r##"# `lang_items`
9975
9976The tracking issue for this feature is: None.
9977
9978------------------------
9979
9980The `rustc` compiler has certain pluggable operations, that is,
9981functionality that isn't hard-coded into the language, but is
9982implemented in libraries, with a special marker to tell the compiler
9983it exists. The marker is the attribute `#[lang = "..."]` and there are
9984various different values of `...`, i.e. various different 'lang
9985items'. Most of them can only be defined once.
9986
9987Lang items are loaded lazily by the compiler; e.g. if one never uses `Box`
9988then there is no need to define a function for `exchange_malloc`.
9989`rustc` will emit an error when an item is needed but not found in the current
9990crate or any that it depends on.
9991
9992Some features provided by lang items:
9993
9994- overloadable operators via traits: the traits corresponding to the
9995 `==`, `<`, dereferencing (`*`) and `+` (etc.) operators are all
9996 marked with lang items; those specific four are `eq`, `partial_ord`,
9997 `deref`/`deref_mut`, and `add` respectively.
9998- panicking: the `panic` and `panic_impl` lang items, among others.
9999- stack unwinding: the lang item `eh_personality` is a function used by the
10000 failure mechanisms of the compiler. This is often mapped to GCC's personality
10001 function (see the [`std` implementation][personality] for more information),
10002 but programs which don't trigger a panic can be assured that this function is
10003 never called.
10004- the traits in `core::marker` used to indicate types of
10005 various kinds; e.g. lang items `sized`, `sync` and `copy`.
10006- memory allocation, see below.
10007
10008Most lang items are defined by `core`, but if you're trying to build
10009an executable without the `std` crate, you might run into the need
10010for lang item definitions.
10011
10012[personality]: https://github.com/rust-lang/rust/blob/HEAD/library/std/src/sys/personality/gcc.rs
10013
10014## Example: Implementing a `Box`
10015
10016`Box` pointers require two lang items: one for the type itself and one for
10017allocation. A freestanding program that uses the `Box` sugar for dynamic
10018allocations via `malloc` and `free`:
10019
10020```rust,ignore (libc-is-finicky)
10021#![feature(lang_items, core_intrinsics, rustc_private, panic_unwind, rustc_attrs)]
10022#![allow(internal_features)]
10023#![no_std]
10024#![no_main]
10025
10026extern crate libc;
10027extern crate unwind;
10028
10029use core::ffi::{c_int, c_void};
10030use core::intrinsics;
10031use core::panic::PanicInfo;
10032use core::ptr::NonNull;
10033
10034pub struct Global; // the global allocator
10035struct Unique<T>(NonNull<T>);
10036
10037#[lang = "owned_box"]
10038pub struct Box<T, A = Global>(Unique<T>, A);
10039
10040impl<T> Box<T> {
10041 pub fn new(x: T) -> Self {
10042 #[rustc_box]
10043 Box::new(x)
10044 }
10045}
10046
10047impl<T, A> Drop for Box<T, A> {
10048 fn drop(&mut self) {
10049 unsafe {
10050 libc::free(self.0.0.as_ptr() as *mut c_void);
10051 }
10052 }
10053}
10054
10055#[lang = "exchange_malloc"]
10056unsafe fn allocate(size: usize, _align: usize) -> *mut u8 {
10057 let p = libc::malloc(size) as *mut u8;
10058
10059 // Check if `malloc` failed:
10060 if p.is_null() {
10061 intrinsics::abort();
10062 }
10063
10064 p
10065}
10066
10067#[no_mangle]
10068extern "C" fn main(_argc: c_int, _argv: *const *const u8) -> c_int {
10069 let _x = Box::new(1);
10070
10071 0
10072}
10073
10074#[lang = "eh_personality"]
10075fn rust_eh_personality() {}
10076
10077#[panic_handler]
10078fn panic_handler(_info: &PanicInfo) -> ! { intrinsics::abort() }
10079```
10080
10081Note the use of `abort`: the `exchange_malloc` lang item is assumed to
10082return a valid pointer, and so needs to do the check internally.
10083
10084## List of all language items
10085
10086An up-to-date list of all language items can be found [here] in the compiler code.
10087
10088[here]: https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc_hir/src/lang_items.rs
10089"##,
10090 default_severity: Severity::Allow,
10091 warn_since: None,
10092 deny_since: None,
10093 },
10094 Lint {
10095 label: "large_assignments",
10096 description: r##"# `large_assignments`
10097
10098Allows setting the threshold for the `large_assignments` lint.
10099
10100The tracking issue for this feature is: [#83518]
10101
10102[#83518]: https://github.com/rust-lang/rust/issues/83518
10103
10104------------------------
10105"##,
10106 default_severity: Severity::Allow,
10107 warn_since: None,
10108 deny_since: None,
10109 },
10110 Lint {
10111 label: "layout_for_ptr",
10112 description: r##"# `layout_for_ptr`
10113
10114
10115
10116The tracking issue for this feature is: [#69835]
10117
10118[#69835]: https://github.com/rust-lang/rust/issues/69835
10119
10120------------------------
10121"##,
10122 default_severity: Severity::Allow,
10123 warn_since: None,
10124 deny_since: None,
10125 },
10126 Lint {
10127 label: "lazy_cell_into_inner",
10128 description: r##"# `lazy_cell_into_inner`
10129
10130
10131
10132The tracking issue for this feature is: [#125623]
10133
10134[#125623]: https://github.com/rust-lang/rust/issues/125623
10135
10136------------------------
10137"##,
10138 default_severity: Severity::Allow,
10139 warn_since: None,
10140 deny_since: None,
10141 },
10142 Lint {
10143 label: "lazy_type_alias",
10144 description: r##"# `lazy_type_alias`
10145
10146Allow to have type alias types for inter-crate use.
10147
10148The tracking issue for this feature is: [#112792]
10149
10150[#112792]: https://github.com/rust-lang/rust/issues/112792
10151
10152------------------------
10153"##,
10154 default_severity: Severity::Allow,
10155 warn_since: None,
10156 deny_since: None,
10157 },
10158 Lint {
10159 label: "legacy_receiver_trait",
10160 description: r##"# `legacy_receiver_trait`
10161
10162
10163
10164This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
10165
10166------------------------
10167"##,
10168 default_severity: Severity::Allow,
10169 warn_since: None,
10170 deny_since: None,
10171 },
10172 Lint {
10173 label: "liballoc_internals",
10174 description: r##"# `liballoc_internals`
10175
10176
10177
10178This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
10179
10180------------------------
10181"##,
10182 default_severity: Severity::Allow,
10183 warn_since: None,
10184 deny_since: None,
10185 },
10186 Lint {
10187 label: "libstd_sys_internals",
10188 description: r##"# `libstd_sys_internals`
10189
10190This feature is internal to the Rust compiler and is not intended for general use.
10191
10192------------------------
10193"##,
10194 default_severity: Severity::Allow,
10195 warn_since: None,
10196 deny_since: None,
10197 },
10198 Lint {
10199 label: "likely_unlikely",
10200 description: r##"# `likely_unlikely`
10201
10202
10203
10204The tracking issue for this feature is: [#151619]
10205
10206[#151619]: https://github.com/rust-lang/rust/issues/151619
10207
10208------------------------
10209"##,
10210 default_severity: Severity::Allow,
10211 warn_since: None,
10212 deny_since: None,
10213 },
10214 Lint {
10215 label: "link_arg_attribute",
10216 description: r##"# `link_arg_attribute`
10217
10218The tracking issue for this feature is: [#99427]
10219
10220------
10221
10222The `link_arg_attribute` feature allows passing arguments into the linker
10223from inside of the source code. Order is preserved for link attributes as
10224they were defined on a single extern block:
10225
10226```rust,no_run
10227#![feature(link_arg_attribute)]
10228
10229#[link(kind = "link-arg", name = "--start-group")]
10230#[link(kind = "static", name = "c")]
10231#[link(kind = "static", name = "gcc")]
10232#[link(kind = "link-arg", name = "--end-group")]
10233extern "C" {}
10234```
10235
10236[#99427]: https://github.com/rust-lang/rust/issues/99427
10237"##,
10238 default_severity: Severity::Allow,
10239 warn_since: None,
10240 deny_since: None,
10241 },
10242 Lint {
10243 label: "link_cfg",
10244 description: r##"# `link_cfg`
10245
10246This feature is internal to the Rust compiler and is not intended for general use.
10247
10248------------------------
10249"##,
10250 default_severity: Severity::Allow,
10251 warn_since: None,
10252 deny_since: None,
10253 },
10254 Lint {
10255 label: "link_llvm_intrinsics",
10256 description: r##"# `link_llvm_intrinsics`
10257
10258Allows using `#[link_name="llvm.*"]`.
10259
10260The tracking issue for this feature is: [#29602]
10261
10262[#29602]: https://github.com/rust-lang/rust/issues/29602
10263
10264------------------------
10265"##,
10266 default_severity: Severity::Allow,
10267 warn_since: None,
10268 deny_since: None,
10269 },
10270 Lint {
10271 label: "linkage",
10272 description: r##"# `linkage`
10273
10274Allows using the `#[linkage = ".."]` attribute.
10275
10276The tracking issue for this feature is: [#29603]
10277
10278[#29603]: https://github.com/rust-lang/rust/issues/29603
10279
10280------------------------
10281"##,
10282 default_severity: Severity::Allow,
10283 warn_since: None,
10284 deny_since: None,
10285 },
10286 Lint {
10287 label: "linked_list_cursors",
10288 description: r##"# `linked_list_cursors`
10289
10290
10291
10292The tracking issue for this feature is: [#58533]
10293
10294[#58533]: https://github.com/rust-lang/rust/issues/58533
10295
10296------------------------
10297"##,
10298 default_severity: Severity::Allow,
10299 warn_since: None,
10300 deny_since: None,
10301 },
10302 Lint {
10303 label: "linked_list_remove",
10304 description: r##"# `linked_list_remove`
10305
10306
10307
10308The tracking issue for this feature is: [#69210]
10309
10310[#69210]: https://github.com/rust-lang/rust/issues/69210
10311
10312------------------------
10313"##,
10314 default_severity: Severity::Allow,
10315 warn_since: None,
10316 deny_since: None,
10317 },
10318 Lint {
10319 label: "linked_list_retain",
10320 description: r##"# `linked_list_retain`
10321
10322
10323
10324The tracking issue for this feature is: [#114135]
10325
10326[#114135]: https://github.com/rust-lang/rust/issues/114135
10327
10328------------------------
10329"##,
10330 default_severity: Severity::Allow,
10331 warn_since: None,
10332 deny_since: None,
10333 },
10334 Lint {
10335 label: "linux_pidfd",
10336 description: r##"# `linux_pidfd`
10337
10338
10339
10340The tracking issue for this feature is: [#82971]
10341
10342[#82971]: https://github.com/rust-lang/rust/issues/82971
10343
10344------------------------
10345"##,
10346 default_severity: Severity::Allow,
10347 warn_since: None,
10348 deny_since: None,
10349 },
10350 Lint {
10351 label: "local_key_cell_update",
10352 description: r##"# `local_key_cell_update`
10353
10354
10355
10356The tracking issue for this feature is: [#143989]
10357
10358[#143989]: https://github.com/rust-lang/rust/issues/143989
10359
10360------------------------
10361"##,
10362 default_severity: Severity::Allow,
10363 warn_since: None,
10364 deny_since: None,
10365 },
10366 Lint {
10367 label: "local_waker",
10368 description: r##"# `local_waker`
10369
10370
10371
10372The tracking issue for this feature is: [#118959]
10373
10374[#118959]: https://github.com/rust-lang/rust/issues/118959
10375
10376------------------------
10377"##,
10378 default_severity: Severity::Allow,
10379 warn_since: None,
10380 deny_since: None,
10381 },
10382 Lint {
10383 label: "lock_value_accessors",
10384 description: r##"# `lock_value_accessors`
10385
10386
10387
10388The tracking issue for this feature is: [#133407]
10389
10390[#133407]: https://github.com/rust-lang/rust/issues/133407
10391
10392------------------------
10393"##,
10394 default_severity: Severity::Allow,
10395 warn_since: None,
10396 deny_since: None,
10397 },
10398 Lint {
10399 label: "log_syntax",
10400 description: r##"# `log_syntax`
10401
10402
10403
10404The tracking issue for this feature is: [#29598]
10405
10406[#29598]: https://github.com/rust-lang/rust/issues/29598
10407
10408------------------------
10409"##,
10410 default_severity: Severity::Allow,
10411 warn_since: None,
10412 deny_since: None,
10413 },
10414 Lint {
10415 label: "loongarch_target_feature",
10416 description: r##"# `loongarch_target_feature`
10417
10418Target features on loongarch.
10419
10420The tracking issue for this feature is: [#150252]
10421
10422[#150252]: https://github.com/rust-lang/rust/issues/150252
10423
10424------------------------
10425"##,
10426 default_severity: Severity::Allow,
10427 warn_since: None,
10428 deny_since: None,
10429 },
10430 Lint {
10431 label: "loop_match",
10432 description: r##"# `loop_match`
10433
10434The tracking issue for this feature is: [#132306]
10435
10436[#132306]: https://github.com/rust-lang/rust/issues/132306
10437
10438------
10439
10440The `#[loop_match]` and `#[const_continue]` attributes can be used to improve the code
10441generation of logic that fits this shape:
10442
10443```ignore (pseudo-rust)
10444loop {
10445 state = 'blk: {
10446 match state {
10447 State::A => {
10448 break 'blk State::B
10449 }
10450 State::B => { /* ... */ }
10451 /* ... */
10452 }
10453 }
10454}
10455```
10456
10457Here the loop itself can be annotated with `#[loop_match]`, and any `break 'blk` with
10458`#[const_continue]` if the value is know at compile time:
10459
10460```ignore (pseudo-rust)
10461#[loop_match]
10462loop {
10463 state = 'blk: {
10464 match state {
10465 State::A => {
10466 #[const_continue]
10467 break 'blk State::B
10468 }
10469 State::B => { /* ... */ }
10470 /* ... */
10471 }
10472 }
10473}
10474```
10475
10476The observable behavior of this loop is exactly the same as without the extra attributes.
10477The difference is in the generated output: normally, when the state is `A`, control flow
10478moves from the `A` branch, back to the top of the loop, then to the `B` branch. With the
10479attributes, The `A` branch will immediately jump to the `B` branch.
10480
10481Removing the indirection can be beneficial for stack usage and branch prediction, and
10482enables other optimizations by clearly splitting out the control flow paths that your
10483program will actually use.
10484"##,
10485 default_severity: Severity::Allow,
10486 warn_since: None,
10487 deny_since: None,
10488 },
10489 Lint {
10490 label: "m68k_target_feature",
10491 description: r##"# `m68k_target_feature`
10492
10493Target features on m68k.
10494
10495The tracking issue for this feature is: [#134328]
10496
10497[#134328]: https://github.com/rust-lang/rust/issues/134328
10498
10499------------------------
10500"##,
10501 default_severity: Severity::Allow,
10502 warn_since: None,
10503 deny_since: None,
10504 },
10505 Lint {
10506 label: "macro_attr",
10507 description: r##"# `macro_attr`
10508
10509Allow `macro_rules!` attribute rules
10510
10511The tracking issue for this feature is: [#143547]
10512
10513[#143547]: https://github.com/rust-lang/rust/issues/143547
10514
10515------------------------
10516"##,
10517 default_severity: Severity::Allow,
10518 warn_since: None,
10519 deny_since: None,
10520 },
10521 Lint {
10522 label: "macro_derive",
10523 description: r##"# `macro_derive`
10524
10525Allow `macro_rules!` derive rules
10526
10527The tracking issue for this feature is: [#143549]
10528
10529[#143549]: https://github.com/rust-lang/rust/issues/143549
10530
10531------------------------
10532"##,
10533 default_severity: Severity::Allow,
10534 warn_since: None,
10535 deny_since: None,
10536 },
10537 Lint {
10538 label: "macro_guard_matcher",
10539 description: r##"# `macro_guard_matcher`
10540
10541Allow `$x:guard` matcher in macros
10542
10543The tracking issue for this feature is: [#153104]
10544
10545[#153104]: https://github.com/rust-lang/rust/issues/153104
10546
10547------------------------
10548"##,
10549 default_severity: Severity::Allow,
10550 warn_since: None,
10551 deny_since: None,
10552 },
10553 Lint {
10554 label: "macro_metavar_expr",
10555 description: r##"# `macro_metavar_expr`
10556
10557The tracking issue for this feature is: [#83527]
10558
10559------------------------
10560
10561> This feature is not to be confused with [`macro_metavar_expr_concat`].
10562
10563[`macro_metavar_expr_concat`]: ./macro-metavar-expr-concat.md
10564[#83527]: https://github.com/rust-lang/rust/issues/83527
10565"##,
10566 default_severity: Severity::Allow,
10567 warn_since: None,
10568 deny_since: None,
10569 },
10570 Lint {
10571 label: "macro_metavar_expr_concat",
10572 description: r##"# `macro_metavar_expr_concat`
10573
10574The tracking issue for this feature is: [#124225]
10575
10576------------------------
10577
10578In stable Rust, there is no way to create new identifiers by joining identifiers to literals or other identifiers without using procedural macros such as [`paste`].
10579 `#![feature(macro_metavar_expr_concat)]` introduces a way to do this, using the concat metavariable expression.
10580
10581> This feature uses the syntax from [`macro_metavar_expr`] but is otherwise
10582> independent. It replaces the since-removed unstable feature
10583> [`concat_idents`].
10584
10585> This is an experimental feature; it and its syntax will require a RFC before stabilization.
10586
10587
10588### Overview
10589
10590`#![feature(macro_metavar_expr_concat)]` provides the `concat` metavariable expression for creating new identifiers:
10591
10592```rust
10593#![feature(macro_metavar_expr_concat)]
10594
10595macro_rules! create_some_structs {
10596 ($name:ident) => {
10597 pub struct ${ concat(First, $name) };
10598 pub struct ${ concat(Second, $name) };
10599 pub struct ${ concat(Third, $name) };
10600 }
10601}
10602
10603create_some_structs!(Thing);
10604```
10605
10606This macro invocation expands to:
10607
10608```rust
10609pub struct FirstThing;
10610pub struct SecondThing;
10611pub struct ThirdThing;
10612```
10613
10614### Syntax
10615
10616This feature builds upon the metavariable expression syntax `${ .. }` as specified in [RFC 3086] ([`macro_metavar_expr`]).
10617 `concat` is available like `${ concat(items) }`, where `items` is a comma separated sequence of idents and/or literals.
10618
10619### Examples
10620
10621#### Create a function or method with a concatenated name
10622
10623```rust
10624#![feature(macro_metavar_expr_concat)]
10625
10626macro_rules! make_getter {
10627 ($name:ident, $field: ident, $ret:ty) => {
10628 impl $name {
10629 pub fn ${ concat(get_, $field) }(&self) -> &$ret {
10630 &self.$field
10631 }
10632 }
10633 }
10634}
10635
10636pub struct Thing {
10637 description: String,
10638}
10639
10640make_getter!(Thing, description, String);
10641```
10642
10643This expands to:
10644
10645```rust
10646pub struct Thing {
10647 description: String,
10648}
10649
10650impl Thing {
10651 pub fn get_description(&self) -> &String {
10652 &self.description
10653 }
10654}
10655```
10656
10657#### Create names for macro generated tests
10658
10659```rust
10660#![feature(macro_metavar_expr_concat)]
10661
10662macro_rules! test_math {
10663 ($integer:ident) => {
10664 #[test]
10665 fn ${ concat(test_, $integer, _, addition) } () {
10666 let a: $integer = 73;
10667 let b: $integer = 42;
10668 assert_eq!(a + b, 115)
10669 }
10670
10671 #[test]
10672 fn ${ concat(test_, $integer, _, subtraction) } () {
10673 let a: $integer = 73;
10674 let b: $integer = 42;
10675 assert_eq!(a - b, 31)
10676 }
10677 }
10678}
10679
10680test_math!(i32);
10681test_math!(u64);
10682test_math!(u128);
10683```
10684
10685Running this returns the following output:
10686
10687```text
10688running 6 tests
10689test test_i32_subtraction ... ok
10690test test_i32_addition ... ok
10691test test_u128_addition ... ok
10692test test_u128_subtraction ... ok
10693test test_u64_addition ... ok
10694test test_u64_subtraction ... ok
10695
10696test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
10697```
10698
10699[`paste`]: https://crates.io/crates/paste
10700[RFC 3086]: https://rust-lang.github.io/rfcs/3086-macro-metavar-expr.html
10701[`macro_metavar_expr`]: ../language-features/macro-metavar-expr.md
10702[`concat_idents`]: https://github.com/rust-lang/rust/issues/29599
10703[#124225]: https://github.com/rust-lang/rust/issues/124225
10704[declarative macros]: https://doc.rust-lang.org/stable/reference/macros-by-example.html
10705"##,
10706 default_severity: Severity::Allow,
10707 warn_since: None,
10708 deny_since: None,
10709 },
10710 Lint {
10711 label: "map_try_insert",
10712 description: r##"# `map_try_insert`
10713
10714
10715
10716The tracking issue for this feature is: [#82766]
10717
10718[#82766]: https://github.com/rust-lang/rust/issues/82766
10719
10720------------------------
10721"##,
10722 default_severity: Severity::Allow,
10723 warn_since: None,
10724 deny_since: None,
10725 },
10726 Lint {
10727 label: "mapped_lock_guards",
10728 description: r##"# `mapped_lock_guards`
10729
10730
10731
10732The tracking issue for this feature is: [#117108]
10733
10734[#117108]: https://github.com/rust-lang/rust/issues/117108
10735
10736------------------------
10737"##,
10738 default_severity: Severity::Allow,
10739 warn_since: None,
10740 deny_since: None,
10741 },
10742 Lint {
10743 label: "marker_trait_attr",
10744 description: r##"# `marker_trait_attr`
10745
10746The tracking issue for this feature is: [#29864]
10747
10748[#29864]: https://github.com/rust-lang/rust/issues/29864
10749
10750------------------------
10751
10752Normally, Rust keeps you from adding trait implementations that could
10753overlap with each other, as it would be ambiguous which to use. This
10754feature, however, carves out an exception to that rule: a trait can
10755opt-in to having overlapping implementations, at the cost that those
10756implementations are not allowed to override anything (and thus the
10757trait itself cannot have any associated items, as they're pointless
10758when they'd need to do the same thing for every type anyway).
10759
10760```rust
10761#![feature(marker_trait_attr)]
10762
10763#[marker] trait CheapToClone: Clone {}
10764
10765impl<T: Copy> CheapToClone for T {}
10766
10767// These could potentially overlap with the blanket implementation above,
10768// so are only allowed because CheapToClone is a marker trait.
10769impl<T: CheapToClone, U: CheapToClone> CheapToClone for (T, U) {}
10770impl<T: CheapToClone> CheapToClone for std::ops::Range<T> {}
10771
10772fn cheap_clone<T: CheapToClone>(t: T) -> T {
10773 t.clone()
10774}
10775```
10776
10777This is expected to replace the unstable `overlapping_marker_traits`
10778feature, which applied to all empty traits (without needing an opt-in).
10779"##,
10780 default_severity: Severity::Allow,
10781 warn_since: None,
10782 deny_since: None,
10783 },
10784 Lint {
10785 label: "maybe_dangling",
10786 description: r##"# `maybe_dangling`
10787
10788
10789
10790The tracking issue for this feature is: [#118166]
10791
10792[#118166]: https://github.com/rust-lang/rust/issues/118166
10793
10794------------------------
10795"##,
10796 default_severity: Severity::Allow,
10797 warn_since: None,
10798 deny_since: None,
10799 },
10800 Lint {
10801 label: "maybe_uninit_array_assume_init",
10802 description: r##"# `maybe_uninit_array_assume_init`
10803
10804
10805
10806The tracking issue for this feature is: [#96097]
10807
10808[#96097]: https://github.com/rust-lang/rust/issues/96097
10809
10810------------------------
10811"##,
10812 default_severity: Severity::Allow,
10813 warn_since: None,
10814 deny_since: None,
10815 },
10816 Lint {
10817 label: "maybe_uninit_as_bytes",
10818 description: r##"# `maybe_uninit_as_bytes`
10819
10820
10821
10822The tracking issue for this feature is: [#93092]
10823
10824[#93092]: https://github.com/rust-lang/rust/issues/93092
10825
10826------------------------
10827"##,
10828 default_severity: Severity::Allow,
10829 warn_since: None,
10830 deny_since: None,
10831 },
10832 Lint {
10833 label: "maybe_uninit_fill",
10834 description: r##"# `maybe_uninit_fill`
10835
10836
10837
10838The tracking issue for this feature is: [#117428]
10839
10840[#117428]: https://github.com/rust-lang/rust/issues/117428
10841
10842------------------------
10843"##,
10844 default_severity: Severity::Allow,
10845 warn_since: None,
10846 deny_since: None,
10847 },
10848 Lint {
10849 label: "maybe_uninit_uninit_array_transpose",
10850 description: r##"# `maybe_uninit_uninit_array_transpose`
10851
10852
10853
10854The tracking issue for this feature is: [#96097]
10855
10856[#96097]: https://github.com/rust-lang/rust/issues/96097
10857
10858------------------------
10859"##,
10860 default_severity: Severity::Allow,
10861 warn_since: None,
10862 deny_since: None,
10863 },
10864 Lint {
10865 label: "mem_conjure_zst",
10866 description: r##"# `mem_conjure_zst`
10867
10868
10869
10870The tracking issue for this feature is: [#95383]
10871
10872[#95383]: https://github.com/rust-lang/rust/issues/95383
10873
10874------------------------
10875"##,
10876 default_severity: Severity::Allow,
10877 warn_since: None,
10878 deny_since: None,
10879 },
10880 Lint {
10881 label: "mem_copy_fn",
10882 description: r##"# `mem_copy_fn`
10883
10884
10885
10886The tracking issue for this feature is: [#98262]
10887
10888[#98262]: https://github.com/rust-lang/rust/issues/98262
10889
10890------------------------
10891"##,
10892 default_severity: Severity::Allow,
10893 warn_since: None,
10894 deny_since: None,
10895 },
10896 Lint {
10897 label: "mgca_type_const_syntax",
10898 description: r##"# `mgca_type_const_syntax`
10899
10900Enable mgca `type const` syntax before expansion.
10901
10902The tracking issue for this feature is: [#132980]
10903
10904[#132980]: https://github.com/rust-lang/rust/issues/132980
10905
10906------------------------
10907"##,
10908 default_severity: Severity::Allow,
10909 warn_since: None,
10910 deny_since: None,
10911 },
10912 Lint {
10913 label: "min_adt_const_params",
10914 description: r##"# `min_adt_const_params`
10915
10916Allows additional const parameter types, such as [u8; 10] or user defined types. User defined types must not have fields more private than the type itself.
10917
10918The tracking issue for this feature is: [#154042]
10919
10920[#154042]: https://github.com/rust-lang/rust/issues/154042
10921
10922------------------------
10923"##,
10924 default_severity: Severity::Allow,
10925 warn_since: None,
10926 deny_since: None,
10927 },
10928 Lint {
10929 label: "min_generic_const_args",
10930 description: r##"# min_generic_const_args
10931
10932Enables the generic const args MVP (paths to type const items and constructors for ADTs and primitives).
10933
10934The tracking issue for this feature is: [#132980]
10935
10936[#132980]: https://github.com/rust-lang/rust/issues/132980
10937
10938------------------------
10939
10940Warning: This feature is incomplete; its design and syntax may change.
10941
10942This feature acts as a minimal alternative to [generic_const_exprs] that allows a smaller subset of functionality,
10943and uses a different approach for implementation. It is intentionally more restrictive, which helps with avoiding edge
10944cases that make the `generic_const_exprs` hard to implement properly. See [Feature background][feature_background]
10945for more details.
10946
10947Related features: [generic_const_args], [generic_const_items].
10948
10949[feature_background]: https://github.com/rust-lang/project-const-generics/blob/main/documents/min_const_generics_plan.md
10950[generic_const_exprs]: generic-const-exprs.md
10951[generic_const_args]: generic-const-args.md
10952[generic_const_items]: generic-const-items.md
10953
10954## `type const` syntax
10955
10956This feature introduces new syntax: `type const`.
10957Constants marked as `type const` are allowed to be used in type contexts, e.g.:
10958
10959```compile_fail
10960#![allow(incomplete_features)]
10961#![feature(min_generic_const_args)]
10962
10963type const X: usize = 1;
10964const Y: usize = 1;
10965
10966struct Foo {
10967 good_arr: [(); X], // Allowed
10968 bad_arr: [(); Y], // Will not compile, `Y` must be `type const`.
10969}
10970```
10971
10972## Examples
10973
10974```rust
10975#![allow(incomplete_features)]
10976#![feature(min_generic_const_args)]
10977
10978trait Bar {
10979 type const VAL: usize;
10980 type const VAL2: usize;
10981}
10982
10983struct Baz;
10984
10985impl Bar for Baz {
10986 type const VAL: usize = 2;
10987 type const VAL2: usize = const { Self::VAL * 2 };
10988}
10989
10990struct Foo<B: Bar> {
10991 arr1: [usize; B::VAL],
10992 arr2: [usize; B::VAL2],
10993}
10994```
10995
10996Note that with [generic_const_exprs] the same example would look as follows:
10997
10998```rust
10999#![allow(incomplete_features)]
11000#![feature(generic_const_exprs)]
11001
11002trait Bar {
11003 const VAL: usize;
11004 const VAL2: usize;
11005}
11006
11007struct Baz;
11008
11009impl Bar for Baz {
11010 const VAL: usize = 2;
11011 const VAL2: usize = const { Self::VAL * 2 };
11012}
11013
11014struct Foo<B: Bar>
11015where
11016 [(); B::VAL]:,
11017 [(); B::VAL2]:,
11018{
11019 arr1: [usize; B::VAL],
11020 arr2: [usize; B::VAL2],
11021}
11022```
11023
11024Use of const functions is allowed:
11025
11026```rust
11027#![allow(incomplete_features)]
11028#![feature(min_generic_const_args)]
11029
11030const VAL: usize = 1;
11031
11032const fn inc(val: usize) -> usize {
11033 val + 1
11034}
11035
11036type const INC: usize = const { inc(VAL) };
11037
11038const ARR: [usize; INC] = [0; INC];
11039```
11040"##,
11041 default_severity: Severity::Allow,
11042 warn_since: None,
11043 deny_since: None,
11044 },
11045 Lint {
11046 label: "min_specialization",
11047 description: r##"# `min_specialization`
11048
11049A minimal, sound subset of specialization intended to be used by the standard library until the soundness issues with specialization are fixed.
11050
11051The tracking issue for this feature is: [#31844]
11052
11053[#31844]: https://github.com/rust-lang/rust/issues/31844
11054
11055------------------------
11056"##,
11057 default_severity: Severity::Allow,
11058 warn_since: None,
11059 deny_since: None,
11060 },
11061 Lint {
11062 label: "mips_target_feature",
11063 description: r##"# `mips_target_feature`
11064
11065Target features on mips.
11066
11067The tracking issue for this feature is: [#150253]
11068
11069[#150253]: https://github.com/rust-lang/rust/issues/150253
11070
11071------------------------
11072"##,
11073 default_severity: Severity::Allow,
11074 warn_since: None,
11075 deny_since: None,
11076 },
11077 Lint {
11078 label: "more_float_constants",
11079 description: r##"# `more_float_constants`
11080
11081
11082
11083The tracking issue for this feature is: [#146939]
11084
11085[#146939]: https://github.com/rust-lang/rust/issues/146939
11086
11087------------------------
11088"##,
11089 default_severity: Severity::Allow,
11090 warn_since: None,
11091 deny_since: None,
11092 },
11093 Lint {
11094 label: "more_maybe_bounds",
11095 description: r##"# `more_maybe_bounds`
11096
11097Allows using `?Trait` trait bounds in more contexts.
11098
11099This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
11100
11101------------------------
11102"##,
11103 default_severity: Severity::Allow,
11104 warn_since: None,
11105 deny_since: None,
11106 },
11107 Lint {
11108 label: "more_qualified_paths",
11109 description: r##"# `more_qualified_paths`
11110
11111The `more_qualified_paths` feature can be used in order to enable the
11112use of qualified paths in patterns.
11113
11114The tracking issue for this feature is: [#86935](https://github.com/rust-lang/rust/issues/86935).
11115
11116------------------------
11117
11118## Example
11119
11120```rust
11121#![feature(more_qualified_paths)]
11122
11123fn main() {
11124 // destructure through a qualified path
11125 let <Foo as A>::Assoc { br } = StructStruct { br: 2 };
11126}
11127
11128struct StructStruct {
11129 br: i8,
11130}
11131
11132struct Foo;
11133
11134trait A {
11135 type Assoc;
11136}
11137
11138impl A for Foo {
11139 type Assoc = StructStruct;
11140}
11141```
11142"##,
11143 default_severity: Severity::Allow,
11144 warn_since: None,
11145 deny_since: None,
11146 },
11147 Lint {
11148 label: "motor_ext",
11149 description: r##"# `motor_ext`
11150
11151
11152
11153The tracking issue for this feature is: [#147456]
11154
11155[#147456]: https://github.com/rust-lang/rust/issues/147456
11156
11157------------------------
11158"##,
11159 default_severity: Severity::Allow,
11160 warn_since: None,
11161 deny_since: None,
11162 },
11163 Lint {
11164 label: "move_expr",
11165 description: r##"# `move_expr`
11166
11167Allows `move(expr)` in closures.
11168
11169The tracking issue for this feature is: [#155050]
11170
11171[#155050]: https://github.com/rust-lang/rust/issues/155050
11172
11173------------------------
11174"##,
11175 default_severity: Severity::Allow,
11176 warn_since: None,
11177 deny_since: None,
11178 },
11179 Lint {
11180 label: "movrs_target_feature",
11181 description: r##"# `movrs_target_feature`
11182
11183The `movrs` target feature on x86.
11184
11185The tracking issue for this feature is: [#137976]
11186
11187[#137976]: https://github.com/rust-lang/rust/issues/137976
11188
11189------------------------
11190"##,
11191 default_severity: Severity::Allow,
11192 warn_since: None,
11193 deny_since: None,
11194 },
11195 Lint {
11196 label: "mpmc_channel",
11197 description: r##"# `mpmc_channel`
11198
11199
11200
11201The tracking issue for this feature is: [#126840]
11202
11203[#126840]: https://github.com/rust-lang/rust/issues/126840
11204
11205------------------------
11206"##,
11207 default_severity: Severity::Allow,
11208 warn_since: None,
11209 deny_since: None,
11210 },
11211 Lint {
11212 label: "mpsc_is_disconnected",
11213 description: r##"# `mpsc_is_disconnected`
11214
11215
11216
11217The tracking issue for this feature is: [#153668]
11218
11219[#153668]: https://github.com/rust-lang/rust/issues/153668
11220
11221------------------------
11222"##,
11223 default_severity: Severity::Allow,
11224 warn_since: None,
11225 deny_since: None,
11226 },
11227 Lint {
11228 label: "multiple_supertrait_upcastable",
11229 description: r##"# `multiple_supertrait_upcastable`
11230
11231Allows the `multiple_supertrait_upcastable` lint.
11232
11233The tracking issue for this feature is: [#150833]
11234
11235[#150833]: https://github.com/rust-lang/rust/issues/150833
11236
11237------------------------
11238"##,
11239 default_severity: Severity::Allow,
11240 warn_since: None,
11241 deny_since: None,
11242 },
11243 Lint {
11244 label: "must_not_suspend",
11245 description: r##"# `must_not_suspend`
11246
11247Allows the `#[must_not_suspend]` attribute.
11248
11249The tracking issue for this feature is: [#83310]
11250
11251[#83310]: https://github.com/rust-lang/rust/issues/83310
11252
11253------------------------
11254"##,
11255 default_severity: Severity::Allow,
11256 warn_since: None,
11257 deny_since: None,
11258 },
11259 Lint {
11260 label: "mut_ref",
11261 description: r##"# `mut_ref`
11262
11263Allows `mut ref` and `mut ref mut` identifier patterns.
11264
11265The tracking issue for this feature is: [#123076]
11266
11267[#123076]: https://github.com/rust-lang/rust/issues/123076
11268
11269------------------------
11270"##,
11271 default_severity: Severity::Allow,
11272 warn_since: None,
11273 deny_since: None,
11274 },
11275 Lint {
11276 label: "mut_restriction",
11277 description: r##"# `mut_restriction`
11278
11279Allows `mut(crate) field: Type` restrictions.
11280
11281The tracking issue for this feature is: [#105077]
11282
11283[#105077]: https://github.com/rust-lang/rust/issues/105077
11284
11285------------------------
11286"##,
11287 default_severity: Severity::Allow,
11288 warn_since: None,
11289 deny_since: None,
11290 },
11291 Lint {
11292 label: "mutex_data_ptr",
11293 description: r##"# `mutex_data_ptr`
11294
11295
11296
11297The tracking issue for this feature is: [#140368]
11298
11299[#140368]: https://github.com/rust-lang/rust/issues/140368
11300
11301------------------------
11302"##,
11303 default_severity: Severity::Allow,
11304 warn_since: None,
11305 deny_since: None,
11306 },
11307 Lint {
11308 label: "naked_functions_rustic_abi",
11309 description: r##"# `naked_functions_rustic_abi`
11310
11311Allows using `#[naked]` on `extern "Rust"` functions.
11312
11313The tracking issue for this feature is: [#138997]
11314
11315[#138997]: https://github.com/rust-lang/rust/issues/138997
11316
11317------------------------
11318"##,
11319 default_severity: Severity::Allow,
11320 warn_since: None,
11321 deny_since: None,
11322 },
11323 Lint {
11324 label: "naked_functions_target_feature",
11325 description: r##"# `naked_functions_target_feature`
11326
11327Allows using `#[target_feature(enable = "...")]` on `#[naked]` on functions.
11328
11329The tracking issue for this feature is: [#138568]
11330
11331[#138568]: https://github.com/rust-lang/rust/issues/138568
11332
11333------------------------
11334"##,
11335 default_severity: Severity::Allow,
11336 warn_since: None,
11337 deny_since: None,
11338 },
11339 Lint {
11340 label: "native_link_modifiers_as_needed",
11341 description: r##"# `native_link_modifiers_as_needed`
11342
11343The tracking issue for this feature is: [#81490]
11344
11345[#81490]: https://github.com/rust-lang/rust/issues/81490
11346
11347------------------------
11348
11349The `native_link_modifiers_as_needed` feature allows you to use the `as-needed` modifier.
11350
11351`as-needed` is only compatible with the `dynamic` and `framework` linking kinds. Using any other kind will result in a compiler error.
11352
11353`+as-needed` means that the library will be actually linked only if it satisfies some undefined symbols at the point at which it is specified on the command line, making it similar to static libraries in this regard.
11354
11355This modifier translates to `--as-needed` for ld-like linkers, and to `-dead_strip_dylibs` / `-needed_library` / `-needed_framework` for ld64.
11356The modifier does nothing for linkers that don't support it (e.g. `link.exe`).
11357
11358The default for this modifier is unclear, some targets currently specify it as `+as-needed`, some do not. We may want to try making `+as-needed` a default for all targets.
11359"##,
11360 default_severity: Severity::Allow,
11361 warn_since: None,
11362 deny_since: None,
11363 },
11364 Lint {
11365 label: "needs_panic_runtime",
11366 description: r##"# `needs_panic_runtime`
11367
11368Allows declaring with `#![needs_panic_runtime]` that a panic runtime is needed.
11369
11370The tracking issue for this feature is: [#32837]
11371
11372[#32837]: https://github.com/rust-lang/rust/issues/32837
11373
11374------------------------
11375"##,
11376 default_severity: Severity::Allow,
11377 warn_since: None,
11378 deny_since: None,
11379 },
11380 Lint {
11381 label: "negative_bounds",
11382 description: r##"# `negative_bounds`
11383
11384Allow negative trait bounds. This is an internal-only feature for testing the trait solver!
11385
11386This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
11387
11388------------------------
11389"##,
11390 default_severity: Severity::Allow,
11391 warn_since: None,
11392 deny_since: None,
11393 },
11394 Lint {
11395 label: "negative_impls",
11396 description: r##"# `negative_impls`
11397
11398The tracking issue for this feature is [#68318].
11399
11400[#68318]: https://github.com/rust-lang/rust/issues/68318
11401
11402----
11403
11404With the feature gate `negative_impls`, you can write negative impls as well as positive ones:
11405
11406```rust
11407#![feature(negative_impls)]
11408trait DerefMut { }
11409impl<T: ?Sized> !DerefMut for &T { }
11410```
11411
11412Negative impls indicate a semver guarantee that the given trait will not be implemented for the given types. Negative impls play an additional purpose for auto traits, described below.
11413
11414Negative impls have the following characteristics:
11415
11416* They do not have any items.
11417* They must obey the orphan rules as if they were a positive impl.
11418* They cannot "overlap" with any positive impls.
11419
11420## Semver interaction
11421
11422It is a breaking change to remove a negative impl. Negative impls are a commitment not to implement the given trait for the named types.
11423
11424## Orphan and overlap rules
11425
11426Negative impls must obey the same orphan rules as a positive impl. This implies you cannot add a negative impl for types defined in upstream crates and so forth.
11427
11428Similarly, negative impls cannot overlap with positive impls, again using the same "overlap" check that we ordinarily use to determine if two impls overlap. (Note that positive impls typically cannot overlap with one another either, except as permitted by specialization.)
11429
11430## Interaction with auto traits
11431
11432Declaring a negative impl `impl !SomeAutoTrait for SomeType` for an
11433auto-trait serves two purposes:
11434
11435* as with any trait, it declares that `SomeType` will never implement `SomeAutoTrait`;
11436* it disables the automatic `SomeType: SomeAutoTrait` impl that would otherwise have been generated.
11437
11438Note that, at present, there is no way to indicate that a given type
11439does not implement an auto trait *but that it may do so in the
11440future*. For ordinary types, this is done by simply not declaring any
11441impl at all, but that is not an option for auto traits. A workaround
11442is that one could embed a marker type as one of the fields, where the
11443marker type is `!AutoTrait`.
11444
11445## Immediate uses
11446
11447Negative impls are used to declare that `&T: !DerefMut` and `&mut T: !Clone`, as required to fix the soundness of `Pin` described in [#66544](https://github.com/rust-lang/rust/issues/66544).
11448
11449This serves two purposes:
11450
11451* For proving the correctness of unsafe code, we can use that impl as evidence that no `DerefMut` or `Clone` impl exists.
11452* It prevents downstream crates from creating such impls.
11453"##,
11454 default_severity: Severity::Allow,
11455 warn_since: None,
11456 deny_since: None,
11457 },
11458 Lint {
11459 label: "never_patterns",
11460 description: r##"# `never_patterns`
11461
11462Allows the `!` pattern.
11463
11464The tracking issue for this feature is: [#118155]
11465
11466[#118155]: https://github.com/rust-lang/rust/issues/118155
11467
11468------------------------
11469"##,
11470 default_severity: Severity::Allow,
11471 warn_since: None,
11472 deny_since: None,
11473 },
11474 Lint {
11475 label: "never_type",
11476 description: r##"# `never_type`
11477
11478Allows the `!` type. Does not imply 'exhaustive_patterns' (below) any more.
11479
11480The tracking issue for this feature is: [#35121]
11481
11482[#35121]: https://github.com/rust-lang/rust/issues/35121
11483
11484------------------------
11485"##,
11486 default_severity: Severity::Allow,
11487 warn_since: None,
11488 deny_since: None,
11489 },
11490 Lint {
11491 label: "new_range",
11492 description: r##"# `new_range`
11493
11494The tracking issue for this feature is: [#123741]
11495
11496[#123741]: https://github.com/rust-lang/rust/issues/123741
11497
11498---
11499
11500Switch the syntaxes `a..`, `a..b`, and `a..=b` to resolve the new range types.
11501"##,
11502 default_severity: Severity::Allow,
11503 warn_since: None,
11504 deny_since: None,
11505 },
11506 Lint {
11507 label: "new_range_api_legacy",
11508 description: r##"# `new_range_api_legacy`
11509
11510
11511
11512The tracking issue for this feature is: [#125687]
11513
11514[#125687]: https://github.com/rust-lang/rust/issues/125687
11515
11516------------------------
11517"##,
11518 default_severity: Severity::Allow,
11519 warn_since: None,
11520 deny_since: None,
11521 },
11522 Lint {
11523 label: "new_range_remainder",
11524 description: r##"# `new_range_remainder`
11525
11526
11527
11528The tracking issue for this feature is: [#154458]
11529
11530[#154458]: https://github.com/rust-lang/rust/issues/154458
11531
11532------------------------
11533"##,
11534 default_severity: Severity::Allow,
11535 warn_since: None,
11536 deny_since: None,
11537 },
11538 Lint {
11539 label: "next_index",
11540 description: r##"# `next_index`
11541
11542
11543
11544The tracking issue for this feature is: [#130711]
11545
11546[#130711]: https://github.com/rust-lang/rust/issues/130711
11547
11548------------------------
11549"##,
11550 default_severity: Severity::Allow,
11551 warn_since: None,
11552 deny_since: None,
11553 },
11554 Lint {
11555 label: "no_core",
11556 description: r##"# `no_core`
11557
11558Allows `#![no_core]`.
11559
11560The tracking issue for this feature is: [#29639]
11561
11562[#29639]: https://github.com/rust-lang/rust/issues/29639
11563
11564------------------------
11565"##,
11566 default_severity: Severity::Allow,
11567 warn_since: None,
11568 deny_since: None,
11569 },
11570 Lint {
11571 label: "non_exhaustive_omitted_patterns_lint",
11572 description: r##"# `non_exhaustive_omitted_patterns_lint`
11573
11574Allows using the `non_exhaustive_omitted_patterns` lint.
11575
11576The tracking issue for this feature is: [#89554]
11577
11578[#89554]: https://github.com/rust-lang/rust/issues/89554
11579
11580------------------------
11581"##,
11582 default_severity: Severity::Allow,
11583 warn_since: None,
11584 deny_since: None,
11585 },
11586 Lint {
11587 label: "non_lifetime_binders",
11588 description: r##"# `non_lifetime_binders`
11589
11590Allows `for<T>` binders in where-clauses
11591
11592The tracking issue for this feature is: [#108185]
11593
11594[#108185]: https://github.com/rust-lang/rust/issues/108185
11595
11596------------------------
11597"##,
11598 default_severity: Severity::Allow,
11599 warn_since: None,
11600 deny_since: None,
11601 },
11602 Lint {
11603 label: "nonpoison_condvar",
11604 description: r##"# `nonpoison_condvar`
11605
11606
11607
11608The tracking issue for this feature is: [#134645]
11609
11610[#134645]: https://github.com/rust-lang/rust/issues/134645
11611
11612------------------------
11613"##,
11614 default_severity: Severity::Allow,
11615 warn_since: None,
11616 deny_since: None,
11617 },
11618 Lint {
11619 label: "nonpoison_mutex",
11620 description: r##"# `nonpoison_mutex`
11621
11622
11623
11624The tracking issue for this feature is: [#134645]
11625
11626[#134645]: https://github.com/rust-lang/rust/issues/134645
11627
11628------------------------
11629"##,
11630 default_severity: Severity::Allow,
11631 warn_since: None,
11632 deny_since: None,
11633 },
11634 Lint {
11635 label: "nonpoison_rwlock",
11636 description: r##"# `nonpoison_rwlock`
11637
11638
11639
11640The tracking issue for this feature is: [#134645]
11641
11642[#134645]: https://github.com/rust-lang/rust/issues/134645
11643
11644------------------------
11645"##,
11646 default_severity: Severity::Allow,
11647 warn_since: None,
11648 deny_since: None,
11649 },
11650 Lint {
11651 label: "nonzero_bitwise",
11652 description: r##"# `nonzero_bitwise`
11653
11654
11655
11656The tracking issue for this feature is: [#128281]
11657
11658[#128281]: https://github.com/rust-lang/rust/issues/128281
11659
11660------------------------
11661"##,
11662 default_severity: Severity::Allow,
11663 warn_since: None,
11664 deny_since: None,
11665 },
11666 Lint {
11667 label: "nonzero_from_mut",
11668 description: r##"# `nonzero_from_mut`
11669
11670
11671
11672The tracking issue for this feature is: [#106290]
11673
11674[#106290]: https://github.com/rust-lang/rust/issues/106290
11675
11676------------------------
11677"##,
11678 default_severity: Severity::Allow,
11679 warn_since: None,
11680 deny_since: None,
11681 },
11682 Lint {
11683 label: "nonzero_from_str_radix",
11684 description: r##"# `nonzero_from_str_radix`
11685
11686
11687
11688The tracking issue for this feature is: [#152193]
11689
11690[#152193]: https://github.com/rust-lang/rust/issues/152193
11691
11692------------------------
11693"##,
11694 default_severity: Severity::Allow,
11695 warn_since: None,
11696 deny_since: None,
11697 },
11698 Lint {
11699 label: "nonzero_internals",
11700 description: r##"# `nonzero_internals`
11701
11702
11703
11704This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
11705
11706------------------------
11707"##,
11708 default_severity: Severity::Allow,
11709 warn_since: None,
11710 deny_since: None,
11711 },
11712 Lint {
11713 label: "nonzero_ops",
11714 description: r##"# `nonzero_ops`
11715
11716
11717
11718The tracking issue for this feature is: [#84186]
11719
11720[#84186]: https://github.com/rust-lang/rust/issues/84186
11721
11722------------------------
11723"##,
11724 default_severity: Severity::Allow,
11725 warn_since: None,
11726 deny_since: None,
11727 },
11728 Lint {
11729 label: "normalize_lexically",
11730 description: r##"# `normalize_lexically`
11731
11732
11733
11734The tracking issue for this feature is: [#134694]
11735
11736[#134694]: https://github.com/rust-lang/rust/issues/134694
11737
11738------------------------
11739"##,
11740 default_severity: Severity::Allow,
11741 warn_since: None,
11742 deny_since: None,
11743 },
11744 Lint {
11745 label: "num_internals",
11746 description: r##"# `num_internals`
11747
11748
11749
11750This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
11751
11752------------------------
11753"##,
11754 default_severity: Severity::Allow,
11755 warn_since: None,
11756 deny_since: None,
11757 },
11758 Lint {
11759 label: "numfmt",
11760 description: r##"# `numfmt`
11761
11762
11763
11764This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
11765
11766------------------------
11767"##,
11768 default_severity: Severity::Allow,
11769 warn_since: None,
11770 deny_since: None,
11771 },
11772 Lint {
11773 label: "nvptx_target_feature",
11774 description: r##"# `nvptx_target_feature`
11775
11776Target feaures on nvptx.
11777
11778The tracking issue for this feature is: [#150254]
11779
11780[#150254]: https://github.com/rust-lang/rust/issues/150254
11781
11782------------------------
11783"##,
11784 default_severity: Severity::Allow,
11785 warn_since: None,
11786 deny_since: None,
11787 },
11788 Lint {
11789 label: "objc_class_variant",
11790 description: r##"# `objc_class_variant`
11791
11792
11793
11794This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
11795
11796------------------------
11797"##,
11798 default_severity: Severity::Allow,
11799 warn_since: None,
11800 deny_since: None,
11801 },
11802 Lint {
11803 label: "objc_selector_variant",
11804 description: r##"# `objc_selector_variant`
11805
11806
11807
11808This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
11809
11810------------------------
11811"##,
11812 default_severity: Severity::Allow,
11813 warn_since: None,
11814 deny_since: None,
11815 },
11816 Lint {
11817 label: "offset_of_enum",
11818 description: r##"# `offset_of_enum`
11819
11820The tracking issue for this feature is: [#120141]
11821
11822[#120141]: https://github.com/rust-lang/rust/issues/120141
11823
11824------------------------
11825
11826When the `offset_of_enum` feature is enabled, the [`offset_of!`] macro may be used to obtain the
11827offsets of fields of `enum`s; to express this, `enum` variants may be traversed as if they were
11828fields. Variants themselves do not have an offset, so they cannot appear as the last path component.
11829
11830```rust
11831#![feature(offset_of_enum)]
11832use std::mem;
11833
11834#[repr(u8)]
11835enum Enum {
11836 A(u8, u16),
11837 B { one: u8, two: u16 },
11838}
11839
11840assert_eq!(mem::offset_of!(Enum, A.0), 1);
11841assert_eq!(mem::offset_of!(Enum, B.two), 2);
11842
11843assert_eq!(mem::offset_of!(Option<&u8>, Some.0), 0);
11844```
11845
11846[`offset_of!`]: ../../std/mem/macro.offset_of.html
11847"##,
11848 default_severity: Severity::Allow,
11849 warn_since: None,
11850 deny_since: None,
11851 },
11852 Lint {
11853 label: "offset_of_slice",
11854 description: r##"# `offset_of_slice`
11855
11856The tracking issue for this feature is: [#126151]
11857
11858[#126151]: https://github.com/rust-lang/rust/issues/126151
11859
11860------------------------
11861
11862When the `offset_of_slice` feature is enabled, the [`offset_of!`] macro may be used to determine
11863the offset of fields whose type is `[T]`, that is, a slice of dynamic size.
11864
11865In general, fields whose type is dynamically sized do not have statically known offsets because
11866they do not have statically known alignments. However, `[T]` has the same alignment as `T`, so
11867it specifically may be allowed.
11868
11869```rust
11870#![feature(offset_of_slice)]
11871
11872#[repr(C)]
11873pub struct Struct {
11874 head: u32,
11875 tail: [u8],
11876}
11877
11878fn main() {
11879 assert_eq!(std::mem::offset_of!(Struct, tail), 4);
11880}
11881```
11882
11883[`offset_of!`]: ../../std/mem/macro.offset_of.html
11884"##,
11885 default_severity: Severity::Allow,
11886 warn_since: None,
11887 deny_since: None,
11888 },
11889 Lint {
11890 label: "once_cell_get_mut",
11891 description: r##"# `once_cell_get_mut`
11892
11893
11894
11895The tracking issue for this feature is: [#121641]
11896
11897[#121641]: https://github.com/rust-lang/rust/issues/121641
11898
11899------------------------
11900"##,
11901 default_severity: Severity::Allow,
11902 warn_since: None,
11903 deny_since: None,
11904 },
11905 Lint {
11906 label: "once_cell_try",
11907 description: r##"# `once_cell_try`
11908
11909
11910
11911The tracking issue for this feature is: [#109737]
11912
11913[#109737]: https://github.com/rust-lang/rust/issues/109737
11914
11915------------------------
11916"##,
11917 default_severity: Severity::Allow,
11918 warn_since: None,
11919 deny_since: None,
11920 },
11921 Lint {
11922 label: "once_cell_try_insert",
11923 description: r##"# `once_cell_try_insert`
11924
11925
11926
11927The tracking issue for this feature is: [#116693]
11928
11929[#116693]: https://github.com/rust-lang/rust/issues/116693
11930
11931------------------------
11932"##,
11933 default_severity: Severity::Allow,
11934 warn_since: None,
11935 deny_since: None,
11936 },
11937 Lint {
11938 label: "one_sided_range",
11939 description: r##"# `one_sided_range`
11940
11941
11942
11943The tracking issue for this feature is: [#69780]
11944
11945[#69780]: https://github.com/rust-lang/rust/issues/69780
11946
11947------------------------
11948"##,
11949 default_severity: Severity::Allow,
11950 warn_since: None,
11951 deny_since: None,
11952 },
11953 Lint {
11954 label: "oneshot_channel",
11955 description: r##"# `oneshot_channel`
11956
11957
11958
11959The tracking issue for this feature is: [#143674]
11960
11961[#143674]: https://github.com/rust-lang/rust/issues/143674
11962
11963------------------------
11964"##,
11965 default_severity: Severity::Allow,
11966 warn_since: None,
11967 deny_since: None,
11968 },
11969 Lint {
11970 label: "optimize_attribute",
11971 description: r##"# `optimize_attribute`
11972
11973Allows using `#[optimize(X)]`.
11974
11975The tracking issue for this feature is: [#54882]
11976
11977[#54882]: https://github.com/rust-lang/rust/issues/54882
11978
11979------------------------
11980"##,
11981 default_severity: Severity::Allow,
11982 warn_since: None,
11983 deny_since: None,
11984 },
11985 Lint {
11986 label: "option_array_transpose",
11987 description: r##"# `option_array_transpose`
11988
11989
11990
11991The tracking issue for this feature is: [#130828]
11992
11993[#130828]: https://github.com/rust-lang/rust/issues/130828
11994
11995------------------------
11996"##,
11997 default_severity: Severity::Allow,
11998 warn_since: None,
11999 deny_since: None,
12000 },
12001 Lint {
12002 label: "option_get_or_try_insert_with",
12003 description: r##"# `option_get_or_try_insert_with`
12004
12005
12006
12007The tracking issue for this feature is: [#143648]
12008
12009[#143648]: https://github.com/rust-lang/rust/issues/143648
12010
12011------------------------
12012"##,
12013 default_severity: Severity::Allow,
12014 warn_since: None,
12015 deny_since: None,
12016 },
12017 Lint {
12018 label: "option_into_flat_iter",
12019 description: r##"# `option_into_flat_iter`
12020
12021
12022
12023The tracking issue for this feature is: [#148441]
12024
12025[#148441]: https://github.com/rust-lang/rust/issues/148441
12026
12027------------------------
12028"##,
12029 default_severity: Severity::Allow,
12030 warn_since: None,
12031 deny_since: None,
12032 },
12033 Lint {
12034 label: "option_reduce",
12035 description: r##"# `option_reduce`
12036
12037
12038
12039The tracking issue for this feature is: [#144273]
12040
12041[#144273]: https://github.com/rust-lang/rust/issues/144273
12042
12043------------------------
12044"##,
12045 default_severity: Severity::Allow,
12046 warn_since: None,
12047 deny_since: None,
12048 },
12049 Lint {
12050 label: "option_reference_flattening",
12051 description: r##"# `option_reference_flattening`
12052
12053
12054
12055The tracking issue for this feature is: [#149221]
12056
12057[#149221]: https://github.com/rust-lang/rust/issues/149221
12058
12059------------------------
12060"##,
12061 default_severity: Severity::Allow,
12062 warn_since: None,
12063 deny_since: None,
12064 },
12065 Lint {
12066 label: "option_zip",
12067 description: r##"# `option_zip`
12068
12069
12070
12071The tracking issue for this feature is: [#70086]
12072
12073[#70086]: https://github.com/rust-lang/rust/issues/70086
12074
12075------------------------
12076"##,
12077 default_severity: Severity::Allow,
12078 warn_since: None,
12079 deny_since: None,
12080 },
12081 Lint {
12082 label: "os_str_slice",
12083 description: r##"# `os_str_slice`
12084
12085
12086
12087The tracking issue for this feature is: [#118485]
12088
12089[#118485]: https://github.com/rust-lang/rust/issues/118485
12090
12091------------------------
12092"##,
12093 default_severity: Severity::Allow,
12094 warn_since: None,
12095 deny_since: None,
12096 },
12097 Lint {
12098 label: "os_str_split_at",
12099 description: r##"# `os_str_split_at`
12100
12101
12102
12103This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12104
12105------------------------
12106"##,
12107 default_severity: Severity::Allow,
12108 warn_since: None,
12109 deny_since: None,
12110 },
12111 Lint {
12112 label: "os_string_truncate",
12113 description: r##"# `os_string_truncate`
12114
12115
12116
12117The tracking issue for this feature is: [#133262]
12118
12119[#133262]: https://github.com/rust-lang/rust/issues/133262
12120
12121------------------------
12122"##,
12123 default_severity: Severity::Allow,
12124 warn_since: None,
12125 deny_since: None,
12126 },
12127 Lint {
12128 label: "panic_abort",
12129 description: r##"# `panic_abort`
12130
12131
12132
12133The tracking issue for this feature is: [#32837]
12134
12135[#32837]: https://github.com/rust-lang/rust/issues/32837
12136
12137------------------------
12138"##,
12139 default_severity: Severity::Allow,
12140 warn_since: None,
12141 deny_since: None,
12142 },
12143 Lint {
12144 label: "panic_always_abort",
12145 description: r##"# `panic_always_abort`
12146
12147
12148
12149The tracking issue for this feature is: [#84438]
12150
12151[#84438]: https://github.com/rust-lang/rust/issues/84438
12152
12153------------------------
12154"##,
12155 default_severity: Severity::Allow,
12156 warn_since: None,
12157 deny_since: None,
12158 },
12159 Lint {
12160 label: "panic_backtrace_config",
12161 description: r##"# `panic_backtrace_config`
12162
12163
12164
12165The tracking issue for this feature is: [#93346]
12166
12167[#93346]: https://github.com/rust-lang/rust/issues/93346
12168
12169------------------------
12170"##,
12171 default_severity: Severity::Allow,
12172 warn_since: None,
12173 deny_since: None,
12174 },
12175 Lint {
12176 label: "panic_can_unwind",
12177 description: r##"# `panic_can_unwind`
12178
12179
12180
12181The tracking issue for this feature is: [#92988]
12182
12183[#92988]: https://github.com/rust-lang/rust/issues/92988
12184
12185------------------------
12186"##,
12187 default_severity: Severity::Allow,
12188 warn_since: None,
12189 deny_since: None,
12190 },
12191 Lint {
12192 label: "panic_internals",
12193 description: r##"# `panic_internals`
12194
12195
12196
12197This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12198
12199------------------------
12200"##,
12201 default_severity: Severity::Allow,
12202 warn_since: None,
12203 deny_since: None,
12204 },
12205 Lint {
12206 label: "panic_runtime",
12207 description: r##"# `panic_runtime`
12208
12209Allows using the `#![panic_runtime]` attribute.
12210
12211The tracking issue for this feature is: [#32837]
12212
12213[#32837]: https://github.com/rust-lang/rust/issues/32837
12214
12215------------------------
12216"##,
12217 default_severity: Severity::Allow,
12218 warn_since: None,
12219 deny_since: None,
12220 },
12221 Lint {
12222 label: "panic_unwind",
12223 description: r##"# `panic_unwind`
12224
12225
12226
12227The tracking issue for this feature is: [#32837]
12228
12229[#32837]: https://github.com/rust-lang/rust/issues/32837
12230
12231------------------------
12232"##,
12233 default_severity: Severity::Allow,
12234 warn_since: None,
12235 deny_since: None,
12236 },
12237 Lint {
12238 label: "panic_update_hook",
12239 description: r##"# `panic_update_hook`
12240
12241
12242
12243The tracking issue for this feature is: [#92649]
12244
12245[#92649]: https://github.com/rust-lang/rust/issues/92649
12246
12247------------------------
12248"##,
12249 default_severity: Severity::Allow,
12250 warn_since: None,
12251 deny_since: None,
12252 },
12253 Lint {
12254 label: "partial_ord_chaining_methods",
12255 description: r##"# `partial_ord_chaining_methods`
12256
12257
12258
12259This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12260
12261------------------------
12262"##,
12263 default_severity: Severity::Allow,
12264 warn_since: None,
12265 deny_since: None,
12266 },
12267 Lint {
12268 label: "patchable_function_entry",
12269 description: r##"# `patchable_function_entry`
12270
12271Allows specifying nop padding on functions for dynamic patching.
12272
12273The tracking issue for this feature is: [#123115]
12274
12275[#123115]: https://github.com/rust-lang/rust/issues/123115
12276
12277------------------------
12278"##,
12279 default_severity: Severity::Allow,
12280 warn_since: None,
12281 deny_since: None,
12282 },
12283 Lint {
12284 label: "path_absolute_method",
12285 description: r##"# `path_absolute_method`
12286
12287
12288
12289The tracking issue for this feature is: [#153328]
12290
12291[#153328]: https://github.com/rust-lang/rust/issues/153328
12292
12293------------------------
12294"##,
12295 default_severity: Severity::Allow,
12296 warn_since: None,
12297 deny_since: None,
12298 },
12299 Lint {
12300 label: "path_trailing_sep",
12301 description: r##"# `path_trailing_sep`
12302
12303
12304
12305The tracking issue for this feature is: [#142503]
12306
12307[#142503]: https://github.com/rust-lang/rust/issues/142503
12308
12309------------------------
12310"##,
12311 default_severity: Severity::Allow,
12312 warn_since: None,
12313 deny_since: None,
12314 },
12315 Lint {
12316 label: "pathbuf_into_string",
12317 description: r##"# `pathbuf_into_string`
12318
12319
12320
12321The tracking issue for this feature is: [#156203]
12322
12323[#156203]: https://github.com/rust-lang/rust/issues/156203
12324
12325------------------------
12326"##,
12327 default_severity: Severity::Allow,
12328 warn_since: None,
12329 deny_since: None,
12330 },
12331 Lint {
12332 label: "pattern",
12333 description: r##"# `pattern`
12334
12335
12336
12337The tracking issue for this feature is: [#27721]
12338
12339[#27721]: https://github.com/rust-lang/rust/issues/27721
12340
12341------------------------
12342"##,
12343 default_severity: Severity::Allow,
12344 warn_since: None,
12345 deny_since: None,
12346 },
12347 Lint {
12348 label: "pattern_complexity_limit",
12349 description: r##"# `pattern_complexity_limit`
12350
12351Set the maximum pattern complexity allowed (not limited by default).
12352
12353This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12354
12355------------------------
12356"##,
12357 default_severity: Severity::Allow,
12358 warn_since: None,
12359 deny_since: None,
12360 },
12361 Lint {
12362 label: "pattern_type_macro",
12363 description: r##"# `pattern_type_macro`
12364
12365
12366
12367The tracking issue for this feature is: [#123646]
12368
12369[#123646]: https://github.com/rust-lang/rust/issues/123646
12370
12371------------------------
12372"##,
12373 default_severity: Severity::Allow,
12374 warn_since: None,
12375 deny_since: None,
12376 },
12377 Lint {
12378 label: "pattern_type_range_trait",
12379 description: r##"# `pattern_type_range_trait`
12380
12381
12382
12383The tracking issue for this feature is: [#123646]
12384
12385[#123646]: https://github.com/rust-lang/rust/issues/123646
12386
12387------------------------
12388"##,
12389 default_severity: Severity::Allow,
12390 warn_since: None,
12391 deny_since: None,
12392 },
12393 Lint {
12394 label: "pattern_types",
12395 description: r##"# `pattern_types`
12396
12397Allows using pattern types.
12398
12399The tracking issue for this feature is: [#123646]
12400
12401[#123646]: https://github.com/rust-lang/rust/issues/123646
12402
12403------------------------
12404"##,
12405 default_severity: Severity::Allow,
12406 warn_since: None,
12407 deny_since: None,
12408 },
12409 Lint {
12410 label: "peer_credentials_unix_socket",
12411 description: r##"# `peer_credentials_unix_socket`
12412
12413
12414
12415The tracking issue for this feature is: [#42839]
12416
12417[#42839]: https://github.com/rust-lang/rust/issues/42839
12418
12419------------------------
12420"##,
12421 default_severity: Severity::Allow,
12422 warn_since: None,
12423 deny_since: None,
12424 },
12425 Lint {
12426 label: "phantom_variance_markers",
12427 description: r##"# `phantom_variance_markers`
12428
12429
12430
12431The tracking issue for this feature is: [#135806]
12432
12433[#135806]: https://github.com/rust-lang/rust/issues/135806
12434
12435------------------------
12436"##,
12437 default_severity: Severity::Allow,
12438 warn_since: None,
12439 deny_since: None,
12440 },
12441 Lint {
12442 label: "pin_coerce_unsized_trait",
12443 description: r##"# `pin_coerce_unsized_trait`
12444
12445
12446
12447The tracking issue for this feature is: [#150112]
12448
12449[#150112]: https://github.com/rust-lang/rust/issues/150112
12450
12451------------------------
12452"##,
12453 default_severity: Severity::Allow,
12454 warn_since: None,
12455 deny_since: None,
12456 },
12457 Lint {
12458 label: "pin_derefmut_internals",
12459 description: r##"# `pin_derefmut_internals`
12460
12461
12462
12463This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12464
12465------------------------
12466"##,
12467 default_severity: Severity::Allow,
12468 warn_since: None,
12469 deny_since: None,
12470 },
12471 Lint {
12472 label: "pin_ergonomics",
12473 description: r##"# `pin_ergonomics`
12474
12475Experimental features that make `Pin` more ergonomic.
12476
12477The tracking issue for this feature is: [#130494]
12478
12479[#130494]: https://github.com/rust-lang/rust/issues/130494
12480
12481------------------------
12482"##,
12483 default_severity: Severity::Allow,
12484 warn_since: None,
12485 deny_since: None,
12486 },
12487 Lint {
12488 label: "pin_macro_internals",
12489 description: r##"# `pin_macro_internals`
12490
12491
12492
12493This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12494
12495------------------------
12496"##,
12497 default_severity: Severity::Allow,
12498 warn_since: None,
12499 deny_since: None,
12500 },
12501 Lint {
12502 label: "pointer_is_aligned_to",
12503 description: r##"# `pointer_is_aligned_to`
12504
12505
12506
12507The tracking issue for this feature is: [#96284]
12508
12509[#96284]: https://github.com/rust-lang/rust/issues/96284
12510
12511------------------------
12512"##,
12513 default_severity: Severity::Allow,
12514 warn_since: None,
12515 deny_since: None,
12516 },
12517 Lint {
12518 label: "pointer_try_cast_aligned",
12519 description: r##"# `pointer_try_cast_aligned`
12520
12521
12522
12523The tracking issue for this feature is: [#141221]
12524
12525[#141221]: https://github.com/rust-lang/rust/issues/141221
12526
12527------------------------
12528"##,
12529 default_severity: Severity::Allow,
12530 warn_since: None,
12531 deny_since: None,
12532 },
12533 Lint {
12534 label: "portable_simd",
12535 description: r##"# `portable_simd`
12536
12537
12538
12539The tracking issue for this feature is: [#86656]
12540
12541[#86656]: https://github.com/rust-lang/rust/issues/86656
12542
12543------------------------
12544"##,
12545 default_severity: Severity::Allow,
12546 warn_since: None,
12547 deny_since: None,
12548 },
12549 Lint {
12550 label: "postfix_match",
12551 description: r##"# `postfix-match`
12552
12553`postfix-match` adds the feature for matching upon values postfix
12554the expressions that generate the values.
12555
12556The tracking issue for this feature is: [#121618](https://github.com/rust-lang/rust/issues/121618).
12557
12558------------------------
12559
12560```rust,edition2021
12561#![feature(postfix_match)]
12562
12563enum Foo {
12564 Bar,
12565 Baz
12566}
12567
12568fn get_foo() -> Foo {
12569 Foo::Bar
12570}
12571
12572get_foo().match {
12573 Foo::Bar => {},
12574 Foo::Baz => panic!(),
12575}
12576```
12577"##,
12578 default_severity: Severity::Allow,
12579 warn_since: None,
12580 deny_since: None,
12581 },
12582 Lint {
12583 label: "powerpc_target_feature",
12584 description: r##"# `powerpc_target_feature`
12585
12586Target features on powerpc.
12587
12588The tracking issue for this feature is: [#150255]
12589
12590[#150255]: https://github.com/rust-lang/rust/issues/150255
12591
12592------------------------
12593"##,
12594 default_severity: Severity::Allow,
12595 warn_since: None,
12596 deny_since: None,
12597 },
12598 Lint {
12599 label: "prelude_future",
12600 description: r##"# `prelude_future`
12601
12602
12603
12604This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12605
12606------------------------
12607"##,
12608 default_severity: Severity::Allow,
12609 warn_since: None,
12610 deny_since: None,
12611 },
12612 Lint {
12613 label: "prelude_import",
12614 description: r##"# `prelude_import`
12615
12616Allows using `#[prelude_import]` on glob `use` items.
12617
12618This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12619
12620------------------------
12621"##,
12622 default_severity: Severity::Allow,
12623 warn_since: None,
12624 deny_since: None,
12625 },
12626 Lint {
12627 label: "prelude_next",
12628 description: r##"# `prelude_next`
12629
12630
12631
12632This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12633
12634------------------------
12635"##,
12636 default_severity: Severity::Allow,
12637 warn_since: None,
12638 deny_since: None,
12639 },
12640 Lint {
12641 label: "prfchw_target_feature",
12642 description: r##"# `prfchw_target_feature`
12643
12644The prfchw target feature on x86.
12645
12646The tracking issue for this feature is: [#150256]
12647
12648[#150256]: https://github.com/rust-lang/rust/issues/150256
12649
12650------------------------
12651"##,
12652 default_severity: Severity::Allow,
12653 warn_since: None,
12654 deny_since: None,
12655 },
12656 Lint {
12657 label: "print_internals",
12658 description: r##"# `print_internals`
12659
12660This feature is internal to the Rust compiler and is not intended for general use.
12661
12662------------------------
12663"##,
12664 default_severity: Severity::Allow,
12665 warn_since: None,
12666 deny_since: None,
12667 },
12668 Lint {
12669 label: "proc_macro_def_site",
12670 description: r##"# `proc_macro_def_site`
12671
12672
12673
12674The tracking issue for this feature is: [#54724]
12675
12676[#54724]: https://github.com/rust-lang/rust/issues/54724
12677
12678------------------------
12679"##,
12680 default_severity: Severity::Allow,
12681 warn_since: None,
12682 deny_since: None,
12683 },
12684 Lint {
12685 label: "proc_macro_diagnostic",
12686 description: r##"# `proc_macro_diagnostic`
12687
12688
12689
12690The tracking issue for this feature is: [#54140]
12691
12692[#54140]: https://github.com/rust-lang/rust/issues/54140
12693
12694------------------------
12695"##,
12696 default_severity: Severity::Allow,
12697 warn_since: None,
12698 deny_since: None,
12699 },
12700 Lint {
12701 label: "proc_macro_expand",
12702 description: r##"# `proc_macro_expand`
12703
12704
12705
12706The tracking issue for this feature is: [#90765]
12707
12708[#90765]: https://github.com/rust-lang/rust/issues/90765
12709
12710------------------------
12711"##,
12712 default_severity: Severity::Allow,
12713 warn_since: None,
12714 deny_since: None,
12715 },
12716 Lint {
12717 label: "proc_macro_hygiene",
12718 description: r##"# `proc_macro_hygiene`
12719
12720Allows macro attributes on expressions, statements and non-inline modules.
12721
12722The tracking issue for this feature is: [#54727]
12723
12724[#54727]: https://github.com/rust-lang/rust/issues/54727
12725
12726------------------------
12727"##,
12728 default_severity: Severity::Allow,
12729 warn_since: None,
12730 deny_since: None,
12731 },
12732 Lint {
12733 label: "proc_macro_internals",
12734 description: r##"# `proc_macro_internals`
12735
12736
12737
12738The tracking issue for this feature is: [#27812]
12739
12740[#27812]: https://github.com/rust-lang/rust/issues/27812
12741
12742------------------------
12743"##,
12744 default_severity: Severity::Allow,
12745 warn_since: None,
12746 deny_since: None,
12747 },
12748 Lint {
12749 label: "proc_macro_quote",
12750 description: r##"# `proc_macro_quote`
12751
12752
12753
12754The tracking issue for this feature is: [#54722]
12755
12756[#54722]: https://github.com/rust-lang/rust/issues/54722
12757
12758------------------------
12759"##,
12760 default_severity: Severity::Allow,
12761 warn_since: None,
12762 deny_since: None,
12763 },
12764 Lint {
12765 label: "proc_macro_span",
12766 description: r##"# `proc_macro_span`
12767
12768
12769
12770The tracking issue for this feature is: [#54725]
12771
12772[#54725]: https://github.com/rust-lang/rust/issues/54725
12773
12774------------------------
12775"##,
12776 default_severity: Severity::Allow,
12777 warn_since: None,
12778 deny_since: None,
12779 },
12780 Lint {
12781 label: "proc_macro_totokens",
12782 description: r##"# `proc_macro_totokens`
12783
12784
12785
12786The tracking issue for this feature is: [#130977]
12787
12788[#130977]: https://github.com/rust-lang/rust/issues/130977
12789
12790------------------------
12791"##,
12792 default_severity: Severity::Allow,
12793 warn_since: None,
12794 deny_since: None,
12795 },
12796 Lint {
12797 label: "proc_macro_tracked_env",
12798 description: r##"# `proc_macro_tracked_env`
12799
12800
12801
12802The tracking issue for this feature is: [#99515]
12803
12804[#99515]: https://github.com/rust-lang/rust/issues/99515
12805
12806------------------------
12807"##,
12808 default_severity: Severity::Allow,
12809 warn_since: None,
12810 deny_since: None,
12811 },
12812 Lint {
12813 label: "proc_macro_tracked_path",
12814 description: r##"# `proc_macro_tracked_path`
12815
12816
12817
12818The tracking issue for this feature is: [#99515]
12819
12820[#99515]: https://github.com/rust-lang/rust/issues/99515
12821
12822------------------------
12823"##,
12824 default_severity: Severity::Allow,
12825 warn_since: None,
12826 deny_since: None,
12827 },
12828 Lint {
12829 label: "proc_macro_value",
12830 description: r##"# `proc_macro_value`
12831
12832
12833
12834The tracking issue for this feature is: [#136652]
12835
12836[#136652]: https://github.com/rust-lang/rust/issues/136652
12837
12838------------------------
12839"##,
12840 default_severity: Severity::Allow,
12841 warn_since: None,
12842 deny_since: None,
12843 },
12844 Lint {
12845 label: "process_chroot",
12846 description: r##"# `process_chroot`
12847
12848
12849
12850The tracking issue for this feature is: [#141298]
12851
12852[#141298]: https://github.com/rust-lang/rust/issues/141298
12853
12854------------------------
12855"##,
12856 default_severity: Severity::Allow,
12857 warn_since: None,
12858 deny_since: None,
12859 },
12860 Lint {
12861 label: "process_exitcode_internals",
12862 description: r##"# `process_exitcode_internals`
12863
12864
12865
12866This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12867
12868------------------------
12869"##,
12870 default_severity: Severity::Allow,
12871 warn_since: None,
12872 deny_since: None,
12873 },
12874 Lint {
12875 label: "process_internals",
12876 description: r##"# `process_internals`
12877
12878
12879
12880This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12881
12882------------------------
12883"##,
12884 default_severity: Severity::Allow,
12885 warn_since: None,
12886 deny_since: None,
12887 },
12888 Lint {
12889 label: "process_setsid",
12890 description: r##"# `process_setsid`
12891
12892
12893
12894The tracking issue for this feature is: [#105376]
12895
12896[#105376]: https://github.com/rust-lang/rust/issues/105376
12897
12898------------------------
12899"##,
12900 default_severity: Severity::Allow,
12901 warn_since: None,
12902 deny_since: None,
12903 },
12904 Lint {
12905 label: "profiler_runtime",
12906 description: r##"# `profiler_runtime`
12907
12908The tracking issue for this feature is: [#42524](https://github.com/rust-lang/rust/issues/42524).
12909
12910------------------------
12911"##,
12912 default_severity: Severity::Allow,
12913 warn_since: None,
12914 deny_since: None,
12915 },
12916 Lint {
12917 label: "profiler_runtime_lib",
12918 description: r##"# `profiler_runtime_lib`
12919
12920This feature is internal to the Rust compiler and is not intended for general use.
12921
12922------------------------
12923"##,
12924 default_severity: Severity::Allow,
12925 warn_since: None,
12926 deny_since: None,
12927 },
12928 Lint {
12929 label: "profiling_marker_api",
12930 description: r##"# `profiling_marker_api`
12931
12932
12933
12934The tracking issue for this feature is: [#148197]
12935
12936[#148197]: https://github.com/rust-lang/rust/issues/148197
12937
12938------------------------
12939"##,
12940 default_severity: Severity::Allow,
12941 warn_since: None,
12942 deny_since: None,
12943 },
12944 Lint {
12945 label: "ptr_alignment_type",
12946 description: r##"# `ptr_alignment_type`
12947
12948
12949
12950The tracking issue for this feature is: [#102070]
12951
12952[#102070]: https://github.com/rust-lang/rust/issues/102070
12953
12954------------------------
12955"##,
12956 default_severity: Severity::Allow,
12957 warn_since: None,
12958 deny_since: None,
12959 },
12960 Lint {
12961 label: "ptr_as_uninit",
12962 description: r##"# `ptr_as_uninit`
12963
12964
12965
12966The tracking issue for this feature is: [#75402]
12967
12968[#75402]: https://github.com/rust-lang/rust/issues/75402
12969
12970------------------------
12971"##,
12972 default_severity: Severity::Allow,
12973 warn_since: None,
12974 deny_since: None,
12975 },
12976 Lint {
12977 label: "ptr_cast_array",
12978 description: r##"# `ptr_cast_array`
12979
12980
12981
12982The tracking issue for this feature is: [#144514]
12983
12984[#144514]: https://github.com/rust-lang/rust/issues/144514
12985
12986------------------------
12987"##,
12988 default_severity: Severity::Allow,
12989 warn_since: None,
12990 deny_since: None,
12991 },
12992 Lint {
12993 label: "ptr_cast_slice",
12994 description: r##"# `ptr_cast_slice`
12995
12996
12997
12998The tracking issue for this feature is: [#149103]
12999
13000[#149103]: https://github.com/rust-lang/rust/issues/149103
13001
13002------------------------
13003"##,
13004 default_severity: Severity::Allow,
13005 warn_since: None,
13006 deny_since: None,
13007 },
13008 Lint {
13009 label: "ptr_internals",
13010 description: r##"# `ptr_internals`
13011
13012
13013
13014This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
13015
13016------------------------
13017"##,
13018 default_severity: Severity::Allow,
13019 warn_since: None,
13020 deny_since: None,
13021 },
13022 Lint {
13023 label: "ptr_mask",
13024 description: r##"# `ptr_mask`
13025
13026
13027
13028The tracking issue for this feature is: [#98290]
13029
13030[#98290]: https://github.com/rust-lang/rust/issues/98290
13031
13032------------------------
13033"##,
13034 default_severity: Severity::Allow,
13035 warn_since: None,
13036 deny_since: None,
13037 },
13038 Lint {
13039 label: "ptr_metadata",
13040 description: r##"# `ptr_metadata`
13041
13042
13043
13044The tracking issue for this feature is: [#81513]
13045
13046[#81513]: https://github.com/rust-lang/rust/issues/81513
13047
13048------------------------
13049"##,
13050 default_severity: Severity::Allow,
13051 warn_since: None,
13052 deny_since: None,
13053 },
13054 Lint {
13055 label: "pub_crate_should_not_need_unstable_attr",
13056 description: r##"# `pub_crate_should_not_need_unstable_attr`
13057
13058
13059
13060This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
13061
13062------------------------
13063"##,
13064 default_severity: Severity::Allow,
13065 warn_since: None,
13066 deny_since: None,
13067 },
13068 Lint {
13069 label: "random",
13070 description: r##"# `random`
13071
13072
13073
13074The tracking issue for this feature is: [#130703]
13075
13076[#130703]: https://github.com/rust-lang/rust/issues/130703
13077
13078------------------------
13079"##,
13080 default_severity: Severity::Allow,
13081 warn_since: None,
13082 deny_since: None,
13083 },
13084 Lint {
13085 label: "range_bounds_is_empty",
13086 description: r##"# `range_bounds_is_empty`
13087
13088
13089
13090The tracking issue for this feature is: [#137300]
13091
13092[#137300]: https://github.com/rust-lang/rust/issues/137300
13093
13094------------------------
13095"##,
13096 default_severity: Severity::Allow,
13097 warn_since: None,
13098 deny_since: None,
13099 },
13100 Lint {
13101 label: "range_into_bounds",
13102 description: r##"# `range_into_bounds`
13103
13104
13105
13106The tracking issue for this feature is: [#136903]
13107
13108[#136903]: https://github.com/rust-lang/rust/issues/136903
13109
13110------------------------
13111"##,
13112 default_severity: Severity::Allow,
13113 warn_since: None,
13114 deny_since: None,
13115 },
13116 Lint {
13117 label: "raw_dylib_elf",
13118 description: r##"# `raw_dylib_elf`
13119
13120Allows the use of raw-dylibs on ELF platforms
13121
13122The tracking issue for this feature is: [#135694]
13123
13124[#135694]: https://github.com/rust-lang/rust/issues/135694
13125
13126------------------------
13127"##,
13128 default_severity: Severity::Allow,
13129 warn_since: None,
13130 deny_since: None,
13131 },
13132 Lint {
13133 label: "raw_os_error_ty",
13134 description: r##"# `raw_os_error_ty`
13135
13136
13137
13138The tracking issue for this feature is: [#107792]
13139
13140[#107792]: https://github.com/rust-lang/rust/issues/107792
13141
13142------------------------
13143"##,
13144 default_severity: Severity::Allow,
13145 warn_since: None,
13146 deny_since: None,
13147 },
13148 Lint {
13149 label: "raw_slice_split",
13150 description: r##"# `raw_slice_split`
13151
13152
13153
13154The tracking issue for this feature is: [#95595]
13155
13156[#95595]: https://github.com/rust-lang/rust/issues/95595
13157
13158------------------------
13159"##,
13160 default_severity: Severity::Allow,
13161 warn_since: None,
13162 deny_since: None,
13163 },
13164 Lint {
13165 label: "raw_vec_internals",
13166 description: r##"# `raw_vec_internals`
13167
13168
13169
13170This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
13171
13172------------------------
13173"##,
13174 default_severity: Severity::Allow,
13175 warn_since: None,
13176 deny_since: None,
13177 },
13178 Lint {
13179 label: "read_array",
13180 description: r##"# `read_array`
13181
13182
13183
13184The tracking issue for this feature is: [#148848]
13185
13186[#148848]: https://github.com/rust-lang/rust/issues/148848
13187
13188------------------------
13189"##,
13190 default_severity: Severity::Allow,
13191 warn_since: None,
13192 deny_since: None,
13193 },
13194 Lint {
13195 label: "read_buf",
13196 description: r##"# `read_buf`
13197
13198
13199
13200The tracking issue for this feature is: [#78485]
13201
13202[#78485]: https://github.com/rust-lang/rust/issues/78485
13203
13204------------------------
13205"##,
13206 default_severity: Severity::Allow,
13207 warn_since: None,
13208 deny_since: None,
13209 },
13210 Lint {
13211 label: "read_buf_at",
13212 description: r##"# `read_buf_at`
13213
13214
13215
13216The tracking issue for this feature is: [#140771]
13217
13218[#140771]: https://github.com/rust-lang/rust/issues/140771
13219
13220------------------------
13221"##,
13222 default_severity: Severity::Allow,
13223 warn_since: None,
13224 deny_since: None,
13225 },
13226 Lint {
13227 label: "reborrow",
13228 description: r##"# `reborrow`
13229
13230
13231
13232The tracking issue for this feature is: [#145612]
13233
13234[#145612]: https://github.com/rust-lang/rust/issues/145612
13235
13236------------------------
13237"##,
13238 default_severity: Severity::Allow,
13239 warn_since: None,
13240 deny_since: None,
13241 },
13242 Lint {
13243 label: "reentrant_lock",
13244 description: r##"# `reentrant_lock`
13245
13246
13247
13248The tracking issue for this feature is: [#121440]
13249
13250[#121440]: https://github.com/rust-lang/rust/issues/121440
13251
13252------------------------
13253"##,
13254 default_severity: Severity::Allow,
13255 warn_since: None,
13256 deny_since: None,
13257 },
13258 Lint {
13259 label: "reentrant_lock_data_ptr",
13260 description: r##"# `reentrant_lock_data_ptr`
13261
13262
13263
13264The tracking issue for this feature is: [#140368]
13265
13266[#140368]: https://github.com/rust-lang/rust/issues/140368
13267
13268------------------------
13269"##,
13270 default_severity: Severity::Allow,
13271 warn_since: None,
13272 deny_since: None,
13273 },
13274 Lint {
13275 label: "ref_pat_eat_one_layer_2024",
13276 description: r##"# `ref_pat_eat_one_layer_2024`
13277
13278The tracking issue for this feature is: [#123076]
13279
13280[#123076]: https://github.com/rust-lang/rust/issues/123076
13281
13282---
13283
13284This feature is incomplete and not yet intended for general use.
13285
13286This implements experimental, Edition-dependent match ergonomics under consideration for inclusion
13287in Rust, allowing `&` patterns in more places. For example:
13288
13289```rust,edition2024
13290#![feature(ref_pat_eat_one_layer_2024)]
13291#![allow(incomplete_features)]
13292#
13293# // Tests type equality in a way that avoids coercing `&&T` or `&mut T` to `&T`.
13294# trait Eq<T> {}
13295# impl<T> Eq<T> for T {}
13296# fn has_type<T>(_: impl Eq<T>) {}
13297
13298// `&` can match against a `ref` binding mode instead of a reference type:
13299let (x, &y) = &(0, 1);
13300has_type::<&u8>(x);
13301has_type::<u8>(y);
13302
13303// `&` can match against `&mut` references:
13304let &z = &mut 2;
13305has_type::<u8>(z);
13306```
13307
13308For specifics, see the corresponding typing rules for [Editions 2021 and earlier] and for
13309[Editions 2024 and later]. For more information on binding modes, see [The Rust Reference].
13310
13311For alternative experimental match ergonomics, see the feature
13312[`ref_pat_eat_one_layer_2024_structural`](./ref-pat-eat-one-layer-2024-structural.md).
13313
13314[Editions 2021 and earlier]: https://nadrieril.github.io/typing-rust-patterns/?compare=false&opts1=AQEBAQIBAQABAAAAAQEBAAEBAAABAAA%3D&mode=rules&do_cmp=false
13315[Editions 2024 and later]: https://nadrieril.github.io/typing-rust-patterns/?compare=false&opts1=AQEBAAABAQABAgIAAQEBAAEBAAABAAA%3D&mode=rules&do_cmp=false
13316[The Rust Reference]: https://doc.rust-lang.org/reference/patterns.html#binding-modes
13317"##,
13318 default_severity: Severity::Allow,
13319 warn_since: None,
13320 deny_since: None,
13321 },
13322 Lint {
13323 label: "ref_pat_eat_one_layer_2024_structural",
13324 description: r##"# `ref_pat_eat_one_layer_2024_structural`
13325
13326The tracking issue for this feature is: [#123076]
13327
13328[#123076]: https://github.com/rust-lang/rust/issues/123076
13329
13330---
13331
13332This feature is incomplete and not yet intended for general use.
13333
13334This implements experimental, Edition-dependent match ergonomics under consideration for inclusion
13335in Rust, allowing `&` patterns in more places. For example:
13336```rust,edition2024
13337#![feature(ref_pat_eat_one_layer_2024_structural)]
13338#![allow(incomplete_features)]
13339#
13340# // Tests type equality in a way that avoids coercing `&&T` or `&mut T` to `&T`.
13341# trait Eq<T> {}
13342# impl<T> Eq<T> for T {}
13343# fn has_type<T>(_: impl Eq<T>) {}
13344
13345// `&` can match against a `ref` binding mode instead of a reference type:
13346let (x, &y) = &(0, 1);
13347has_type::<&u8>(x);
13348has_type::<u8>(y);
13349
13350// `&` can match against `&mut` references:
13351let &z = &mut 2;
13352has_type::<u8>(z);
13353```
13354
13355For specifics, see the corresponding typing rules for [Editions 2021 and earlier] and for
13356[Editions 2024 and later]. For more information on binding modes, see [The Rust Reference].
13357
13358For alternative experimental match ergonomics, see the feature
13359[`ref_pat_eat_one_layer_2024`](./ref-pat-eat-one-layer-2024.md).
13360
13361[Editions 2021 and earlier]: https://nadrieril.github.io/typing-rust-patterns/?compare=false&opts1=AQEBAQIBAQEBAAAAAAAAAAAAAAAAAAA%3D&mode=rules&do_cmp=false
13362[Editions 2024 and later]: https://nadrieril.github.io/typing-rust-patterns/?compare=false&opts1=AQEBAgEBAQEBAgIAAAAAAAAAAAAAAAA%3D&mode=rules&do_cmp=false
13363[The Rust Reference]: https://doc.rust-lang.org/reference/patterns.html#binding-modes
13364"##,
13365 default_severity: Severity::Allow,
13366 warn_since: None,
13367 deny_since: None,
13368 },
13369 Lint {
13370 label: "refcell_try_map",
13371 description: r##"# `refcell_try_map`
13372
13373
13374
13375The tracking issue for this feature is: [#143801]
13376
13377[#143801]: https://github.com/rust-lang/rust/issues/143801
13378
13379------------------------
13380"##,
13381 default_severity: Severity::Allow,
13382 warn_since: None,
13383 deny_since: None,
13384 },
13385 Lint {
13386 label: "register_tool",
13387 description: r##"# `register_tool`
13388
13389The tracking issue for this feature is: [#66079]
13390
13391[#66079]: https://github.com/rust-lang/rust/issues/66079
13392
13393------------------------
13394
13395The `register_tool` language feature informs the compiler that attributes in your code are meant to be used with tools other than the compiler itself. This can be useful if your code has semantic meaning without the external tool, but enables additional features when the tool is present.
13396
13397`register_tool` also allows configuring lint levels for external tools.
13398
13399Tool attributes are only meant for ignorable attributes. If your code *changes* meaning when the attribute is present, it should not use a tool attribute (because it cannot be compiled with anything other than the external tool, and in a sense is a fork of the language).
13400
13401------------------------
13402
13403`#![register_tool(tool)]` is an attribute, and is only valid at the crate root.
13404Attributes using the registered tool are checked for valid syntax, and lint attributes are checked to be in a valid format. However, the compiler cannot validate the semantics of the attribute, nor can it tell whether the configured lint is present in the external tool.
13405
13406Semantically, `clippy::*`, `rustdoc::*`, and `rustfmt::*` lints and attributes all behave as if `#![register_tool(clippy, rustdoc, rustfmt)]` were injected into the crate root, except that the `rustdoc` namespace can only be used for lints, not for attributes.
13407When compiling with `-Z unstable-features`, `rustc::*` lints can also be used. Like `rustdoc`, the `rustc` namespace can only be used with lints, not attributes.
13408
13409The compiler will emit an error if it encounters a lint/attribute whose namespace isn't a registered tool.
13410
13411Tool namespaces cannot be nested; `register_tool(main_tool::subtool)` is an error.
13412
13413## Examples
13414
13415Tool attributes:
13416
13417```rust
13418#![feature(register_tool)]
13419#![register_tool(c2rust)]
13420
13421// Mark which C header file this module was generated from.
13422#[c2rust::header_src = "operations.h"]
13423pub mod operations_h {
13424 use std::ffi::c_int;
13425
13426 // Mark which source line this struct was generated from.
13427 #[c2rust::src_loc = "11:0"]
13428 pub struct Point {
13429 pub x: c_int,
13430 pub y: c_int,
13431 }
13432}
13433```
13434
13435Tool lints:
13436
13437```
13438#![feature(register_tool)]
13439#![register_tool(bevy)]
13440#![deny(bevy::duplicate_bevy_dependencies)]
13441```
13442"##,
13443 default_severity: Severity::Allow,
13444 warn_since: None,
13445 deny_since: None,
13446 },
13447 Lint {
13448 label: "repr_simd",
13449 description: r##"# `repr_simd`
13450
13451Allows `repr(simd)` and importing the various simd intrinsics.
13452
13453The tracking issue for this feature is: [#27731]
13454
13455[#27731]: https://github.com/rust-lang/rust/issues/27731
13456
13457------------------------
13458"##,
13459 default_severity: Severity::Allow,
13460 warn_since: None,
13461 deny_since: None,
13462 },
13463 Lint {
13464 label: "restricted_std",
13465 description: r##"# `restricted_std`
13466
13467
13468
13469This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
13470
13471------------------------
13472"##,
13473 default_severity: Severity::Allow,
13474 warn_since: None,
13475 deny_since: None,
13476 },
13477 Lint {
13478 label: "result_option_map_or_default",
13479 description: r##"# `result_option_map_or_default`
13480
13481
13482
13483The tracking issue for this feature is: [#138099]
13484
13485[#138099]: https://github.com/rust-lang/rust/issues/138099
13486
13487------------------------
13488"##,
13489 default_severity: Severity::Allow,
13490 warn_since: None,
13491 deny_since: None,
13492 },
13493 Lint {
13494 label: "return_address",
13495 description: r##"# `return_address`
13496
13497
13498
13499The tracking issue for this feature is: [#154966]
13500
13501[#154966]: https://github.com/rust-lang/rust/issues/154966
13502
13503------------------------
13504"##,
13505 default_severity: Severity::Allow,
13506 warn_since: None,
13507 deny_since: None,
13508 },
13509 Lint {
13510 label: "return_type_notation",
13511 description: r##"# `return_type_notation`
13512
13513Allows bounding the return type of AFIT/RPITIT.
13514
13515The tracking issue for this feature is: [#109417]
13516
13517[#109417]: https://github.com/rust-lang/rust/issues/109417
13518
13519------------------------
13520"##,
13521 default_severity: Severity::Allow,
13522 warn_since: None,
13523 deny_since: None,
13524 },
13525 Lint {
13526 label: "rev_into_inner",
13527 description: r##"# `rev_into_inner`
13528
13529
13530
13531The tracking issue for this feature is: [#144277]
13532
13533[#144277]: https://github.com/rust-lang/rust/issues/144277
13534
13535------------------------
13536"##,
13537 default_severity: Severity::Allow,
13538 warn_since: None,
13539 deny_since: None,
13540 },
13541 Lint {
13542 label: "riscv_target_feature",
13543 description: r##"# `riscv_target_feature`
13544
13545Target features on riscv.
13546
13547The tracking issue for this feature is: [#150257]
13548
13549[#150257]: https://github.com/rust-lang/rust/issues/150257
13550
13551------------------------
13552"##,
13553 default_severity: Severity::Allow,
13554 warn_since: None,
13555 deny_since: None,
13556 },
13557 Lint {
13558 label: "rt",
13559 description: r##"# `rt`
13560
13561This feature is internal to the Rust compiler and is not intended for general use.
13562
13563------------------------
13564"##,
13565 default_severity: Severity::Allow,
13566 warn_since: None,
13567 deny_since: None,
13568 },
13569 Lint {
13570 label: "rtm_target_feature",
13571 description: r##"# `rtm_target_feature`
13572
13573The rtm target feature on x86.
13574
13575The tracking issue for this feature is: [#150258]
13576
13577[#150258]: https://github.com/rust-lang/rust/issues/150258
13578
13579------------------------
13580"##,
13581 default_severity: Severity::Allow,
13582 warn_since: None,
13583 deny_since: None,
13584 },
13585 Lint {
13586 label: "rust_cold_cc",
13587 description: r##"# `rust_cold_cc`
13588
13589Allows `extern "rust-cold"`.
13590
13591The tracking issue for this feature is: [#97544]
13592
13593[#97544]: https://github.com/rust-lang/rust/issues/97544
13594
13595------------------------
13596"##,
13597 default_severity: Severity::Allow,
13598 warn_since: None,
13599 deny_since: None,
13600 },
13601 Lint {
13602 label: "rust_preserve_none_cc",
13603 description: r##"# `rust_preserve_none_cc`
13604
13605Allows `extern "rust-preserve-none"`.
13606
13607The tracking issue for this feature is: [#151401]
13608
13609[#151401]: https://github.com/rust-lang/rust/issues/151401
13610
13611------------------------
13612"##,
13613 default_severity: Severity::Allow,
13614 warn_since: None,
13615 deny_since: None,
13616 },
13617 Lint {
13618 label: "rustc_attrs",
13619 description: r##"# `rustc_attrs`
13620
13621This feature has no tracking issue, and is therefore internal to
13622the compiler, not being intended for general use.
13623
13624Note: `rustc_attrs` enables many rustc-internal attributes and this page
13625only discuss a few of them.
13626
13627------------------------
13628
13629The `rustc_attrs` feature allows debugging rustc type layouts by using
13630`#[rustc_dump_layout(...)]` to debug layout at compile time (it even works
13631with `cargo check`) as an alternative to `rustc -Z print-type-sizes`
13632that is way more verbose.
13633
13634Options provided by `#[rustc_dump_layout(...)]` are `backend_repr`, `align`,
13635`debug`, `homogeneous_aggregate` and `size`.
13636Note that it only works on sized types without generics.
13637
13638## Examples
13639
13640```rust,compile_fail
13641#![feature(rustc_attrs)]
13642
13643#[rustc_dump_layout(backend_repr, size)]
13644pub enum X {
13645 Y(u8, u8, u8),
13646 Z(isize),
13647}
13648```
13649
13650When that is compiled, the compiler will error with something like
13651
13652```text
13653error: backend_repr: Aggregate { sized: true }
13654 --> src/lib.rs:4:1
13655 |
136564 | / pub enum T {
136575 | | Y(u8, u8, u8),
136586 | | Z(isize),
136597 | | }
13660 | |_^
13661
13662error: size: Size { raw: 16 }
13663 --> src/lib.rs:4:1
13664 |
136654 | / pub enum T {
136665 | | Y(u8, u8, u8),
136676 | | Z(isize),
136687 | | }
13669 | |_^
13670
13671error: aborting due to 2 previous errors
13672```
13673"##,
13674 default_severity: Severity::Allow,
13675 warn_since: None,
13676 deny_since: None,
13677 },
13678 Lint {
13679 label: "rustc_private",
13680 description: r##"# `rustc_private`
13681
13682The tracking issue for this feature is: [#27812]
13683
13684[#27812]: https://github.com/rust-lang/rust/issues/27812
13685
13686------------------------
13687
13688This feature allows access to unstable internal compiler crates such as `rustc_driver`.
13689
13690The presence of this feature changes the way the linkage format for dylibs is calculated in a way
13691that is necessary for linking against dylibs that statically link `std` (such as `rustc_driver`).
13692This makes this feature "viral" in linkage; its use in a given crate makes its use required in
13693dependent crates which link to it (including integration tests, which are built as separate crates).
13694
13695## Common linker failures related to missing LLVM libraries
13696
13697### When using `rustc-private` with Official Toolchains
13698
13699When using the `rustc_private` feature with official toolchains distributed via rustup, you'll need to install:
13700
137011. The `rustc-dev` component (provides compiler libraries)
137022. The `llvm-tools` component (provides LLVM libraries needed for linking)
13703
13704You can install these components using `rustup`:
13705
13706```text
13707rustup component add rustc-dev llvm-tools
13708```
13709
13710Without the `llvm-tools` component, you may encounter linking errors like:
13711
13712```text
13713error: linking with `cc` failed: exit status: 1
13714 |
13715 = note: rust-lld: error: unable to find library -lLLVM-{version}
13716```
13717
13718### When using `rustc-private` with Custom Toolchains
13719
13720For custom-built toolchains or environments not using rustup, different configuration may be required:
13721
13722- Ensure LLVM libraries are available in your library search paths
13723- You might need to configure library paths explicitly depending on your LLVM installation
13724"##,
13725 default_severity: Severity::Allow,
13726 warn_since: None,
13727 deny_since: None,
13728 },
13729 Lint {
13730 label: "rustdoc_internals",
13731 description: r##"# `rustdoc_internals`
13732
13733Allows using internal rustdoc features like `doc(keyword)`.
13734
13735The tracking issue for this feature is: [#90418]
13736
13737[#90418]: https://github.com/rust-lang/rust/issues/90418
13738
13739------------------------
13740"##,
13741 default_severity: Severity::Allow,
13742 warn_since: None,
13743 deny_since: None,
13744 },
13745 Lint {
13746 label: "rustdoc_missing_doc_code_examples",
13747 description: r##"# `rustdoc_missing_doc_code_examples`
13748
13749Allows using the `rustdoc::missing_doc_code_examples` lint
13750
13751The tracking issue for this feature is: [#101730]
13752
13753[#101730]: https://github.com/rust-lang/rust/issues/101730
13754
13755------------------------
13756"##,
13757 default_severity: Severity::Allow,
13758 warn_since: None,
13759 deny_since: None,
13760 },
13761 Lint {
13762 label: "rwlock_data_ptr",
13763 description: r##"# `rwlock_data_ptr`
13764
13765
13766
13767The tracking issue for this feature is: [#140368]
13768
13769[#140368]: https://github.com/rust-lang/rust/issues/140368
13770
13771------------------------
13772"##,
13773 default_severity: Severity::Allow,
13774 warn_since: None,
13775 deny_since: None,
13776 },
13777 Lint {
13778 label: "s390x_target_feature",
13779 description: r##"# `s390x_target_feature`
13780
13781Target features on s390x.
13782
13783The tracking issue for this feature is: [#150259]
13784
13785[#150259]: https://github.com/rust-lang/rust/issues/150259
13786
13787------------------------
13788"##,
13789 default_severity: Severity::Allow,
13790 warn_since: None,
13791 deny_since: None,
13792 },
13793 Lint {
13794 label: "sanitize",
13795 description: r##"# `sanitize`
13796
13797The tracking issue for this feature is: [#39699]
13798
13799[#39699]: https://github.com/rust-lang/rust/issues/39699
13800
13801------------------------
13802
13803The `sanitize` attribute can be used to selectively disable or enable sanitizer
13804instrumentation in an annotated function. This might be useful to: avoid
13805instrumentation overhead in a performance critical function, or avoid
13806instrumenting code that contains constructs unsupported by given sanitizer.
13807
13808The precise effect of this annotation depends on particular sanitizer in use.
13809For example, with `sanitize(thread = "off")`, the thread sanitizer will no
13810longer instrument non-atomic store / load operations, but it will instrument
13811atomic operations to avoid reporting false positives and provide meaning full
13812stack traces.
13813
13814This attribute was previously named `no_sanitize`.
13815
13816## Examples
13817
13818``` rust
13819#![feature(sanitize)]
13820
13821#[sanitize(address = "off")]
13822fn foo() {
13823 // ...
13824}
13825```
13826
13827It is also possible to disable sanitizers for entire modules and enable them
13828for single items or functions.
13829
13830```rust
13831#![feature(sanitize)]
13832
13833#[sanitize(address = "off")]
13834mod foo {
13835 fn unsanitized() {
13836 // ...
13837 }
13838
13839 #[sanitize(address = "on")]
13840 fn sanitized() {
13841 // ...
13842 }
13843}
13844```
13845
13846It's also applicable to impl blocks.
13847
13848```rust
13849#![feature(sanitize)]
13850
13851trait MyTrait {
13852 fn foo(&self);
13853 fn bar(&self);
13854}
13855
13856#[sanitize(address = "off")]
13857impl MyTrait for () {
13858 fn foo(&self) {
13859 // ...
13860 }
13861
13862 #[sanitize(address = "on")]
13863 fn bar(&self) {
13864 // ...
13865 }
13866}
13867```
13868"##,
13869 default_severity: Severity::Allow,
13870 warn_since: None,
13871 deny_since: None,
13872 },
13873 Lint {
13874 label: "sealed",
13875 description: r##"# `sealed`
13876
13877
13878
13879This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
13880
13881------------------------
13882"##,
13883 default_severity: Severity::Allow,
13884 warn_since: None,
13885 deny_since: None,
13886 },
13887 Lint {
13888 label: "seek_io_take_position",
13889 description: r##"# `seek_io_take_position`
13890
13891
13892
13893The tracking issue for this feature is: [#97227]
13894
13895[#97227]: https://github.com/rust-lang/rust/issues/97227
13896
13897------------------------
13898"##,
13899 default_severity: Severity::Allow,
13900 warn_since: None,
13901 deny_since: None,
13902 },
13903 Lint {
13904 label: "seek_stream_len",
13905 description: r##"# `seek_stream_len`
13906
13907
13908
13909The tracking issue for this feature is: [#59359]
13910
13911[#59359]: https://github.com/rust-lang/rust/issues/59359
13912
13913------------------------
13914"##,
13915 default_severity: Severity::Allow,
13916 warn_since: None,
13917 deny_since: None,
13918 },
13919 Lint {
13920 label: "set_permissions_nofollow",
13921 description: r##"# `set_permissions_nofollow`
13922
13923
13924
13925The tracking issue for this feature is: [#141607]
13926
13927[#141607]: https://github.com/rust-lang/rust/issues/141607
13928
13929------------------------
13930"##,
13931 default_severity: Severity::Allow,
13932 warn_since: None,
13933 deny_since: None,
13934 },
13935 Lint {
13936 label: "set_ptr_value",
13937 description: r##"# `set_ptr_value`
13938
13939
13940
13941The tracking issue for this feature is: [#75091]
13942
13943[#75091]: https://github.com/rust-lang/rust/issues/75091
13944
13945------------------------
13946"##,
13947 default_severity: Severity::Allow,
13948 warn_since: None,
13949 deny_since: None,
13950 },
13951 Lint {
13952 label: "setgroups",
13953 description: r##"# `setgroups`
13954
13955
13956
13957The tracking issue for this feature is: [#90747]
13958
13959[#90747]: https://github.com/rust-lang/rust/issues/90747
13960
13961------------------------
13962"##,
13963 default_severity: Severity::Allow,
13964 warn_since: None,
13965 deny_since: None,
13966 },
13967 Lint {
13968 label: "sgx_platform",
13969 description: r##"# `sgx_platform`
13970
13971
13972
13973The tracking issue for this feature is: [#56975]
13974
13975[#56975]: https://github.com/rust-lang/rust/issues/56975
13976
13977------------------------
13978"##,
13979 default_severity: Severity::Allow,
13980 warn_since: None,
13981 deny_since: None,
13982 },
13983 Lint {
13984 label: "share_trait",
13985 description: r##"# `share_trait`
13986
13987
13988
13989The tracking issue for this feature is: [#156756]
13990
13991[#156756]: https://github.com/rust-lang/rust/issues/156756
13992
13993------------------------
13994"##,
13995 default_severity: Severity::Allow,
13996 warn_since: None,
13997 deny_since: None,
13998 },
13999 Lint {
14000 label: "signed_bigint_helpers",
14001 description: r##"# `signed_bigint_helpers`
14002
14003
14004
14005The tracking issue for this feature is: [#151989]
14006
14007[#151989]: https://github.com/rust-lang/rust/issues/151989
14008
14009------------------------
14010"##,
14011 default_severity: Severity::Allow,
14012 warn_since: None,
14013 deny_since: None,
14014 },
14015 Lint {
14016 label: "simd_ffi",
14017 description: r##"# `simd_ffi`
14018
14019Allows the use of SIMD types in functions declared in `extern` blocks.
14020
14021The tracking issue for this feature is: [#27731]
14022
14023[#27731]: https://github.com/rust-lang/rust/issues/27731
14024
14025------------------------
14026"##,
14027 default_severity: Severity::Allow,
14028 warn_since: None,
14029 deny_since: None,
14030 },
14031 Lint {
14032 label: "sized_hierarchy",
14033 description: r##"# `sized_hierarchy`
14034
14035Introduces a hierarchy of `Sized` traits (RFC 3729).
14036
14037The tracking issue for this feature is: [#144404]
14038
14039[#144404]: https://github.com/rust-lang/rust/issues/144404
14040
14041------------------------
14042"##,
14043 default_severity: Severity::Allow,
14044 warn_since: None,
14045 deny_since: None,
14046 },
14047 Lint {
14048 label: "sized_type_properties",
14049 description: r##"# `sized_type_properties`
14050
14051
14052
14053This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
14054
14055------------------------
14056"##,
14057 default_severity: Severity::Allow,
14058 warn_since: None,
14059 deny_since: None,
14060 },
14061 Lint {
14062 label: "slice_concat_ext",
14063 description: r##"# `slice_concat_ext`
14064
14065
14066
14067The tracking issue for this feature is: [#27747]
14068
14069[#27747]: https://github.com/rust-lang/rust/issues/27747
14070
14071------------------------
14072"##,
14073 default_severity: Severity::Allow,
14074 warn_since: None,
14075 deny_since: None,
14076 },
14077 Lint {
14078 label: "slice_concat_trait",
14079 description: r##"# `slice_concat_trait`
14080
14081
14082
14083The tracking issue for this feature is: [#27747]
14084
14085[#27747]: https://github.com/rust-lang/rust/issues/27747
14086
14087------------------------
14088"##,
14089 default_severity: Severity::Allow,
14090 warn_since: None,
14091 deny_since: None,
14092 },
14093 Lint {
14094 label: "slice_from_ptr_range",
14095 description: r##"# `slice_from_ptr_range`
14096
14097
14098
14099The tracking issue for this feature is: [#89792]
14100
14101[#89792]: https://github.com/rust-lang/rust/issues/89792
14102
14103------------------------
14104"##,
14105 default_severity: Severity::Allow,
14106 warn_since: None,
14107 deny_since: None,
14108 },
14109 Lint {
14110 label: "slice_index_methods",
14111 description: r##"# `slice_index_methods`
14112
14113
14114
14115This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
14116
14117------------------------
14118"##,
14119 default_severity: Severity::Allow,
14120 warn_since: None,
14121 deny_since: None,
14122 },
14123 Lint {
14124 label: "slice_internals",
14125 description: r##"# `slice_internals`
14126
14127
14128
14129This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
14130
14131------------------------
14132"##,
14133 default_severity: Severity::Allow,
14134 warn_since: None,
14135 deny_since: None,
14136 },
14137 Lint {
14138 label: "slice_iter_mut_as_mut_slice",
14139 description: r##"# `slice_iter_mut_as_mut_slice`
14140
14141
14142
14143The tracking issue for this feature is: [#93079]
14144
14145[#93079]: https://github.com/rust-lang/rust/issues/93079
14146
14147------------------------
14148"##,
14149 default_severity: Severity::Allow,
14150 warn_since: None,
14151 deny_since: None,
14152 },
14153 Lint {
14154 label: "slice_partial_sort_unstable",
14155 description: r##"# `slice_partial_sort_unstable`
14156
14157
14158
14159The tracking issue for this feature is: [#149046]
14160
14161[#149046]: https://github.com/rust-lang/rust/issues/149046
14162
14163------------------------
14164"##,
14165 default_severity: Severity::Allow,
14166 warn_since: None,
14167 deny_since: None,
14168 },
14169 Lint {
14170 label: "slice_partition_dedup",
14171 description: r##"# `slice_partition_dedup`
14172
14173
14174
14175The tracking issue for this feature is: [#54279]
14176
14177[#54279]: https://github.com/rust-lang/rust/issues/54279
14178
14179------------------------
14180"##,
14181 default_severity: Severity::Allow,
14182 warn_since: None,
14183 deny_since: None,
14184 },
14185 Lint {
14186 label: "slice_pattern",
14187 description: r##"# `slice_pattern`
14188
14189
14190
14191The tracking issue for this feature is: [#56345]
14192
14193[#56345]: https://github.com/rust-lang/rust/issues/56345
14194
14195------------------------
14196"##,
14197 default_severity: Severity::Allow,
14198 warn_since: None,
14199 deny_since: None,
14200 },
14201 Lint {
14202 label: "slice_ptr_get",
14203 description: r##"# `slice_ptr_get`
14204
14205
14206
14207The tracking issue for this feature is: [#74265]
14208
14209[#74265]: https://github.com/rust-lang/rust/issues/74265
14210
14211------------------------
14212"##,
14213 default_severity: Severity::Allow,
14214 warn_since: None,
14215 deny_since: None,
14216 },
14217 Lint {
14218 label: "slice_range",
14219 description: r##"# `slice_range`
14220
14221
14222
14223The tracking issue for this feature is: [#76393]
14224
14225[#76393]: https://github.com/rust-lang/rust/issues/76393
14226
14227------------------------
14228"##,
14229 default_severity: Severity::Allow,
14230 warn_since: None,
14231 deny_since: None,
14232 },
14233 Lint {
14234 label: "slice_shift",
14235 description: r##"# `slice_shift`
14236
14237
14238
14239The tracking issue for this feature is: [#151772]
14240
14241[#151772]: https://github.com/rust-lang/rust/issues/151772
14242
14243------------------------
14244"##,
14245 default_severity: Severity::Allow,
14246 warn_since: None,
14247 deny_since: None,
14248 },
14249 Lint {
14250 label: "slice_split_once",
14251 description: r##"# `slice_split_once`
14252
14253
14254
14255The tracking issue for this feature is: [#112811]
14256
14257[#112811]: https://github.com/rust-lang/rust/issues/112811
14258
14259------------------------
14260"##,
14261 default_severity: Severity::Allow,
14262 warn_since: None,
14263 deny_since: None,
14264 },
14265 Lint {
14266 label: "slice_swap_unchecked",
14267 description: r##"# `slice_swap_unchecked`
14268
14269
14270
14271The tracking issue for this feature is: [#88539]
14272
14273[#88539]: https://github.com/rust-lang/rust/issues/88539
14274
14275------------------------
14276"##,
14277 default_severity: Severity::Allow,
14278 warn_since: None,
14279 deny_since: None,
14280 },
14281 Lint {
14282 label: "sliceindex_wrappers",
14283 description: r##"# `sliceindex_wrappers`
14284
14285
14286
14287The tracking issue for this feature is: [#146179]
14288
14289[#146179]: https://github.com/rust-lang/rust/issues/146179
14290
14291------------------------
14292"##,
14293 default_severity: Severity::Allow,
14294 warn_since: None,
14295 deny_since: None,
14296 },
14297 Lint {
14298 label: "smart_pointer_try_map",
14299 description: r##"# `smart_pointer_try_map`
14300
14301
14302
14303The tracking issue for this feature is: [#144419]
14304
14305[#144419]: https://github.com/rust-lang/rust/issues/144419
14306
14307------------------------
14308"##,
14309 default_severity: Severity::Allow,
14310 warn_since: None,
14311 deny_since: None,
14312 },
14313 Lint {
14314 label: "solid_ext",
14315 description: r##"# `solid_ext`
14316
14317
14318
14319This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
14320
14321------------------------
14322"##,
14323 default_severity: Severity::Allow,
14324 warn_since: None,
14325 deny_since: None,
14326 },
14327 Lint {
14328 label: "sort_floats",
14329 description: r##"# `sort_floats`
14330
14331
14332
14333The tracking issue for this feature is: [#93396]
14334
14335[#93396]: https://github.com/rust-lang/rust/issues/93396
14336
14337------------------------
14338"##,
14339 default_severity: Severity::Allow,
14340 warn_since: None,
14341 deny_since: None,
14342 },
14343 Lint {
14344 label: "sparc_target_feature",
14345 description: r##"# `sparc_target_feature`
14346
14347Target features on sparc.
14348
14349The tracking issue for this feature is: [#132783]
14350
14351[#132783]: https://github.com/rust-lang/rust/issues/132783
14352
14353------------------------
14354"##,
14355 default_severity: Severity::Allow,
14356 warn_since: None,
14357 deny_since: None,
14358 },
14359 Lint {
14360 label: "specialization",
14361 description: r##"# `specialization`
14362
14363Allows specialization of implementations (RFC 1210).
14364
14365The tracking issue for this feature is: [#31844]
14366
14367[#31844]: https://github.com/rust-lang/rust/issues/31844
14368
14369------------------------
14370"##,
14371 default_severity: Severity::Allow,
14372 warn_since: None,
14373 deny_since: None,
14374 },
14375 Lint {
14376 label: "split_array",
14377 description: r##"# `split_array`
14378
14379
14380
14381The tracking issue for this feature is: [#90091]
14382
14383[#90091]: https://github.com/rust-lang/rust/issues/90091
14384
14385------------------------
14386"##,
14387 default_severity: Severity::Allow,
14388 warn_since: None,
14389 deny_since: None,
14390 },
14391 Lint {
14392 label: "split_as_slice",
14393 description: r##"# `split_as_slice`
14394
14395
14396
14397The tracking issue for this feature is: [#96137]
14398
14399[#96137]: https://github.com/rust-lang/rust/issues/96137
14400
14401------------------------
14402"##,
14403 default_severity: Severity::Allow,
14404 warn_since: None,
14405 deny_since: None,
14406 },
14407 Lint {
14408 label: "staged_api",
14409 description: r##"# `staged_api`
14410
14411Allows using the `#[stable]` and `#[unstable]` attributes.
14412
14413This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
14414
14415------------------------
14416"##,
14417 default_severity: Severity::Allow,
14418 warn_since: None,
14419 deny_since: None,
14420 },
14421 Lint {
14422 label: "static_align",
14423 description: r##"# `static_align`
14424
14425Allows using `#[rustc_align_static(...)]` on static items.
14426
14427The tracking issue for this feature is: [#146177]
14428
14429[#146177]: https://github.com/rust-lang/rust/issues/146177
14430
14431------------------------
14432"##,
14433 default_severity: Severity::Allow,
14434 warn_since: None,
14435 deny_since: None,
14436 },
14437 Lint {
14438 label: "std_internals",
14439 description: r##"# `std_internals`
14440
14441
14442
14443This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
14444
14445------------------------
14446"##,
14447 default_severity: Severity::Allow,
14448 warn_since: None,
14449 deny_since: None,
14450 },
14451 Lint {
14452 label: "stdarch_aarch64_feature_detection",
14453 description: r##"# `stdarch_aarch64_feature_detection`
14454
14455
14456
14457The tracking issue for this feature is: [#127764]
14458
14459[#127764]: https://github.com/rust-lang/rust/issues/127764
14460
14461------------------------
14462"##,
14463 default_severity: Severity::Allow,
14464 warn_since: None,
14465 deny_since: None,
14466 },
14467 Lint {
14468 label: "stdarch_arm_feature_detection",
14469 description: r##"# `stdarch_arm_feature_detection`
14470
14471
14472
14473The tracking issue for this feature is: [#111190]
14474
14475[#111190]: https://github.com/rust-lang/rust/issues/111190
14476
14477------------------------
14478"##,
14479 default_severity: Severity::Allow,
14480 warn_since: None,
14481 deny_since: None,
14482 },
14483 Lint {
14484 label: "stdarch_internal",
14485 description: r##"# `stdarch_internal`
14486
14487
14488
14489This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
14490
14491------------------------
14492"##,
14493 default_severity: Severity::Allow,
14494 warn_since: None,
14495 deny_since: None,
14496 },
14497 Lint {
14498 label: "stdarch_loongarch_feature_detection",
14499 description: r##"# `stdarch_loongarch_feature_detection`
14500
14501
14502
14503The tracking issue for this feature is: [#117425]
14504
14505[#117425]: https://github.com/rust-lang/rust/issues/117425
14506
14507------------------------
14508"##,
14509 default_severity: Severity::Allow,
14510 warn_since: None,
14511 deny_since: None,
14512 },
14513 Lint {
14514 label: "stdarch_mips_feature_detection",
14515 description: r##"# `stdarch_mips_feature_detection`
14516
14517
14518
14519The tracking issue for this feature is: [#111188]
14520
14521[#111188]: https://github.com/rust-lang/rust/issues/111188
14522
14523------------------------
14524"##,
14525 default_severity: Severity::Allow,
14526 warn_since: None,
14527 deny_since: None,
14528 },
14529 Lint {
14530 label: "stdarch_powerpc_feature_detection",
14531 description: r##"# `stdarch_powerpc_feature_detection`
14532
14533
14534
14535The tracking issue for this feature is: [#111191]
14536
14537[#111191]: https://github.com/rust-lang/rust/issues/111191
14538
14539------------------------
14540"##,
14541 default_severity: Severity::Allow,
14542 warn_since: None,
14543 deny_since: None,
14544 },
14545 Lint {
14546 label: "stdarch_riscv_feature_detection",
14547 description: r##"# `stdarch_riscv_feature_detection`
14548
14549
14550
14551The tracking issue for this feature is: [#111192]
14552
14553[#111192]: https://github.com/rust-lang/rust/issues/111192
14554
14555------------------------
14556"##,
14557 default_severity: Severity::Allow,
14558 warn_since: None,
14559 deny_since: None,
14560 },
14561 Lint {
14562 label: "stdio_fd_consts",
14563 description: r##"# `stdio_fd_consts`
14564
14565
14566
14567The tracking issue for this feature is: [#150836]
14568
14569[#150836]: https://github.com/rust-lang/rust/issues/150836
14570
14571------------------------
14572"##,
14573 default_severity: Severity::Allow,
14574 warn_since: None,
14575 deny_since: None,
14576 },
14577 Lint {
14578 label: "stdio_makes_pipe",
14579 description: r##"# `stdio_makes_pipe`
14580
14581
14582
14583The tracking issue for this feature is: [#98288]
14584
14585[#98288]: https://github.com/rust-lang/rust/issues/98288
14586
14587------------------------
14588"##,
14589 default_severity: Severity::Allow,
14590 warn_since: None,
14591 deny_since: None,
14592 },
14593 Lint {
14594 label: "stdio_swap",
14595 description: r##"# `stdio_swap`
14596
14597
14598
14599The tracking issue for this feature is: [#150667]
14600
14601[#150667]: https://github.com/rust-lang/rust/issues/150667
14602
14603------------------------
14604"##,
14605 default_severity: Severity::Allow,
14606 warn_since: None,
14607 deny_since: None,
14608 },
14609 Lint {
14610 label: "step_trait",
14611 description: r##"# `step_trait`
14612
14613
14614
14615The tracking issue for this feature is: [#42168]
14616
14617[#42168]: https://github.com/rust-lang/rust/issues/42168
14618
14619------------------------
14620"##,
14621 default_severity: Severity::Allow,
14622 warn_since: None,
14623 deny_since: None,
14624 },
14625 Lint {
14626 label: "stmt_expr_attributes",
14627 description: r##"# `stmt_expr_attributes`
14628
14629Allows attributes on expressions and non-item statements.
14630
14631The tracking issue for this feature is: [#15701]
14632
14633[#15701]: https://github.com/rust-lang/rust/issues/15701
14634
14635------------------------
14636"##,
14637 default_severity: Severity::Allow,
14638 warn_since: None,
14639 deny_since: None,
14640 },
14641 Lint {
14642 label: "str_as_str",
14643 description: r##"# `str_as_str`
14644
14645
14646
14647The tracking issue for this feature is: [#130366]
14648
14649[#130366]: https://github.com/rust-lang/rust/issues/130366
14650
14651------------------------
14652"##,
14653 default_severity: Severity::Allow,
14654 warn_since: None,
14655 deny_since: None,
14656 },
14657 Lint {
14658 label: "str_from_raw_parts",
14659 description: r##"# `str_from_raw_parts`
14660
14661
14662
14663The tracking issue for this feature is: [#119206]
14664
14665[#119206]: https://github.com/rust-lang/rust/issues/119206
14666
14667------------------------
14668"##,
14669 default_severity: Severity::Allow,
14670 warn_since: None,
14671 deny_since: None,
14672 },
14673 Lint {
14674 label: "str_from_utf16_endian",
14675 description: r##"# `str_from_utf16_endian`
14676
14677
14678
14679The tracking issue for this feature is: [#116258]
14680
14681[#116258]: https://github.com/rust-lang/rust/issues/116258
14682
14683------------------------
14684"##,
14685 default_severity: Severity::Allow,
14686 warn_since: None,
14687 deny_since: None,
14688 },
14689 Lint {
14690 label: "str_internals",
14691 description: r##"# `str_internals`
14692
14693This feature is internal to the Rust compiler and is not intended for general use.
14694
14695------------------------
14696"##,
14697 default_severity: Severity::Allow,
14698 warn_since: None,
14699 deny_since: None,
14700 },
14701 Lint {
14702 label: "str_lines_remainder",
14703 description: r##"# `str_lines_remainder`
14704
14705
14706
14707The tracking issue for this feature is: [#77998]
14708
14709[#77998]: https://github.com/rust-lang/rust/issues/77998
14710
14711------------------------
14712"##,
14713 default_severity: Severity::Allow,
14714 warn_since: None,
14715 deny_since: None,
14716 },
14717 Lint {
14718 label: "str_split_inclusive_remainder",
14719 description: r##"# `str_split_inclusive_remainder`
14720
14721
14722
14723The tracking issue for this feature is: [#77998]
14724
14725[#77998]: https://github.com/rust-lang/rust/issues/77998
14726
14727------------------------
14728"##,
14729 default_severity: Severity::Allow,
14730 warn_since: None,
14731 deny_since: None,
14732 },
14733 Lint {
14734 label: "str_split_remainder",
14735 description: r##"# `str_split_remainder`
14736
14737
14738
14739The tracking issue for this feature is: [#77998]
14740
14741[#77998]: https://github.com/rust-lang/rust/issues/77998
14742
14743------------------------
14744"##,
14745 default_severity: Severity::Allow,
14746 warn_since: None,
14747 deny_since: None,
14748 },
14749 Lint {
14750 label: "str_split_whitespace_remainder",
14751 description: r##"# `str_split_whitespace_remainder`
14752
14753
14754
14755The tracking issue for this feature is: [#77998]
14756
14757[#77998]: https://github.com/rust-lang/rust/issues/77998
14758
14759------------------------
14760"##,
14761 default_severity: Severity::Allow,
14762 warn_since: None,
14763 deny_since: None,
14764 },
14765 Lint {
14766 label: "strict_provenance_lints",
14767 description: r##"# `strict_provenance_lints`
14768
14769The tracking issue for this feature is: [#130351]
14770
14771[#130351]: https://github.com/rust-lang/rust/issues/130351
14772-----
14773
14774The `strict_provenance_lints` feature allows to enable the `fuzzy_provenance_casts` and `lossy_provenance_casts` lints.
14775These lint on casts between integers and pointers, that are recommended against or invalid in the strict provenance model.
14776
14777## Example
14778
14779```rust
14780#![feature(strict_provenance_lints)]
14781#![warn(fuzzy_provenance_casts)]
14782
14783fn main() {
14784 let _dangling = 16_usize as *const u8;
14785 //~^ WARNING: strict provenance disallows casting integer `usize` to pointer `*const u8`
14786}
14787```
14788"##,
14789 default_severity: Severity::Allow,
14790 warn_since: None,
14791 deny_since: None,
14792 },
14793 Lint {
14794 label: "string_from_utf8_lossy_owned",
14795 description: r##"# `string_from_utf8_lossy_owned`
14796
14797
14798
14799The tracking issue for this feature is: [#129436]
14800
14801[#129436]: https://github.com/rust-lang/rust/issues/129436
14802
14803------------------------
14804"##,
14805 default_severity: Severity::Allow,
14806 warn_since: None,
14807 deny_since: None,
14808 },
14809 Lint {
14810 label: "string_into_chars",
14811 description: r##"# `string_into_chars`
14812
14813
14814
14815The tracking issue for this feature is: [#133125]
14816
14817[#133125]: https://github.com/rust-lang/rust/issues/133125
14818
14819------------------------
14820"##,
14821 default_severity: Severity::Allow,
14822 warn_since: None,
14823 deny_since: None,
14824 },
14825 Lint {
14826 label: "string_remove_matches",
14827 description: r##"# `string_remove_matches`
14828
14829
14830
14831The tracking issue for this feature is: [#72826]
14832
14833[#72826]: https://github.com/rust-lang/rust/issues/72826
14834
14835------------------------
14836"##,
14837 default_severity: Severity::Allow,
14838 warn_since: None,
14839 deny_since: None,
14840 },
14841 Lint {
14842 label: "string_replace_in_place",
14843 description: r##"# `string_replace_in_place`
14844
14845
14846
14847The tracking issue for this feature is: [#147949]
14848
14849[#147949]: https://github.com/rust-lang/rust/issues/147949
14850
14851------------------------
14852"##,
14853 default_severity: Severity::Allow,
14854 warn_since: None,
14855 deny_since: None,
14856 },
14857 Lint {
14858 label: "strip_circumfix",
14859 description: r##"# `strip_circumfix`
14860
14861
14862
14863The tracking issue for this feature is: [#147946]
14864
14865[#147946]: https://github.com/rust-lang/rust/issues/147946
14866
14867------------------------
14868"##,
14869 default_severity: Severity::Allow,
14870 warn_since: None,
14871 deny_since: None,
14872 },
14873 Lint {
14874 label: "structural_match",
14875 description: r##"# `structural_match`
14876
14877Allows using `#[structural_match]` which indicates that a type is structurally matchable. FIXME: Subsumed by trait `StructuralPartialEq`, cannot move to removed until a library feature with the same name exists.
14878
14879The tracking issue for this feature is: [#31434]
14880
14881[#31434]: https://github.com/rust-lang/rust/issues/31434
14882
14883------------------------
14884"##,
14885 default_severity: Severity::Allow,
14886 warn_since: None,
14887 deny_since: None,
14888 },
14889 Lint {
14890 label: "substr_range",
14891 description: r##"# `substr_range`
14892
14893
14894
14895The tracking issue for this feature is: [#126769]
14896
14897[#126769]: https://github.com/rust-lang/rust/issues/126769
14898
14899------------------------
14900"##,
14901 default_severity: Severity::Allow,
14902 warn_since: None,
14903 deny_since: None,
14904 },
14905 Lint {
14906 label: "super_let",
14907 description: r##"# `super_let`
14908
14909Allows `super let` statements.
14910
14911The tracking issue for this feature is: [#139076]
14912
14913[#139076]: https://github.com/rust-lang/rust/issues/139076
14914
14915------------------------
14916"##,
14917 default_severity: Severity::Allow,
14918 warn_since: None,
14919 deny_since: None,
14920 },
14921 Lint {
14922 label: "supertrait_item_shadowing",
14923 description: r##"# `supertrait_item_shadowing`
14924
14925Allows subtrait items to shadow supertrait items.
14926
14927The tracking issue for this feature is: [#89151]
14928
14929[#89151]: https://github.com/rust-lang/rust/issues/89151
14930
14931------------------------
14932"##,
14933 default_severity: Severity::Allow,
14934 warn_since: None,
14935 deny_since: None,
14936 },
14937 Lint {
14938 label: "sync_nonpoison",
14939 description: r##"# `sync_nonpoison`
14940
14941
14942
14943The tracking issue for this feature is: [#134645]
14944
14945[#134645]: https://github.com/rust-lang/rust/issues/134645
14946
14947------------------------
14948"##,
14949 default_severity: Severity::Allow,
14950 warn_since: None,
14951 deny_since: None,
14952 },
14953 Lint {
14954 label: "sync_poison_mod",
14955 description: r##"# `sync_poison_mod`
14956
14957
14958
14959The tracking issue for this feature is: [#134646]
14960
14961[#134646]: https://github.com/rust-lang/rust/issues/134646
14962
14963------------------------
14964"##,
14965 default_severity: Severity::Allow,
14966 warn_since: None,
14967 deny_since: None,
14968 },
14969 Lint {
14970 label: "sync_unsafe_cell",
14971 description: r##"# `sync_unsafe_cell`
14972
14973
14974
14975The tracking issue for this feature is: [#95439]
14976
14977[#95439]: https://github.com/rust-lang/rust/issues/95439
14978
14979------------------------
14980"##,
14981 default_severity: Severity::Allow,
14982 warn_since: None,
14983 deny_since: None,
14984 },
14985 Lint {
14986 label: "tcp_deferaccept",
14987 description: r##"# `tcp_deferaccept`
14988
14989
14990
14991The tracking issue for this feature is: [#119639]
14992
14993[#119639]: https://github.com/rust-lang/rust/issues/119639
14994
14995------------------------
14996"##,
14997 default_severity: Severity::Allow,
14998 warn_since: None,
14999 deny_since: None,
15000 },
15001 Lint {
15002 label: "tcp_keepalive",
15003 description: r##"# `tcp_keepalive`
15004
15005
15006
15007The tracking issue for this feature is: [#155889]
15008
15009[#155889]: https://github.com/rust-lang/rust/issues/155889
15010
15011------------------------
15012"##,
15013 default_severity: Severity::Allow,
15014 warn_since: None,
15015 deny_since: None,
15016 },
15017 Lint {
15018 label: "tcp_linger",
15019 description: r##"# `tcp_linger`
15020
15021
15022
15023The tracking issue for this feature is: [#88494]
15024
15025[#88494]: https://github.com/rust-lang/rust/issues/88494
15026
15027------------------------
15028"##,
15029 default_severity: Severity::Allow,
15030 warn_since: None,
15031 deny_since: None,
15032 },
15033 Lint {
15034 label: "tcplistener_into_incoming",
15035 description: r##"# `tcplistener_into_incoming`
15036
15037
15038
15039The tracking issue for this feature is: [#88373]
15040
15041[#88373]: https://github.com/rust-lang/rust/issues/88373
15042
15043------------------------
15044"##,
15045 default_severity: Severity::Allow,
15046 warn_since: None,
15047 deny_since: None,
15048 },
15049 Lint {
15050 label: "temporary_niche_types",
15051 description: r##"# `temporary_niche_types`
15052
15053
15054
15055This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
15056
15057------------------------
15058"##,
15059 default_severity: Severity::Allow,
15060 warn_since: None,
15061 deny_since: None,
15062 },
15063 Lint {
15064 label: "test",
15065 description: r##"# `test`
15066
15067The tracking issue for this feature is: None.
15068
15069------------------------
15070
15071The internals of the `test` crate are unstable, behind the `test` flag. The
15072most widely used part of the `test` crate are benchmark tests, which can test
15073the performance of your code. Let's make our `src/lib.rs` look like this
15074(comments elided):
15075
15076```rust,no_run
15077#![feature(test)]
15078
15079extern crate test;
15080
15081pub fn add_two(a: i32) -> i32 {
15082 a + 2
15083}
15084
15085#[cfg(test)]
15086mod tests {
15087 use super::*;
15088 use test::Bencher;
15089
15090 #[test]
15091 fn it_works() {
15092 assert_eq!(4, add_two(2));
15093 }
15094
15095 #[bench]
15096 fn bench_add_two(b: &mut Bencher) {
15097 b.iter(|| add_two(2));
15098 }
15099}
15100```
15101
15102Note the `test` feature gate, which enables this unstable feature.
15103
15104We've imported the `test` crate, which contains our benchmarking support.
15105We have a new function as well, with the `bench` attribute. Unlike regular
15106tests, which take no arguments, benchmark tests take a `&mut Bencher`. This
15107`Bencher` provides an `iter` method, which takes a closure. This closure
15108contains the code we'd like to benchmark.
15109
15110We can run benchmark tests with `cargo bench`:
15111
15112```bash
15113$ cargo bench
15114 Compiling adder v0.0.1 (file:///home/steve/tmp/adder)
15115 Running target/release/adder-91b3e234d4ed382a
15116
15117running 2 tests
15118test tests::it_works ... ignored
15119test tests::bench_add_two ... bench: 1 ns/iter (+/- 0)
15120
15121test result: ok. 0 passed; 0 failed; 1 ignored; 1 measured
15122```
15123
15124Our non-benchmark test was ignored. You may have noticed that `cargo bench`
15125takes a bit longer than `cargo test`. This is because Rust runs our benchmark
15126a number of times, and then takes the average. Because we're doing so little
15127work in this example, we have a `1 ns/iter (+/- 0)`, but this would show
15128the variance if there was one.
15129
15130Advice on writing benchmarks:
15131
15132
15133* Move setup code outside the `iter` loop; only put the part you want to measure inside
15134* Make the code do "the same thing" on each iteration; do not accumulate or change state
15135* Make the outer function idempotent too; the benchmark runner is likely to run
15136 it many times
15137* Make the inner `iter` loop short and fast so benchmark runs are fast and the
15138 calibrator can adjust the run-length at fine resolution
15139* Make the code in the `iter` loop do something simple, to assist in pinpointing
15140 performance improvements (or regressions)
15141
15142## Gotcha: optimizations
15143
15144There's another tricky part to writing benchmarks: benchmarks compiled with
15145optimizations activated can be dramatically changed by the optimizer so that
15146the benchmark is no longer benchmarking what one expects. For example, the
15147compiler might recognize that some calculation has no external effects and
15148remove it entirely.
15149
15150```rust,no_run
15151#![feature(test)]
15152
15153extern crate test;
15154use test::Bencher;
15155
15156#[bench]
15157fn bench_xor_1000_ints(b: &mut Bencher) {
15158 b.iter(|| {
15159 (0..1000).fold(0, |old, new| old ^ new);
15160 });
15161}
15162```
15163
15164gives the following results
15165
15166```text
15167running 1 test
15168test bench_xor_1000_ints ... bench: 0 ns/iter (+/- 0)
15169
15170test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured
15171```
15172
15173The benchmarking runner offers two ways to avoid this. Either, the closure that
15174the `iter` method receives can return an arbitrary value which forces the
15175optimizer to consider the result used and ensures it cannot remove the
15176computation entirely. This could be done for the example above by adjusting the
15177`b.iter` call to
15178
15179```rust
15180# struct X;
15181# impl X { fn iter<T, F>(&self, _: F) where F: FnMut() -> T {} } let b = X;
15182b.iter(|| {
15183 // Note lack of `;` (could also use an explicit `return`).
15184 (0..1000).fold(0, |old, new| old ^ new)
15185});
15186```
15187
15188Or, the other option is to call the generic `test::black_box` function, which
15189is an opaque "black box" to the optimizer and so forces it to consider any
15190argument as used.
15191
15192```rust
15193#![feature(test)]
15194
15195extern crate test;
15196
15197# fn main() {
15198# struct X;
15199# impl X { fn iter<T, F>(&self, _: F) where F: FnMut() -> T {} } let b = X;
15200b.iter(|| {
15201 let n = test::black_box(1000);
15202
15203 (0..n).fold(0, |a, b| a ^ b)
15204})
15205# }
15206```
15207
15208Neither of these read or modify the value, and are very cheap for small values.
15209Larger values can be passed indirectly to reduce overhead (e.g.
15210`black_box(&huge_struct)`).
15211
15212Performing either of the above changes gives the following benchmarking results
15213
15214```text
15215running 1 test
15216test bench_xor_1000_ints ... bench: 131 ns/iter (+/- 3)
15217
15218test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured
15219```
15220
15221However, the optimizer can still modify a testcase in an undesirable manner
15222even when using either of the above.
15223"##,
15224 default_severity: Severity::Allow,
15225 warn_since: None,
15226 deny_since: None,
15227 },
15228 Lint {
15229 label: "test_incomplete_feature",
15230 description: r##"# `test_incomplete_feature`
15231
15232Perma-unstable, only used to test the `incomplete_features` lint.
15233
15234This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
15235
15236------------------------
15237"##,
15238 default_severity: Severity::Allow,
15239 warn_since: None,
15240 deny_since: None,
15241 },
15242 Lint {
15243 label: "test_unstable_lint",
15244 description: r##"# `test_unstable_lint`
15245
15246Added for testing unstable lints; perma-unstable.
15247
15248This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
15249
15250------------------------
15251"##,
15252 default_severity: Severity::Allow,
15253 warn_since: None,
15254 deny_since: None,
15255 },
15256 Lint {
15257 label: "thin_box",
15258 description: r##"# `thin_box`
15259
15260
15261
15262The tracking issue for this feature is: [#92791]
15263
15264[#92791]: https://github.com/rust-lang/rust/issues/92791
15265
15266------------------------
15267"##,
15268 default_severity: Severity::Allow,
15269 warn_since: None,
15270 deny_since: None,
15271 },
15272 Lint {
15273 label: "thread_id_value",
15274 description: r##"# `thread_id_value`
15275
15276
15277
15278The tracking issue for this feature is: [#67939]
15279
15280[#67939]: https://github.com/rust-lang/rust/issues/67939
15281
15282------------------------
15283"##,
15284 default_severity: Severity::Allow,
15285 warn_since: None,
15286 deny_since: None,
15287 },
15288 Lint {
15289 label: "thread_local",
15290 description: r##"# `thread_local`
15291
15292Allows using `#[thread_local]` on `static` items.
15293
15294The tracking issue for this feature is: [#29594]
15295
15296[#29594]: https://github.com/rust-lang/rust/issues/29594
15297
15298------------------------
15299"##,
15300 default_severity: Severity::Allow,
15301 warn_since: None,
15302 deny_since: None,
15303 },
15304 Lint {
15305 label: "thread_local_internals",
15306 description: r##"# `thread_local_internals`
15307
15308This feature is internal to the Rust compiler and is not intended for general use.
15309
15310------------------------
15311"##,
15312 default_severity: Severity::Allow,
15313 warn_since: None,
15314 deny_since: None,
15315 },
15316 Lint {
15317 label: "thread_raw",
15318 description: r##"# `thread_raw`
15319
15320
15321
15322The tracking issue for this feature is: [#97523]
15323
15324[#97523]: https://github.com/rust-lang/rust/issues/97523
15325
15326------------------------
15327"##,
15328 default_severity: Severity::Allow,
15329 warn_since: None,
15330 deny_since: None,
15331 },
15332 Lint {
15333 label: "thread_sleep_until",
15334 description: r##"# `thread_sleep_until`
15335
15336
15337
15338The tracking issue for this feature is: [#113752]
15339
15340[#113752]: https://github.com/rust-lang/rust/issues/113752
15341
15342------------------------
15343"##,
15344 default_severity: Severity::Allow,
15345 warn_since: None,
15346 deny_since: None,
15347 },
15348 Lint {
15349 label: "thread_spawn_hook",
15350 description: r##"# `thread_spawn_hook`
15351
15352
15353
15354The tracking issue for this feature is: [#132951]
15355
15356[#132951]: https://github.com/rust-lang/rust/issues/132951
15357
15358------------------------
15359"##,
15360 default_severity: Severity::Allow,
15361 warn_since: None,
15362 deny_since: None,
15363 },
15364 Lint {
15365 label: "time_saturating_systemtime",
15366 description: r##"# `time_saturating_systemtime`
15367
15368
15369
15370The tracking issue for this feature is: [#151199]
15371
15372[#151199]: https://github.com/rust-lang/rust/issues/151199
15373
15374------------------------
15375"##,
15376 default_severity: Severity::Allow,
15377 warn_since: None,
15378 deny_since: None,
15379 },
15380 Lint {
15381 label: "time_systemtime_limits",
15382 description: r##"# `time_systemtime_limits`
15383
15384
15385
15386The tracking issue for this feature is: [#149067]
15387
15388[#149067]: https://github.com/rust-lang/rust/issues/149067
15389
15390------------------------
15391"##,
15392 default_severity: Severity::Allow,
15393 warn_since: None,
15394 deny_since: None,
15395 },
15396 Lint {
15397 label: "titlecase",
15398 description: r##"# `titlecase`
15399
15400
15401
15402The tracking issue for this feature is: [#153892]
15403
15404[#153892]: https://github.com/rust-lang/rust/issues/153892
15405
15406------------------------
15407"##,
15408 default_severity: Severity::Allow,
15409 warn_since: None,
15410 deny_since: None,
15411 },
15412 Lint {
15413 label: "trace_macros",
15414 description: r##"# `trace_macros`
15415
15416The tracking issue for this feature is [#29598].
15417
15418[#29598]: https://github.com/rust-lang/rust/issues/29598
15419
15420------------------------
15421
15422With `trace_macros` you can trace the expansion of macros in your code.
15423
15424## Examples
15425
15426```rust
15427#![feature(trace_macros)]
15428
15429fn main() {
15430 trace_macros!(true);
15431 println!("Hello, Rust!");
15432 trace_macros!(false);
15433}
15434```
15435
15436The `cargo build` output:
15437
15438```txt
15439note: trace_macro
15440 --> src/main.rs:5:5
15441 |
154425 | println!("Hello, Rust!");
15443 | ^^^^^^^^^^^^^^^^^^^^^^^^^
15444 |
15445 = note: expanding `println! { "Hello, Rust!" }`
15446 = note: to `print ! ( concat ! ( "Hello, Rust!" , "\n" ) )`
15447 = note: expanding `print! { concat ! ( "Hello, Rust!" , "\n" ) }`
15448 = note: to `$crate :: io :: _print ( format_args ! ( concat ! ( "Hello, Rust!" , "\n" ) )
15449 )`
15450
15451 Finished dev [unoptimized + debuginfo] target(s) in 0.60 secs
15452```
15453"##,
15454 default_severity: Severity::Allow,
15455 warn_since: None,
15456 deny_since: None,
15457 },
15458 Lint {
15459 label: "trait_alias",
15460 description: r##"# `trait_alias`
15461
15462The tracking issue for this feature is: [#41517]
15463
15464[#41517]: https://github.com/rust-lang/rust/issues/41517
15465
15466------------------------
15467
15468The `trait_alias` feature adds support for trait aliases. These allow aliases
15469to be created for one or more traits (currently just a single regular trait plus
15470any number of auto-traits), and used wherever traits would normally be used as
15471either bounds or trait objects.
15472
15473```rust
15474#![feature(trait_alias)]
15475
15476trait Foo = std::fmt::Debug + Send;
15477trait Bar = Foo + Sync;
15478
15479// Use trait alias as bound on type parameter.
15480fn foo<T: Foo>(v: &T) {
15481 println!("{:?}", v);
15482}
15483
15484pub fn main() {
15485 foo(&1);
15486
15487 // Use trait alias for trait objects.
15488 let a: &dyn Bar = &123;
15489 println!("{:?}", a);
15490 let b = Box::new(456) as Box<dyn Foo>;
15491 println!("{:?}", b);
15492}
15493```
15494"##,
15495 default_severity: Severity::Allow,
15496 warn_since: None,
15497 deny_since: None,
15498 },
15499 Lint {
15500 label: "transmutability",
15501 description: r##"# `transmutability`
15502
15503
15504
15505The tracking issue for this feature is: [#99571]
15506
15507[#99571]: https://github.com/rust-lang/rust/issues/99571
15508
15509------------------------
15510"##,
15511 default_severity: Severity::Allow,
15512 warn_since: None,
15513 deny_since: None,
15514 },
15515 Lint {
15516 label: "transmute_generic_consts",
15517 description: r##"# `transmute_generic_consts`
15518
15519Allows for transmuting between arrays with sizes that contain generic consts.
15520
15521The tracking issue for this feature is: [#109929]
15522
15523[#109929]: https://github.com/rust-lang/rust/issues/109929
15524
15525------------------------
15526"##,
15527 default_severity: Severity::Allow,
15528 warn_since: None,
15529 deny_since: None,
15530 },
15531 Lint {
15532 label: "transmute_neo",
15533 description: r##"# `transmute_neo`
15534
15535
15536
15537The tracking issue for this feature is: [#155079]
15538
15539[#155079]: https://github.com/rust-lang/rust/issues/155079
15540
15541------------------------
15542"##,
15543 default_severity: Severity::Allow,
15544 warn_since: None,
15545 deny_since: None,
15546 },
15547 Lint {
15548 label: "transmute_prefix",
15549 description: r##"# `transmute_prefix`
15550
15551
15552
15553The tracking issue for this feature is: [#155079]
15554
15555[#155079]: https://github.com/rust-lang/rust/issues/155079
15556
15557------------------------
15558"##,
15559 default_severity: Severity::Allow,
15560 warn_since: None,
15561 deny_since: None,
15562 },
15563 Lint {
15564 label: "transparent_unions",
15565 description: r##"# `transparent_unions`
15566
15567The tracking issue for this feature is [#60405]
15568
15569[#60405]: https://github.com/rust-lang/rust/issues/60405
15570
15571----
15572
15573The `transparent_unions` feature allows you mark `union`s as
15574`#[repr(transparent)]`. A `union` may be `#[repr(transparent)]` in exactly the
15575same conditions in which a `struct` may be `#[repr(transparent)]` (generally,
15576this means the `union` must have exactly one non-zero-sized field). Some
15577concrete illustrations follow.
15578
15579```rust
15580#![feature(transparent_unions)]
15581
15582// This union has the same representation as `f32`.
15583#[repr(transparent)]
15584union SingleFieldUnion {
15585 field: f32,
15586}
15587
15588// This union has the same representation as `usize`.
15589#[repr(transparent)]
15590union MultiFieldUnion {
15591 field: usize,
15592 nothing: (),
15593}
15594```
15595
15596For consistency with transparent `struct`s, `union`s must have exactly one
15597non-zero-sized field. If all fields are zero-sized, the `union` must not be
15598`#[repr(transparent)]`:
15599
15600```rust
15601#![feature(transparent_unions)]
15602
15603// This (non-transparent) union is already valid in stable Rust:
15604pub union GoodUnion {
15605 pub nothing: (),
15606}
15607
15608// Error: transparent union needs exactly one non-zero-sized field, but has 0
15609// #[repr(transparent)]
15610// pub union BadUnion {
15611// pub nothing: (),
15612// }
15613```
15614
15615The one exception is if the `union` is generic over `T` and has a field of type
15616`T`, it may be `#[repr(transparent)]` even if `T` is a zero-sized type:
15617
15618```rust
15619#![feature(transparent_unions)]
15620
15621// This union has the same representation as `T`.
15622#[repr(transparent)]
15623pub union GenericUnion<T: Copy> { // Unions with non-`Copy` fields are unstable.
15624 pub field: T,
15625 pub nothing: (),
15626}
15627
15628// This is okay even though `()` is a zero-sized type.
15629pub const THIS_IS_OKAY: GenericUnion<()> = GenericUnion { field: () };
15630```
15631
15632Like transparent `struct`s, a transparent `union` of type `U` has the same
15633layout, size, and ABI as its single non-ZST field. If it is generic over a type
15634`T`, and all its fields are ZSTs except for exactly one field of type `T`, then
15635it has the same layout and ABI as `T` (even if `T` is a ZST when monomorphized).
15636
15637Like transparent `struct`s, transparent `union`s are FFI-safe if and only if
15638their underlying representation type is also FFI-safe.
15639
15640A `union` may not be eligible for the same nonnull-style optimizations that a
15641`struct` or `enum` (with the same fields) are eligible for. Adding
15642`#[repr(transparent)]` to `union` does not change this. To give a more concrete
15643example, it is unspecified whether `size_of::<T>()` is equal to
15644`size_of::<Option<T>>()`, where `T` is a `union` (regardless of whether or not
15645it is transparent). The Rust compiler is free to perform this optimization if
15646possible, but is not required to, and different compiler versions may differ in
15647their application of these optimizations.
15648"##,
15649 default_severity: Severity::Allow,
15650 warn_since: None,
15651 deny_since: None,
15652 },
15653 Lint {
15654 label: "trim_prefix_suffix",
15655 description: r##"# `trim_prefix_suffix`
15656
15657
15658
15659The tracking issue for this feature is: [#142312]
15660
15661[#142312]: https://github.com/rust-lang/rust/issues/142312
15662
15663------------------------
15664"##,
15665 default_severity: Severity::Allow,
15666 warn_since: None,
15667 deny_since: None,
15668 },
15669 Lint {
15670 label: "trivial_bounds",
15671 description: r##"# `trivial_bounds`
15672
15673Allows inconsistent bounds in where clauses.
15674
15675The tracking issue for this feature is: [#48214]
15676
15677[#48214]: https://github.com/rust-lang/rust/issues/48214
15678
15679------------------------
15680"##,
15681 default_severity: Severity::Allow,
15682 warn_since: None,
15683 deny_since: None,
15684 },
15685 Lint {
15686 label: "trivial_clone",
15687 description: r##"# `trivial_clone`
15688
15689
15690
15691This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
15692
15693------------------------
15694"##,
15695 default_severity: Severity::Allow,
15696 warn_since: None,
15697 deny_since: None,
15698 },
15699 Lint {
15700 label: "trusted_fused",
15701 description: r##"# `trusted_fused`
15702
15703
15704
15705This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
15706
15707------------------------
15708"##,
15709 default_severity: Severity::Allow,
15710 warn_since: None,
15711 deny_since: None,
15712 },
15713 Lint {
15714 label: "trusted_len",
15715 description: r##"# `trusted_len`
15716
15717
15718
15719The tracking issue for this feature is: [#37572]
15720
15721[#37572]: https://github.com/rust-lang/rust/issues/37572
15722
15723------------------------
15724"##,
15725 default_severity: Severity::Allow,
15726 warn_since: None,
15727 deny_since: None,
15728 },
15729 Lint {
15730 label: "trusted_random_access",
15731 description: r##"# `trusted_random_access`
15732
15733
15734
15735This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
15736
15737------------------------
15738"##,
15739 default_severity: Severity::Allow,
15740 warn_since: None,
15741 deny_since: None,
15742 },
15743 Lint {
15744 label: "trusted_step",
15745 description: r##"# `trusted_step`
15746
15747
15748
15749The tracking issue for this feature is: [#85731]
15750
15751[#85731]: https://github.com/rust-lang/rust/issues/85731
15752
15753------------------------
15754"##,
15755 default_severity: Severity::Allow,
15756 warn_since: None,
15757 deny_since: None,
15758 },
15759 Lint {
15760 label: "try_as_dyn",
15761 description: r##"# `try_as_dyn`
15762
15763
15764
15765The tracking issue for this feature is: [#144361]
15766
15767[#144361]: https://github.com/rust-lang/rust/issues/144361
15768
15769------------------------
15770"##,
15771 default_severity: Severity::Allow,
15772 warn_since: None,
15773 deny_since: None,
15774 },
15775 Lint {
15776 label: "try_blocks",
15777 description: r##"# `try_blocks`
15778
15779The tracking issue for this feature is: [#154391]
15780
15781[#154391]: https://github.com/rust-lang/rust/issues/154391
15782
15783------------------------
15784
15785The `try_blocks` feature adds support for `try` blocks. A `try`
15786block creates a new scope one can use the `?` operator in.
15787
15788```rust,edition2018
15789#![feature(try_blocks)]
15790
15791use std::num::ParseIntError;
15792
15793let result = try {
15794 "1".parse::<i32>()?
15795 + "2".parse::<i32>()?
15796 + "3".parse::<i32>()?
15797};
15798assert_eq!(result, Ok(6));
15799
15800let result = try {
15801 "1".parse::<i32>()?
15802 + "foo".parse::<i32>()?
15803 + "3".parse::<i32>()?
15804};
15805assert!(result.is_err());
15806```
15807"##,
15808 default_severity: Severity::Allow,
15809 warn_since: None,
15810 deny_since: None,
15811 },
15812 Lint {
15813 label: "try_blocks_heterogeneous",
15814 description: r##"# `try_blocks_heterogeneous`
15815
15816Allows using `try bikeshed TargetType {...}` expressions.
15817
15818The tracking issue for this feature is: [#149488]
15819
15820[#149488]: https://github.com/rust-lang/rust/issues/149488
15821
15822------------------------
15823"##,
15824 default_severity: Severity::Allow,
15825 warn_since: None,
15826 deny_since: None,
15827 },
15828 Lint {
15829 label: "try_find",
15830 description: r##"# `try_find`
15831
15832
15833
15834The tracking issue for this feature is: [#63178]
15835
15836[#63178]: https://github.com/rust-lang/rust/issues/63178
15837
15838------------------------
15839"##,
15840 default_severity: Severity::Allow,
15841 warn_since: None,
15842 deny_since: None,
15843 },
15844 Lint {
15845 label: "try_from_int_error_kind",
15846 description: r##"# `try_from_int_error_kind`
15847
15848
15849
15850The tracking issue for this feature is: [#153978]
15851
15852[#153978]: https://github.com/rust-lang/rust/issues/153978
15853
15854------------------------
15855"##,
15856 default_severity: Severity::Allow,
15857 warn_since: None,
15858 deny_since: None,
15859 },
15860 Lint {
15861 label: "try_reserve_kind",
15862 description: r##"# `try_reserve_kind`
15863
15864
15865
15866The tracking issue for this feature is: [#48043]
15867
15868[#48043]: https://github.com/rust-lang/rust/issues/48043
15869
15870------------------------
15871"##,
15872 default_severity: Severity::Allow,
15873 warn_since: None,
15874 deny_since: None,
15875 },
15876 Lint {
15877 label: "try_trait_v2",
15878 description: r##"# `try_trait_v2`
15879
15880
15881
15882The tracking issue for this feature is: [#84277]
15883
15884[#84277]: https://github.com/rust-lang/rust/issues/84277
15885
15886------------------------
15887"##,
15888 default_severity: Severity::Allow,
15889 warn_since: None,
15890 deny_since: None,
15891 },
15892 Lint {
15893 label: "try_trait_v2_residual",
15894 description: r##"# `try_trait_v2_residual`
15895
15896
15897
15898The tracking issue for this feature is: [#91285]
15899
15900[#91285]: https://github.com/rust-lang/rust/issues/91285
15901
15902------------------------
15903"##,
15904 default_severity: Severity::Allow,
15905 warn_since: None,
15906 deny_since: None,
15907 },
15908 Lint {
15909 label: "try_trait_v2_yeet",
15910 description: r##"# `try_trait_v2_yeet`
15911
15912
15913
15914The tracking issue for this feature is: [#96374]
15915
15916[#96374]: https://github.com/rust-lang/rust/issues/96374
15917
15918------------------------
15919"##,
15920 default_severity: Severity::Allow,
15921 warn_since: None,
15922 deny_since: None,
15923 },
15924 Lint {
15925 label: "try_with_capacity",
15926 description: r##"# `try_with_capacity`
15927
15928
15929
15930The tracking issue for this feature is: [#91913]
15931
15932[#91913]: https://github.com/rust-lang/rust/issues/91913
15933
15934------------------------
15935"##,
15936 default_severity: Severity::Allow,
15937 warn_since: None,
15938 deny_since: None,
15939 },
15940 Lint {
15941 label: "tuple_trait",
15942 description: r##"# `tuple_trait`
15943
15944
15945
15946This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
15947
15948------------------------
15949"##,
15950 default_severity: Severity::Allow,
15951 warn_since: None,
15952 deny_since: None,
15953 },
15954 Lint {
15955 label: "type_alias_impl_trait",
15956 description: r##"# `type_alias_impl_trait`
15957
15958The tracking issue for this feature is: [#63063]
15959
15960------------------------
15961
15962> This feature is not to be confused with [`trait_alias`] or [`impl_trait_in_assoc_type`].
15963
15964### What is `impl Trait`?
15965
15966`impl Trait` in return position is useful for declaring types that are constrained by traits, but whose concrete type should be hidden:
15967
15968```rust
15969use std::fmt::Debug;
15970
15971fn new() -> impl Debug {
15972 42
15973}
15974
15975fn main() {
15976 let thing = new();
15977 // What actually is a `thing`?
15978 // No idea but we know it implements `Debug`, so we can debug print it
15979 println!("{thing:?}");
15980}
15981```
15982
15983See the [reference] for more information about `impl Trait` in return position.
15984
15985### `type_alias_impl_trait`
15986
15987However, we might want to use an `impl Trait` in multiple locations but actually use the same concrete type everywhere while keeping it hidden.
15988This can be useful in libraries where you want to hide implementation details.
15989
15990The `#[define_opaque]` attribute must be used to explicitly list opaque items constrained by the item it's on.
15991
15992```rust
15993#![feature(type_alias_impl_trait)]
15994# #![allow(unused_variables, dead_code)]
15995trait Trait {}
15996
15997struct MyType;
15998
15999impl Trait for MyType {}
16000
16001type Alias = impl Trait;
16002
16003#[define_opaque(Alias)] // To constrain the type alias to `MyType`
16004fn new() -> Alias {
16005 MyType
16006}
16007
16008#[define_opaque(Alias)] // So we can name the concrete type inside this item
16009fn main() {
16010 let thing: MyType = new();
16011}
16012
16013// It can be a part of a struct too
16014struct HaveAlias {
16015 stuff: String,
16016 thing: Alias,
16017}
16018```
16019
16020In this example, the concrete type referred to by `Alias` is guaranteed to be the same wherever `Alias` occurs.
16021
16022> Originally this feature included type aliases as an associated type of a trait. In [#110237] this was split off to [`impl_trait_in_assoc_type`].
16023
16024### `type_alias_impl_trait` in argument position.
16025
16026Note that using `Alias` as an argument type is *not* the same as argument-position `impl Trait`, as `Alias` refers to a unique type, whereas the concrete type for argument-position `impl Trait` is chosen by the caller.
16027
16028```rust
16029# #![feature(type_alias_impl_trait)]
16030# #![allow(unused_variables)]
16031# pub mod x {
16032# pub trait Trait {}
16033#
16034# struct MyType;
16035#
16036# impl Trait for MyType {}
16037#
16038# pub type Alias = impl Trait;
16039#
16040# #[define_opaque(Alias)]
16041# pub fn new() -> Alias {
16042# MyType
16043# }
16044# }
16045# use x::*;
16046// this...
16047pub fn take_alias(x: Alias) {
16048 // ...
16049}
16050
16051// ...is *not* the same as
16052pub fn take_impl(x: impl Trait) {
16053 // ...
16054}
16055# fn main(){}
16056```
16057
16058```rust,compile_fail,E0308
16059# #![feature(type_alias_impl_trait)]
16060# #![allow(unused_variables)]
16061# pub mod x {
16062# pub trait Trait {}
16063#
16064# struct MyType;
16065#
16066# impl Trait for MyType {}
16067#
16068# pub type Alias = impl Trait;
16069#
16070# #[define_opaque(Alias)]
16071# pub fn new() -> Alias {
16072# MyType
16073# }
16074# }
16075# use x::*;
16076# pub fn take_alias(x: Alias) {
16077# // ...
16078# }
16079#
16080# pub fn take_impl(x: impl Trait) {
16081# // ...
16082# }
16083#
16084// a user's crate using the trait and type alias
16085struct UserType;
16086impl Trait for UserType {}
16087
16088# fn main(){
16089let x = UserType;
16090take_alias(x);
16091// ERROR expected opaque type, found `UserType`
16092// this function *actually* takes a `MyType` as is constrained in `new`
16093
16094let x = UserType;
16095take_impl(x);
16096// OK
16097
16098let x = new();
16099take_alias(x);
16100// OK
16101
16102let x = new();
16103take_impl(x);
16104// OK
16105# }
16106```
16107
16108Note that the user cannot use `#[define_opaque(Alias)]` to reify the opaque type because only the crate where the type alias is declared may do so. But if this happened in the same crate and the opaque type was reified, they'd get a familiar error: "expected `MyType`, got `UserType`".
16109
16110[#63063]: https://github.com/rust-lang/rust/issues/63063
16111[#110237]: https://github.com/rust-lang/rust/pull/110237
16112[reference]: https://doc.rust-lang.org/stable/reference/types/impl-trait.html#abstract-return-types
16113[`trait_alias`]: ./trait-alias.md
16114[`impl_trait_in_assoc_type`]: ./impl-trait-in-assoc-type.md
16115"##,
16116 default_severity: Severity::Allow,
16117 warn_since: None,
16118 deny_since: None,
16119 },
16120 Lint {
16121 label: "type_ascription",
16122 description: r##"# `type_ascription`
16123
16124
16125
16126The tracking issue for this feature is: [#23416]
16127
16128[#23416]: https://github.com/rust-lang/rust/issues/23416
16129
16130------------------------
16131"##,
16132 default_severity: Severity::Allow,
16133 warn_since: None,
16134 deny_since: None,
16135 },
16136 Lint {
16137 label: "type_changing_struct_update",
16138 description: r##"# `type_changing_struct_update`
16139
16140The tracking issue for this feature is: [#86555]
16141
16142[#86555]: https://github.com/rust-lang/rust/issues/86555
16143
16144------------------------
16145
16146This implements [RFC2528]. When turned on, you can create instances of the same struct
16147that have different generic type or lifetime parameters.
16148
16149[RFC2528]: https://github.com/rust-lang/rfcs/blob/master/text/2528-type-changing-struct-update-syntax.md
16150
16151```rust
16152#![allow(unused_variables, dead_code)]
16153#![feature(type_changing_struct_update)]
16154
16155fn main () {
16156 struct Foo<T, U> {
16157 field1: T,
16158 field2: U,
16159 }
16160
16161 let base: Foo<String, i32> = Foo {
16162 field1: String::from("hello"),
16163 field2: 1234,
16164 };
16165 let updated: Foo<f64, i32> = Foo {
16166 field1: 3.14,
16167 ..base
16168 };
16169}
16170```
16171"##,
16172 default_severity: Severity::Allow,
16173 warn_since: None,
16174 deny_since: None,
16175 },
16176 Lint {
16177 label: "type_info",
16178 description: r##"# `type_info`
16179
16180
16181
16182The tracking issue for this feature is: [#146922]
16183
16184[#146922]: https://github.com/rust-lang/rust/issues/146922
16185
16186------------------------
16187"##,
16188 default_severity: Severity::Allow,
16189 warn_since: None,
16190 deny_since: None,
16191 },
16192 Lint {
16193 label: "ub_checks",
16194 description: r##"# `ub_checks`
16195
16196
16197
16198This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
16199
16200------------------------
16201"##,
16202 default_severity: Severity::Allow,
16203 warn_since: None,
16204 deny_since: None,
16205 },
16206 Lint {
16207 label: "uefi_std",
16208 description: r##"# `uefi_std`
16209
16210
16211
16212The tracking issue for this feature is: [#100499]
16213
16214[#100499]: https://github.com/rust-lang/rust/issues/100499
16215
16216------------------------
16217"##,
16218 default_severity: Severity::Allow,
16219 warn_since: None,
16220 deny_since: None,
16221 },
16222 Lint {
16223 label: "uint_carryless_mul",
16224 description: r##"# `uint_carryless_mul`
16225
16226
16227
16228The tracking issue for this feature is: [#152080]
16229
16230[#152080]: https://github.com/rust-lang/rust/issues/152080
16231
16232------------------------
16233"##,
16234 default_severity: Severity::Allow,
16235 warn_since: None,
16236 deny_since: None,
16237 },
16238 Lint {
16239 label: "uint_gather_scatter_bits",
16240 description: r##"# `uint_gather_scatter_bits`
16241
16242
16243
16244The tracking issue for this feature is: [#149069]
16245
16246[#149069]: https://github.com/rust-lang/rust/issues/149069
16247
16248------------------------
16249"##,
16250 default_severity: Severity::Allow,
16251 warn_since: None,
16252 deny_since: None,
16253 },
16254 Lint {
16255 label: "unboxed_closures",
16256 description: r##"# `unboxed_closures`
16257
16258The tracking issue for this feature is [#29625]
16259
16260See Also: [`fn_traits`](../library-features/fn-traits.md)
16261
16262[#29625]: https://github.com/rust-lang/rust/issues/29625
16263
16264----
16265
16266The `unboxed_closures` feature allows you to write functions using the `"rust-call"` ABI,
16267required for implementing the [`Fn*`] family of traits. `"rust-call"` functions must have
16268exactly one (non self) argument, a tuple representing the argument list.
16269
16270[`Fn*`]: ../../std/ops/trait.Fn.html
16271
16272```rust
16273#![feature(unboxed_closures)]
16274
16275extern "rust-call" fn add_args(args: (u32, u32)) -> u32 {
16276 args.0 + args.1
16277}
16278
16279fn main() {}
16280```
16281"##,
16282 default_severity: Severity::Allow,
16283 warn_since: None,
16284 deny_since: None,
16285 },
16286 Lint {
16287 label: "unicode_internals",
16288 description: r##"# `unicode_internals`
16289
16290
16291
16292This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
16293
16294------------------------
16295"##,
16296 default_severity: Severity::Allow,
16297 warn_since: None,
16298 deny_since: None,
16299 },
16300 Lint {
16301 label: "unique_rc_arc",
16302 description: r##"# `unique_rc_arc`
16303
16304
16305
16306The tracking issue for this feature is: [#112566]
16307
16308[#112566]: https://github.com/rust-lang/rust/issues/112566
16309
16310------------------------
16311"##,
16312 default_severity: Severity::Allow,
16313 warn_since: None,
16314 deny_since: None,
16315 },
16316 Lint {
16317 label: "unix_file_vectored_at",
16318 description: r##"# `unix_file_vectored_at`
16319
16320
16321
16322The tracking issue for this feature is: [#89517]
16323
16324[#89517]: https://github.com/rust-lang/rust/issues/89517
16325
16326------------------------
16327"##,
16328 default_severity: Severity::Allow,
16329 warn_since: None,
16330 deny_since: None,
16331 },
16332 Lint {
16333 label: "unix_kill_process_group",
16334 description: r##"# `unix_kill_process_group`
16335
16336
16337
16338The tracking issue for this feature is: [#156537]
16339
16340[#156537]: https://github.com/rust-lang/rust/issues/156537
16341
16342------------------------
16343"##,
16344 default_severity: Severity::Allow,
16345 warn_since: None,
16346 deny_since: None,
16347 },
16348 Lint {
16349 label: "unix_mkfifo",
16350 description: r##"# `unix_mkfifo`
16351
16352
16353
16354The tracking issue for this feature is: [#139324]
16355
16356[#139324]: https://github.com/rust-lang/rust/issues/139324
16357
16358------------------------
16359"##,
16360 default_severity: Severity::Allow,
16361 warn_since: None,
16362 deny_since: None,
16363 },
16364 Lint {
16365 label: "unix_send_signal",
16366 description: r##"# `unix_send_signal`
16367
16368
16369
16370The tracking issue for this feature is: [#141975]
16371
16372[#141975]: https://github.com/rust-lang/rust/issues/141975
16373
16374------------------------
16375"##,
16376 default_severity: Severity::Allow,
16377 warn_since: None,
16378 deny_since: None,
16379 },
16380 Lint {
16381 label: "unix_set_mark",
16382 description: r##"# `unix_set_mark`
16383
16384
16385
16386The tracking issue for this feature is: [#96467]
16387
16388[#96467]: https://github.com/rust-lang/rust/issues/96467
16389
16390------------------------
16391"##,
16392 default_severity: Severity::Allow,
16393 warn_since: None,
16394 deny_since: None,
16395 },
16396 Lint {
16397 label: "unix_socket_ancillary_data",
16398 description: r##"# `unix_socket_ancillary_data`
16399
16400
16401
16402The tracking issue for this feature is: [#76915]
16403
16404[#76915]: https://github.com/rust-lang/rust/issues/76915
16405
16406------------------------
16407"##,
16408 default_severity: Severity::Allow,
16409 warn_since: None,
16410 deny_since: None,
16411 },
16412 Lint {
16413 label: "unix_socket_exclbind",
16414 description: r##"# `unix_socket_exclbind`
16415
16416
16417
16418The tracking issue for this feature is: [#123481]
16419
16420[#123481]: https://github.com/rust-lang/rust/issues/123481
16421
16422------------------------
16423"##,
16424 default_severity: Severity::Allow,
16425 warn_since: None,
16426 deny_since: None,
16427 },
16428 Lint {
16429 label: "unix_socket_peek",
16430 description: r##"# `unix_socket_peek`
16431
16432
16433
16434The tracking issue for this feature is: [#76923]
16435
16436[#76923]: https://github.com/rust-lang/rust/issues/76923
16437
16438------------------------
16439"##,
16440 default_severity: Severity::Allow,
16441 warn_since: None,
16442 deny_since: None,
16443 },
16444 Lint {
16445 label: "unnamed_enum_variants",
16446 description: r##"# `unnamed_enum_variants`
16447
16448Allows using `_ = <range-or-int>` enum variants.
16449
16450The tracking issue for this feature is: [#156628]
16451
16452[#156628]: https://github.com/rust-lang/rust/issues/156628
16453
16454------------------------
16455"##,
16456 default_severity: Severity::Allow,
16457 warn_since: None,
16458 deny_since: None,
16459 },
16460 Lint {
16461 label: "unqualified_local_imports",
16462 description: r##"# `unqualified_local_imports`
16463
16464Helps with formatting for `group_imports = "StdExternalCrate"`.
16465
16466The tracking issue for this feature is: [#138299]
16467
16468[#138299]: https://github.com/rust-lang/rust/issues/138299
16469
16470------------------------
16471"##,
16472 default_severity: Severity::Allow,
16473 warn_since: None,
16474 deny_since: None,
16475 },
16476 Lint {
16477 label: "unsafe_binders",
16478 description: r##"# `unsafe_binders`
16479
16480Allows using `unsafe<'a> &'a T` unsafe binder types.
16481
16482The tracking issue for this feature is: [#130516]
16483
16484[#130516]: https://github.com/rust-lang/rust/issues/130516
16485
16486------------------------
16487"##,
16488 default_severity: Severity::Allow,
16489 warn_since: None,
16490 deny_since: None,
16491 },
16492 Lint {
16493 label: "unsafe_cell_access",
16494 description: r##"# `unsafe_cell_access`
16495
16496
16497
16498The tracking issue for this feature is: [#136327]
16499
16500[#136327]: https://github.com/rust-lang/rust/issues/136327
16501
16502------------------------
16503"##,
16504 default_severity: Severity::Allow,
16505 warn_since: None,
16506 deny_since: None,
16507 },
16508 Lint {
16509 label: "unsafe_fields",
16510 description: r##"# `unsafe_fields`
16511
16512Allows declaring fields `unsafe`.
16513
16514The tracking issue for this feature is: [#132922]
16515
16516[#132922]: https://github.com/rust-lang/rust/issues/132922
16517
16518------------------------
16519"##,
16520 default_severity: Severity::Allow,
16521 warn_since: None,
16522 deny_since: None,
16523 },
16524 Lint {
16525 label: "unsafe_pinned",
16526 description: r##"# `unsafe_pinned`
16527
16528
16529
16530The tracking issue for this feature is: [#125735]
16531
16532[#125735]: https://github.com/rust-lang/rust/issues/125735
16533
16534------------------------
16535"##,
16536 default_severity: Severity::Allow,
16537 warn_since: None,
16538 deny_since: None,
16539 },
16540 Lint {
16541 label: "unsafe_unpin",
16542 description: r##"# `unsafe_unpin`
16543
16544
16545
16546The tracking issue for this feature is: [#125735]
16547
16548[#125735]: https://github.com/rust-lang/rust/issues/125735
16549
16550------------------------
16551"##,
16552 default_severity: Severity::Allow,
16553 warn_since: None,
16554 deny_since: None,
16555 },
16556 Lint {
16557 label: "unsize",
16558 description: r##"# `unsize`
16559
16560
16561
16562The tracking issue for this feature is: [#18598]
16563
16564[#18598]: https://github.com/rust-lang/rust/issues/18598
16565
16566------------------------
16567"##,
16568 default_severity: Severity::Allow,
16569 warn_since: None,
16570 deny_since: None,
16571 },
16572 Lint {
16573 label: "unsized_const_params",
16574 description: r##"# `unsized_const_params`
16575
16576Allows const generic parameters to be defined with types that are not `Sized`, e.g. `fn foo<const N: [u8]>() {`.
16577
16578The tracking issue for this feature is: [#95174]
16579
16580[#95174]: https://github.com/rust-lang/rust/issues/95174
16581
16582------------------------
16583"##,
16584 default_severity: Severity::Allow,
16585 warn_since: None,
16586 deny_since: None,
16587 },
16588 Lint {
16589 label: "unsized_fn_params",
16590 description: r##"# `unsized_fn_params`
16591
16592Allows unsized fn parameters.
16593
16594The tracking issue for this feature is: [#48055]
16595
16596[#48055]: https://github.com/rust-lang/rust/issues/48055
16597
16598------------------------
16599"##,
16600 default_severity: Severity::Allow,
16601 warn_since: None,
16602 deny_since: None,
16603 },
16604 Lint {
16605 label: "unwrap_infallible",
16606 description: r##"# `unwrap_infallible`
16607
16608
16609
16610The tracking issue for this feature is: [#61695]
16611
16612[#61695]: https://github.com/rust-lang/rust/issues/61695
16613
16614------------------------
16615"##,
16616 default_severity: Severity::Allow,
16617 warn_since: None,
16618 deny_since: None,
16619 },
16620 Lint {
16621 label: "update_panic_count",
16622 description: r##"# `update_panic_count`
16623
16624This feature is internal to the Rust compiler and is not intended for general use.
16625
16626------------------------
16627"##,
16628 default_severity: Severity::Allow,
16629 warn_since: None,
16630 deny_since: None,
16631 },
16632 Lint {
16633 label: "used_with_arg",
16634 description: r##"# `used_with_arg`
16635
16636Allows using the `#[used(linker)]` (or `#[used(compiler)]`) attribute.
16637
16638The tracking issue for this feature is: [#93798]
16639
16640[#93798]: https://github.com/rust-lang/rust/issues/93798
16641
16642------------------------
16643"##,
16644 default_severity: Severity::Allow,
16645 warn_since: None,
16646 deny_since: None,
16647 },
16648 Lint {
16649 label: "utf16_extra",
16650 description: r##"# `utf16_extra`
16651
16652
16653
16654The tracking issue for this feature is: [#94919]
16655
16656[#94919]: https://github.com/rust-lang/rust/issues/94919
16657
16658------------------------
16659"##,
16660 default_severity: Severity::Allow,
16661 warn_since: None,
16662 deny_since: None,
16663 },
16664 Lint {
16665 label: "variant_count",
16666 description: r##"# `variant_count`
16667
16668
16669
16670The tracking issue for this feature is: [#73662]
16671
16672[#73662]: https://github.com/rust-lang/rust/issues/73662
16673
16674------------------------
16675"##,
16676 default_severity: Severity::Allow,
16677 warn_since: None,
16678 deny_since: None,
16679 },
16680 Lint {
16681 label: "vec_deque_extract_if",
16682 description: r##"# `vec_deque_extract_if`
16683
16684
16685
16686The tracking issue for this feature is: [#147750]
16687
16688[#147750]: https://github.com/rust-lang/rust/issues/147750
16689
16690------------------------
16691"##,
16692 default_severity: Severity::Allow,
16693 warn_since: None,
16694 deny_since: None,
16695 },
16696 Lint {
16697 label: "vec_deque_iter_as_slices",
16698 description: r##"# `vec_deque_iter_as_slices`
16699
16700
16701
16702The tracking issue for this feature is: [#123947]
16703
16704[#123947]: https://github.com/rust-lang/rust/issues/123947
16705
16706------------------------
16707"##,
16708 default_severity: Severity::Allow,
16709 warn_since: None,
16710 deny_since: None,
16711 },
16712 Lint {
16713 label: "vec_deque_truncate_front",
16714 description: r##"# `vec_deque_truncate_front`
16715
16716
16717
16718The tracking issue for this feature is: [#140667]
16719
16720[#140667]: https://github.com/rust-lang/rust/issues/140667
16721
16722------------------------
16723"##,
16724 default_severity: Severity::Allow,
16725 warn_since: None,
16726 deny_since: None,
16727 },
16728 Lint {
16729 label: "vec_fallible_shrink",
16730 description: r##"# `vec_fallible_shrink`
16731
16732
16733
16734The tracking issue for this feature is: [#152350]
16735
16736[#152350]: https://github.com/rust-lang/rust/issues/152350
16737
16738------------------------
16739"##,
16740 default_severity: Severity::Allow,
16741 warn_since: None,
16742 deny_since: None,
16743 },
16744 Lint {
16745 label: "vec_from_fn",
16746 description: r##"# `vec_from_fn`
16747
16748
16749
16750The tracking issue for this feature is: [#149698]
16751
16752[#149698]: https://github.com/rust-lang/rust/issues/149698
16753
16754------------------------
16755"##,
16756 default_severity: Severity::Allow,
16757 warn_since: None,
16758 deny_since: None,
16759 },
16760 Lint {
16761 label: "vec_into_chunks",
16762 description: r##"# `vec_into_chunks`
16763
16764
16765
16766The tracking issue for this feature is: [#142137]
16767
16768[#142137]: https://github.com/rust-lang/rust/issues/142137
16769
16770------------------------
16771"##,
16772 default_severity: Severity::Allow,
16773 warn_since: None,
16774 deny_since: None,
16775 },
16776 Lint {
16777 label: "vec_peek_mut",
16778 description: r##"# `vec_peek_mut`
16779
16780
16781
16782The tracking issue for this feature is: [#122742]
16783
16784[#122742]: https://github.com/rust-lang/rust/issues/122742
16785
16786------------------------
16787"##,
16788 default_severity: Severity::Allow,
16789 warn_since: None,
16790 deny_since: None,
16791 },
16792 Lint {
16793 label: "vec_push_within_capacity",
16794 description: r##"# `vec_push_within_capacity`
16795
16796
16797
16798The tracking issue for this feature is: [#100486]
16799
16800[#100486]: https://github.com/rust-lang/rust/issues/100486
16801
16802------------------------
16803"##,
16804 default_severity: Severity::Allow,
16805 warn_since: None,
16806 deny_since: None,
16807 },
16808 Lint {
16809 label: "vec_recycle",
16810 description: r##"# `vec_recycle`
16811
16812
16813
16814The tracking issue for this feature is: [#148227]
16815
16816[#148227]: https://github.com/rust-lang/rust/issues/148227
16817
16818------------------------
16819"##,
16820 default_severity: Severity::Allow,
16821 warn_since: None,
16822 deny_since: None,
16823 },
16824 Lint {
16825 label: "vec_split_at_spare",
16826 description: r##"# `vec_split_at_spare`
16827
16828
16829
16830The tracking issue for this feature is: [#81944]
16831
16832[#81944]: https://github.com/rust-lang/rust/issues/81944
16833
16834------------------------
16835"##,
16836 default_severity: Severity::Allow,
16837 warn_since: None,
16838 deny_since: None,
16839 },
16840 Lint {
16841 label: "vec_try_remove",
16842 description: r##"# `vec_try_remove`
16843
16844
16845
16846The tracking issue for this feature is: [#146954]
16847
16848[#146954]: https://github.com/rust-lang/rust/issues/146954
16849
16850------------------------
16851"##,
16852 default_severity: Severity::Allow,
16853 warn_since: None,
16854 deny_since: None,
16855 },
16856 Lint {
16857 label: "view_types",
16858 description: r##"# `view_types`
16859
16860Allows view types.
16861
16862The tracking issue for this feature is: [#155938]
16863
16864[#155938]: https://github.com/rust-lang/rust/issues/155938
16865
16866------------------------
16867"##,
16868 default_severity: Severity::Allow,
16869 warn_since: None,
16870 deny_since: None,
16871 },
16872 Lint {
16873 label: "waker_fn",
16874 description: r##"# `waker_fn`
16875
16876
16877
16878The tracking issue for this feature is: [#149580]
16879
16880[#149580]: https://github.com/rust-lang/rust/issues/149580
16881
16882------------------------
16883"##,
16884 default_severity: Severity::Allow,
16885 warn_since: None,
16886 deny_since: None,
16887 },
16888 Lint {
16889 label: "waker_from_fn_ptr",
16890 description: r##"# `waker_from_fn_ptr`
16891
16892
16893
16894The tracking issue for this feature is: [#148457]
16895
16896[#148457]: https://github.com/rust-lang/rust/issues/148457
16897
16898------------------------
16899"##,
16900 default_severity: Severity::Allow,
16901 warn_since: None,
16902 deny_since: None,
16903 },
16904 Lint {
16905 label: "wasi_ext",
16906 description: r##"# `wasi_ext`
16907
16908
16909
16910The tracking issue for this feature is: [#71213]
16911
16912[#71213]: https://github.com/rust-lang/rust/issues/71213
16913
16914------------------------
16915"##,
16916 default_severity: Severity::Allow,
16917 warn_since: None,
16918 deny_since: None,
16919 },
16920 Lint {
16921 label: "wasm_target_feature",
16922 description: r##"# `wasm_target_feature`
16923
16924Target features on wasm.
16925
16926The tracking issue for this feature is: [#150260]
16927
16928[#150260]: https://github.com/rust-lang/rust/issues/150260
16929
16930------------------------
16931"##,
16932 default_severity: Severity::Allow,
16933 warn_since: None,
16934 deny_since: None,
16935 },
16936 Lint {
16937 label: "where_clause_attrs",
16938 description: r##"# `where_clause_attrs`
16939
16940Allows use of attributes in `where` clauses.
16941
16942The tracking issue for this feature is: [#115590]
16943
16944[#115590]: https://github.com/rust-lang/rust/issues/115590
16945
16946------------------------
16947"##,
16948 default_severity: Severity::Allow,
16949 warn_since: None,
16950 deny_since: None,
16951 },
16952 Lint {
16953 label: "widening_mul",
16954 description: r##"# `widening_mul`
16955
16956
16957
16958The tracking issue for this feature is: [#152016]
16959
16960[#152016]: https://github.com/rust-lang/rust/issues/152016
16961
16962------------------------
16963"##,
16964 default_severity: Severity::Allow,
16965 warn_since: None,
16966 deny_since: None,
16967 },
16968 Lint {
16969 label: "windows_by_handle",
16970 description: r##"# `windows_by_handle`
16971
16972
16973
16974The tracking issue for this feature is: [#63010]
16975
16976[#63010]: https://github.com/rust-lang/rust/issues/63010
16977
16978------------------------
16979"##,
16980 default_severity: Severity::Allow,
16981 warn_since: None,
16982 deny_since: None,
16983 },
16984 Lint {
16985 label: "windows_c",
16986 description: r##"# `windows_c`
16987
16988This feature is internal to the Rust compiler and is not intended for general use.
16989
16990------------------------
16991"##,
16992 default_severity: Severity::Allow,
16993 warn_since: None,
16994 deny_since: None,
16995 },
16996 Lint {
16997 label: "windows_change_time",
16998 description: r##"# `windows_change_time`
16999
17000
17001
17002The tracking issue for this feature is: [#121478]
17003
17004[#121478]: https://github.com/rust-lang/rust/issues/121478
17005
17006------------------------
17007"##,
17008 default_severity: Severity::Allow,
17009 warn_since: None,
17010 deny_since: None,
17011 },
17012 Lint {
17013 label: "windows_freeze_file_times",
17014 description: r##"# `windows_freeze_file_times`
17015
17016
17017
17018The tracking issue for this feature is: [#149715]
17019
17020[#149715]: https://github.com/rust-lang/rust/issues/149715
17021
17022------------------------
17023"##,
17024 default_severity: Severity::Allow,
17025 warn_since: None,
17026 deny_since: None,
17027 },
17028 Lint {
17029 label: "windows_handle",
17030 description: r##"# `windows_handle`
17031
17032This feature is internal to the Rust compiler and is not intended for general use.
17033
17034------------------------
17035"##,
17036 default_severity: Severity::Allow,
17037 warn_since: None,
17038 deny_since: None,
17039 },
17040 Lint {
17041 label: "windows_net",
17042 description: r##"# `windows_net`
17043
17044This feature is internal to the Rust compiler and is not intended for general use.
17045
17046------------------------
17047"##,
17048 default_severity: Severity::Allow,
17049 warn_since: None,
17050 deny_since: None,
17051 },
17052 Lint {
17053 label: "windows_permissions_ext",
17054 description: r##"# `windows_permissions_ext`
17055
17056
17057
17058The tracking issue for this feature is: [#152956]
17059
17060[#152956]: https://github.com/rust-lang/rust/issues/152956
17061
17062------------------------
17063"##,
17064 default_severity: Severity::Allow,
17065 warn_since: None,
17066 deny_since: None,
17067 },
17068 Lint {
17069 label: "windows_process_exit_code_from",
17070 description: r##"# `windows_process_exit_code_from`
17071
17072
17073
17074The tracking issue for this feature is: [#111688]
17075
17076[#111688]: https://github.com/rust-lang/rust/issues/111688
17077
17078------------------------
17079"##,
17080 default_severity: Severity::Allow,
17081 warn_since: None,
17082 deny_since: None,
17083 },
17084 Lint {
17085 label: "windows_process_extensions_async_pipes",
17086 description: r##"# `windows_process_extensions_async_pipes`
17087
17088
17089
17090The tracking issue for this feature is: [#98289]
17091
17092[#98289]: https://github.com/rust-lang/rust/issues/98289
17093
17094------------------------
17095"##,
17096 default_severity: Severity::Allow,
17097 warn_since: None,
17098 deny_since: None,
17099 },
17100 Lint {
17101 label: "windows_process_extensions_force_quotes",
17102 description: r##"# `windows_process_extensions_force_quotes`
17103
17104
17105
17106The tracking issue for this feature is: [#82227]
17107
17108[#82227]: https://github.com/rust-lang/rust/issues/82227
17109
17110------------------------
17111"##,
17112 default_severity: Severity::Allow,
17113 warn_since: None,
17114 deny_since: None,
17115 },
17116 Lint {
17117 label: "windows_process_extensions_inherit_handles",
17118 description: r##"# `windows_process_extensions_inherit_handles`
17119
17120
17121
17122The tracking issue for this feature is: [#146407]
17123
17124[#146407]: https://github.com/rust-lang/rust/issues/146407
17125
17126------------------------
17127"##,
17128 default_severity: Severity::Allow,
17129 warn_since: None,
17130 deny_since: None,
17131 },
17132 Lint {
17133 label: "windows_process_extensions_main_thread_handle",
17134 description: r##"# `windows_process_extensions_main_thread_handle`
17135
17136
17137
17138The tracking issue for this feature is: [#96723]
17139
17140[#96723]: https://github.com/rust-lang/rust/issues/96723
17141
17142------------------------
17143"##,
17144 default_severity: Severity::Allow,
17145 warn_since: None,
17146 deny_since: None,
17147 },
17148 Lint {
17149 label: "windows_process_extensions_raw_attribute",
17150 description: r##"# `windows_process_extensions_raw_attribute`
17151
17152
17153
17154The tracking issue for this feature is: [#114854]
17155
17156[#114854]: https://github.com/rust-lang/rust/issues/114854
17157
17158------------------------
17159"##,
17160 default_severity: Severity::Allow,
17161 warn_since: None,
17162 deny_since: None,
17163 },
17164 Lint {
17165 label: "windows_process_extensions_show_window",
17166 description: r##"# `windows_process_extensions_show_window`
17167
17168
17169
17170The tracking issue for this feature is: [#127544]
17171
17172[#127544]: https://github.com/rust-lang/rust/issues/127544
17173
17174------------------------
17175"##,
17176 default_severity: Severity::Allow,
17177 warn_since: None,
17178 deny_since: None,
17179 },
17180 Lint {
17181 label: "windows_process_extensions_startupinfo",
17182 description: r##"# `windows_process_extensions_startupinfo`
17183
17184
17185
17186The tracking issue for this feature is: [#141010]
17187
17188[#141010]: https://github.com/rust-lang/rust/issues/141010
17189
17190------------------------
17191"##,
17192 default_severity: Severity::Allow,
17193 warn_since: None,
17194 deny_since: None,
17195 },
17196 Lint {
17197 label: "windows_stdio",
17198 description: r##"# `windows_stdio`
17199
17200This feature is internal to the Rust compiler and is not intended for general use.
17201
17202------------------------
17203"##,
17204 default_severity: Severity::Allow,
17205 warn_since: None,
17206 deny_since: None,
17207 },
17208 Lint {
17209 label: "windows_unix_domain_sockets",
17210 description: r##"# `windows_unix_domain_sockets`
17211
17212
17213
17214The tracking issue for this feature is: [#150487]
17215
17216[#150487]: https://github.com/rust-lang/rust/issues/150487
17217
17218------------------------
17219"##,
17220 default_severity: Severity::Allow,
17221 warn_since: None,
17222 deny_since: None,
17223 },
17224 Lint {
17225 label: "with_negative_coherence",
17226 description: r##"# `with_negative_coherence`
17227
17228Use for stable + negative coherence and strict coherence depending on trait's rustc_strict_coherence value.
17229
17230This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
17231
17232------------------------
17233"##,
17234 default_severity: Severity::Allow,
17235 warn_since: None,
17236 deny_since: None,
17237 },
17238 Lint {
17239 label: "wrapping_int_impl",
17240 description: r##"# `wrapping_int_impl`
17241
17242
17243
17244The tracking issue for this feature is: [#32463]
17245
17246[#32463]: https://github.com/rust-lang/rust/issues/32463
17247
17248------------------------
17249"##,
17250 default_severity: Severity::Allow,
17251 warn_since: None,
17252 deny_since: None,
17253 },
17254 Lint {
17255 label: "wrapping_next_power_of_two",
17256 description: r##"# `wrapping_next_power_of_two`
17257
17258
17259
17260The tracking issue for this feature is: [#32463]
17261
17262[#32463]: https://github.com/rust-lang/rust/issues/32463
17263
17264------------------------
17265"##,
17266 default_severity: Severity::Allow,
17267 warn_since: None,
17268 deny_since: None,
17269 },
17270 Lint {
17271 label: "write_all_vectored",
17272 description: r##"# `write_all_vectored`
17273
17274
17275
17276The tracking issue for this feature is: [#70436]
17277
17278[#70436]: https://github.com/rust-lang/rust/issues/70436
17279
17280------------------------
17281"##,
17282 default_severity: Severity::Allow,
17283 warn_since: None,
17284 deny_since: None,
17285 },
17286 Lint {
17287 label: "wtf8_internals",
17288 description: r##"# `wtf8_internals`
17289
17290
17291
17292This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
17293
17294------------------------
17295"##,
17296 default_severity: Severity::Allow,
17297 warn_since: None,
17298 deny_since: None,
17299 },
17300 Lint {
17301 label: "x86_amx_intrinsics",
17302 description: r##"# `x86_amx_intrinsics`
17303
17304Allows use of x86 `AMX` target-feature attributes and intrinsics
17305
17306The tracking issue for this feature is: [#126622]
17307
17308[#126622]: https://github.com/rust-lang/rust/issues/126622
17309
17310------------------------
17311"##,
17312 default_severity: Severity::Allow,
17313 warn_since: None,
17314 deny_since: None,
17315 },
17316 Lint {
17317 label: "x87_target_feature",
17318 description: r##"# `x87_target_feature`
17319
17320The x87 target feature on x86.
17321
17322The tracking issue for this feature is: [#150261]
17323
17324[#150261]: https://github.com/rust-lang/rust/issues/150261
17325
17326------------------------
17327"##,
17328 default_severity: Severity::Allow,
17329 warn_since: None,
17330 deny_since: None,
17331 },
17332 Lint {
17333 label: "xop_target_feature",
17334 description: r##"# `xop_target_feature`
17335
17336Allows use of the `xop` target-feature
17337
17338The tracking issue for this feature is: [#127208]
17339
17340[#127208]: https://github.com/rust-lang/rust/issues/127208
17341
17342------------------------
17343"##,
17344 default_severity: Severity::Allow,
17345 warn_since: None,
17346 deny_since: None,
17347 },
17348 Lint {
17349 label: "yeet_desugar_details",
17350 description: r##"# `yeet_desugar_details`
17351
17352
17353
17354This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
17355
17356------------------------
17357"##,
17358 default_severity: Severity::Allow,
17359 warn_since: None,
17360 deny_since: None,
17361 },
17362 Lint {
17363 label: "yeet_expr",
17364 description: r##"# `yeet_expr`
17365
17366The tracking issue for this feature is: [#96373]
17367
17368[#96373]: https://github.com/rust-lang/rust/issues/96373
17369
17370------------------------
17371
17372The `yeet_expr` feature adds support for `do yeet` expressions,
17373which can be used to early-exit from a function or `try` block.
17374
17375These are highly experimental, thus the placeholder syntax.
17376
17377```rust,edition2021
17378#![feature(yeet_expr)]
17379
17380fn foo() -> Result<String, i32> {
17381 do yeet 4;
17382}
17383assert_eq!(foo(), Err(4));
17384
17385fn bar() -> Option<String> {
17386 do yeet;
17387}
17388assert_eq!(bar(), None);
17389```
17390"##,
17391 default_severity: Severity::Allow,
17392 warn_since: None,
17393 deny_since: None,
17394 },
17395 Lint {
17396 label: "yield_expr",
17397 description: r##"# `yield_expr`
17398
17399
17400
17401The tracking issue for this feature is: [#43122]
17402
17403[#43122]: https://github.com/rust-lang/rust/issues/43122
17404
17405------------------------
17406"##,
17407 default_severity: Severity::Allow,
17408 warn_since: None,
17409 deny_since: None,
17410 },
17411];
17412
17413pub const CLIPPY_LINTS: &[Lint] = &[
17414 Lint {
17415 label: "clippy::absolute_paths",
17416 description: r##"Checks for usage of items through absolute paths, like `std::env::current_dir`."##,
17417 default_severity: Severity::Allow,
17418 warn_since: None,
17419 deny_since: None,
17420 },
17421 Lint {
17422 label: "clippy::absurd_extreme_comparisons",
17423 description: r##"Checks for comparisons where one side of the relation is
17424either the minimum or maximum value for its type and warns if it involves a
17425case that is always true or always false. Only integer and boolean types are
17426checked."##,
17427 default_severity: Severity::Allow,
17428 warn_since: None,
17429 deny_since: None,
17430 },
17431 Lint {
17432 label: "clippy::alloc_instead_of_core",
17433 description: r##"Finds items imported through `alloc` when available through `core`."##,
17434 default_severity: Severity::Allow,
17435 warn_since: None,
17436 deny_since: None,
17437 },
17438 Lint {
17439 label: "clippy::allow_attributes",
17440 description: r##"Checks for usage of the `#[allow]` attribute and suggests replacing it with
17441the `#[expect]` (See [RFC 2383](https://rust-lang.github.io/rfcs/2383-lint-reasons.html))
17442
17443This lint only warns outer attributes (`#[allow]`), as inner attributes
17444(`#![allow]`) are usually used to enable or disable lints on a global scale."##,
17445 default_severity: Severity::Allow,
17446 warn_since: None,
17447 deny_since: None,
17448 },
17449 Lint {
17450 label: "clippy::allow_attributes_without_reason",
17451 description: r##"Checks for attributes that allow lints without a reason."##,
17452 default_severity: Severity::Allow,
17453 warn_since: None,
17454 deny_since: None,
17455 },
17456 Lint {
17457 label: "clippy::almost_complete_range",
17458 description: r##"Checks for ranges which almost include the entire range of letters from 'a' to 'z'
17459or digits from '0' to '9', but don't because they're a half open range."##,
17460 default_severity: Severity::Allow,
17461 warn_since: None,
17462 deny_since: None,
17463 },
17464 Lint {
17465 label: "clippy::almost_swapped",
17466 description: r##"Checks for `foo = bar; bar = foo` sequences."##,
17467 default_severity: Severity::Allow,
17468 warn_since: None,
17469 deny_since: None,
17470 },
17471 Lint {
17472 label: "clippy::approx_constant",
17473 description: r##"Checks for floating point literals that approximate
17474constants which are defined in
17475[`std::f32::consts`](https://doc.rust-lang.org/stable/std/f32/consts/#constants)
17476or
17477[`std::f64::consts`](https://doc.rust-lang.org/stable/std/f64/consts/#constants),
17478respectively, suggesting to use the predefined constant."##,
17479 default_severity: Severity::Allow,
17480 warn_since: None,
17481 deny_since: None,
17482 },
17483 Lint {
17484 label: "clippy::arc_with_non_send_sync",
17485 description: r##".
17486This lint warns when you use `Arc` with a type that does not implement `Send` or `Sync`."##,
17487 default_severity: Severity::Allow,
17488 warn_since: None,
17489 deny_since: None,
17490 },
17491 Lint {
17492 label: "clippy::arithmetic_side_effects",
17493 description: r##"Checks any kind of arithmetic operation of any type.
17494
17495Operators like `+`, `-`, `*` or `<<` are usually capable of overflowing according to the [Rust
17496Reference](https://doc.rust-lang.org/reference/expressions/operator-expr.html#overflow),
17497or can panic (`/`, `%`).
17498
17499Known safe built-in types like `Wrapping` or `Saturating`, floats, operations in constant
17500environments, allowed types and non-constant operations that won't overflow are ignored."##,
17501 default_severity: Severity::Allow,
17502 warn_since: None,
17503 deny_since: None,
17504 },
17505 Lint {
17506 label: "clippy::as_conversions",
17507 description: r##"Checks for usage of `as` conversions.
17508
17509Note that this lint is specialized in linting *every single* use of `as`
17510regardless of whether good alternatives exist or not.
17511If you want more precise lints for `as`, please consider using these separate lints:
17512`unnecessary_cast`, `cast_lossless/cast_possible_truncation/cast_possible_wrap/cast_precision_loss/cast_sign_loss`,
17513`fn_to_numeric_cast(_with_truncation)`, `char_lit_as_u8`, `ref_to_mut` and `ptr_as_ptr`.
17514There is a good explanation the reason why this lint should work in this way and how it is useful
17515[in this issue](https://github.com/rust-lang/rust-clippy/issues/5122)."##,
17516 default_severity: Severity::Allow,
17517 warn_since: None,
17518 deny_since: None,
17519 },
17520 Lint {
17521 label: "clippy::as_ptr_cast_mut",
17522 description: r##"Checks for the result of a `&self`-taking `as_ptr` being cast to a mutable pointer."##,
17523 default_severity: Severity::Allow,
17524 warn_since: None,
17525 deny_since: None,
17526 },
17527 Lint {
17528 label: "clippy::as_underscore",
17529 description: r##"Checks for the usage of `as _` conversion using inferred type."##,
17530 default_severity: Severity::Allow,
17531 warn_since: None,
17532 deny_since: None,
17533 },
17534 Lint {
17535 label: "clippy::assertions_on_constants",
17536 description: r##"Checks for `assert!(true)` and `assert!(false)` calls."##,
17537 default_severity: Severity::Allow,
17538 warn_since: None,
17539 deny_since: None,
17540 },
17541 Lint {
17542 label: "clippy::assertions_on_result_states",
17543 description: r##"Checks for `assert!(r.is_ok())` or `assert!(r.is_err())` calls."##,
17544 default_severity: Severity::Allow,
17545 warn_since: None,
17546 deny_since: None,
17547 },
17548 Lint {
17549 label: "clippy::assign_op_pattern",
17550 description: r##"Checks for `a = a op b` or `a = b commutative_op a`
17551patterns."##,
17552 default_severity: Severity::Allow,
17553 warn_since: None,
17554 deny_since: None,
17555 },
17556 Lint {
17557 label: "clippy::assign_ops",
17558 description: r##"Nothing. This lint has been deprecated"##,
17559 default_severity: Severity::Allow,
17560 warn_since: None,
17561 deny_since: None,
17562 },
17563 Lint {
17564 label: "clippy::assigning_clones",
17565 description: r##"Checks for code like `foo = bar.clone();`"##,
17566 default_severity: Severity::Allow,
17567 warn_since: None,
17568 deny_since: None,
17569 },
17570 Lint {
17571 label: "clippy::async_yields_async",
17572 description: r##"Checks for async blocks that yield values of types
17573that can themselves be awaited."##,
17574 default_severity: Severity::Allow,
17575 warn_since: None,
17576 deny_since: None,
17577 },
17578 Lint {
17579 label: "clippy::await_holding_invalid_type",
17580 description: r##"Allows users to configure types which should not be held across await
17581suspension points."##,
17582 default_severity: Severity::Allow,
17583 warn_since: None,
17584 deny_since: None,
17585 },
17586 Lint {
17587 label: "clippy::await_holding_lock",
17588 description: r##"Checks for calls to `await` while holding a non-async-aware
17589`MutexGuard`."##,
17590 default_severity: Severity::Allow,
17591 warn_since: None,
17592 deny_since: None,
17593 },
17594 Lint {
17595 label: "clippy::await_holding_refcell_ref",
17596 description: r##"Checks for calls to `await` while holding a `RefCell`, `Ref`, or `RefMut`."##,
17597 default_severity: Severity::Allow,
17598 warn_since: None,
17599 deny_since: None,
17600 },
17601 Lint {
17602 label: "clippy::bad_bit_mask",
17603 description: r##"Checks for incompatible bit masks in comparisons.
17604
17605The formula for detecting if an expression of the type `_ <bit_op> m
17606<cmp_op> c` (where `<bit_op>` is one of {`&`, `|`} and `<cmp_op>` is one of
17607{`!=`, `>=`, `>`, `!=`, `>=`, `>`}) can be determined from the following
17608table:
17609
17610|Comparison |Bit Op|Example |is always|Formula |
17611|------------|------|-------------|---------|----------------------|
17612|`==` or `!=`| `&` |`x & 2 == 3` |`false` |`c & m != c` |
17613|`<` or `>=`| `&` |`x & 2 < 3` |`true` |`m < c` |
17614|`>` or `<=`| `&` |`x & 1 > 1` |`false` |`m <= c` |
17615|`==` or `!=`| `\\|` |`x \\| 1 == 0`|`false` |`c \\| m != c` |
17616|`<` or `>=`| `\\|` |`x \\| 1 < 1` |`false` |`m >= c` |
17617|`<=` or `>` | `\\|` |`x \\| 1 > 0` |`true` |`m > c` |"##,
17618 default_severity: Severity::Allow,
17619 warn_since: None,
17620 deny_since: None,
17621 },
17622 Lint {
17623 label: "clippy::big_endian_bytes",
17624 description: r##"Checks for the usage of the `to_be_bytes` method and/or the function `from_be_bytes`."##,
17625 default_severity: Severity::Allow,
17626 warn_since: None,
17627 deny_since: None,
17628 },
17629 Lint {
17630 label: "clippy::bind_instead_of_map",
17631 description: r##"Checks for usage of `_.and_then(|x| Some(y))`, `_.and_then(|x| Ok(y))`
17632or `_.or_else(|x| Err(y))`."##,
17633 default_severity: Severity::Allow,
17634 warn_since: None,
17635 deny_since: None,
17636 },
17637 Lint {
17638 label: "clippy::blanket_clippy_restriction_lints",
17639 description: r##"Checks for `warn`/`deny`/`forbid` attributes targeting the whole clippy::restriction category."##,
17640 default_severity: Severity::Allow,
17641 warn_since: None,
17642 deny_since: None,
17643 },
17644 Lint {
17645 label: "clippy::blocks_in_conditions",
17646 description: r##"Checks for `if` and `match` conditions that use blocks containing an
17647expression, statements or conditions that use closures with blocks."##,
17648 default_severity: Severity::Allow,
17649 warn_since: None,
17650 deny_since: None,
17651 },
17652 Lint {
17653 label: "clippy::bool_assert_comparison",
17654 description: r##"This lint warns about boolean comparisons in assert-like macros."##,
17655 default_severity: Severity::Allow,
17656 warn_since: None,
17657 deny_since: None,
17658 },
17659 Lint {
17660 label: "clippy::bool_comparison",
17661 description: r##"Checks for expressions of the form `x == true`,
17662`x != true` and order comparisons such as `x < true` (or vice versa) and
17663suggest using the variable directly."##,
17664 default_severity: Severity::Allow,
17665 warn_since: None,
17666 deny_since: None,
17667 },
17668 Lint {
17669 label: "clippy::bool_to_int_with_if",
17670 description: r##"Instead of using an if statement to convert a bool to an int,
17671this lint suggests using a `from()` function or an `as` coercion."##,
17672 default_severity: Severity::Allow,
17673 warn_since: None,
17674 deny_since: None,
17675 },
17676 Lint {
17677 label: "clippy::borrow_as_ptr",
17678 description: r##"Checks for the usage of `&expr as *const T` or
17679`&mut expr as *mut T`, and suggest using `ptr::addr_of` or
17680`ptr::addr_of_mut` instead."##,
17681 default_severity: Severity::Allow,
17682 warn_since: None,
17683 deny_since: None,
17684 },
17685 Lint {
17686 label: "clippy::borrow_deref_ref",
17687 description: r##"Checks for `&*(&T)`."##,
17688 default_severity: Severity::Allow,
17689 warn_since: None,
17690 deny_since: None,
17691 },
17692 Lint {
17693 label: "clippy::borrow_interior_mutable_const",
17694 description: r##"Checks if `const` items which is interior mutable (e.g.,
17695contains a `Cell`, `Mutex`, `AtomicXxxx`, etc.) has been borrowed directly."##,
17696 default_severity: Severity::Allow,
17697 warn_since: None,
17698 deny_since: None,
17699 },
17700 Lint {
17701 label: "clippy::borrowed_box",
17702 description: r##"Checks for usage of `&Box<T>` anywhere in the code.
17703Check the [Box documentation](https://doc.rust-lang.org/std/boxed/index.html) for more information."##,
17704 default_severity: Severity::Allow,
17705 warn_since: None,
17706 deny_since: None,
17707 },
17708 Lint {
17709 label: "clippy::box_collection",
17710 description: r##"Checks for usage of `Box<T>` where T is a collection such as Vec anywhere in the code.
17711Check the [Box documentation](https://doc.rust-lang.org/std/boxed/index.html) for more information."##,
17712 default_severity: Severity::Allow,
17713 warn_since: None,
17714 deny_since: None,
17715 },
17716 Lint {
17717 label: "clippy::box_default",
17718 description: r##"checks for `Box::new(Default::default())`, which can be written as
17719`Box::default()`."##,
17720 default_severity: Severity::Allow,
17721 warn_since: None,
17722 deny_since: None,
17723 },
17724 Lint {
17725 label: "clippy::boxed_local",
17726 description: r##"Checks for usage of `Box<T>` where an unboxed `T` would
17727work fine."##,
17728 default_severity: Severity::Allow,
17729 warn_since: None,
17730 deny_since: None,
17731 },
17732 Lint {
17733 label: "clippy::branches_sharing_code",
17734 description: r##"Checks if the `if` and `else` block contain shared code that can be
17735moved out of the blocks."##,
17736 default_severity: Severity::Allow,
17737 warn_since: None,
17738 deny_since: None,
17739 },
17740 Lint {
17741 label: "clippy::builtin_type_shadow",
17742 description: r##"Warns if a generic shadows a built-in type."##,
17743 default_severity: Severity::Allow,
17744 warn_since: None,
17745 deny_since: None,
17746 },
17747 Lint {
17748 label: "clippy::byte_char_slices",
17749 description: r##"Checks for hard to read slices of byte characters, that could be more easily expressed as a
17750byte string."##,
17751 default_severity: Severity::Allow,
17752 warn_since: None,
17753 deny_since: None,
17754 },
17755 Lint {
17756 label: "clippy::bytes_count_to_len",
17757 description: r##"It checks for `str::bytes().count()` and suggests replacing it with
17758`str::len()`."##,
17759 default_severity: Severity::Allow,
17760 warn_since: None,
17761 deny_since: None,
17762 },
17763 Lint {
17764 label: "clippy::bytes_nth",
17765 description: r##"Checks for the use of `.bytes().nth()`."##,
17766 default_severity: Severity::Allow,
17767 warn_since: None,
17768 deny_since: None,
17769 },
17770 Lint {
17771 label: "clippy::cargo_common_metadata",
17772 description: r##"Checks to see if all common metadata is defined in
17773`Cargo.toml`. See: https://rust-lang-nursery.github.io/api-guidelines/documentation.html#cargotoml-includes-all-common-metadata-c-metadata"##,
17774 default_severity: Severity::Allow,
17775 warn_since: None,
17776 deny_since: None,
17777 },
17778 Lint {
17779 label: "clippy::case_sensitive_file_extension_comparisons",
17780 description: r##"Checks for calls to `ends_with` with possible file extensions
17781and suggests to use a case-insensitive approach instead."##,
17782 default_severity: Severity::Allow,
17783 warn_since: None,
17784 deny_since: None,
17785 },
17786 Lint {
17787 label: "clippy::cast_abs_to_unsigned",
17788 description: r##"Checks for usage of the `abs()` method that cast the result to unsigned."##,
17789 default_severity: Severity::Allow,
17790 warn_since: None,
17791 deny_since: None,
17792 },
17793 Lint {
17794 label: "clippy::cast_enum_constructor",
17795 description: r##"Checks for casts from an enum tuple constructor to an integer."##,
17796 default_severity: Severity::Allow,
17797 warn_since: None,
17798 deny_since: None,
17799 },
17800 Lint {
17801 label: "clippy::cast_enum_truncation",
17802 description: r##"Checks for casts from an enum type to an integral type that will definitely truncate the
17803value."##,
17804 default_severity: Severity::Allow,
17805 warn_since: None,
17806 deny_since: None,
17807 },
17808 Lint {
17809 label: "clippy::cast_lossless",
17810 description: r##"Checks for casts between numeric types that can be replaced by safe
17811conversion functions."##,
17812 default_severity: Severity::Allow,
17813 warn_since: None,
17814 deny_since: None,
17815 },
17816 Lint {
17817 label: "clippy::cast_nan_to_int",
17818 description: r##"Checks for a known NaN float being cast to an integer"##,
17819 default_severity: Severity::Allow,
17820 warn_since: None,
17821 deny_since: None,
17822 },
17823 Lint {
17824 label: "clippy::cast_possible_truncation",
17825 description: r##"Checks for casts between numeric types that may
17826truncate large values. This is expected behavior, so the cast is `Allow` by
17827default. It suggests user either explicitly ignore the lint,
17828or use `try_from()` and handle the truncation, default, or panic explicitly."##,
17829 default_severity: Severity::Allow,
17830 warn_since: None,
17831 deny_since: None,
17832 },
17833 Lint {
17834 label: "clippy::cast_possible_wrap",
17835 description: r##"Checks for casts from an unsigned type to a signed type of
17836the same size, or possibly smaller due to target-dependent integers.
17837Performing such a cast is a no-op for the compiler (that is, nothing is
17838changed at the bit level), and the binary representation of the value is
17839reinterpreted. This can cause wrapping if the value is too big
17840for the target signed type. However, the cast works as defined, so this lint
17841is `Allow` by default."##,
17842 default_severity: Severity::Allow,
17843 warn_since: None,
17844 deny_since: None,
17845 },
17846 Lint {
17847 label: "clippy::cast_precision_loss",
17848 description: r##"Checks for casts from any numeric type to a float type where
17849the receiving type cannot store all values from the original type without
17850rounding errors. This possible rounding is to be expected, so this lint is
17851`Allow` by default.
17852
17853Basically, this warns on casting any integer with 32 or more bits to `f32`
17854or any 64-bit integer to `f64`."##,
17855 default_severity: Severity::Allow,
17856 warn_since: None,
17857 deny_since: None,
17858 },
17859 Lint {
17860 label: "clippy::cast_ptr_alignment",
17861 description: r##"Checks for casts, using `as` or `pointer::cast`, from a
17862less strictly aligned pointer to a more strictly aligned pointer."##,
17863 default_severity: Severity::Allow,
17864 warn_since: None,
17865 deny_since: None,
17866 },
17867 Lint {
17868 label: "clippy::cast_sign_loss",
17869 description: r##"Checks for casts from a signed to an unsigned numeric
17870type. In this case, negative values wrap around to large positive values,
17871which can be quite surprising in practice. However, since the cast works as
17872defined, this lint is `Allow` by default."##,
17873 default_severity: Severity::Allow,
17874 warn_since: None,
17875 deny_since: None,
17876 },
17877 Lint {
17878 label: "clippy::cast_slice_different_sizes",
17879 description: r##"Checks for `as` casts between raw pointers to slices with differently sized elements."##,
17880 default_severity: Severity::Allow,
17881 warn_since: None,
17882 deny_since: None,
17883 },
17884 Lint {
17885 label: "clippy::cast_slice_from_raw_parts",
17886 description: r##"Checks for a raw slice being cast to a slice pointer"##,
17887 default_severity: Severity::Allow,
17888 warn_since: None,
17889 deny_since: None,
17890 },
17891 Lint {
17892 label: "clippy::cfg_not_test",
17893 description: r##"Checks for usage of `cfg` that excludes code from `test` builds. (i.e., `#[cfg(not(test))]`)"##,
17894 default_severity: Severity::Allow,
17895 warn_since: None,
17896 deny_since: None,
17897 },
17898 Lint {
17899 label: "clippy::char_lit_as_u8",
17900 description: r##"Checks for expressions where a character literal is cast
17901to `u8` and suggests using a byte literal instead."##,
17902 default_severity: Severity::Allow,
17903 warn_since: None,
17904 deny_since: None,
17905 },
17906 Lint {
17907 label: "clippy::chars_last_cmp",
17908 description: r##"Checks for usage of `_.chars().last()` or
17909`_.chars().next_back()` on a `str` to check if it ends with a given char."##,
17910 default_severity: Severity::Allow,
17911 warn_since: None,
17912 deny_since: None,
17913 },
17914 Lint {
17915 label: "clippy::chars_next_cmp",
17916 description: r##"Checks for usage of `.chars().next()` on a `str` to check
17917if it starts with a given char."##,
17918 default_severity: Severity::Allow,
17919 warn_since: None,
17920 deny_since: None,
17921 },
17922 Lint {
17923 label: "clippy::checked_conversions",
17924 description: r##"Checks for explicit bounds checking when casting."##,
17925 default_severity: Severity::Allow,
17926 warn_since: None,
17927 deny_since: None,
17928 },
17929 Lint {
17930 label: "clippy::clear_with_drain",
17931 description: r##"Checks for usage of `.drain(..)` for the sole purpose of clearing a container."##,
17932 default_severity: Severity::Allow,
17933 warn_since: None,
17934 deny_since: None,
17935 },
17936 Lint {
17937 label: "clippy::clone_on_copy",
17938 description: r##"Checks for usage of `.clone()` on a `Copy` type."##,
17939 default_severity: Severity::Allow,
17940 warn_since: None,
17941 deny_since: None,
17942 },
17943 Lint {
17944 label: "clippy::clone_on_ref_ptr",
17945 description: r##"Checks for usage of `.clone()` on a ref-counted pointer,
17946(`Rc`, `Arc`, `rc::Weak`, or `sync::Weak`), and suggests calling Clone via unified
17947function syntax instead (e.g., `Rc::clone(foo)`)."##,
17948 default_severity: Severity::Allow,
17949 warn_since: None,
17950 deny_since: None,
17951 },
17952 Lint {
17953 label: "clippy::cloned_instead_of_copied",
17954 description: r##"Checks for usage of `cloned()` on an `Iterator` or `Option` where
17955`copied()` could be used instead."##,
17956 default_severity: Severity::Allow,
17957 warn_since: None,
17958 deny_since: None,
17959 },
17960 Lint {
17961 label: "clippy::cmp_null",
17962 description: r##"This lint checks for equality comparisons with `ptr::null`"##,
17963 default_severity: Severity::Allow,
17964 warn_since: None,
17965 deny_since: None,
17966 },
17967 Lint {
17968 label: "clippy::cmp_owned",
17969 description: r##"Checks for conversions to owned values just for the sake
17970of a comparison."##,
17971 default_severity: Severity::Allow,
17972 warn_since: None,
17973 deny_since: None,
17974 },
17975 Lint {
17976 label: "clippy::cognitive_complexity",
17977 description: r##"Checks for methods with high cognitive complexity."##,
17978 default_severity: Severity::Allow,
17979 warn_since: None,
17980 deny_since: None,
17981 },
17982 Lint {
17983 label: "clippy::collapsible_else_if",
17984 description: r##"Checks for collapsible `else { if ... }` expressions
17985that can be collapsed to `else if ...`."##,
17986 default_severity: Severity::Allow,
17987 warn_since: None,
17988 deny_since: None,
17989 },
17990 Lint {
17991 label: "clippy::collapsible_if",
17992 description: r##"Checks for nested `if` statements which can be collapsed
17993by `&&`-combining their conditions."##,
17994 default_severity: Severity::Allow,
17995 warn_since: None,
17996 deny_since: None,
17997 },
17998 Lint {
17999 label: "clippy::collapsible_match",
18000 description: r##"Finds nested `match` or `if let` expressions where the patterns may be collapsed together
18001without adding any branches.
18002
18003Note that this lint is not intended to find _all_ cases where nested match patterns can be merged, but only
18004cases where merging would most likely make the code more readable."##,
18005 default_severity: Severity::Allow,
18006 warn_since: None,
18007 deny_since: None,
18008 },
18009 Lint {
18010 label: "clippy::collapsible_str_replace",
18011 description: r##"Checks for consecutive calls to `str::replace` (2 or more)
18012that can be collapsed into a single call."##,
18013 default_severity: Severity::Allow,
18014 warn_since: None,
18015 deny_since: None,
18016 },
18017 Lint {
18018 label: "clippy::collection_is_never_read",
18019 description: r##"Checks for collections that are never queried."##,
18020 default_severity: Severity::Allow,
18021 warn_since: None,
18022 deny_since: None,
18023 },
18024 Lint {
18025 label: "clippy::comparison_chain",
18026 description: r##"Checks comparison chains written with `if` that can be
18027rewritten with `match` and `cmp`."##,
18028 default_severity: Severity::Allow,
18029 warn_since: None,
18030 deny_since: None,
18031 },
18032 Lint {
18033 label: "clippy::comparison_to_empty",
18034 description: r##"Checks for comparing to an empty slice such as `` or `[]`,
18035and suggests using `.is_empty()` where applicable."##,
18036 default_severity: Severity::Allow,
18037 warn_since: None,
18038 deny_since: None,
18039 },
18040 Lint {
18041 label: "clippy::const_is_empty",
18042 description: r##"It identifies calls to `.is_empty()` on constant values."##,
18043 default_severity: Severity::Allow,
18044 warn_since: None,
18045 deny_since: None,
18046 },
18047 Lint {
18048 label: "clippy::copy_iterator",
18049 description: r##"Checks for types that implement `Copy` as well as
18050`Iterator`."##,
18051 default_severity: Severity::Allow,
18052 warn_since: None,
18053 deny_since: None,
18054 },
18055 Lint {
18056 label: "clippy::crate_in_macro_def",
18057 description: r##"Checks for usage of `crate` as opposed to `$crate` in a macro definition."##,
18058 default_severity: Severity::Allow,
18059 warn_since: None,
18060 deny_since: None,
18061 },
18062 Lint {
18063 label: "clippy::create_dir",
18064 description: r##"Checks usage of `std::fs::create_dir` and suggest using `std::fs::create_dir_all` instead."##,
18065 default_severity: Severity::Allow,
18066 warn_since: None,
18067 deny_since: None,
18068 },
18069 Lint {
18070 label: "clippy::crosspointer_transmute",
18071 description: r##"Checks for transmutes between a type `T` and `*T`."##,
18072 default_severity: Severity::Allow,
18073 warn_since: None,
18074 deny_since: None,
18075 },
18076 Lint {
18077 label: "clippy::dbg_macro",
18078 description: r##"Checks for usage of the [`dbg!`](https://doc.rust-lang.org/std/macro.dbg.html) macro."##,
18079 default_severity: Severity::Allow,
18080 warn_since: None,
18081 deny_since: None,
18082 },
18083 Lint {
18084 label: "clippy::debug_assert_with_mut_call",
18085 description: r##"Checks for function/method calls with a mutable
18086parameter in `debug_assert!`, `debug_assert_eq!` and `debug_assert_ne!` macros."##,
18087 default_severity: Severity::Allow,
18088 warn_since: None,
18089 deny_since: None,
18090 },
18091 Lint {
18092 label: "clippy::decimal_literal_representation",
18093 description: r##"Warns if there is a better representation for a numeric literal."##,
18094 default_severity: Severity::Allow,
18095 warn_since: None,
18096 deny_since: None,
18097 },
18098 Lint {
18099 label: "clippy::declare_interior_mutable_const",
18100 description: r##"Checks for declaration of `const` items which is interior
18101mutable (e.g., contains a `Cell`, `Mutex`, `AtomicXxxx`, etc.)."##,
18102 default_severity: Severity::Allow,
18103 warn_since: None,
18104 deny_since: None,
18105 },
18106 Lint {
18107 label: "clippy::default_constructed_unit_structs",
18108 description: r##"Checks for construction on unit struct using `default`."##,
18109 default_severity: Severity::Allow,
18110 warn_since: None,
18111 deny_since: None,
18112 },
18113 Lint {
18114 label: "clippy::default_instead_of_iter_empty",
18115 description: r##"It checks for `std::iter::Empty::default()` and suggests replacing it with
18116`std::iter::empty()`."##,
18117 default_severity: Severity::Allow,
18118 warn_since: None,
18119 deny_since: None,
18120 },
18121 Lint {
18122 label: "clippy::default_numeric_fallback",
18123 description: r##"Checks for usage of unconstrained numeric literals which may cause default numeric fallback in type
18124inference.
18125
18126Default numeric fallback means that if numeric types have not yet been bound to concrete
18127types at the end of type inference, then integer type is bound to `i32`, and similarly
18128floating type is bound to `f64`.
18129
18130See [RFC0212](https://github.com/rust-lang/rfcs/blob/master/text/0212-restore-int-fallback.md) for more information about the fallback."##,
18131 default_severity: Severity::Allow,
18132 warn_since: None,
18133 deny_since: None,
18134 },
18135 Lint {
18136 label: "clippy::default_trait_access",
18137 description: r##"Checks for literal calls to `Default::default()`."##,
18138 default_severity: Severity::Allow,
18139 warn_since: None,
18140 deny_since: None,
18141 },
18142 Lint {
18143 label: "clippy::default_union_representation",
18144 description: r##"Displays a warning when a union is declared with the default representation (without a `#[repr(C)]` attribute)."##,
18145 default_severity: Severity::Allow,
18146 warn_since: None,
18147 deny_since: None,
18148 },
18149 Lint {
18150 label: "clippy::deprecated_cfg_attr",
18151 description: r##"Checks for `#[cfg_attr(rustfmt, rustfmt_skip)]` and suggests to replace it
18152with `#[rustfmt::skip]`."##,
18153 default_severity: Severity::Allow,
18154 warn_since: None,
18155 deny_since: None,
18156 },
18157 Lint {
18158 label: "clippy::deprecated_clippy_cfg_attr",
18159 description: r##"Checks for `#[cfg_attr(feature = cargo-clippy, ...)]` and for
18160`#[cfg(feature = cargo-clippy)]` and suggests to replace it with
18161`#[cfg_attr(clippy, ...)]` or `#[cfg(clippy)]`."##,
18162 default_severity: Severity::Allow,
18163 warn_since: None,
18164 deny_since: None,
18165 },
18166 Lint {
18167 label: "clippy::deprecated_semver",
18168 description: r##"Checks for `#[deprecated]` annotations with a `since`
18169field that is not a valid semantic version. Also allows TBD to signal
18170future deprecation."##,
18171 default_severity: Severity::Allow,
18172 warn_since: None,
18173 deny_since: None,
18174 },
18175 Lint {
18176 label: "clippy::deref_addrof",
18177 description: r##"Checks for usage of `*&` and `*&mut` in expressions."##,
18178 default_severity: Severity::Allow,
18179 warn_since: None,
18180 deny_since: None,
18181 },
18182 Lint {
18183 label: "clippy::deref_by_slicing",
18184 description: r##"Checks for slicing expressions which are equivalent to dereferencing the
18185value."##,
18186 default_severity: Severity::Allow,
18187 warn_since: None,
18188 deny_since: None,
18189 },
18190 Lint {
18191 label: "clippy::derivable_impls",
18192 description: r##"Detects manual `std::default::Default` implementations that are identical to a derived implementation."##,
18193 default_severity: Severity::Allow,
18194 warn_since: None,
18195 deny_since: None,
18196 },
18197 Lint {
18198 label: "clippy::derive_ord_xor_partial_ord",
18199 description: r##"Lints against manual `PartialOrd` and `Ord` implementations for types with a derived `Ord`
18200or `PartialOrd` implementation."##,
18201 default_severity: Severity::Allow,
18202 warn_since: None,
18203 deny_since: None,
18204 },
18205 Lint {
18206 label: "clippy::derive_partial_eq_without_eq",
18207 description: r##"Checks for types that derive `PartialEq` and could implement `Eq`."##,
18208 default_severity: Severity::Allow,
18209 warn_since: None,
18210 deny_since: None,
18211 },
18212 Lint {
18213 label: "clippy::derived_hash_with_manual_eq",
18214 description: r##"Lints against manual `PartialEq` implementations for types with a derived `Hash`
18215implementation."##,
18216 default_severity: Severity::Allow,
18217 warn_since: None,
18218 deny_since: None,
18219 },
18220 Lint {
18221 label: "clippy::disallowed_macros",
18222 description: r##"Denies the configured macros in clippy.toml
18223
18224Note: Even though this lint is warn-by-default, it will only trigger if
18225macros are defined in the clippy.toml file."##,
18226 default_severity: Severity::Allow,
18227 warn_since: None,
18228 deny_since: None,
18229 },
18230 Lint {
18231 label: "clippy::disallowed_methods",
18232 description: r##"Denies the configured methods and functions in clippy.toml
18233
18234Note: Even though this lint is warn-by-default, it will only trigger if
18235methods are defined in the clippy.toml file."##,
18236 default_severity: Severity::Allow,
18237 warn_since: None,
18238 deny_since: None,
18239 },
18240 Lint {
18241 label: "clippy::disallowed_names",
18242 description: r##"Checks for usage of disallowed names for variables, such
18243as `foo`."##,
18244 default_severity: Severity::Allow,
18245 warn_since: None,
18246 deny_since: None,
18247 },
18248 Lint {
18249 label: "clippy::disallowed_script_idents",
18250 description: r##"Checks for usage of unicode scripts other than those explicitly allowed
18251by the lint config.
18252
18253This lint doesn't take into account non-text scripts such as `Unknown` and `Linear_A`.
18254It also ignores the `Common` script type.
18255While configuring, be sure to use official script name [aliases] from
18256[the list of supported scripts][supported_scripts].
18257
18258See also: [`non_ascii_idents`].
18259
18260[aliases]: http://www.unicode.org/reports/tr24/tr24-31.html#Script_Value_Aliases
18261[supported_scripts]: https://www.unicode.org/iso15924/iso15924-codes.html"##,
18262 default_severity: Severity::Allow,
18263 warn_since: None,
18264 deny_since: None,
18265 },
18266 Lint {
18267 label: "clippy::disallowed_types",
18268 description: r##"Denies the configured types in clippy.toml.
18269
18270Note: Even though this lint is warn-by-default, it will only trigger if
18271types are defined in the clippy.toml file."##,
18272 default_severity: Severity::Allow,
18273 warn_since: None,
18274 deny_since: None,
18275 },
18276 Lint {
18277 label: "clippy::diverging_sub_expression",
18278 description: r##"Checks for diverging calls that are not match arms or
18279statements."##,
18280 default_severity: Severity::Allow,
18281 warn_since: None,
18282 deny_since: None,
18283 },
18284 Lint {
18285 label: "clippy::doc_lazy_continuation",
18286 description: r##"In CommonMark Markdown, the language used to write doc comments, a
18287paragraph nested within a list or block quote does not need any line
18288after the first one to be indented or marked. The specification calls
18289this a lazy paragraph continuation."##,
18290 default_severity: Severity::Allow,
18291 warn_since: None,
18292 deny_since: None,
18293 },
18294 Lint {
18295 label: "clippy::doc_link_with_quotes",
18296 description: r##"Detects the syntax `['foo']` in documentation comments (notice quotes instead of backticks)
18297outside of code blocks"##,
18298 default_severity: Severity::Allow,
18299 warn_since: None,
18300 deny_since: None,
18301 },
18302 Lint {
18303 label: "clippy::doc_markdown",
18304 description: r##"Checks for the presence of `_`, `::` or camel-case words
18305outside ticks in documentation."##,
18306 default_severity: Severity::Allow,
18307 warn_since: None,
18308 deny_since: None,
18309 },
18310 Lint {
18311 label: "clippy::double_comparisons",
18312 description: r##"Checks for double comparisons that could be simplified to a single expression."##,
18313 default_severity: Severity::Allow,
18314 warn_since: None,
18315 deny_since: None,
18316 },
18317 Lint {
18318 label: "clippy::double_must_use",
18319 description: r##"Checks for a `#[must_use]` attribute without
18320further information on functions and methods that return a type already
18321marked as `#[must_use]`."##,
18322 default_severity: Severity::Allow,
18323 warn_since: None,
18324 deny_since: None,
18325 },
18326 Lint {
18327 label: "clippy::double_neg",
18328 description: r##"Detects expressions of the form `--x`."##,
18329 default_severity: Severity::Allow,
18330 warn_since: None,
18331 deny_since: None,
18332 },
18333 Lint {
18334 label: "clippy::double_parens",
18335 description: r##"Checks for unnecessary double parentheses."##,
18336 default_severity: Severity::Allow,
18337 warn_since: None,
18338 deny_since: None,
18339 },
18340 Lint {
18341 label: "clippy::drain_collect",
18342 description: r##"Checks for calls to `.drain()` that clear the collection, immediately followed by a call to `.collect()`.
18343
18344> Collection in this context refers to any type with a `drain` method:
18345> `Vec`, `VecDeque`, `BinaryHeap`, `HashSet`,`HashMap`, `String`"##,
18346 default_severity: Severity::Allow,
18347 warn_since: None,
18348 deny_since: None,
18349 },
18350 Lint {
18351 label: "clippy::drop_non_drop",
18352 description: r##"Checks for calls to `std::mem::drop` with a value that does not implement `Drop`."##,
18353 default_severity: Severity::Allow,
18354 warn_since: None,
18355 deny_since: None,
18356 },
18357 Lint {
18358 label: "clippy::duplicate_mod",
18359 description: r##"Checks for files that are included as modules multiple times."##,
18360 default_severity: Severity::Allow,
18361 warn_since: None,
18362 deny_since: None,
18363 },
18364 Lint {
18365 label: "clippy::duplicate_underscore_argument",
18366 description: r##"Checks for function arguments having the similar names
18367differing by an underscore."##,
18368 default_severity: Severity::Allow,
18369 warn_since: None,
18370 deny_since: None,
18371 },
18372 Lint {
18373 label: "clippy::duplicated_attributes",
18374 description: r##"Checks for attributes that appear two or more times."##,
18375 default_severity: Severity::Allow,
18376 warn_since: None,
18377 deny_since: None,
18378 },
18379 Lint {
18380 label: "clippy::duration_subsec",
18381 description: r##"Checks for calculation of subsecond microseconds or milliseconds
18382from other `Duration` methods."##,
18383 default_severity: Severity::Allow,
18384 warn_since: None,
18385 deny_since: None,
18386 },
18387 Lint {
18388 label: "clippy::eager_transmute",
18389 description: r##"Checks for integer validity checks, followed by a transmute that is (incorrectly) evaluated
18390eagerly (e.g. using `bool::then_some`)."##,
18391 default_severity: Severity::Allow,
18392 warn_since: None,
18393 deny_since: None,
18394 },
18395 Lint {
18396 label: "clippy::else_if_without_else",
18397 description: r##"Checks for usage of if expressions with an `else if` branch,
18398but without a final `else` branch."##,
18399 default_severity: Severity::Allow,
18400 warn_since: None,
18401 deny_since: None,
18402 },
18403 Lint {
18404 label: "clippy::empty_docs",
18405 description: r##"Detects documentation that is empty."##,
18406 default_severity: Severity::Allow,
18407 warn_since: None,
18408 deny_since: None,
18409 },
18410 Lint {
18411 label: "clippy::empty_drop",
18412 description: r##"Checks for empty `Drop` implementations."##,
18413 default_severity: Severity::Allow,
18414 warn_since: None,
18415 deny_since: None,
18416 },
18417 Lint {
18418 label: "clippy::empty_enum",
18419 description: r##"Checks for `enum`s with no variants, which therefore are uninhabited types
18420(cannot be instantiated).
18421
18422As of this writing, the `never_type` is still a nightly-only experimental API.
18423Therefore, this lint is only triggered if `#![feature(never_type)]` is enabled."##,
18424 default_severity: Severity::Allow,
18425 warn_since: None,
18426 deny_since: None,
18427 },
18428 Lint {
18429 label: "clippy::empty_enum_variants_with_brackets",
18430 description: r##"Finds enum variants without fields that are declared with empty brackets."##,
18431 default_severity: Severity::Allow,
18432 warn_since: None,
18433 deny_since: None,
18434 },
18435 Lint {
18436 label: "clippy::empty_line_after_doc_comments",
18437 description: r##"Checks for empty lines after doc comments."##,
18438 default_severity: Severity::Allow,
18439 warn_since: None,
18440 deny_since: None,
18441 },
18442 Lint {
18443 label: "clippy::empty_line_after_outer_attr",
18444 description: r##"Checks for empty lines after outer attributes"##,
18445 default_severity: Severity::Allow,
18446 warn_since: None,
18447 deny_since: None,
18448 },
18449 Lint {
18450 label: "clippy::empty_loop",
18451 description: r##"Checks for empty `loop` expressions."##,
18452 default_severity: Severity::Allow,
18453 warn_since: None,
18454 deny_since: None,
18455 },
18456 Lint {
18457 label: "clippy::empty_structs_with_brackets",
18458 description: r##"Finds structs without fields (a so-called empty struct) that are declared with brackets."##,
18459 default_severity: Severity::Allow,
18460 warn_since: None,
18461 deny_since: None,
18462 },
18463 Lint {
18464 label: "clippy::enum_clike_unportable_variant",
18465 description: r##"Checks for C-like enumerations that are
18466`repr(isize/usize)` and have values that don't fit into an `i32`."##,
18467 default_severity: Severity::Allow,
18468 warn_since: None,
18469 deny_since: None,
18470 },
18471 Lint {
18472 label: "clippy::enum_glob_use",
18473 description: r##"Checks for `use Enum::*`."##,
18474 default_severity: Severity::Allow,
18475 warn_since: None,
18476 deny_since: None,
18477 },
18478 Lint {
18479 label: "clippy::enum_variant_names",
18480 description: r##"Detects enumeration variants that are prefixed or suffixed
18481by the same characters."##,
18482 default_severity: Severity::Allow,
18483 warn_since: None,
18484 deny_since: None,
18485 },
18486 Lint {
18487 label: "clippy::eq_op",
18488 description: r##"Checks for equal operands to comparison, logical and
18489bitwise, difference and division binary operators (`==`, `>`, etc., `&&`,
18490`||`, `&`, `|`, `^`, `-` and `/`)."##,
18491 default_severity: Severity::Allow,
18492 warn_since: None,
18493 deny_since: None,
18494 },
18495 Lint {
18496 label: "clippy::equatable_if_let",
18497 description: r##"Checks for pattern matchings that can be expressed using equality."##,
18498 default_severity: Severity::Allow,
18499 warn_since: None,
18500 deny_since: None,
18501 },
18502 Lint {
18503 label: "clippy::erasing_op",
18504 description: r##"Checks for erasing operations, e.g., `x * 0`."##,
18505 default_severity: Severity::Allow,
18506 warn_since: None,
18507 deny_since: None,
18508 },
18509 Lint {
18510 label: "clippy::err_expect",
18511 description: r##"Checks for `.err().expect()` calls on the `Result` type."##,
18512 default_severity: Severity::Allow,
18513 warn_since: None,
18514 deny_since: None,
18515 },
18516 Lint {
18517 label: "clippy::error_impl_error",
18518 description: r##"Checks for types named `Error` that implement `Error`."##,
18519 default_severity: Severity::Allow,
18520 warn_since: None,
18521 deny_since: None,
18522 },
18523 Lint {
18524 label: "clippy::excessive_nesting",
18525 description: r##"Checks for blocks which are nested beyond a certain threshold.
18526
18527Note: Even though this lint is warn-by-default, it will only trigger if a maximum nesting level is defined in the clippy.toml file."##,
18528 default_severity: Severity::Allow,
18529 warn_since: None,
18530 deny_since: None,
18531 },
18532 Lint {
18533 label: "clippy::excessive_precision",
18534 description: r##"Checks for float literals with a precision greater
18535than that supported by the underlying type."##,
18536 default_severity: Severity::Allow,
18537 warn_since: None,
18538 deny_since: None,
18539 },
18540 Lint {
18541 label: "clippy::exhaustive_enums",
18542 description: r##"Warns on any exported `enum`s that are not tagged `#[non_exhaustive]`"##,
18543 default_severity: Severity::Allow,
18544 warn_since: None,
18545 deny_since: None,
18546 },
18547 Lint {
18548 label: "clippy::exhaustive_structs",
18549 description: r##"Warns on any exported `struct`s that are not tagged `#[non_exhaustive]`"##,
18550 default_severity: Severity::Allow,
18551 warn_since: None,
18552 deny_since: None,
18553 },
18554 Lint {
18555 label: "clippy::exit",
18556 description: r##"Detects calls to the `exit()` function which terminates the program."##,
18557 default_severity: Severity::Allow,
18558 warn_since: None,
18559 deny_since: None,
18560 },
18561 Lint {
18562 label: "clippy::expect_fun_call",
18563 description: r##"Checks for calls to `.expect(&format!(...))`, `.expect(foo(..))`,
18564etc., and suggests to use `unwrap_or_else` instead"##,
18565 default_severity: Severity::Allow,
18566 warn_since: None,
18567 deny_since: None,
18568 },
18569 Lint {
18570 label: "clippy::expect_used",
18571 description: r##"Checks for `.expect()` or `.expect_err()` calls on `Result`s and `.expect()` call on `Option`s."##,
18572 default_severity: Severity::Allow,
18573 warn_since: None,
18574 deny_since: None,
18575 },
18576 Lint {
18577 label: "clippy::expl_impl_clone_on_copy",
18578 description: r##"Checks for explicit `Clone` implementations for `Copy`
18579types."##,
18580 default_severity: Severity::Allow,
18581 warn_since: None,
18582 deny_since: None,
18583 },
18584 Lint {
18585 label: "clippy::explicit_auto_deref",
18586 description: r##"Checks for dereferencing expressions which would be covered by auto-deref."##,
18587 default_severity: Severity::Allow,
18588 warn_since: None,
18589 deny_since: None,
18590 },
18591 Lint {
18592 label: "clippy::explicit_counter_loop",
18593 description: r##"Checks `for` loops over slices with an explicit counter
18594and suggests the use of `.enumerate()`."##,
18595 default_severity: Severity::Allow,
18596 warn_since: None,
18597 deny_since: None,
18598 },
18599 Lint {
18600 label: "clippy::explicit_deref_methods",
18601 description: r##"Checks for explicit `deref()` or `deref_mut()` method calls."##,
18602 default_severity: Severity::Allow,
18603 warn_since: None,
18604 deny_since: None,
18605 },
18606 Lint {
18607 label: "clippy::explicit_into_iter_loop",
18608 description: r##"Checks for loops on `y.into_iter()` where `y` will do, and
18609suggests the latter."##,
18610 default_severity: Severity::Allow,
18611 warn_since: None,
18612 deny_since: None,
18613 },
18614 Lint {
18615 label: "clippy::explicit_iter_loop",
18616 description: r##"Checks for loops on `x.iter()` where `&x` will do, and
18617suggests the latter."##,
18618 default_severity: Severity::Allow,
18619 warn_since: None,
18620 deny_since: None,
18621 },
18622 Lint {
18623 label: "clippy::explicit_write",
18624 description: r##"Checks for usage of `write!()` / `writeln()!` which can be
18625replaced with `(e)print!()` / `(e)println!()`"##,
18626 default_severity: Severity::Allow,
18627 warn_since: None,
18628 deny_since: None,
18629 },
18630 Lint {
18631 label: "clippy::extend_from_slice",
18632 description: r##"Nothing. This lint has been deprecated"##,
18633 default_severity: Severity::Allow,
18634 warn_since: None,
18635 deny_since: None,
18636 },
18637 Lint {
18638 label: "clippy::extend_with_drain",
18639 description: r##"Checks for occurrences where one vector gets extended instead of append"##,
18640 default_severity: Severity::Allow,
18641 warn_since: None,
18642 deny_since: None,
18643 },
18644 Lint {
18645 label: "clippy::extra_unused_lifetimes",
18646 description: r##"Checks for lifetimes in generics that are never used
18647anywhere else."##,
18648 default_severity: Severity::Allow,
18649 warn_since: None,
18650 deny_since: None,
18651 },
18652 Lint {
18653 label: "clippy::extra_unused_type_parameters",
18654 description: r##"Checks for type parameters in generics that are never used anywhere else."##,
18655 default_severity: Severity::Allow,
18656 warn_since: None,
18657 deny_since: None,
18658 },
18659 Lint {
18660 label: "clippy::fallible_impl_from",
18661 description: r##"Checks for impls of `From<..>` that contain `panic!()` or `unwrap()`"##,
18662 default_severity: Severity::Allow,
18663 warn_since: None,
18664 deny_since: None,
18665 },
18666 Lint {
18667 label: "clippy::field_reassign_with_default",
18668 description: r##"Checks for immediate reassignment of fields initialized
18669with Default::default()."##,
18670 default_severity: Severity::Allow,
18671 warn_since: None,
18672 deny_since: None,
18673 },
18674 Lint {
18675 label: "clippy::field_scoped_visibility_modifiers",
18676 description: r##"Checks for usage of scoped visibility modifiers, like `pub(crate)`, on fields. These
18677make a field visible within a scope between public and private."##,
18678 default_severity: Severity::Allow,
18679 warn_since: None,
18680 deny_since: None,
18681 },
18682 Lint {
18683 label: "clippy::filetype_is_file",
18684 description: r##"Checks for `FileType::is_file()`."##,
18685 default_severity: Severity::Allow,
18686 warn_since: None,
18687 deny_since: None,
18688 },
18689 Lint {
18690 label: "clippy::filter_map_bool_then",
18691 description: r##"Checks for usage of `bool::then` in `Iterator::filter_map`."##,
18692 default_severity: Severity::Allow,
18693 warn_since: None,
18694 deny_since: None,
18695 },
18696 Lint {
18697 label: "clippy::filter_map_identity",
18698 description: r##"Checks for usage of `filter_map(|x| x)`."##,
18699 default_severity: Severity::Allow,
18700 warn_since: None,
18701 deny_since: None,
18702 },
18703 Lint {
18704 label: "clippy::filter_map_next",
18705 description: r##"Checks for usage of `_.filter_map(_).next()`."##,
18706 default_severity: Severity::Allow,
18707 warn_since: None,
18708 deny_since: None,
18709 },
18710 Lint {
18711 label: "clippy::filter_next",
18712 description: r##"Checks for usage of `_.filter(_).next()`."##,
18713 default_severity: Severity::Allow,
18714 warn_since: None,
18715 deny_since: None,
18716 },
18717 Lint {
18718 label: "clippy::flat_map_identity",
18719 description: r##"Checks for usage of `flat_map(|x| x)`."##,
18720 default_severity: Severity::Allow,
18721 warn_since: None,
18722 deny_since: None,
18723 },
18724 Lint {
18725 label: "clippy::flat_map_option",
18726 description: r##"Checks for usage of `Iterator::flat_map()` where `filter_map()` could be
18727used instead."##,
18728 default_severity: Severity::Allow,
18729 warn_since: None,
18730 deny_since: None,
18731 },
18732 Lint {
18733 label: "clippy::float_arithmetic",
18734 description: r##"Checks for float arithmetic."##,
18735 default_severity: Severity::Allow,
18736 warn_since: None,
18737 deny_since: None,
18738 },
18739 Lint {
18740 label: "clippy::float_cmp",
18741 description: r##"Checks for (in-)equality comparisons on floating-point
18742values (apart from zero), except in functions called `*eq*` (which probably
18743implement equality for a type involving floats)."##,
18744 default_severity: Severity::Allow,
18745 warn_since: None,
18746 deny_since: None,
18747 },
18748 Lint {
18749 label: "clippy::float_cmp_const",
18750 description: r##"Checks for (in-)equality comparisons on constant floating-point
18751values (apart from zero), except in functions called `*eq*` (which probably
18752implement equality for a type involving floats)."##,
18753 default_severity: Severity::Allow,
18754 warn_since: None,
18755 deny_since: None,
18756 },
18757 Lint {
18758 label: "clippy::float_equality_without_abs",
18759 description: r##"Checks for statements of the form `(a - b) < f32::EPSILON` or
18760`(a - b) < f64::EPSILON`. Notes the missing `.abs()`."##,
18761 default_severity: Severity::Allow,
18762 warn_since: None,
18763 deny_since: None,
18764 },
18765 Lint {
18766 label: "clippy::fn_address_comparisons",
18767 description: r##"Checks for comparisons with an address of a function item."##,
18768 default_severity: Severity::Allow,
18769 warn_since: None,
18770 deny_since: None,
18771 },
18772 Lint {
18773 label: "clippy::fn_params_excessive_bools",
18774 description: r##"Checks for excessive use of
18775bools in function definitions."##,
18776 default_severity: Severity::Allow,
18777 warn_since: None,
18778 deny_since: None,
18779 },
18780 Lint {
18781 label: "clippy::fn_to_numeric_cast",
18782 description: r##"Checks for casts of function pointers to something other than `usize`."##,
18783 default_severity: Severity::Allow,
18784 warn_since: None,
18785 deny_since: None,
18786 },
18787 Lint {
18788 label: "clippy::fn_to_numeric_cast_any",
18789 description: r##"Checks for casts of a function pointer to any integer type."##,
18790 default_severity: Severity::Allow,
18791 warn_since: None,
18792 deny_since: None,
18793 },
18794 Lint {
18795 label: "clippy::fn_to_numeric_cast_with_truncation",
18796 description: r##"Checks for casts of a function pointer to a numeric type not wide enough to
18797store an address."##,
18798 default_severity: Severity::Allow,
18799 warn_since: None,
18800 deny_since: None,
18801 },
18802 Lint {
18803 label: "clippy::for_kv_map",
18804 description: r##"Checks for iterating a map (`HashMap` or `BTreeMap`) and
18805ignoring either the keys or values."##,
18806 default_severity: Severity::Allow,
18807 warn_since: None,
18808 deny_since: None,
18809 },
18810 Lint {
18811 label: "clippy::forget_non_drop",
18812 description: r##"Checks for calls to `std::mem::forget` with a value that does not implement `Drop`."##,
18813 default_severity: Severity::Allow,
18814 warn_since: None,
18815 deny_since: None,
18816 },
18817 Lint {
18818 label: "clippy::format_collect",
18819 description: r##"Checks for usage of `.map(|_| format!(..)).collect::<String>()`."##,
18820 default_severity: Severity::Allow,
18821 warn_since: None,
18822 deny_since: None,
18823 },
18824 Lint {
18825 label: "clippy::format_in_format_args",
18826 description: r##"Detects `format!` within the arguments of another macro that does
18827formatting such as `format!` itself, `write!` or `println!`. Suggests
18828inlining the `format!` call."##,
18829 default_severity: Severity::Allow,
18830 warn_since: None,
18831 deny_since: None,
18832 },
18833 Lint {
18834 label: "clippy::format_push_string",
18835 description: r##"Detects cases where the result of a `format!` call is
18836appended to an existing `String`."##,
18837 default_severity: Severity::Allow,
18838 warn_since: None,
18839 deny_since: None,
18840 },
18841 Lint {
18842 label: "clippy::four_forward_slashes",
18843 description: r##"Checks for outer doc comments written with 4 forward slashes (`////`)."##,
18844 default_severity: Severity::Allow,
18845 warn_since: None,
18846 deny_since: None,
18847 },
18848 Lint {
18849 label: "clippy::from_iter_instead_of_collect",
18850 description: r##"Checks for `from_iter()` function calls on types that implement the `FromIterator`
18851trait."##,
18852 default_severity: Severity::Allow,
18853 warn_since: None,
18854 deny_since: None,
18855 },
18856 Lint {
18857 label: "clippy::from_over_into",
18858 description: r##"Searches for implementations of the `Into<..>` trait and suggests to implement `From<..>` instead."##,
18859 default_severity: Severity::Allow,
18860 warn_since: None,
18861 deny_since: None,
18862 },
18863 Lint {
18864 label: "clippy::from_raw_with_void_ptr",
18865 description: r##"Checks if we're passing a `c_void` raw pointer to `{Box,Rc,Arc,Weak}::from_raw(_)`"##,
18866 default_severity: Severity::Allow,
18867 warn_since: None,
18868 deny_since: None,
18869 },
18870 Lint {
18871 label: "clippy::from_str_radix_10",
18872 description: r##"Checks for function invocations of the form `primitive::from_str_radix(s, 10)`"##,
18873 default_severity: Severity::Allow,
18874 warn_since: None,
18875 deny_since: None,
18876 },
18877 Lint {
18878 label: "clippy::future_not_send",
18879 description: r##"This lint requires Future implementations returned from
18880functions and methods to implement the `Send` marker trait. It is mostly
18881used by library authors (public and internal) that target an audience where
18882multithreaded executors are likely to be used for running these Futures."##,
18883 default_severity: Severity::Allow,
18884 warn_since: None,
18885 deny_since: None,
18886 },
18887 Lint {
18888 label: "clippy::get_first",
18889 description: r##"Checks for usage of `x.get(0)` instead of
18890`x.first()` or `x.front()`."##,
18891 default_severity: Severity::Allow,
18892 warn_since: None,
18893 deny_since: None,
18894 },
18895 Lint {
18896 label: "clippy::get_last_with_len",
18897 description: r##"Checks for usage of `x.get(x.len() - 1)` instead of
18898`x.last()`."##,
18899 default_severity: Severity::Allow,
18900 warn_since: None,
18901 deny_since: None,
18902 },
18903 Lint {
18904 label: "clippy::get_unwrap",
18905 description: r##"Checks for usage of `.get().unwrap()` (or
18906`.get_mut().unwrap`) on a standard library type which implements `Index`"##,
18907 default_severity: Severity::Allow,
18908 warn_since: None,
18909 deny_since: None,
18910 },
18911 Lint {
18912 label: "clippy::host_endian_bytes",
18913 description: r##"Checks for the usage of the `to_ne_bytes` method and/or the function `from_ne_bytes`."##,
18914 default_severity: Severity::Allow,
18915 warn_since: None,
18916 deny_since: None,
18917 },
18918 Lint {
18919 label: "clippy::identity_op",
18920 description: r##"Checks for identity operations, e.g., `x + 0`."##,
18921 default_severity: Severity::Allow,
18922 warn_since: None,
18923 deny_since: None,
18924 },
18925 Lint {
18926 label: "clippy::if_let_mutex",
18927 description: r##"Checks for `Mutex::lock` calls in `if let` expression
18928with lock calls in any of the else blocks."##,
18929 default_severity: Severity::Allow,
18930 warn_since: None,
18931 deny_since: None,
18932 },
18933 Lint {
18934 label: "clippy::if_not_else",
18935 description: r##"Checks for usage of `!` or `!=` in an if condition with an
18936else branch."##,
18937 default_severity: Severity::Allow,
18938 warn_since: None,
18939 deny_since: None,
18940 },
18941 Lint {
18942 label: "clippy::if_same_then_else",
18943 description: r##"Checks for `if/else` with the same body as the *then* part
18944and the *else* part."##,
18945 default_severity: Severity::Allow,
18946 warn_since: None,
18947 deny_since: None,
18948 },
18949 Lint {
18950 label: "clippy::if_then_some_else_none",
18951 description: r##"Checks for if-else that could be written using either `bool::then` or `bool::then_some`."##,
18952 default_severity: Severity::Allow,
18953 warn_since: None,
18954 deny_since: None,
18955 },
18956 Lint {
18957 label: "clippy::ifs_same_cond",
18958 description: r##"Checks for consecutive `if`s with the same condition."##,
18959 default_severity: Severity::Allow,
18960 warn_since: None,
18961 deny_since: None,
18962 },
18963 Lint {
18964 label: "clippy::ignored_unit_patterns",
18965 description: r##"Checks for usage of `_` in patterns of type `()`."##,
18966 default_severity: Severity::Allow,
18967 warn_since: None,
18968 deny_since: None,
18969 },
18970 Lint {
18971 label: "clippy::impl_hash_borrow_with_str_and_bytes",
18972 description: r##"This lint is concerned with the semantics of `Borrow` and `Hash` for a
18973type that implements all three of `Hash`, `Borrow<str>` and `Borrow<[u8]>`
18974as it is impossible to satisfy the semantics of Borrow and `Hash` for
18975both `Borrow<str>` and `Borrow<[u8]>`."##,
18976 default_severity: Severity::Allow,
18977 warn_since: None,
18978 deny_since: None,
18979 },
18980 Lint {
18981 label: "clippy::impl_trait_in_params",
18982 description: r##"Lints when `impl Trait` is being used in a function's parameters."##,
18983 default_severity: Severity::Allow,
18984 warn_since: None,
18985 deny_since: None,
18986 },
18987 Lint {
18988 label: "clippy::implicit_clone",
18989 description: r##"Checks for the usage of `_.to_owned()`, `vec.to_vec()`, or similar when calling `_.clone()` would be clearer."##,
18990 default_severity: Severity::Allow,
18991 warn_since: None,
18992 deny_since: None,
18993 },
18994 Lint {
18995 label: "clippy::implicit_hasher",
18996 description: r##"Checks for public `impl` or `fn` missing generalization
18997over different hashers and implicitly defaulting to the default hashing
18998algorithm (`SipHash`)."##,
18999 default_severity: Severity::Allow,
19000 warn_since: None,
19001 deny_since: None,
19002 },
19003 Lint {
19004 label: "clippy::implicit_return",
19005 description: r##"Checks for missing return statements at the end of a block."##,
19006 default_severity: Severity::Allow,
19007 warn_since: None,
19008 deny_since: None,
19009 },
19010 Lint {
19011 label: "clippy::implicit_saturating_add",
19012 description: r##"Checks for implicit saturating addition."##,
19013 default_severity: Severity::Allow,
19014 warn_since: None,
19015 deny_since: None,
19016 },
19017 Lint {
19018 label: "clippy::implicit_saturating_sub",
19019 description: r##"Checks for implicit saturating subtraction."##,
19020 default_severity: Severity::Allow,
19021 warn_since: None,
19022 deny_since: None,
19023 },
19024 Lint {
19025 label: "clippy::implied_bounds_in_impls",
19026 description: r##"Looks for bounds in `impl Trait` in return position that are implied by other bounds.
19027This can happen when a trait is specified that another trait already has as a supertrait
19028(e.g. `fn() -> impl Deref + DerefMut<Target = i32>` has an unnecessary `Deref` bound,
19029because `Deref` is a supertrait of `DerefMut`)"##,
19030 default_severity: Severity::Allow,
19031 warn_since: None,
19032 deny_since: None,
19033 },
19034 Lint {
19035 label: "clippy::impossible_comparisons",
19036 description: r##"Checks for double comparisons that can never succeed"##,
19037 default_severity: Severity::Allow,
19038 warn_since: None,
19039 deny_since: None,
19040 },
19041 Lint {
19042 label: "clippy::imprecise_flops",
19043 description: r##"Looks for floating-point expressions that
19044can be expressed using built-in methods to improve accuracy
19045at the cost of performance."##,
19046 default_severity: Severity::Allow,
19047 warn_since: None,
19048 deny_since: None,
19049 },
19050 Lint {
19051 label: "clippy::incompatible_msrv",
19052 description: r##"This lint checks that no function newer than the defined MSRV (minimum
19053supported rust version) is used in the crate."##,
19054 default_severity: Severity::Allow,
19055 warn_since: None,
19056 deny_since: None,
19057 },
19058 Lint {
19059 label: "clippy::inconsistent_digit_grouping",
19060 description: r##"Warns if an integral or floating-point constant is
19061grouped inconsistently with underscores."##,
19062 default_severity: Severity::Allow,
19063 warn_since: None,
19064 deny_since: None,
19065 },
19066 Lint {
19067 label: "clippy::inconsistent_struct_constructor",
19068 description: r##"Checks for struct constructors where all fields are shorthand and
19069the order of the field init shorthand in the constructor is inconsistent
19070with the order in the struct definition."##,
19071 default_severity: Severity::Allow,
19072 warn_since: None,
19073 deny_since: None,
19074 },
19075 Lint {
19076 label: "clippy::index_refutable_slice",
19077 description: r##"The lint checks for slice bindings in patterns that are only used to
19078access individual slice values."##,
19079 default_severity: Severity::Allow,
19080 warn_since: None,
19081 deny_since: None,
19082 },
19083 Lint {
19084 label: "clippy::indexing_slicing",
19085 description: r##"Checks for usage of indexing or slicing. Arrays are special cases, this lint
19086does report on arrays if we can tell that slicing operations are in bounds and does not
19087lint on constant `usize` indexing on arrays because that is handled by rustc's `const_err` lint."##,
19088 default_severity: Severity::Allow,
19089 warn_since: None,
19090 deny_since: None,
19091 },
19092 Lint {
19093 label: "clippy::ineffective_bit_mask",
19094 description: r##"Checks for bit masks in comparisons which can be removed
19095without changing the outcome. The basic structure can be seen in the
19096following table:
19097
19098|Comparison| Bit Op |Example |equals |
19099|----------|----------|------------|-------|
19100|`>` / `<=`|`\\|` / `^`|`x \\| 2 > 3`|`x > 3`|
19101|`<` / `>=`|`\\|` / `^`|`x ^ 1 < 4` |`x < 4`|"##,
19102 default_severity: Severity::Allow,
19103 warn_since: None,
19104 deny_since: None,
19105 },
19106 Lint {
19107 label: "clippy::ineffective_open_options",
19108 description: r##"Checks if both `.write(true)` and `.append(true)` methods are called
19109on a same `OpenOptions`."##,
19110 default_severity: Severity::Allow,
19111 warn_since: None,
19112 deny_since: None,
19113 },
19114 Lint {
19115 label: "clippy::inefficient_to_string",
19116 description: r##"Checks for usage of `.to_string()` on an `&&T` where
19117`T` implements `ToString` directly (like `&&str` or `&&String`)."##,
19118 default_severity: Severity::Allow,
19119 warn_since: None,
19120 deny_since: None,
19121 },
19122 Lint {
19123 label: "clippy::infallible_destructuring_match",
19124 description: r##"Checks for matches being used to destructure a single-variant enum
19125or tuple struct where a `let` will suffice."##,
19126 default_severity: Severity::Allow,
19127 warn_since: None,
19128 deny_since: None,
19129 },
19130 Lint {
19131 label: "clippy::infinite_iter",
19132 description: r##"Checks for iteration that is guaranteed to be infinite."##,
19133 default_severity: Severity::Allow,
19134 warn_since: None,
19135 deny_since: None,
19136 },
19137 Lint {
19138 label: "clippy::infinite_loop",
19139 description: r##"Checks for infinite loops in a function where the return type is not `!`
19140and lint accordingly."##,
19141 default_severity: Severity::Allow,
19142 warn_since: None,
19143 deny_since: None,
19144 },
19145 Lint {
19146 label: "clippy::inherent_to_string",
19147 description: r##"Checks for the definition of inherent methods with a signature of `to_string(&self) -> String`."##,
19148 default_severity: Severity::Allow,
19149 warn_since: None,
19150 deny_since: None,
19151 },
19152 Lint {
19153 label: "clippy::inherent_to_string_shadow_display",
19154 description: r##"Checks for the definition of inherent methods with a signature of `to_string(&self) -> String` and if the type implementing this method also implements the `Display` trait."##,
19155 default_severity: Severity::Allow,
19156 warn_since: None,
19157 deny_since: None,
19158 },
19159 Lint {
19160 label: "clippy::init_numbered_fields",
19161 description: r##"Checks for tuple structs initialized with field syntax.
19162It will however not lint if a base initializer is present.
19163The lint will also ignore code in macros."##,
19164 default_severity: Severity::Allow,
19165 warn_since: None,
19166 deny_since: None,
19167 },
19168 Lint {
19169 label: "clippy::inline_always",
19170 description: r##"Checks for items annotated with `#[inline(always)]`,
19171unless the annotated function is empty or simply panics."##,
19172 default_severity: Severity::Allow,
19173 warn_since: None,
19174 deny_since: None,
19175 },
19176 Lint {
19177 label: "clippy::inline_asm_x86_att_syntax",
19178 description: r##"Checks for usage of AT&T x86 assembly syntax."##,
19179 default_severity: Severity::Allow,
19180 warn_since: None,
19181 deny_since: None,
19182 },
19183 Lint {
19184 label: "clippy::inline_asm_x86_intel_syntax",
19185 description: r##"Checks for usage of Intel x86 assembly syntax."##,
19186 default_severity: Severity::Allow,
19187 warn_since: None,
19188 deny_since: None,
19189 },
19190 Lint {
19191 label: "clippy::inline_fn_without_body",
19192 description: r##"Checks for `#[inline]` on trait methods without bodies"##,
19193 default_severity: Severity::Allow,
19194 warn_since: None,
19195 deny_since: None,
19196 },
19197 Lint {
19198 label: "clippy::inspect_for_each",
19199 description: r##"Checks for usage of `inspect().for_each()`."##,
19200 default_severity: Severity::Allow,
19201 warn_since: None,
19202 deny_since: None,
19203 },
19204 Lint {
19205 label: "clippy::int_plus_one",
19206 description: r##"Checks for usage of `x >= y + 1` or `x - 1 >= y` (and `<=`) in a block"##,
19207 default_severity: Severity::Allow,
19208 warn_since: None,
19209 deny_since: None,
19210 },
19211 Lint {
19212 label: "clippy::integer_division",
19213 description: r##"Checks for division of integers"##,
19214 default_severity: Severity::Allow,
19215 warn_since: None,
19216 deny_since: None,
19217 },
19218 Lint {
19219 label: "clippy::integer_division_remainder_used",
19220 description: r##"Checks for the usage of division (`/`) and remainder (`%`) operations
19221when performed on any integer types using the default `Div` and `Rem` trait implementations."##,
19222 default_severity: Severity::Allow,
19223 warn_since: None,
19224 deny_since: None,
19225 },
19226 Lint {
19227 label: "clippy::into_iter_on_ref",
19228 description: r##"Checks for `into_iter` calls on references which should be replaced by `iter`
19229or `iter_mut`."##,
19230 default_severity: Severity::Allow,
19231 warn_since: None,
19232 deny_since: None,
19233 },
19234 Lint {
19235 label: "clippy::into_iter_without_iter",
19236 description: r##"This is the opposite of the `iter_without_into_iter` lint.
19237It looks for `IntoIterator for (&|&mut) Type` implementations without an inherent `iter` or `iter_mut` method
19238on the type or on any of the types in its `Deref` chain."##,
19239 default_severity: Severity::Allow,
19240 warn_since: None,
19241 deny_since: None,
19242 },
19243 Lint {
19244 label: "clippy::invalid_null_ptr_usage",
19245 description: r##"This lint checks for invalid usages of `ptr::null`."##,
19246 default_severity: Severity::Allow,
19247 warn_since: None,
19248 deny_since: None,
19249 },
19250 Lint {
19251 label: "clippy::invalid_regex",
19252 description: r##"Checks [regex](https://crates.io/crates/regex) creation
19253(with `Regex::new`, `RegexBuilder::new`, or `RegexSet::new`) for correct
19254regex syntax."##,
19255 default_severity: Severity::Allow,
19256 warn_since: None,
19257 deny_since: None,
19258 },
19259 Lint {
19260 label: "clippy::invalid_upcast_comparisons",
19261 description: r##"Checks for comparisons where the relation is always either
19262true or false, but where one side has been upcast so that the comparison is
19263necessary. Only integer types are checked."##,
19264 default_severity: Severity::Allow,
19265 warn_since: None,
19266 deny_since: None,
19267 },
19268 Lint {
19269 label: "clippy::inverted_saturating_sub",
19270 description: r##"Checks for comparisons between integers, followed by subtracting the greater value from the
19271lower one."##,
19272 default_severity: Severity::Allow,
19273 warn_since: None,
19274 deny_since: None,
19275 },
19276 Lint {
19277 label: "clippy::invisible_characters",
19278 description: r##"Checks for invisible Unicode characters in the code."##,
19279 default_severity: Severity::Allow,
19280 warn_since: None,
19281 deny_since: None,
19282 },
19283 Lint {
19284 label: "clippy::is_digit_ascii_radix",
19285 description: r##"Finds usages of [`char::is_digit`](https://doc.rust-lang.org/stable/std/primitive.char.html#method.is_digit) that
19286can be replaced with [`is_ascii_digit`](https://doc.rust-lang.org/stable/std/primitive.char.html#method.is_ascii_digit) or
19287[`is_ascii_hexdigit`](https://doc.rust-lang.org/stable/std/primitive.char.html#method.is_ascii_hexdigit)."##,
19288 default_severity: Severity::Allow,
19289 warn_since: None,
19290 deny_since: None,
19291 },
19292 Lint {
19293 label: "clippy::items_after_statements",
19294 description: r##"Checks for items declared after some statement in a block."##,
19295 default_severity: Severity::Allow,
19296 warn_since: None,
19297 deny_since: None,
19298 },
19299 Lint {
19300 label: "clippy::items_after_test_module",
19301 description: r##"Triggers if an item is declared after the testing module marked with `#[cfg(test)]`."##,
19302 default_severity: Severity::Allow,
19303 warn_since: None,
19304 deny_since: None,
19305 },
19306 Lint {
19307 label: "clippy::iter_cloned_collect",
19308 description: r##"Checks for the use of `.cloned().collect()` on slice to
19309create a `Vec`."##,
19310 default_severity: Severity::Allow,
19311 warn_since: None,
19312 deny_since: None,
19313 },
19314 Lint {
19315 label: "clippy::iter_count",
19316 description: r##"Checks for the use of `.iter().count()`."##,
19317 default_severity: Severity::Allow,
19318 warn_since: None,
19319 deny_since: None,
19320 },
19321 Lint {
19322 label: "clippy::iter_filter_is_ok",
19323 description: r##"Checks for usage of `.filter(Result::is_ok)` that may be replaced with a `.flatten()` call.
19324This lint will require additional changes to the follow-up calls as it affects the type."##,
19325 default_severity: Severity::Allow,
19326 warn_since: None,
19327 deny_since: None,
19328 },
19329 Lint {
19330 label: "clippy::iter_filter_is_some",
19331 description: r##"Checks for usage of `.filter(Option::is_some)` that may be replaced with a `.flatten()` call.
19332This lint will require additional changes to the follow-up calls as it affects the type."##,
19333 default_severity: Severity::Allow,
19334 warn_since: None,
19335 deny_since: None,
19336 },
19337 Lint {
19338 label: "clippy::iter_kv_map",
19339 description: r##"Checks for iterating a map (`HashMap` or `BTreeMap`) and
19340ignoring either the keys or values."##,
19341 default_severity: Severity::Allow,
19342 warn_since: None,
19343 deny_since: None,
19344 },
19345 Lint {
19346 label: "clippy::iter_next_loop",
19347 description: r##"Checks for loops on `x.next()`."##,
19348 default_severity: Severity::Allow,
19349 warn_since: None,
19350 deny_since: None,
19351 },
19352 Lint {
19353 label: "clippy::iter_next_slice",
19354 description: r##"Checks for usage of `iter().next()` on a Slice or an Array"##,
19355 default_severity: Severity::Allow,
19356 warn_since: None,
19357 deny_since: None,
19358 },
19359 Lint {
19360 label: "clippy::iter_not_returning_iterator",
19361 description: r##"Detects methods named `iter` or `iter_mut` that do not have a return type that implements `Iterator`."##,
19362 default_severity: Severity::Allow,
19363 warn_since: None,
19364 deny_since: None,
19365 },
19366 Lint {
19367 label: "clippy::iter_nth",
19368 description: r##"Checks for usage of `.iter().nth()`/`.iter_mut().nth()` on standard library types that have
19369equivalent `.get()`/`.get_mut()` methods."##,
19370 default_severity: Severity::Allow,
19371 warn_since: None,
19372 deny_since: None,
19373 },
19374 Lint {
19375 label: "clippy::iter_nth_zero",
19376 description: r##"Checks for the use of `iter.nth(0)`."##,
19377 default_severity: Severity::Allow,
19378 warn_since: None,
19379 deny_since: None,
19380 },
19381 Lint {
19382 label: "clippy::iter_on_empty_collections",
19383 description: r##"Checks for calls to `iter`, `iter_mut` or `into_iter` on empty collections"##,
19384 default_severity: Severity::Allow,
19385 warn_since: None,
19386 deny_since: None,
19387 },
19388 Lint {
19389 label: "clippy::iter_on_single_items",
19390 description: r##"Checks for calls to `iter`, `iter_mut` or `into_iter` on collections containing a single item"##,
19391 default_severity: Severity::Allow,
19392 warn_since: None,
19393 deny_since: None,
19394 },
19395 Lint {
19396 label: "clippy::iter_out_of_bounds",
19397 description: r##"Looks for iterator combinator calls such as `.take(x)` or `.skip(x)`
19398where `x` is greater than the amount of items that an iterator will produce."##,
19399 default_severity: Severity::Allow,
19400 warn_since: None,
19401 deny_since: None,
19402 },
19403 Lint {
19404 label: "clippy::iter_over_hash_type",
19405 description: r##"This is a restriction lint which prevents the use of hash types (i.e., `HashSet` and `HashMap`) in for loops."##,
19406 default_severity: Severity::Allow,
19407 warn_since: None,
19408 deny_since: None,
19409 },
19410 Lint {
19411 label: "clippy::iter_overeager_cloned",
19412 description: r##"Checks for usage of `_.cloned().<func>()` where call to `.cloned()` can be postponed."##,
19413 default_severity: Severity::Allow,
19414 warn_since: None,
19415 deny_since: None,
19416 },
19417 Lint {
19418 label: "clippy::iter_skip_next",
19419 description: r##"Checks for usage of `.skip(x).next()` on iterators."##,
19420 default_severity: Severity::Allow,
19421 warn_since: None,
19422 deny_since: None,
19423 },
19424 Lint {
19425 label: "clippy::iter_skip_zero",
19426 description: r##"Checks for usage of `.skip(0)` on iterators."##,
19427 default_severity: Severity::Allow,
19428 warn_since: None,
19429 deny_since: None,
19430 },
19431 Lint {
19432 label: "clippy::iter_with_drain",
19433 description: r##"Checks for usage of `.drain(..)` on `Vec` and `VecDeque` for iteration."##,
19434 default_severity: Severity::Allow,
19435 warn_since: None,
19436 deny_since: None,
19437 },
19438 Lint {
19439 label: "clippy::iter_without_into_iter",
19440 description: r##"Looks for `iter` and `iter_mut` methods without an associated `IntoIterator for (&|&mut) Type` implementation."##,
19441 default_severity: Severity::Allow,
19442 warn_since: None,
19443 deny_since: None,
19444 },
19445 Lint {
19446 label: "clippy::iterator_step_by_zero",
19447 description: r##"Checks for calling `.step_by(0)` on iterators which panics."##,
19448 default_severity: Severity::Allow,
19449 warn_since: None,
19450 deny_since: None,
19451 },
19452 Lint {
19453 label: "clippy::join_absolute_paths",
19454 description: r##"Checks for calls to `Path::join` that start with a path separator (`\\\\` or `/`)."##,
19455 default_severity: Severity::Allow,
19456 warn_since: None,
19457 deny_since: None,
19458 },
19459 Lint {
19460 label: "clippy::just_underscores_and_digits",
19461 description: r##"Checks if you have variables whose name consists of just
19462underscores and digits."##,
19463 default_severity: Severity::Allow,
19464 warn_since: None,
19465 deny_since: None,
19466 },
19467 Lint {
19468 label: "clippy::large_const_arrays",
19469 description: r##"Checks for large `const` arrays that should
19470be defined as `static` instead."##,
19471 default_severity: Severity::Allow,
19472 warn_since: None,
19473 deny_since: None,
19474 },
19475 Lint {
19476 label: "clippy::large_digit_groups",
19477 description: r##"Warns if the digits of an integral or floating-point
19478constant are grouped into groups that
19479are too large."##,
19480 default_severity: Severity::Allow,
19481 warn_since: None,
19482 deny_since: None,
19483 },
19484 Lint {
19485 label: "clippy::large_enum_variant",
19486 description: r##"Checks for large size differences between variants on
19487`enum`s."##,
19488 default_severity: Severity::Allow,
19489 warn_since: None,
19490 deny_since: None,
19491 },
19492 Lint {
19493 label: "clippy::large_futures",
19494 description: r##"It checks for the size of a `Future` created by `async fn` or `async {}`."##,
19495 default_severity: Severity::Allow,
19496 warn_since: None,
19497 deny_since: None,
19498 },
19499 Lint {
19500 label: "clippy::large_include_file",
19501 description: r##"Checks for the inclusion of large files via `include_bytes!()`
19502or `include_str!()`."##,
19503 default_severity: Severity::Allow,
19504 warn_since: None,
19505 deny_since: None,
19506 },
19507 Lint {
19508 label: "clippy::large_stack_arrays",
19509 description: r##"Checks for local arrays that may be too large."##,
19510 default_severity: Severity::Allow,
19511 warn_since: None,
19512 deny_since: None,
19513 },
19514 Lint {
19515 label: "clippy::large_stack_frames",
19516 description: r##"Checks for functions that use a lot of stack space.
19517
19518This often happens when constructing a large type, such as an array with a lot of elements,
19519or constructing *many* smaller-but-still-large structs, or copying around a lot of large types.
19520
19521This lint is a more general version of [`large_stack_arrays`](https://rust-lang.github.io/rust-clippy/master/#large_stack_arrays)
19522that is intended to look at functions as a whole instead of only individual array expressions inside of a function."##,
19523 default_severity: Severity::Allow,
19524 warn_since: None,
19525 deny_since: None,
19526 },
19527 Lint {
19528 label: "clippy::large_types_passed_by_value",
19529 description: r##"Checks for functions taking arguments by value, where
19530the argument type is `Copy` and large enough to be worth considering
19531passing by reference. Does not trigger if the function is being exported,
19532because that might induce API breakage, if the parameter is declared as mutable,
19533or if the argument is a `self`."##,
19534 default_severity: Severity::Allow,
19535 warn_since: None,
19536 deny_since: None,
19537 },
19538 Lint {
19539 label: "clippy::legacy_numeric_constants",
19540 description: r##"Checks for usage of `<integer>::max_value()`, `std::<integer>::MAX`,
19541`std::<float>::EPSILON`, etc."##,
19542 default_severity: Severity::Allow,
19543 warn_since: None,
19544 deny_since: None,
19545 },
19546 Lint {
19547 label: "clippy::len_without_is_empty",
19548 description: r##"Checks for items that implement `.len()` but not
19549`.is_empty()`."##,
19550 default_severity: Severity::Allow,
19551 warn_since: None,
19552 deny_since: None,
19553 },
19554 Lint {
19555 label: "clippy::len_zero",
19556 description: r##"Checks for getting the length of something via `.len()`
19557just to compare to zero, and suggests using `.is_empty()` where applicable."##,
19558 default_severity: Severity::Allow,
19559 warn_since: None,
19560 deny_since: None,
19561 },
19562 Lint {
19563 label: "clippy::let_and_return",
19564 description: r##"Checks for `let`-bindings, which are subsequently
19565returned."##,
19566 default_severity: Severity::Allow,
19567 warn_since: None,
19568 deny_since: None,
19569 },
19570 Lint {
19571 label: "clippy::let_underscore_future",
19572 description: r##"Checks for `let _ = <expr>` where the resulting type of expr implements `Future`"##,
19573 default_severity: Severity::Allow,
19574 warn_since: None,
19575 deny_since: None,
19576 },
19577 Lint {
19578 label: "clippy::let_underscore_lock",
19579 description: r##"Checks for `let _ = sync_lock`. This supports `mutex` and `rwlock` in
19580`parking_lot`. For `std` locks see the `rustc` lint
19581[`let_underscore_lock`](https://doc.rust-lang.org/nightly/rustc/lints/listing/deny-by-default.html#let-underscore-lock)"##,
19582 default_severity: Severity::Allow,
19583 warn_since: None,
19584 deny_since: None,
19585 },
19586 Lint {
19587 label: "clippy::let_underscore_must_use",
19588 description: r##"Checks for `let _ = <expr>` where expr is `#[must_use]`"##,
19589 default_severity: Severity::Allow,
19590 warn_since: None,
19591 deny_since: None,
19592 },
19593 Lint {
19594 label: "clippy::let_underscore_untyped",
19595 description: r##"Checks for `let _ = <expr>` without a type annotation, and suggests to either provide one,
19596or remove the `let` keyword altogether."##,
19597 default_severity: Severity::Allow,
19598 warn_since: None,
19599 deny_since: None,
19600 },
19601 Lint {
19602 label: "clippy::let_unit_value",
19603 description: r##"Checks for binding a unit value."##,
19604 default_severity: Severity::Allow,
19605 warn_since: None,
19606 deny_since: None,
19607 },
19608 Lint {
19609 label: "clippy::let_with_type_underscore",
19610 description: r##"Detects when a variable is declared with an explicit type of `_`."##,
19611 default_severity: Severity::Allow,
19612 warn_since: None,
19613 deny_since: None,
19614 },
19615 Lint {
19616 label: "clippy::lines_filter_map_ok",
19617 description: r##"Checks for usage of `lines.filter_map(Result::ok)` or `lines.flat_map(Result::ok)`
19618when `lines` has type `std::io::Lines`."##,
19619 default_severity: Severity::Allow,
19620 warn_since: None,
19621 deny_since: None,
19622 },
19623 Lint {
19624 label: "clippy::linkedlist",
19625 description: r##"Checks for usage of any `LinkedList`, suggesting to use a
19626`Vec` or a `VecDeque` (formerly called `RingBuf`)."##,
19627 default_severity: Severity::Allow,
19628 warn_since: None,
19629 deny_since: None,
19630 },
19631 Lint {
19632 label: "clippy::lint_groups_priority",
19633 description: r##"Checks for lint groups with the same priority as lints in the `Cargo.toml`
19634[`[lints]` table](https://doc.rust-lang.org/cargo/reference/manifest.html#the-lints-section).
19635
19636This lint will be removed once [cargo#12918](https://github.com/rust-lang/cargo/issues/12918)
19637is resolved."##,
19638 default_severity: Severity::Allow,
19639 warn_since: None,
19640 deny_since: None,
19641 },
19642 Lint {
19643 label: "clippy::little_endian_bytes",
19644 description: r##"Checks for the usage of the `to_le_bytes` method and/or the function `from_le_bytes`."##,
19645 default_severity: Severity::Allow,
19646 warn_since: None,
19647 deny_since: None,
19648 },
19649 Lint {
19650 label: "clippy::lossy_float_literal",
19651 description: r##"Checks for whole number float literals that
19652cannot be represented as the underlying type without loss."##,
19653 default_severity: Severity::Allow,
19654 warn_since: None,
19655 deny_since: None,
19656 },
19657 Lint {
19658 label: "clippy::macro_metavars_in_unsafe",
19659 description: r##"Looks for macros that expand metavariables in an unsafe block."##,
19660 default_severity: Severity::Allow,
19661 warn_since: None,
19662 deny_since: None,
19663 },
19664 Lint {
19665 label: "clippy::macro_use_imports",
19666 description: r##"Checks for `#[macro_use] use...`."##,
19667 default_severity: Severity::Allow,
19668 warn_since: None,
19669 deny_since: None,
19670 },
19671 Lint {
19672 label: "clippy::main_recursion",
19673 description: r##"Checks for recursion using the entrypoint."##,
19674 default_severity: Severity::Allow,
19675 warn_since: None,
19676 deny_since: None,
19677 },
19678 Lint {
19679 label: "clippy::manual_assert",
19680 description: r##"Detects `if`-then-`panic!` that can be replaced with `assert!`."##,
19681 default_severity: Severity::Allow,
19682 warn_since: None,
19683 deny_since: None,
19684 },
19685 Lint {
19686 label: "clippy::manual_async_fn",
19687 description: r##"It checks for manual implementations of `async` functions."##,
19688 default_severity: Severity::Allow,
19689 warn_since: None,
19690 deny_since: None,
19691 },
19692 Lint {
19693 label: "clippy::manual_bits",
19694 description: r##"Checks for usage of `std::mem::size_of::<T>() * 8` when
19695`T::BITS` is available."##,
19696 default_severity: Severity::Allow,
19697 warn_since: None,
19698 deny_since: None,
19699 },
19700 Lint {
19701 label: "clippy::manual_c_str_literals",
19702 description: r##"Checks for the manual creation of C strings (a string with a `NUL` byte at the end), either
19703through one of the `CStr` constructor functions, or more plainly by calling `.as_ptr()`
19704on a (byte) string literal with a hardcoded `\\0` byte at the end."##,
19705 default_severity: Severity::Allow,
19706 warn_since: None,
19707 deny_since: None,
19708 },
19709 Lint {
19710 label: "clippy::manual_clamp",
19711 description: r##"Identifies good opportunities for a clamp function from std or core, and suggests using it."##,
19712 default_severity: Severity::Allow,
19713 warn_since: None,
19714 deny_since: None,
19715 },
19716 Lint {
19717 label: "clippy::manual_div_ceil",
19718 description: r##"Checks for an expression like `(x + (y - 1)) / y` which is a common manual reimplementation
19719of `x.div_ceil(y)`."##,
19720 default_severity: Severity::Allow,
19721 warn_since: None,
19722 deny_since: None,
19723 },
19724 Lint {
19725 label: "clippy::manual_filter",
19726 description: r##"Checks for usage of `match` which could be implemented using `filter`"##,
19727 default_severity: Severity::Allow,
19728 warn_since: None,
19729 deny_since: None,
19730 },
19731 Lint {
19732 label: "clippy::manual_filter_map",
19733 description: r##"Checks for usage of `_.filter(_).map(_)` that can be written more simply
19734as `filter_map(_)`."##,
19735 default_severity: Severity::Allow,
19736 warn_since: None,
19737 deny_since: None,
19738 },
19739 Lint {
19740 label: "clippy::manual_find",
19741 description: r##"Checks for manual implementations of Iterator::find"##,
19742 default_severity: Severity::Allow,
19743 warn_since: None,
19744 deny_since: None,
19745 },
19746 Lint {
19747 label: "clippy::manual_find_map",
19748 description: r##"Checks for usage of `_.find(_).map(_)` that can be written more simply
19749as `find_map(_)`."##,
19750 default_severity: Severity::Allow,
19751 warn_since: None,
19752 deny_since: None,
19753 },
19754 Lint {
19755 label: "clippy::manual_flatten",
19756 description: r##"Checks for unnecessary `if let` usage in a for loop
19757where only the `Some` or `Ok` variant of the iterator element is used."##,
19758 default_severity: Severity::Allow,
19759 warn_since: None,
19760 deny_since: None,
19761 },
19762 Lint {
19763 label: "clippy::manual_hash_one",
19764 description: r##"Checks for cases where [`BuildHasher::hash_one`] can be used.
19765
19766[`BuildHasher::hash_one`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html#method.hash_one"##,
19767 default_severity: Severity::Allow,
19768 warn_since: None,
19769 deny_since: None,
19770 },
19771 Lint {
19772 label: "clippy::manual_inspect",
19773 description: r##"Checks for uses of `map` which return the original item."##,
19774 default_severity: Severity::Allow,
19775 warn_since: None,
19776 deny_since: None,
19777 },
19778 Lint {
19779 label: "clippy::manual_instant_elapsed",
19780 description: r##"Lints subtraction between `Instant::now()` and another `Instant`."##,
19781 default_severity: Severity::Allow,
19782 warn_since: None,
19783 deny_since: None,
19784 },
19785 Lint {
19786 label: "clippy::manual_is_ascii_check",
19787 description: r##"Suggests to use dedicated built-in methods,
19788`is_ascii_(lowercase|uppercase|digit|hexdigit)` for checking on corresponding
19789ascii range"##,
19790 default_severity: Severity::Allow,
19791 warn_since: None,
19792 deny_since: None,
19793 },
19794 Lint {
19795 label: "clippy::manual_is_finite",
19796 description: r##"Checks for manual `is_finite` reimplementations
19797(i.e., `x != <float>::INFINITY && x != <float>::NEG_INFINITY`)."##,
19798 default_severity: Severity::Allow,
19799 warn_since: None,
19800 deny_since: None,
19801 },
19802 Lint {
19803 label: "clippy::manual_is_infinite",
19804 description: r##"Checks for manual `is_infinite` reimplementations
19805(i.e., `x == <float>::INFINITY || x == <float>::NEG_INFINITY`)."##,
19806 default_severity: Severity::Allow,
19807 warn_since: None,
19808 deny_since: None,
19809 },
19810 Lint {
19811 label: "clippy::manual_is_power_of_two",
19812 description: r##"Checks for expressions like `x.count_ones() == 1` or `x & (x - 1) == 0`, with x and unsigned integer, which are manual
19813reimplementations of `x.is_power_of_two()`."##,
19814 default_severity: Severity::Allow,
19815 warn_since: None,
19816 deny_since: None,
19817 },
19818 Lint {
19819 label: "clippy::manual_is_variant_and",
19820 description: r##"Checks for usage of `option.map(f).unwrap_or_default()` and `result.map(f).unwrap_or_default()` where f is a function or closure that returns the `bool` type."##,
19821 default_severity: Severity::Allow,
19822 warn_since: None,
19823 deny_since: None,
19824 },
19825 Lint {
19826 label: "clippy::manual_let_else",
19827 description: r##"Warn of cases where `let...else` could be used"##,
19828 default_severity: Severity::Allow,
19829 warn_since: None,
19830 deny_since: None,
19831 },
19832 Lint {
19833 label: "clippy::manual_main_separator_str",
19834 description: r##"Checks for references on `std::path::MAIN_SEPARATOR.to_string()` used
19835to build a `&str`."##,
19836 default_severity: Severity::Allow,
19837 warn_since: None,
19838 deny_since: None,
19839 },
19840 Lint {
19841 label: "clippy::manual_map",
19842 description: r##"Checks for usage of `match` which could be implemented using `map`"##,
19843 default_severity: Severity::Allow,
19844 warn_since: None,
19845 deny_since: None,
19846 },
19847 Lint {
19848 label: "clippy::manual_memcpy",
19849 description: r##"Checks for for-loops that manually copy items between
19850slices that could be optimized by having a memcpy."##,
19851 default_severity: Severity::Allow,
19852 warn_since: None,
19853 deny_since: None,
19854 },
19855 Lint {
19856 label: "clippy::manual_next_back",
19857 description: r##"Checks for `.rev().next()` on a `DoubleEndedIterator`"##,
19858 default_severity: Severity::Allow,
19859 warn_since: None,
19860 deny_since: None,
19861 },
19862 Lint {
19863 label: "clippy::manual_non_exhaustive",
19864 description: r##"Checks for manual implementations of the non-exhaustive pattern."##,
19865 default_severity: Severity::Allow,
19866 warn_since: None,
19867 deny_since: None,
19868 },
19869 Lint {
19870 label: "clippy::manual_ok_or",
19871 description: r##"Finds patterns that reimplement `Option::ok_or`."##,
19872 default_severity: Severity::Allow,
19873 warn_since: None,
19874 deny_since: None,
19875 },
19876 Lint {
19877 label: "clippy::manual_pattern_char_comparison",
19878 description: r##"Checks for manual `char` comparison in string patterns"##,
19879 default_severity: Severity::Allow,
19880 warn_since: None,
19881 deny_since: None,
19882 },
19883 Lint {
19884 label: "clippy::manual_range_contains",
19885 description: r##"Checks for expressions like `x >= 3 && x < 8` that could
19886be more readably expressed as `(3..8).contains(x)`."##,
19887 default_severity: Severity::Allow,
19888 warn_since: None,
19889 deny_since: None,
19890 },
19891 Lint {
19892 label: "clippy::manual_range_patterns",
19893 description: r##"Looks for combined OR patterns that are all contained in a specific range,
19894e.g. `6 | 4 | 5 | 9 | 7 | 8` can be rewritten as `4..=9`."##,
19895 default_severity: Severity::Allow,
19896 warn_since: None,
19897 deny_since: None,
19898 },
19899 Lint {
19900 label: "clippy::manual_rem_euclid",
19901 description: r##"Checks for an expression like `((x % 4) + 4) % 4` which is a common manual reimplementation
19902of `x.rem_euclid(4)`."##,
19903 default_severity: Severity::Allow,
19904 warn_since: None,
19905 deny_since: None,
19906 },
19907 Lint {
19908 label: "clippy::manual_retain",
19909 description: r##"Checks for code to be replaced by `.retain()`."##,
19910 default_severity: Severity::Allow,
19911 warn_since: None,
19912 deny_since: None,
19913 },
19914 Lint {
19915 label: "clippy::manual_rotate",
19916 description: r##"It detects manual bit rotations that could be rewritten using standard
19917functions `rotate_left` or `rotate_right`."##,
19918 default_severity: Severity::Allow,
19919 warn_since: None,
19920 deny_since: None,
19921 },
19922 Lint {
19923 label: "clippy::manual_saturating_arithmetic",
19924 description: r##"Checks for `.checked_add/sub(x).unwrap_or(MAX/MIN)`."##,
19925 default_severity: Severity::Allow,
19926 warn_since: None,
19927 deny_since: None,
19928 },
19929 Lint {
19930 label: "clippy::manual_slice_size_calculation",
19931 description: r##"When `a` is `&[T]`, detect `a.len() * size_of::<T>()` and suggest `size_of_val(a)`
19932instead."##,
19933 default_severity: Severity::Allow,
19934 warn_since: None,
19935 deny_since: None,
19936 },
19937 Lint {
19938 label: "clippy::manual_split_once",
19939 description: r##"Checks for usage of `str::splitn(2, _)`"##,
19940 default_severity: Severity::Allow,
19941 warn_since: None,
19942 deny_since: None,
19943 },
19944 Lint {
19945 label: "clippy::manual_str_repeat",
19946 description: r##"Checks for manual implementations of `str::repeat`"##,
19947 default_severity: Severity::Allow,
19948 warn_since: None,
19949 deny_since: None,
19950 },
19951 Lint {
19952 label: "clippy::manual_string_new",
19953 description: r##"Checks for usage of `` to create a `String`, such as `.to_string()`, `.to_owned()`,
19954`String::from()` and others."##,
19955 default_severity: Severity::Allow,
19956 warn_since: None,
19957 deny_since: None,
19958 },
19959 Lint {
19960 label: "clippy::manual_strip",
19961 description: r##"Suggests using `strip_{prefix,suffix}` over `str::{starts,ends}_with` and slicing using
19962the pattern's length."##,
19963 default_severity: Severity::Allow,
19964 warn_since: None,
19965 deny_since: None,
19966 },
19967 Lint {
19968 label: "clippy::manual_swap",
19969 description: r##"Checks for manual swapping.
19970
19971Note that the lint will not be emitted in const blocks, as the suggestion would not be applicable."##,
19972 default_severity: Severity::Allow,
19973 warn_since: None,
19974 deny_since: None,
19975 },
19976 Lint {
19977 label: "clippy::manual_try_fold",
19978 description: r##"Checks for usage of `Iterator::fold` with a type that implements `Try`."##,
19979 default_severity: Severity::Allow,
19980 warn_since: None,
19981 deny_since: None,
19982 },
19983 Lint {
19984 label: "clippy::manual_unwrap_or",
19985 description: r##"Finds patterns that reimplement `Option::unwrap_or` or `Result::unwrap_or`."##,
19986 default_severity: Severity::Allow,
19987 warn_since: None,
19988 deny_since: None,
19989 },
19990 Lint {
19991 label: "clippy::manual_unwrap_or_default",
19992 description: r##"Checks if a `match` or `if let` expression can be simplified using
19993`.unwrap_or_default()`."##,
19994 default_severity: Severity::Allow,
19995 warn_since: None,
19996 deny_since: None,
19997 },
19998 Lint {
19999 label: "clippy::manual_while_let_some",
20000 description: r##"Looks for loops that check for emptiness of a `Vec` in the condition and pop an element
20001in the body as a separate operation."##,
20002 default_severity: Severity::Allow,
20003 warn_since: None,
20004 deny_since: None,
20005 },
20006 Lint {
20007 label: "clippy::many_single_char_names",
20008 description: r##"Checks for too many variables whose name consists of a
20009single character."##,
20010 default_severity: Severity::Allow,
20011 warn_since: None,
20012 deny_since: None,
20013 },
20014 Lint {
20015 label: "clippy::map_clone",
20016 description: r##"Checks for usage of `map(|x| x.clone())` or
20017dereferencing closures for `Copy` types, on `Iterator` or `Option`,
20018and suggests `cloned()` or `copied()` instead"##,
20019 default_severity: Severity::Allow,
20020 warn_since: None,
20021 deny_since: None,
20022 },
20023 Lint {
20024 label: "clippy::map_collect_result_unit",
20025 description: r##"Checks for usage of `_.map(_).collect::<Result<(), _>()`."##,
20026 default_severity: Severity::Allow,
20027 warn_since: None,
20028 deny_since: None,
20029 },
20030 Lint {
20031 label: "clippy::map_entry",
20032 description: r##"Checks for usage of `contains_key` + `insert` on `HashMap`
20033or `BTreeMap`."##,
20034 default_severity: Severity::Allow,
20035 warn_since: None,
20036 deny_since: None,
20037 },
20038 Lint {
20039 label: "clippy::map_err_ignore",
20040 description: r##"Checks for instances of `map_err(|_| Some::Enum)`"##,
20041 default_severity: Severity::Allow,
20042 warn_since: None,
20043 deny_since: None,
20044 },
20045 Lint {
20046 label: "clippy::map_flatten",
20047 description: r##"Checks for usage of `_.map(_).flatten(_)` on `Iterator` and `Option`"##,
20048 default_severity: Severity::Allow,
20049 warn_since: None,
20050 deny_since: None,
20051 },
20052 Lint {
20053 label: "clippy::map_identity",
20054 description: r##"Checks for instances of `map(f)` where `f` is the identity function."##,
20055 default_severity: Severity::Allow,
20056 warn_since: None,
20057 deny_since: None,
20058 },
20059 Lint {
20060 label: "clippy::map_unwrap_or",
20061 description: r##"Checks for usage of `option.map(_).unwrap_or(_)` or `option.map(_).unwrap_or_else(_)` or
20062`result.map(_).unwrap_or_else(_)`."##,
20063 default_severity: Severity::Allow,
20064 warn_since: None,
20065 deny_since: None,
20066 },
20067 Lint {
20068 label: "clippy::match_as_ref",
20069 description: r##"Checks for match which is used to add a reference to an
20070`Option` value."##,
20071 default_severity: Severity::Allow,
20072 warn_since: None,
20073 deny_since: None,
20074 },
20075 Lint {
20076 label: "clippy::match_bool",
20077 description: r##"Checks for matches where match expression is a `bool`. It
20078suggests to replace the expression with an `if...else` block."##,
20079 default_severity: Severity::Allow,
20080 warn_since: None,
20081 deny_since: None,
20082 },
20083 Lint {
20084 label: "clippy::match_like_matches_macro",
20085 description: r##"Checks for `match` or `if let` expressions producing a
20086`bool` that could be written using `matches!`"##,
20087 default_severity: Severity::Allow,
20088 warn_since: None,
20089 deny_since: None,
20090 },
20091 Lint {
20092 label: "clippy::match_on_vec_items",
20093 description: r##"Checks for `match vec[idx]` or `match vec[n..m]`."##,
20094 default_severity: Severity::Allow,
20095 warn_since: None,
20096 deny_since: None,
20097 },
20098 Lint {
20099 label: "clippy::match_overlapping_arm",
20100 description: r##"Checks for overlapping match arms."##,
20101 default_severity: Severity::Allow,
20102 warn_since: None,
20103 deny_since: None,
20104 },
20105 Lint {
20106 label: "clippy::match_ref_pats",
20107 description: r##"Checks for matches where all arms match a reference,
20108suggesting to remove the reference and deref the matched expression
20109instead. It also checks for `if let &foo = bar` blocks."##,
20110 default_severity: Severity::Allow,
20111 warn_since: None,
20112 deny_since: None,
20113 },
20114 Lint {
20115 label: "clippy::match_result_ok",
20116 description: r##"Checks for unnecessary `ok()` in `while let`."##,
20117 default_severity: Severity::Allow,
20118 warn_since: None,
20119 deny_since: None,
20120 },
20121 Lint {
20122 label: "clippy::match_same_arms",
20123 description: r##"Checks for `match` with identical arm bodies.
20124
20125Note: Does not lint on wildcards if the `non_exhaustive_omitted_patterns_lint` feature is
20126enabled and disallowed."##,
20127 default_severity: Severity::Allow,
20128 warn_since: None,
20129 deny_since: None,
20130 },
20131 Lint {
20132 label: "clippy::match_single_binding",
20133 description: r##"Checks for useless match that binds to only one value."##,
20134 default_severity: Severity::Allow,
20135 warn_since: None,
20136 deny_since: None,
20137 },
20138 Lint {
20139 label: "clippy::match_str_case_mismatch",
20140 description: r##"Checks for `match` expressions modifying the case of a string with non-compliant arms"##,
20141 default_severity: Severity::Allow,
20142 warn_since: None,
20143 deny_since: None,
20144 },
20145 Lint {
20146 label: "clippy::match_wild_err_arm",
20147 description: r##"Checks for arm which matches all errors with `Err(_)`
20148and take drastic actions like `panic!`."##,
20149 default_severity: Severity::Allow,
20150 warn_since: None,
20151 deny_since: None,
20152 },
20153 Lint {
20154 label: "clippy::match_wildcard_for_single_variants",
20155 description: r##"Checks for wildcard enum matches for a single variant."##,
20156 default_severity: Severity::Allow,
20157 warn_since: None,
20158 deny_since: None,
20159 },
20160 Lint {
20161 label: "clippy::maybe_infinite_iter",
20162 description: r##"Checks for iteration that may be infinite."##,
20163 default_severity: Severity::Allow,
20164 warn_since: None,
20165 deny_since: None,
20166 },
20167 Lint {
20168 label: "clippy::mem_forget",
20169 description: r##"Checks for usage of `std::mem::forget(t)` where `t` is
20170`Drop` or has a field that implements `Drop`."##,
20171 default_severity: Severity::Allow,
20172 warn_since: None,
20173 deny_since: None,
20174 },
20175 Lint {
20176 label: "clippy::mem_replace_option_with_none",
20177 description: r##"Checks for `mem::replace()` on an `Option` with
20178`None`."##,
20179 default_severity: Severity::Allow,
20180 warn_since: None,
20181 deny_since: None,
20182 },
20183 Lint {
20184 label: "clippy::mem_replace_with_default",
20185 description: r##"Checks for `std::mem::replace` on a value of type
20186`T` with `T::default()`."##,
20187 default_severity: Severity::Allow,
20188 warn_since: None,
20189 deny_since: None,
20190 },
20191 Lint {
20192 label: "clippy::mem_replace_with_uninit",
20193 description: r##"Checks for `mem::replace(&mut _, mem::uninitialized())`
20194and `mem::replace(&mut _, mem::zeroed())`."##,
20195 default_severity: Severity::Allow,
20196 warn_since: None,
20197 deny_since: None,
20198 },
20199 Lint {
20200 label: "clippy::min_ident_chars",
20201 description: r##"Checks for identifiers which consist of a single character (or fewer than the configured threshold).
20202
20203Note: This lint can be very noisy when enabled; it may be desirable to only enable it
20204temporarily."##,
20205 default_severity: Severity::Allow,
20206 warn_since: None,
20207 deny_since: None,
20208 },
20209 Lint {
20210 label: "clippy::min_max",
20211 description: r##"Checks for expressions where `std::cmp::min` and `max` are
20212used to clamp values, but switched so that the result is constant."##,
20213 default_severity: Severity::Allow,
20214 warn_since: None,
20215 deny_since: None,
20216 },
20217 Lint {
20218 label: "clippy::misaligned_transmute",
20219 description: r##"Nothing. This lint has been deprecated"##,
20220 default_severity: Severity::Allow,
20221 warn_since: None,
20222 deny_since: None,
20223 },
20224 Lint {
20225 label: "clippy::mismatching_type_param_order",
20226 description: r##"Checks for type parameters which are positioned inconsistently between
20227a type definition and impl block. Specifically, a parameter in an impl
20228block which has the same name as a parameter in the type def, but is in
20229a different place."##,
20230 default_severity: Severity::Allow,
20231 warn_since: None,
20232 deny_since: None,
20233 },
20234 Lint {
20235 label: "clippy::misnamed_getters",
20236 description: r##"Checks for getter methods that return a field that doesn't correspond
20237to the name of the method, when there is a field's whose name matches that of the method."##,
20238 default_severity: Severity::Allow,
20239 warn_since: None,
20240 deny_since: None,
20241 },
20242 Lint {
20243 label: "clippy::misrefactored_assign_op",
20244 description: r##"Checks for `a op= a op b` or `a op= b op a` patterns."##,
20245 default_severity: Severity::Allow,
20246 warn_since: None,
20247 deny_since: None,
20248 },
20249 Lint {
20250 label: "clippy::missing_assert_message",
20251 description: r##"Checks assertions without a custom panic message."##,
20252 default_severity: Severity::Allow,
20253 warn_since: None,
20254 deny_since: None,
20255 },
20256 Lint {
20257 label: "clippy::missing_asserts_for_indexing",
20258 description: r##"Checks for repeated slice indexing without asserting beforehand that the length
20259is greater than the largest index used to index into the slice."##,
20260 default_severity: Severity::Allow,
20261 warn_since: None,
20262 deny_since: None,
20263 },
20264 Lint {
20265 label: "clippy::missing_const_for_fn",
20266 description: r##"Suggests the use of `const` in functions and methods where possible."##,
20267 default_severity: Severity::Allow,
20268 warn_since: None,
20269 deny_since: None,
20270 },
20271 Lint {
20272 label: "clippy::missing_const_for_thread_local",
20273 description: r##"Suggests to use `const` in `thread_local!` macro if possible."##,
20274 default_severity: Severity::Allow,
20275 warn_since: None,
20276 deny_since: None,
20277 },
20278 Lint {
20279 label: "clippy::missing_docs_in_private_items",
20280 description: r##"Warns if there is missing documentation for any private documentable item."##,
20281 default_severity: Severity::Allow,
20282 warn_since: None,
20283 deny_since: None,
20284 },
20285 Lint {
20286 label: "clippy::missing_enforced_import_renames",
20287 description: r##"Checks for imports that do not rename the item as specified
20288in the `enforced-import-renames` config option.
20289
20290Note: Even though this lint is warn-by-default, it will only trigger if
20291import renames are defined in the `clippy.toml` file."##,
20292 default_severity: Severity::Allow,
20293 warn_since: None,
20294 deny_since: None,
20295 },
20296 Lint {
20297 label: "clippy::missing_errors_doc",
20298 description: r##"Checks the doc comments of publicly visible functions that
20299return a `Result` type and warns if there is no `# Errors` section."##,
20300 default_severity: Severity::Allow,
20301 warn_since: None,
20302 deny_since: None,
20303 },
20304 Lint {
20305 label: "clippy::missing_fields_in_debug",
20306 description: r##"Checks for manual [`core::fmt::Debug`](https://doc.rust-lang.org/core/fmt/trait.Debug.html) implementations that do not use all fields."##,
20307 default_severity: Severity::Allow,
20308 warn_since: None,
20309 deny_since: None,
20310 },
20311 Lint {
20312 label: "clippy::missing_inline_in_public_items",
20313 description: r##"It lints if an exported function, method, trait method with default impl,
20314or trait method impl is not `#[inline]`."##,
20315 default_severity: Severity::Allow,
20316 warn_since: None,
20317 deny_since: None,
20318 },
20319 Lint {
20320 label: "clippy::missing_panics_doc",
20321 description: r##"Checks the doc comments of publicly visible functions that
20322may panic and warns if there is no `# Panics` section."##,
20323 default_severity: Severity::Allow,
20324 warn_since: None,
20325 deny_since: None,
20326 },
20327 Lint {
20328 label: "clippy::missing_safety_doc",
20329 description: r##"Checks for the doc comments of publicly visible
20330unsafe functions and warns if there is no `# Safety` section."##,
20331 default_severity: Severity::Allow,
20332 warn_since: None,
20333 deny_since: None,
20334 },
20335 Lint {
20336 label: "clippy::missing_spin_loop",
20337 description: r##"Checks for empty spin loops"##,
20338 default_severity: Severity::Allow,
20339 warn_since: None,
20340 deny_since: None,
20341 },
20342 Lint {
20343 label: "clippy::missing_trait_methods",
20344 description: r##"Checks if a provided method is used implicitly by a trait
20345implementation."##,
20346 default_severity: Severity::Allow,
20347 warn_since: None,
20348 deny_since: None,
20349 },
20350 Lint {
20351 label: "clippy::missing_transmute_annotations",
20352 description: r##"Checks if transmute calls have all generics specified."##,
20353 default_severity: Severity::Allow,
20354 warn_since: None,
20355 deny_since: None,
20356 },
20357 Lint {
20358 label: "clippy::mistyped_literal_suffixes",
20359 description: r##"Warns for mistyped suffix in literals"##,
20360 default_severity: Severity::Allow,
20361 warn_since: None,
20362 deny_since: None,
20363 },
20364 Lint {
20365 label: "clippy::mixed_attributes_style",
20366 description: r##"Checks for items that have the same kind of attributes with mixed styles (inner/outer)."##,
20367 default_severity: Severity::Allow,
20368 warn_since: None,
20369 deny_since: None,
20370 },
20371 Lint {
20372 label: "clippy::mixed_case_hex_literals",
20373 description: r##"Warns on hexadecimal literals with mixed-case letter
20374digits."##,
20375 default_severity: Severity::Allow,
20376 warn_since: None,
20377 deny_since: None,
20378 },
20379 Lint {
20380 label: "clippy::mixed_read_write_in_expression",
20381 description: r##"Checks for a read and a write to the same variable where
20382whether the read occurs before or after the write depends on the evaluation
20383order of sub-expressions."##,
20384 default_severity: Severity::Allow,
20385 warn_since: None,
20386 deny_since: None,
20387 },
20388 Lint {
20389 label: "clippy::mod_module_files",
20390 description: r##"Checks that module layout uses only self named module files; bans `mod.rs` files."##,
20391 default_severity: Severity::Allow,
20392 warn_since: None,
20393 deny_since: None,
20394 },
20395 Lint {
20396 label: "clippy::module_inception",
20397 description: r##"Checks for modules that have the same name as their
20398parent module"##,
20399 default_severity: Severity::Allow,
20400 warn_since: None,
20401 deny_since: None,
20402 },
20403 Lint {
20404 label: "clippy::module_name_repetitions",
20405 description: r##"Detects type names that are prefixed or suffixed by the
20406containing module's name."##,
20407 default_severity: Severity::Allow,
20408 warn_since: None,
20409 deny_since: None,
20410 },
20411 Lint {
20412 label: "clippy::modulo_arithmetic",
20413 description: r##"Checks for modulo arithmetic."##,
20414 default_severity: Severity::Allow,
20415 warn_since: None,
20416 deny_since: None,
20417 },
20418 Lint {
20419 label: "clippy::modulo_one",
20420 description: r##"Checks for getting the remainder of integer division by one or minus
20421one."##,
20422 default_severity: Severity::Allow,
20423 warn_since: None,
20424 deny_since: None,
20425 },
20426 Lint {
20427 label: "clippy::multi_assignments",
20428 description: r##"Checks for nested assignments."##,
20429 default_severity: Severity::Allow,
20430 warn_since: None,
20431 deny_since: None,
20432 },
20433 Lint {
20434 label: "clippy::multiple_bound_locations",
20435 description: r##"Check if a generic is defined both in the bound predicate and in the `where` clause."##,
20436 default_severity: Severity::Allow,
20437 warn_since: None,
20438 deny_since: None,
20439 },
20440 Lint {
20441 label: "clippy::multiple_crate_versions",
20442 description: r##"Checks to see if multiple versions of a crate are being
20443used."##,
20444 default_severity: Severity::Allow,
20445 warn_since: None,
20446 deny_since: None,
20447 },
20448 Lint {
20449 label: "clippy::multiple_inherent_impl",
20450 description: r##"Checks for multiple inherent implementations of a struct"##,
20451 default_severity: Severity::Allow,
20452 warn_since: None,
20453 deny_since: None,
20454 },
20455 Lint {
20456 label: "clippy::multiple_unsafe_ops_per_block",
20457 description: r##"Checks for `unsafe` blocks that contain more than one unsafe operation."##,
20458 default_severity: Severity::Allow,
20459 warn_since: None,
20460 deny_since: None,
20461 },
20462 Lint {
20463 label: "clippy::must_use_candidate",
20464 description: r##"Checks for public functions that have no
20465`#[must_use]` attribute, but return something not already marked
20466must-use, have no mutable arg and mutate no statics."##,
20467 default_severity: Severity::Allow,
20468 warn_since: None,
20469 deny_since: None,
20470 },
20471 Lint {
20472 label: "clippy::must_use_unit",
20473 description: r##"Checks for a `#[must_use]` attribute on
20474unit-returning functions and methods."##,
20475 default_severity: Severity::Allow,
20476 warn_since: None,
20477 deny_since: None,
20478 },
20479 Lint {
20480 label: "clippy::mut_from_ref",
20481 description: r##"This lint checks for functions that take immutable references and return
20482mutable ones. This will not trigger if no unsafe code exists as there
20483are multiple safe functions which will do this transformation
20484
20485To be on the conservative side, if there's at least one mutable
20486reference with the output lifetime, this lint will not trigger."##,
20487 default_severity: Severity::Allow,
20488 warn_since: None,
20489 deny_since: None,
20490 },
20491 Lint {
20492 label: "clippy::mut_mut",
20493 description: r##"Checks for instances of `mut mut` references."##,
20494 default_severity: Severity::Allow,
20495 warn_since: None,
20496 deny_since: None,
20497 },
20498 Lint {
20499 label: "clippy::mut_mutex_lock",
20500 description: r##"Checks for `&mut Mutex::lock` calls"##,
20501 default_severity: Severity::Allow,
20502 warn_since: None,
20503 deny_since: None,
20504 },
20505 Lint {
20506 label: "clippy::mut_range_bound",
20507 description: r##"Checks for loops with a range bound that is a mutable variable."##,
20508 default_severity: Severity::Allow,
20509 warn_since: None,
20510 deny_since: None,
20511 },
20512 Lint {
20513 label: "clippy::mutable_key_type",
20514 description: r##"Checks for sets/maps with mutable key types."##,
20515 default_severity: Severity::Allow,
20516 warn_since: None,
20517 deny_since: None,
20518 },
20519 Lint {
20520 label: "clippy::mutex_atomic",
20521 description: r##"Checks for usage of `Mutex<X>` where an atomic will do."##,
20522 default_severity: Severity::Allow,
20523 warn_since: None,
20524 deny_since: None,
20525 },
20526 Lint {
20527 label: "clippy::mutex_integer",
20528 description: r##"Checks for usage of `Mutex<X>` where `X` is an integral
20529type."##,
20530 default_severity: Severity::Allow,
20531 warn_since: None,
20532 deny_since: None,
20533 },
20534 Lint {
20535 label: "clippy::naive_bytecount",
20536 description: r##"Checks for naive byte counts"##,
20537 default_severity: Severity::Allow,
20538 warn_since: None,
20539 deny_since: None,
20540 },
20541 Lint {
20542 label: "clippy::needless_arbitrary_self_type",
20543 description: r##"The lint checks for `self` in fn parameters that
20544specify the `Self`-type explicitly"##,
20545 default_severity: Severity::Allow,
20546 warn_since: None,
20547 deny_since: None,
20548 },
20549 Lint {
20550 label: "clippy::needless_bitwise_bool",
20551 description: r##"Checks for usage of bitwise and/or operators between booleans, where performance may be improved by using
20552a lazy and."##,
20553 default_severity: Severity::Allow,
20554 warn_since: None,
20555 deny_since: None,
20556 },
20557 Lint {
20558 label: "clippy::needless_bool",
20559 description: r##"Checks for expressions of the form `if c { true } else {
20560false }` (or vice versa) and suggests using the condition directly."##,
20561 default_severity: Severity::Allow,
20562 warn_since: None,
20563 deny_since: None,
20564 },
20565 Lint {
20566 label: "clippy::needless_bool_assign",
20567 description: r##"Checks for expressions of the form `if c { x = true } else { x = false }`
20568(or vice versa) and suggest assigning the variable directly from the
20569condition."##,
20570 default_severity: Severity::Allow,
20571 warn_since: None,
20572 deny_since: None,
20573 },
20574 Lint {
20575 label: "clippy::needless_borrow",
20576 description: r##"Checks for address of operations (`&`) that are going to
20577be dereferenced immediately by the compiler."##,
20578 default_severity: Severity::Allow,
20579 warn_since: None,
20580 deny_since: None,
20581 },
20582 Lint {
20583 label: "clippy::needless_borrowed_reference",
20584 description: r##"Checks for bindings that needlessly destructure a reference and borrow the inner
20585value with `&ref`."##,
20586 default_severity: Severity::Allow,
20587 warn_since: None,
20588 deny_since: None,
20589 },
20590 Lint {
20591 label: "clippy::needless_borrows_for_generic_args",
20592 description: r##"Checks for borrow operations (`&`) that are used as a generic argument to a
20593function when the borrowed value could be used."##,
20594 default_severity: Severity::Allow,
20595 warn_since: None,
20596 deny_since: None,
20597 },
20598 Lint {
20599 label: "clippy::needless_character_iteration",
20600 description: r##"Checks if an iterator is used to check if a string is ascii."##,
20601 default_severity: Severity::Allow,
20602 warn_since: None,
20603 deny_since: None,
20604 },
20605 Lint {
20606 label: "clippy::needless_collect",
20607 description: r##"Checks for functions collecting an iterator when collect
20608is not needed."##,
20609 default_severity: Severity::Allow,
20610 warn_since: None,
20611 deny_since: None,
20612 },
20613 Lint {
20614 label: "clippy::needless_continue",
20615 description: r##"The lint checks for `if`-statements appearing in loops
20616that contain a `continue` statement in either their main blocks or their
20617`else`-blocks, when omitting the `else`-block possibly with some
20618rearrangement of code can make the code easier to understand."##,
20619 default_severity: Severity::Allow,
20620 warn_since: None,
20621 deny_since: None,
20622 },
20623 Lint {
20624 label: "clippy::needless_doctest_main",
20625 description: r##"Checks for `fn main() { .. }` in doctests"##,
20626 default_severity: Severity::Allow,
20627 warn_since: None,
20628 deny_since: None,
20629 },
20630 Lint {
20631 label: "clippy::needless_else",
20632 description: r##"Checks for empty `else` branches."##,
20633 default_severity: Severity::Allow,
20634 warn_since: None,
20635 deny_since: None,
20636 },
20637 Lint {
20638 label: "clippy::needless_for_each",
20639 description: r##"Checks for usage of `for_each` that would be more simply written as a
20640`for` loop."##,
20641 default_severity: Severity::Allow,
20642 warn_since: None,
20643 deny_since: None,
20644 },
20645 Lint {
20646 label: "clippy::needless_if",
20647 description: r##"Checks for empty `if` branches with no else branch."##,
20648 default_severity: Severity::Allow,
20649 warn_since: None,
20650 deny_since: None,
20651 },
20652 Lint {
20653 label: "clippy::needless_late_init",
20654 description: r##"Checks for late initializations that can be replaced by a `let` statement
20655with an initializer."##,
20656 default_severity: Severity::Allow,
20657 warn_since: None,
20658 deny_since: None,
20659 },
20660 Lint {
20661 label: "clippy::needless_lifetimes",
20662 description: r##"Checks for lifetime annotations which can be removed by
20663relying on lifetime elision."##,
20664 default_severity: Severity::Allow,
20665 warn_since: None,
20666 deny_since: None,
20667 },
20668 Lint {
20669 label: "clippy::needless_match",
20670 description: r##"Checks for unnecessary `match` or match-like `if let` returns for `Option` and `Result`
20671when function signatures are the same."##,
20672 default_severity: Severity::Allow,
20673 warn_since: None,
20674 deny_since: None,
20675 },
20676 Lint {
20677 label: "clippy::needless_maybe_sized",
20678 description: r##"Lints `?Sized` bounds applied to type parameters that cannot be unsized"##,
20679 default_severity: Severity::Allow,
20680 warn_since: None,
20681 deny_since: None,
20682 },
20683 Lint {
20684 label: "clippy::needless_option_as_deref",
20685 description: r##"Checks for no-op uses of `Option::{as_deref, as_deref_mut}`,
20686for example, `Option<&T>::as_deref()` returns the same type."##,
20687 default_severity: Severity::Allow,
20688 warn_since: None,
20689 deny_since: None,
20690 },
20691 Lint {
20692 label: "clippy::needless_option_take",
20693 description: r##"Checks for calling `take` function after `as_ref`."##,
20694 default_severity: Severity::Allow,
20695 warn_since: None,
20696 deny_since: None,
20697 },
20698 Lint {
20699 label: "clippy::needless_parens_on_range_literals",
20700 description: r##"The lint checks for parenthesis on literals in range statements that are
20701superfluous."##,
20702 default_severity: Severity::Allow,
20703 warn_since: None,
20704 deny_since: None,
20705 },
20706 Lint {
20707 label: "clippy::needless_pass_by_ref_mut",
20708 description: r##"Check if a `&mut` function argument is actually used mutably.
20709
20710Be careful if the function is publicly reexported as it would break compatibility with
20711users of this function, when the users pass this function as an argument."##,
20712 default_severity: Severity::Allow,
20713 warn_since: None,
20714 deny_since: None,
20715 },
20716 Lint {
20717 label: "clippy::needless_pass_by_value",
20718 description: r##"Checks for functions taking arguments by value, but not
20719consuming them in its
20720body."##,
20721 default_severity: Severity::Allow,
20722 warn_since: None,
20723 deny_since: None,
20724 },
20725 Lint {
20726 label: "clippy::needless_pub_self",
20727 description: r##"Checks for usage of `pub(self)` and `pub(in self)`."##,
20728 default_severity: Severity::Allow,
20729 warn_since: None,
20730 deny_since: None,
20731 },
20732 Lint {
20733 label: "clippy::needless_question_mark",
20734 description: r##"Suggests alternatives for useless applications of `?` in terminating expressions"##,
20735 default_severity: Severity::Allow,
20736 warn_since: None,
20737 deny_since: None,
20738 },
20739 Lint {
20740 label: "clippy::needless_range_loop",
20741 description: r##"Checks for looping over the range of `0..len` of some
20742collection just to get the values by index."##,
20743 default_severity: Severity::Allow,
20744 warn_since: None,
20745 deny_since: None,
20746 },
20747 Lint {
20748 label: "clippy::needless_raw_string_hashes",
20749 description: r##"Checks for raw string literals with an unnecessary amount of hashes around them."##,
20750 default_severity: Severity::Allow,
20751 warn_since: None,
20752 deny_since: None,
20753 },
20754 Lint {
20755 label: "clippy::needless_raw_strings",
20756 description: r##"Checks for raw string literals where a string literal can be used instead."##,
20757 default_severity: Severity::Allow,
20758 warn_since: None,
20759 deny_since: None,
20760 },
20761 Lint {
20762 label: "clippy::needless_return",
20763 description: r##"Checks for return statements at the end of a block."##,
20764 default_severity: Severity::Allow,
20765 warn_since: None,
20766 deny_since: None,
20767 },
20768 Lint {
20769 label: "clippy::needless_return_with_question_mark",
20770 description: r##"Checks for return statements on `Err` paired with the `?` operator."##,
20771 default_severity: Severity::Allow,
20772 warn_since: None,
20773 deny_since: None,
20774 },
20775 Lint {
20776 label: "clippy::needless_splitn",
20777 description: r##"Checks for usage of `str::splitn` (or `str::rsplitn`) where using `str::split` would be the same."##,
20778 default_severity: Severity::Allow,
20779 warn_since: None,
20780 deny_since: None,
20781 },
20782 Lint {
20783 label: "clippy::needless_update",
20784 description: r##"Checks for needlessly including a base struct on update
20785when all fields are changed anyway.
20786
20787This lint is not applied to structs marked with
20788[non_exhaustive](https://doc.rust-lang.org/reference/attributes/type_system.html)."##,
20789 default_severity: Severity::Allow,
20790 warn_since: None,
20791 deny_since: None,
20792 },
20793 Lint {
20794 label: "clippy::neg_cmp_op_on_partial_ord",
20795 description: r##"Checks for the usage of negated comparison operators on types which only implement
20796`PartialOrd` (e.g., `f64`)."##,
20797 default_severity: Severity::Allow,
20798 warn_since: None,
20799 deny_since: None,
20800 },
20801 Lint {
20802 label: "clippy::neg_multiply",
20803 description: r##"Checks for multiplication by -1 as a form of negation."##,
20804 default_severity: Severity::Allow,
20805 warn_since: None,
20806 deny_since: None,
20807 },
20808 Lint {
20809 label: "clippy::negative_feature_names",
20810 description: r##"Checks for negative feature names with prefix `no-` or `not-`"##,
20811 default_severity: Severity::Allow,
20812 warn_since: None,
20813 deny_since: None,
20814 },
20815 Lint {
20816 label: "clippy::never_loop",
20817 description: r##"Checks for loops that will always `break`, `return` or
20818`continue` an outer loop."##,
20819 default_severity: Severity::Allow,
20820 warn_since: None,
20821 deny_since: None,
20822 },
20823 Lint {
20824 label: "clippy::new_ret_no_self",
20825 description: r##"Checks for `new` not returning a type that contains `Self`."##,
20826 default_severity: Severity::Allow,
20827 warn_since: None,
20828 deny_since: None,
20829 },
20830 Lint {
20831 label: "clippy::new_without_default",
20832 description: r##"Checks for public types with a `pub fn new() -> Self` method and no
20833implementation of
20834[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html)."##,
20835 default_severity: Severity::Allow,
20836 warn_since: None,
20837 deny_since: None,
20838 },
20839 Lint {
20840 label: "clippy::no_effect",
20841 description: r##"Checks for statements which have no effect."##,
20842 default_severity: Severity::Allow,
20843 warn_since: None,
20844 deny_since: None,
20845 },
20846 Lint {
20847 label: "clippy::no_effect_replace",
20848 description: r##"Checks for `replace` statements which have no effect."##,
20849 default_severity: Severity::Allow,
20850 warn_since: None,
20851 deny_since: None,
20852 },
20853 Lint {
20854 label: "clippy::no_effect_underscore_binding",
20855 description: r##"Checks for binding to underscore prefixed variable without side-effects."##,
20856 default_severity: Severity::Allow,
20857 warn_since: None,
20858 deny_since: None,
20859 },
20860 Lint {
20861 label: "clippy::no_mangle_with_rust_abi",
20862 description: r##"Checks for Rust ABI functions with the `#[no_mangle]` attribute."##,
20863 default_severity: Severity::Allow,
20864 warn_since: None,
20865 deny_since: None,
20866 },
20867 Lint {
20868 label: "clippy::non_ascii_literal",
20869 description: r##"Checks for non-ASCII characters in string and char literals."##,
20870 default_severity: Severity::Allow,
20871 warn_since: None,
20872 deny_since: None,
20873 },
20874 Lint {
20875 label: "clippy::non_canonical_clone_impl",
20876 description: r##"Checks for non-canonical implementations of `Clone` when `Copy` is already implemented."##,
20877 default_severity: Severity::Allow,
20878 warn_since: None,
20879 deny_since: None,
20880 },
20881 Lint {
20882 label: "clippy::non_canonical_partial_ord_impl",
20883 description: r##"Checks for non-canonical implementations of `PartialOrd` when `Ord` is already implemented."##,
20884 default_severity: Severity::Allow,
20885 warn_since: None,
20886 deny_since: None,
20887 },
20888 Lint {
20889 label: "clippy::non_minimal_cfg",
20890 description: r##"Checks for `any` and `all` combinators in `cfg` with only one condition."##,
20891 default_severity: Severity::Allow,
20892 warn_since: None,
20893 deny_since: None,
20894 },
20895 Lint {
20896 label: "clippy::non_octal_unix_permissions",
20897 description: r##"Checks for non-octal values used to set Unix file permissions."##,
20898 default_severity: Severity::Allow,
20899 warn_since: None,
20900 deny_since: None,
20901 },
20902 Lint {
20903 label: "clippy::non_send_fields_in_send_ty",
20904 description: r##"This lint warns about a `Send` implementation for a type that
20905contains fields that are not safe to be sent across threads.
20906It tries to detect fields that can cause a soundness issue
20907when sent to another thread (e.g., `Rc`) while allowing `!Send` fields
20908that are expected to exist in a `Send` type, such as raw pointers."##,
20909 default_severity: Severity::Allow,
20910 warn_since: None,
20911 deny_since: None,
20912 },
20913 Lint {
20914 label: "clippy::non_zero_suggestions",
20915 description: r##"Checks for conversions from `NonZero` types to regular integer types,
20916and suggests using `NonZero` types for the target as well."##,
20917 default_severity: Severity::Allow,
20918 warn_since: None,
20919 deny_since: None,
20920 },
20921 Lint {
20922 label: "clippy::nonminimal_bool",
20923 description: r##"Checks for boolean expressions that can be written more
20924concisely."##,
20925 default_severity: Severity::Allow,
20926 warn_since: None,
20927 deny_since: None,
20928 },
20929 Lint {
20930 label: "clippy::nonsensical_open_options",
20931 description: r##"Checks for duplicate open options as well as combinations
20932that make no sense."##,
20933 default_severity: Severity::Allow,
20934 warn_since: None,
20935 deny_since: None,
20936 },
20937 Lint {
20938 label: "clippy::nonstandard_macro_braces",
20939 description: r##"Checks that common macros are used with consistent bracing."##,
20940 default_severity: Severity::Allow,
20941 warn_since: None,
20942 deny_since: None,
20943 },
20944 Lint {
20945 label: "clippy::not_unsafe_ptr_arg_deref",
20946 description: r##"Checks for public functions that dereference raw pointer
20947arguments but are not marked `unsafe`."##,
20948 default_severity: Severity::Allow,
20949 warn_since: None,
20950 deny_since: None,
20951 },
20952 Lint {
20953 label: "clippy::obfuscated_if_else",
20954 description: r##"Checks for usage of `.then_some(..).unwrap_or(..)`"##,
20955 default_severity: Severity::Allow,
20956 warn_since: None,
20957 deny_since: None,
20958 },
20959 Lint {
20960 label: "clippy::octal_escapes",
20961 description: r##"Checks for `\\0` escapes in string and byte literals that look like octal
20962character escapes in C."##,
20963 default_severity: Severity::Allow,
20964 warn_since: None,
20965 deny_since: None,
20966 },
20967 Lint {
20968 label: "clippy::ok_expect",
20969 description: r##"Checks for usage of `ok().expect(..)`."##,
20970 default_severity: Severity::Allow,
20971 warn_since: None,
20972 deny_since: None,
20973 },
20974 Lint {
20975 label: "clippy::only_used_in_recursion",
20976 description: r##"Checks for arguments that are only used in recursion with no side-effects."##,
20977 default_severity: Severity::Allow,
20978 warn_since: None,
20979 deny_since: None,
20980 },
20981 Lint {
20982 label: "clippy::op_ref",
20983 description: r##"Checks for arguments to `==` which have their address
20984taken to satisfy a bound
20985and suggests to dereference the other argument instead"##,
20986 default_severity: Severity::Allow,
20987 warn_since: None,
20988 deny_since: None,
20989 },
20990 Lint {
20991 label: "clippy::option_as_ref_cloned",
20992 description: r##"Checks for usage of `.as_ref().cloned()` and `.as_mut().cloned()` on `Option`s"##,
20993 default_severity: Severity::Allow,
20994 warn_since: None,
20995 deny_since: None,
20996 },
20997 Lint {
20998 label: "clippy::option_as_ref_deref",
20999 description: r##"Checks for usage of `_.as_ref().map(Deref::deref)` or its aliases (such as String::as_str)."##,
21000 default_severity: Severity::Allow,
21001 warn_since: None,
21002 deny_since: None,
21003 },
21004 Lint {
21005 label: "clippy::option_env_unwrap",
21006 description: r##"Checks for usage of `option_env!(...).unwrap()` and
21007suggests usage of the `env!` macro."##,
21008 default_severity: Severity::Allow,
21009 warn_since: None,
21010 deny_since: None,
21011 },
21012 Lint {
21013 label: "clippy::option_filter_map",
21014 description: r##"Checks for iterators of `Option`s using `.filter(Option::is_some).map(Option::unwrap)` that may
21015be replaced with a `.flatten()` call."##,
21016 default_severity: Severity::Allow,
21017 warn_since: None,
21018 deny_since: None,
21019 },
21020 Lint {
21021 label: "clippy::option_if_let_else",
21022 description: r##"Lints usage of `if let Some(v) = ... { y } else { x }` and
21023`match .. { Some(v) => y, None/_ => x }` which are more
21024idiomatically done with `Option::map_or` (if the else bit is a pure
21025expression) or `Option::map_or_else` (if the else bit is an impure
21026expression)."##,
21027 default_severity: Severity::Allow,
21028 warn_since: None,
21029 deny_since: None,
21030 },
21031 Lint {
21032 label: "clippy::option_map_or_err_ok",
21033 description: r##"Checks for usage of `_.map_or(Err(_), Ok)`."##,
21034 default_severity: Severity::Allow,
21035 warn_since: None,
21036 deny_since: None,
21037 },
21038 Lint {
21039 label: "clippy::option_map_or_none",
21040 description: r##"Checks for usage of `_.map_or(None, _)`."##,
21041 default_severity: Severity::Allow,
21042 warn_since: None,
21043 deny_since: None,
21044 },
21045 Lint {
21046 label: "clippy::option_map_unit_fn",
21047 description: r##"Checks for usage of `option.map(f)` where f is a function
21048or closure that returns the unit type `()`."##,
21049 default_severity: Severity::Allow,
21050 warn_since: None,
21051 deny_since: None,
21052 },
21053 Lint {
21054 label: "clippy::option_option",
21055 description: r##"Checks for usage of `Option<Option<_>>` in function signatures and type
21056definitions"##,
21057 default_severity: Severity::Allow,
21058 warn_since: None,
21059 deny_since: None,
21060 },
21061 Lint {
21062 label: "clippy::or_fun_call",
21063 description: r##"Checks for calls to `.or(foo(..))`, `.unwrap_or(foo(..))`,
21064`.or_insert(foo(..))` etc., and suggests to use `.or_else(|| foo(..))`,
21065`.unwrap_or_else(|| foo(..))`, `.unwrap_or_default()` or `.or_default()`
21066etc. instead."##,
21067 default_severity: Severity::Allow,
21068 warn_since: None,
21069 deny_since: None,
21070 },
21071 Lint {
21072 label: "clippy::or_then_unwrap",
21073 description: r##"Checks for `.or(…).unwrap()` calls to Options and Results."##,
21074 default_severity: Severity::Allow,
21075 warn_since: None,
21076 deny_since: None,
21077 },
21078 Lint {
21079 label: "clippy::out_of_bounds_indexing",
21080 description: r##"Checks for out of bounds array indexing with a constant
21081index."##,
21082 default_severity: Severity::Allow,
21083 warn_since: None,
21084 deny_since: None,
21085 },
21086 Lint {
21087 label: "clippy::overly_complex_bool_expr",
21088 description: r##"Checks for boolean expressions that contain terminals that
21089can be eliminated."##,
21090 default_severity: Severity::Allow,
21091 warn_since: None,
21092 deny_since: None,
21093 },
21094 Lint {
21095 label: "clippy::panic",
21096 description: r##"Checks for usage of `panic!`."##,
21097 default_severity: Severity::Allow,
21098 warn_since: None,
21099 deny_since: None,
21100 },
21101 Lint {
21102 label: "clippy::panic_in_result_fn",
21103 description: r##"Checks for usage of `panic!` or assertions in a function whose return type is `Result`."##,
21104 default_severity: Severity::Allow,
21105 warn_since: None,
21106 deny_since: None,
21107 },
21108 Lint {
21109 label: "clippy::panicking_overflow_checks",
21110 description: r##"Detects C-style underflow/overflow checks."##,
21111 default_severity: Severity::Allow,
21112 warn_since: None,
21113 deny_since: None,
21114 },
21115 Lint {
21116 label: "clippy::panicking_unwrap",
21117 description: r##"Checks for calls of `unwrap[_err]()` that will always fail."##,
21118 default_severity: Severity::Allow,
21119 warn_since: None,
21120 deny_since: None,
21121 },
21122 Lint {
21123 label: "clippy::partial_pub_fields",
21124 description: r##"Checks whether some but not all fields of a `struct` are public.
21125
21126Either make all fields of a type public, or make none of them public"##,
21127 default_severity: Severity::Allow,
21128 warn_since: None,
21129 deny_since: None,
21130 },
21131 Lint {
21132 label: "clippy::partialeq_ne_impl",
21133 description: r##"Checks for manual re-implementations of `PartialEq::ne`."##,
21134 default_severity: Severity::Allow,
21135 warn_since: None,
21136 deny_since: None,
21137 },
21138 Lint {
21139 label: "clippy::partialeq_to_none",
21140 description: r##"Checks for binary comparisons to a literal `Option::None`."##,
21141 default_severity: Severity::Allow,
21142 warn_since: None,
21143 deny_since: None,
21144 },
21145 Lint {
21146 label: "clippy::path_buf_push_overwrite",
21147 description: r##"* Checks for [push](https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.push)
21148calls on `PathBuf` that can cause overwrites."##,
21149 default_severity: Severity::Allow,
21150 warn_since: None,
21151 deny_since: None,
21152 },
21153 Lint {
21154 label: "clippy::path_ends_with_ext",
21155 description: r##"Looks for calls to `Path::ends_with` calls where the argument looks like a file extension.
21156
21157By default, Clippy has a short list of known filenames that start with a dot
21158but aren't necessarily file extensions (e.g. the `.git` folder), which are allowed by default.
21159The `allowed-dotfiles` configuration can be used to allow additional
21160file extensions that Clippy should not lint."##,
21161 default_severity: Severity::Allow,
21162 warn_since: None,
21163 deny_since: None,
21164 },
21165 Lint {
21166 label: "clippy::pathbuf_init_then_push",
21167 description: r##"Checks for calls to `push` immediately after creating a new `PathBuf`."##,
21168 default_severity: Severity::Allow,
21169 warn_since: None,
21170 deny_since: None,
21171 },
21172 Lint {
21173 label: "clippy::pattern_type_mismatch",
21174 description: r##"Checks for patterns that aren't exact representations of the types
21175they are applied to.
21176
21177To satisfy this lint, you will have to adjust either the expression that is matched
21178against or the pattern itself, as well as the bindings that are introduced by the
21179adjusted patterns. For matching you will have to either dereference the expression
21180with the `*` operator, or amend the patterns to explicitly match against `&<pattern>`
21181or `&mut <pattern>` depending on the reference mutability. For the bindings you need
21182to use the inverse. You can leave them as plain bindings if you wish for the value
21183to be copied, but you must use `ref mut <variable>` or `ref <variable>` to construct
21184a reference into the matched structure.
21185
21186If you are looking for a way to learn about ownership semantics in more detail, it
21187is recommended to look at IDE options available to you to highlight types, lifetimes
21188and reference semantics in your code. The available tooling would expose these things
21189in a general way even outside of the various pattern matching mechanics. Of course
21190this lint can still be used to highlight areas of interest and ensure a good understanding
21191of ownership semantics."##,
21192 default_severity: Severity::Allow,
21193 warn_since: None,
21194 deny_since: None,
21195 },
21196 Lint {
21197 label: "clippy::permissions_set_readonly_false",
21198 description: r##"Checks for calls to `std::fs::Permissions.set_readonly` with argument `false`."##,
21199 default_severity: Severity::Allow,
21200 warn_since: None,
21201 deny_since: None,
21202 },
21203 Lint {
21204 label: "clippy::pointers_in_nomem_asm_block",
21205 description: r##"Checks if any pointer is being passed to an asm! block with `nomem` option."##,
21206 default_severity: Severity::Allow,
21207 warn_since: None,
21208 deny_since: None,
21209 },
21210 Lint {
21211 label: "clippy::possible_missing_comma",
21212 description: r##"Checks for possible missing comma in an array. It lints if
21213an array element is a binary operator expression and it lies on two lines."##,
21214 default_severity: Severity::Allow,
21215 warn_since: None,
21216 deny_since: None,
21217 },
21218 Lint {
21219 label: "clippy::precedence",
21220 description: r##"Checks for operations where precedence may be unclear
21221and suggests to add parentheses. Currently it catches the following:
21222* mixed usage of arithmetic and bit shifting/combining operators without
21223parentheses"##,
21224 default_severity: Severity::Allow,
21225 warn_since: None,
21226 deny_since: None,
21227 },
21228 Lint {
21229 label: "clippy::print_in_format_impl",
21230 description: r##"Checks for usage of `println`, `print`, `eprintln` or `eprint` in an
21231implementation of a formatting trait."##,
21232 default_severity: Severity::Allow,
21233 warn_since: None,
21234 deny_since: None,
21235 },
21236 Lint {
21237 label: "clippy::print_literal",
21238 description: r##"This lint warns about the use of literals as `print!`/`println!` args."##,
21239 default_severity: Severity::Allow,
21240 warn_since: None,
21241 deny_since: None,
21242 },
21243 Lint {
21244 label: "clippy::print_stderr",
21245 description: r##"Checks for printing on *stderr*. The purpose of this lint
21246is to catch debugging remnants."##,
21247 default_severity: Severity::Allow,
21248 warn_since: None,
21249 deny_since: None,
21250 },
21251 Lint {
21252 label: "clippy::print_stdout",
21253 description: r##"Checks for printing on *stdout*. The purpose of this lint
21254is to catch debugging remnants."##,
21255 default_severity: Severity::Allow,
21256 warn_since: None,
21257 deny_since: None,
21258 },
21259 Lint {
21260 label: "clippy::print_with_newline",
21261 description: r##"This lint warns when you use `print!()` with a format
21262string that ends in a newline."##,
21263 default_severity: Severity::Allow,
21264 warn_since: None,
21265 deny_since: None,
21266 },
21267 Lint {
21268 label: "clippy::println_empty_string",
21269 description: r##"This lint warns when you use `println!()` to
21270print a newline."##,
21271 default_severity: Severity::Allow,
21272 warn_since: None,
21273 deny_since: None,
21274 },
21275 Lint {
21276 label: "clippy::ptr_arg",
21277 description: r##"This lint checks for function arguments of type `&String`, `&Vec`,
21278`&PathBuf`, and `Cow<_>`. It will also suggest you replace `.clone()` calls
21279with the appropriate `.to_owned()`/`to_string()` calls."##,
21280 default_severity: Severity::Allow,
21281 warn_since: None,
21282 deny_since: None,
21283 },
21284 Lint {
21285 label: "clippy::ptr_as_ptr",
21286 description: r##"Checks for `as` casts between raw pointers that don't change their
21287constness, namely `*const T` to `*const U` and `*mut T` to `*mut U`."##,
21288 default_severity: Severity::Allow,
21289 warn_since: None,
21290 deny_since: None,
21291 },
21292 Lint {
21293 label: "clippy::ptr_cast_constness",
21294 description: r##"Checks for `as` casts between raw pointers that change their constness, namely `*const T` to
21295`*mut T` and `*mut T` to `*const T`."##,
21296 default_severity: Severity::Allow,
21297 warn_since: None,
21298 deny_since: None,
21299 },
21300 Lint {
21301 label: "clippy::ptr_eq",
21302 description: r##"Use `std::ptr::eq` when applicable"##,
21303 default_severity: Severity::Allow,
21304 warn_since: None,
21305 deny_since: None,
21306 },
21307 Lint {
21308 label: "clippy::ptr_offset_with_cast",
21309 description: r##"Checks for usage of the `offset` pointer method with a `usize` casted to an
21310`isize`."##,
21311 default_severity: Severity::Allow,
21312 warn_since: None,
21313 deny_since: None,
21314 },
21315 Lint {
21316 label: "clippy::pub_enum_variant_names",
21317 description: r##"Nothing. This lint has been deprecated"##,
21318 default_severity: Severity::Allow,
21319 warn_since: None,
21320 deny_since: None,
21321 },
21322 Lint {
21323 label: "clippy::pub_underscore_fields",
21324 description: r##"Checks whether any field of the struct is prefixed with an `_` (underscore) and also marked
21325`pub` (public)"##,
21326 default_severity: Severity::Allow,
21327 warn_since: None,
21328 deny_since: None,
21329 },
21330 Lint {
21331 label: "clippy::pub_use",
21332 description: r##"Restricts the usage of `pub use ...`"##,
21333 default_severity: Severity::Allow,
21334 warn_since: None,
21335 deny_since: None,
21336 },
21337 Lint {
21338 label: "clippy::pub_with_shorthand",
21339 description: r##"Checks for usage of `pub(<loc>)` with `in`."##,
21340 default_severity: Severity::Allow,
21341 warn_since: None,
21342 deny_since: None,
21343 },
21344 Lint {
21345 label: "clippy::pub_without_shorthand",
21346 description: r##"Checks for usage of `pub(<loc>)` without `in`.
21347
21348Note: As you cannot write a module's path in `pub(<loc>)`, this will only trigger on
21349`pub(super)` and the like."##,
21350 default_severity: Severity::Allow,
21351 warn_since: None,
21352 deny_since: None,
21353 },
21354 Lint {
21355 label: "clippy::question_mark",
21356 description: r##"Checks for expressions that could be replaced by the question mark operator."##,
21357 default_severity: Severity::Allow,
21358 warn_since: None,
21359 deny_since: None,
21360 },
21361 Lint {
21362 label: "clippy::question_mark_used",
21363 description: r##"Checks for expressions that use the question mark operator and rejects them."##,
21364 default_severity: Severity::Allow,
21365 warn_since: None,
21366 deny_since: None,
21367 },
21368 Lint {
21369 label: "clippy::range_minus_one",
21370 description: r##"Checks for inclusive ranges where 1 is subtracted from
21371the upper bound, e.g., `x..=(y-1)`."##,
21372 default_severity: Severity::Allow,
21373 warn_since: None,
21374 deny_since: None,
21375 },
21376 Lint {
21377 label: "clippy::range_plus_one",
21378 description: r##"Checks for exclusive ranges where 1 is added to the
21379upper bound, e.g., `x..(y+1)`."##,
21380 default_severity: Severity::Allow,
21381 warn_since: None,
21382 deny_since: None,
21383 },
21384 Lint {
21385 label: "clippy::range_step_by_zero",
21386 description: r##"Nothing. This lint has been deprecated"##,
21387 default_severity: Severity::Allow,
21388 warn_since: None,
21389 deny_since: None,
21390 },
21391 Lint {
21392 label: "clippy::range_zip_with_len",
21393 description: r##"Checks for zipping a collection with the range of
21394`0.._.len()`."##,
21395 default_severity: Severity::Allow,
21396 warn_since: None,
21397 deny_since: None,
21398 },
21399 Lint {
21400 label: "clippy::rc_buffer",
21401 description: r##"Checks for `Rc<T>` and `Arc<T>` when `T` is a mutable buffer type such as `String` or `Vec`."##,
21402 default_severity: Severity::Allow,
21403 warn_since: None,
21404 deny_since: None,
21405 },
21406 Lint {
21407 label: "clippy::rc_clone_in_vec_init",
21408 description: r##"Checks for reference-counted pointers (`Arc`, `Rc`, `rc::Weak`, and `sync::Weak`)
21409in `vec![elem; len]`"##,
21410 default_severity: Severity::Allow,
21411 warn_since: None,
21412 deny_since: None,
21413 },
21414 Lint {
21415 label: "clippy::rc_mutex",
21416 description: r##"Checks for `Rc<Mutex<T>>`."##,
21417 default_severity: Severity::Allow,
21418 warn_since: None,
21419 deny_since: None,
21420 },
21421 Lint {
21422 label: "clippy::read_line_without_trim",
21423 description: r##"Looks for calls to [`Stdin::read_line`] to read a line from the standard input
21424into a string, then later attempting to use that string for an operation that will never
21425work for strings with a trailing newline character in it (e.g. parsing into a `i32`)."##,
21426 default_severity: Severity::Allow,
21427 warn_since: None,
21428 deny_since: None,
21429 },
21430 Lint {
21431 label: "clippy::read_zero_byte_vec",
21432 description: r##"This lint catches reads into a zero-length `Vec`.
21433Especially in the case of a call to `with_capacity`, this lint warns that read
21434gets the number of bytes from the `Vec`'s length, not its capacity."##,
21435 default_severity: Severity::Allow,
21436 warn_since: None,
21437 deny_since: None,
21438 },
21439 Lint {
21440 label: "clippy::readonly_write_lock",
21441 description: r##"Looks for calls to `RwLock::write` where the lock is only used for reading."##,
21442 default_severity: Severity::Allow,
21443 warn_since: None,
21444 deny_since: None,
21445 },
21446 Lint {
21447 label: "clippy::recursive_format_impl",
21448 description: r##"Checks for format trait implementations (e.g. `Display`) with a recursive call to itself
21449which uses `self` as a parameter.
21450This is typically done indirectly with the `write!` macro or with `to_string()`."##,
21451 default_severity: Severity::Allow,
21452 warn_since: None,
21453 deny_since: None,
21454 },
21455 Lint {
21456 label: "clippy::redundant_allocation",
21457 description: r##"Checks for usage of redundant allocations anywhere in the code."##,
21458 default_severity: Severity::Allow,
21459 warn_since: None,
21460 deny_since: None,
21461 },
21462 Lint {
21463 label: "clippy::redundant_as_str",
21464 description: r##"Checks for usage of `as_str()` on a `String` chained with a method available on the `String` itself."##,
21465 default_severity: Severity::Allow,
21466 warn_since: None,
21467 deny_since: None,
21468 },
21469 Lint {
21470 label: "clippy::redundant_async_block",
21471 description: r##"Checks for `async` block that only returns `await` on a future."##,
21472 default_severity: Severity::Allow,
21473 warn_since: None,
21474 deny_since: None,
21475 },
21476 Lint {
21477 label: "clippy::redundant_at_rest_pattern",
21478 description: r##"Checks for `[all @ ..]` patterns."##,
21479 default_severity: Severity::Allow,
21480 warn_since: None,
21481 deny_since: None,
21482 },
21483 Lint {
21484 label: "clippy::redundant_clone",
21485 description: r##"Checks for a redundant `clone()` (and its relatives) which clones an owned
21486value that is going to be dropped without further use."##,
21487 default_severity: Severity::Allow,
21488 warn_since: None,
21489 deny_since: None,
21490 },
21491 Lint {
21492 label: "clippy::redundant_closure",
21493 description: r##"Checks for closures which just call another function where
21494the function can be called directly. `unsafe` functions, calls where types
21495get adjusted or where the callee is marked `#[track_caller]` are ignored."##,
21496 default_severity: Severity::Allow,
21497 warn_since: None,
21498 deny_since: None,
21499 },
21500 Lint {
21501 label: "clippy::redundant_closure_call",
21502 description: r##"Detects closures called in the same expression where they
21503are defined."##,
21504 default_severity: Severity::Allow,
21505 warn_since: None,
21506 deny_since: None,
21507 },
21508 Lint {
21509 label: "clippy::redundant_closure_for_method_calls",
21510 description: r##"Checks for closures which only invoke a method on the closure
21511argument and can be replaced by referencing the method directly."##,
21512 default_severity: Severity::Allow,
21513 warn_since: None,
21514 deny_since: None,
21515 },
21516 Lint {
21517 label: "clippy::redundant_comparisons",
21518 description: r##"Checks for ineffective double comparisons against constants."##,
21519 default_severity: Severity::Allow,
21520 warn_since: None,
21521 deny_since: None,
21522 },
21523 Lint {
21524 label: "clippy::redundant_else",
21525 description: r##"Checks for `else` blocks that can be removed without changing semantics."##,
21526 default_severity: Severity::Allow,
21527 warn_since: None,
21528 deny_since: None,
21529 },
21530 Lint {
21531 label: "clippy::redundant_feature_names",
21532 description: r##"Checks for feature names with prefix `use-`, `with-` or suffix `-support`"##,
21533 default_severity: Severity::Allow,
21534 warn_since: None,
21535 deny_since: None,
21536 },
21537 Lint {
21538 label: "clippy::redundant_field_names",
21539 description: r##"Checks for fields in struct literals where shorthands
21540could be used."##,
21541 default_severity: Severity::Allow,
21542 warn_since: None,
21543 deny_since: None,
21544 },
21545 Lint {
21546 label: "clippy::redundant_guards",
21547 description: r##"Checks for unnecessary guards in match expressions."##,
21548 default_severity: Severity::Allow,
21549 warn_since: None,
21550 deny_since: None,
21551 },
21552 Lint {
21553 label: "clippy::redundant_locals",
21554 description: r##"Checks for redundant redefinitions of local bindings."##,
21555 default_severity: Severity::Allow,
21556 warn_since: None,
21557 deny_since: None,
21558 },
21559 Lint {
21560 label: "clippy::redundant_pattern",
21561 description: r##"Checks for patterns in the form `name @ _`."##,
21562 default_severity: Severity::Allow,
21563 warn_since: None,
21564 deny_since: None,
21565 },
21566 Lint {
21567 label: "clippy::redundant_pattern_matching",
21568 description: r##"Lint for redundant pattern matching over `Result`, `Option`,
21569`std::task::Poll`, `std::net::IpAddr` or `bool`s"##,
21570 default_severity: Severity::Allow,
21571 warn_since: None,
21572 deny_since: None,
21573 },
21574 Lint {
21575 label: "clippy::redundant_pub_crate",
21576 description: r##"Checks for items declared `pub(crate)` that are not crate visible because they
21577are inside a private module."##,
21578 default_severity: Severity::Allow,
21579 warn_since: None,
21580 deny_since: None,
21581 },
21582 Lint {
21583 label: "clippy::redundant_slicing",
21584 description: r##"Checks for redundant slicing expressions which use the full range, and
21585do not change the type."##,
21586 default_severity: Severity::Allow,
21587 warn_since: None,
21588 deny_since: None,
21589 },
21590 Lint {
21591 label: "clippy::redundant_static_lifetimes",
21592 description: r##"Checks for constants and statics with an explicit `'static` lifetime."##,
21593 default_severity: Severity::Allow,
21594 warn_since: None,
21595 deny_since: None,
21596 },
21597 Lint {
21598 label: "clippy::redundant_type_annotations",
21599 description: r##"Warns about needless / redundant type annotations."##,
21600 default_severity: Severity::Allow,
21601 warn_since: None,
21602 deny_since: None,
21603 },
21604 Lint {
21605 label: "clippy::ref_as_ptr",
21606 description: r##"Checks for casts of references to pointer using `as`
21607and suggests `std::ptr::from_ref` and `std::ptr::from_mut` instead."##,
21608 default_severity: Severity::Allow,
21609 warn_since: None,
21610 deny_since: None,
21611 },
21612 Lint {
21613 label: "clippy::ref_binding_to_reference",
21614 description: r##"Checks for `ref` bindings which create a reference to a reference."##,
21615 default_severity: Severity::Allow,
21616 warn_since: None,
21617 deny_since: None,
21618 },
21619 Lint {
21620 label: "clippy::ref_option",
21621 description: r##"Warns when a function signature uses `&Option<T>` instead of `Option<&T>`."##,
21622 default_severity: Severity::Allow,
21623 warn_since: None,
21624 deny_since: None,
21625 },
21626 Lint {
21627 label: "clippy::ref_option_ref",
21628 description: r##"Checks for usage of `&Option<&T>`."##,
21629 default_severity: Severity::Allow,
21630 warn_since: None,
21631 deny_since: None,
21632 },
21633 Lint {
21634 label: "clippy::ref_patterns",
21635 description: r##"Checks for usages of the `ref` keyword."##,
21636 default_severity: Severity::Allow,
21637 warn_since: None,
21638 deny_since: None,
21639 },
21640 Lint {
21641 label: "clippy::regex_macro",
21642 description: r##"Nothing. This lint has been deprecated"##,
21643 default_severity: Severity::Allow,
21644 warn_since: None,
21645 deny_since: None,
21646 },
21647 Lint {
21648 label: "clippy::renamed_function_params",
21649 description: r##"Lints when the name of function parameters from trait impl is
21650different than its default implementation."##,
21651 default_severity: Severity::Allow,
21652 warn_since: None,
21653 deny_since: None,
21654 },
21655 Lint {
21656 label: "clippy::repeat_once",
21657 description: r##"Checks for usage of `.repeat(1)` and suggest the following method for each types.
21658- `.to_string()` for `str`
21659- `.clone()` for `String`
21660- `.to_vec()` for `slice`
21661
21662The lint will evaluate constant expressions and values as arguments of `.repeat(..)` and emit a message if
21663they are equivalent to `1`. (Related discussion in [rust-clippy#7306](https://github.com/rust-lang/rust-clippy/issues/7306))"##,
21664 default_severity: Severity::Allow,
21665 warn_since: None,
21666 deny_since: None,
21667 },
21668 Lint {
21669 label: "clippy::repeat_vec_with_capacity",
21670 description: r##"Looks for patterns such as `vec![Vec::with_capacity(x); n]` or `iter::repeat(Vec::with_capacity(x))`."##,
21671 default_severity: Severity::Allow,
21672 warn_since: None,
21673 deny_since: None,
21674 },
21675 Lint {
21676 label: "clippy::replace_consts",
21677 description: r##"Nothing. This lint has been deprecated"##,
21678 default_severity: Severity::Allow,
21679 warn_since: None,
21680 deny_since: None,
21681 },
21682 Lint {
21683 label: "clippy::reserve_after_initialization",
21684 description: r##"Informs the user about a more concise way to create a vector with a known capacity."##,
21685 default_severity: Severity::Allow,
21686 warn_since: None,
21687 deny_since: None,
21688 },
21689 Lint {
21690 label: "clippy::rest_pat_in_fully_bound_structs",
21691 description: r##"Checks for unnecessary '..' pattern binding on struct when all fields are explicitly matched."##,
21692 default_severity: Severity::Allow,
21693 warn_since: None,
21694 deny_since: None,
21695 },
21696 Lint {
21697 label: "clippy::result_filter_map",
21698 description: r##"Checks for iterators of `Result`s using `.filter(Result::is_ok).map(Result::unwrap)` that may
21699be replaced with a `.flatten()` call."##,
21700 default_severity: Severity::Allow,
21701 warn_since: None,
21702 deny_since: None,
21703 },
21704 Lint {
21705 label: "clippy::result_large_err",
21706 description: r##"Checks for functions that return `Result` with an unusually large
21707`Err`-variant."##,
21708 default_severity: Severity::Allow,
21709 warn_since: None,
21710 deny_since: None,
21711 },
21712 Lint {
21713 label: "clippy::result_map_or_into_option",
21714 description: r##"Checks for usage of `_.map_or(None, Some)`."##,
21715 default_severity: Severity::Allow,
21716 warn_since: None,
21717 deny_since: None,
21718 },
21719 Lint {
21720 label: "clippy::result_map_unit_fn",
21721 description: r##"Checks for usage of `result.map(f)` where f is a function
21722or closure that returns the unit type `()`."##,
21723 default_severity: Severity::Allow,
21724 warn_since: None,
21725 deny_since: None,
21726 },
21727 Lint {
21728 label: "clippy::result_unit_err",
21729 description: r##"Checks for public functions that return a `Result`
21730with an `Err` type of `()`. It suggests using a custom type that
21731implements `std::error::Error`."##,
21732 default_severity: Severity::Allow,
21733 warn_since: None,
21734 deny_since: None,
21735 },
21736 Lint {
21737 label: "clippy::return_self_not_must_use",
21738 description: r##"This lint warns when a method returning `Self` doesn't have the `#[must_use]` attribute."##,
21739 default_severity: Severity::Allow,
21740 warn_since: None,
21741 deny_since: None,
21742 },
21743 Lint {
21744 label: "clippy::reversed_empty_ranges",
21745 description: r##"Checks for range expressions `x..y` where both `x` and `y`
21746are constant and `x` is greater to `y`. Also triggers if `x` is equal to `y` when they are conditions to a `for` loop."##,
21747 default_severity: Severity::Allow,
21748 warn_since: None,
21749 deny_since: None,
21750 },
21751 Lint {
21752 label: "clippy::same_functions_in_if_condition",
21753 description: r##"Checks for consecutive `if`s with the same function call."##,
21754 default_severity: Severity::Allow,
21755 warn_since: None,
21756 deny_since: None,
21757 },
21758 Lint {
21759 label: "clippy::same_item_push",
21760 description: r##"Checks whether a for loop is being used to push a constant
21761value into a Vec."##,
21762 default_severity: Severity::Allow,
21763 warn_since: None,
21764 deny_since: None,
21765 },
21766 Lint {
21767 label: "clippy::same_name_method",
21768 description: r##"It lints if a struct has two methods with the same name:
21769one from a trait, another not from a trait."##,
21770 default_severity: Severity::Allow,
21771 warn_since: None,
21772 deny_since: None,
21773 },
21774 Lint {
21775 label: "clippy::search_is_some",
21776 description: r##"Checks for an iterator or string search (such as `find()`,
21777`position()`, or `rposition()`) followed by a call to `is_some()` or `is_none()`."##,
21778 default_severity: Severity::Allow,
21779 warn_since: None,
21780 deny_since: None,
21781 },
21782 Lint {
21783 label: "clippy::seek_from_current",
21784 description: r##"Checks if the `seek` method of the `Seek` trait is called with `SeekFrom::Current(0)`,
21785and if it is, suggests using `stream_position` instead."##,
21786 default_severity: Severity::Allow,
21787 warn_since: None,
21788 deny_since: None,
21789 },
21790 Lint {
21791 label: "clippy::seek_to_start_instead_of_rewind",
21792 description: r##"Checks for jumps to the start of a stream that implements `Seek`
21793and uses the `seek` method providing `Start` as parameter."##,
21794 default_severity: Severity::Allow,
21795 warn_since: None,
21796 deny_since: None,
21797 },
21798 Lint {
21799 label: "clippy::self_assignment",
21800 description: r##"Checks for explicit self-assignments."##,
21801 default_severity: Severity::Allow,
21802 warn_since: None,
21803 deny_since: None,
21804 },
21805 Lint {
21806 label: "clippy::self_named_constructors",
21807 description: r##"Warns when constructors have the same name as their types."##,
21808 default_severity: Severity::Allow,
21809 warn_since: None,
21810 deny_since: None,
21811 },
21812 Lint {
21813 label: "clippy::self_named_module_files",
21814 description: r##"Checks that module layout uses only `mod.rs` files."##,
21815 default_severity: Severity::Allow,
21816 warn_since: None,
21817 deny_since: None,
21818 },
21819 Lint {
21820 label: "clippy::semicolon_if_nothing_returned",
21821 description: r##"Looks for blocks of expressions and fires if the last expression returns
21822`()` but is not followed by a semicolon."##,
21823 default_severity: Severity::Allow,
21824 warn_since: None,
21825 deny_since: None,
21826 },
21827 Lint {
21828 label: "clippy::semicolon_inside_block",
21829 description: r##"Suggests moving the semicolon after a block to the inside of the block, after its last
21830expression."##,
21831 default_severity: Severity::Allow,
21832 warn_since: None,
21833 deny_since: None,
21834 },
21835 Lint {
21836 label: "clippy::semicolon_outside_block",
21837 description: r##"Suggests moving the semicolon from a block's final expression outside of the block."##,
21838 default_severity: Severity::Allow,
21839 warn_since: None,
21840 deny_since: None,
21841 },
21842 Lint {
21843 label: "clippy::separated_literal_suffix",
21844 description: r##"Warns if literal suffixes are separated by an underscore.
21845To enforce separated literal suffix style,
21846see the `unseparated_literal_suffix` lint."##,
21847 default_severity: Severity::Allow,
21848 warn_since: None,
21849 deny_since: None,
21850 },
21851 Lint {
21852 label: "clippy::serde_api_misuse",
21853 description: r##"Checks for misuses of the serde API."##,
21854 default_severity: Severity::Allow,
21855 warn_since: None,
21856 deny_since: None,
21857 },
21858 Lint {
21859 label: "clippy::set_contains_or_insert",
21860 description: r##"Checks for usage of `contains` to see if a value is not present
21861in a set like `HashSet` or `BTreeSet`, followed by an `insert`."##,
21862 default_severity: Severity::Allow,
21863 warn_since: None,
21864 deny_since: None,
21865 },
21866 Lint {
21867 label: "clippy::shadow_reuse",
21868 description: r##"Checks for bindings that shadow other bindings already in
21869scope, while reusing the original value."##,
21870 default_severity: Severity::Allow,
21871 warn_since: None,
21872 deny_since: None,
21873 },
21874 Lint {
21875 label: "clippy::shadow_same",
21876 description: r##"Checks for bindings that shadow other bindings already in
21877scope, while just changing reference level or mutability."##,
21878 default_severity: Severity::Allow,
21879 warn_since: None,
21880 deny_since: None,
21881 },
21882 Lint {
21883 label: "clippy::shadow_unrelated",
21884 description: r##"Checks for bindings that shadow other bindings already in
21885scope, either without an initialization or with one that does not even use
21886the original value."##,
21887 default_severity: Severity::Allow,
21888 warn_since: None,
21889 deny_since: None,
21890 },
21891 Lint {
21892 label: "clippy::short_circuit_statement",
21893 description: r##"Checks for the use of short circuit boolean conditions as
21894a
21895statement."##,
21896 default_severity: Severity::Allow,
21897 warn_since: None,
21898 deny_since: None,
21899 },
21900 Lint {
21901 label: "clippy::should_assert_eq",
21902 description: r##"Nothing. This lint has been deprecated"##,
21903 default_severity: Severity::Allow,
21904 warn_since: None,
21905 deny_since: None,
21906 },
21907 Lint {
21908 label: "clippy::should_implement_trait",
21909 description: r##"Checks for methods that should live in a trait
21910implementation of a `std` trait (see [llogiq's blog
21911post](http://llogiq.github.io/2015/07/30/traits.html) for further
21912information) instead of an inherent implementation."##,
21913 default_severity: Severity::Allow,
21914 warn_since: None,
21915 deny_since: None,
21916 },
21917 Lint {
21918 label: "clippy::should_panic_without_expect",
21919 description: r##"Checks for `#[should_panic]` attributes without specifying the expected panic message."##,
21920 default_severity: Severity::Allow,
21921 warn_since: None,
21922 deny_since: None,
21923 },
21924 Lint {
21925 label: "clippy::significant_drop_in_scrutinee",
21926 description: r##"Checks for temporaries returned from function calls in a match scrutinee that have the
21927`clippy::has_significant_drop` attribute."##,
21928 default_severity: Severity::Allow,
21929 warn_since: None,
21930 deny_since: None,
21931 },
21932 Lint {
21933 label: "clippy::significant_drop_tightening",
21934 description: r##"Searches for elements marked with `#[clippy::has_significant_drop]` that could be early
21935dropped but are in fact dropped at the end of their scopes. In other words, enforces the
21936tightening of their possible lifetimes."##,
21937 default_severity: Severity::Allow,
21938 warn_since: None,
21939 deny_since: None,
21940 },
21941 Lint {
21942 label: "clippy::similar_names",
21943 description: r##"Checks for names that are very similar and thus confusing.
21944
21945Note: this lint looks for similar names throughout each
21946scope. To allow it, you need to allow it on the scope
21947level, not on the name that is reported."##,
21948 default_severity: Severity::Allow,
21949 warn_since: None,
21950 deny_since: None,
21951 },
21952 Lint {
21953 label: "clippy::single_call_fn",
21954 description: r##"Checks for functions that are only used once. Does not lint tests."##,
21955 default_severity: Severity::Allow,
21956 warn_since: None,
21957 deny_since: None,
21958 },
21959 Lint {
21960 label: "clippy::single_char_add_str",
21961 description: r##"Warns when using `push_str`/`insert_str` with a single-character string literal
21962where `push`/`insert` with a `char` would work fine."##,
21963 default_severity: Severity::Allow,
21964 warn_since: None,
21965 deny_since: None,
21966 },
21967 Lint {
21968 label: "clippy::single_char_lifetime_names",
21969 description: r##"Checks for lifetimes with names which are one character
21970long."##,
21971 default_severity: Severity::Allow,
21972 warn_since: None,
21973 deny_since: None,
21974 },
21975 Lint {
21976 label: "clippy::single_char_pattern",
21977 description: r##"Checks for string methods that receive a single-character
21978`str` as an argument, e.g., `_.split(x)`."##,
21979 default_severity: Severity::Allow,
21980 warn_since: None,
21981 deny_since: None,
21982 },
21983 Lint {
21984 label: "clippy::single_component_path_imports",
21985 description: r##"Checking for imports with single component use path."##,
21986 default_severity: Severity::Allow,
21987 warn_since: None,
21988 deny_since: None,
21989 },
21990 Lint {
21991 label: "clippy::single_element_loop",
21992 description: r##"Checks whether a for loop has a single element."##,
21993 default_severity: Severity::Allow,
21994 warn_since: None,
21995 deny_since: None,
21996 },
21997 Lint {
21998 label: "clippy::single_match",
21999 description: r##"Checks for matches with a single arm where an `if let`
22000will usually suffice.
22001
22002This intentionally does not lint if there are comments
22003inside of the other arm, so as to allow the user to document
22004why having another explicit pattern with an empty body is necessary,
22005or because the comments need to be preserved for other reasons."##,
22006 default_severity: Severity::Allow,
22007 warn_since: None,
22008 deny_since: None,
22009 },
22010 Lint {
22011 label: "clippy::single_match_else",
22012 description: r##"Checks for matches with two arms where an `if let else` will
22013usually suffice."##,
22014 default_severity: Severity::Allow,
22015 warn_since: None,
22016 deny_since: None,
22017 },
22018 Lint {
22019 label: "clippy::single_range_in_vec_init",
22020 description: r##"Checks for `Vec` or array initializations that contain only one range."##,
22021 default_severity: Severity::Allow,
22022 warn_since: None,
22023 deny_since: None,
22024 },
22025 Lint {
22026 label: "clippy::size_of_in_element_count",
22027 description: r##"Detects expressions where
22028`size_of::<T>` or `size_of_val::<T>` is used as a
22029count of elements of type `T`"##,
22030 default_severity: Severity::Allow,
22031 warn_since: None,
22032 deny_since: None,
22033 },
22034 Lint {
22035 label: "clippy::size_of_ref",
22036 description: r##"Checks for calls to `std::mem::size_of_val()` where the argument is
22037a reference to a reference."##,
22038 default_severity: Severity::Allow,
22039 warn_since: None,
22040 deny_since: None,
22041 },
22042 Lint {
22043 label: "clippy::skip_while_next",
22044 description: r##"Checks for usage of `_.skip_while(condition).next()`."##,
22045 default_severity: Severity::Allow,
22046 warn_since: None,
22047 deny_since: None,
22048 },
22049 Lint {
22050 label: "clippy::slow_vector_initialization",
22051 description: r##"Checks slow zero-filled vector initialization"##,
22052 default_severity: Severity::Allow,
22053 warn_since: None,
22054 deny_since: None,
22055 },
22056 Lint {
22057 label: "clippy::stable_sort_primitive",
22058 description: r##"When sorting primitive values (integers, bools, chars, as well
22059as arrays, slices, and tuples of such items), it is typically better to
22060use an unstable sort than a stable sort."##,
22061 default_severity: Severity::Allow,
22062 warn_since: None,
22063 deny_since: None,
22064 },
22065 Lint {
22066 label: "clippy::std_instead_of_alloc",
22067 description: r##"Finds items imported through `std` when available through `alloc`."##,
22068 default_severity: Severity::Allow,
22069 warn_since: None,
22070 deny_since: None,
22071 },
22072 Lint {
22073 label: "clippy::std_instead_of_core",
22074 description: r##"Finds items imported through `std` when available through `core`."##,
22075 default_severity: Severity::Allow,
22076 warn_since: None,
22077 deny_since: None,
22078 },
22079 Lint {
22080 label: "clippy::str_split_at_newline",
22081 description: r##"Checks for usages of `str.trim().split(\
22082)` and `str.trim().split(\\
22083)`."##,
22084 default_severity: Severity::Allow,
22085 warn_since: None,
22086 deny_since: None,
22087 },
22088 Lint {
22089 label: "clippy::str_to_string",
22090 description: r##"This lint checks for `.to_string()` method calls on values of type `&str`."##,
22091 default_severity: Severity::Allow,
22092 warn_since: None,
22093 deny_since: None,
22094 },
22095 Lint {
22096 label: "clippy::string_add",
22097 description: r##"Checks for all instances of `x + _` where `x` is of type
22098`String`, but only if [`string_add_assign`](#string_add_assign) does *not*
22099match."##,
22100 default_severity: Severity::Allow,
22101 warn_since: None,
22102 deny_since: None,
22103 },
22104 Lint {
22105 label: "clippy::string_add_assign",
22106 description: r##"Checks for string appends of the form `x = x + y` (without
22107`let`!)."##,
22108 default_severity: Severity::Allow,
22109 warn_since: None,
22110 deny_since: None,
22111 },
22112 Lint {
22113 label: "clippy::string_extend_chars",
22114 description: r##"Checks for the use of `.extend(s.chars())` where s is a
22115`&str` or `String`."##,
22116 default_severity: Severity::Allow,
22117 warn_since: None,
22118 deny_since: None,
22119 },
22120 Lint {
22121 label: "clippy::string_from_utf8_as_bytes",
22122 description: r##"Check if the string is transformed to byte array and casted back to string."##,
22123 default_severity: Severity::Allow,
22124 warn_since: None,
22125 deny_since: None,
22126 },
22127 Lint {
22128 label: "clippy::string_lit_as_bytes",
22129 description: r##"Checks for the `as_bytes` method called on string literals
22130that contain only ASCII characters."##,
22131 default_severity: Severity::Allow,
22132 warn_since: None,
22133 deny_since: None,
22134 },
22135 Lint {
22136 label: "clippy::string_lit_chars_any",
22137 description: r##"Checks for `<string_lit>.chars().any(|i| i == c)`."##,
22138 default_severity: Severity::Allow,
22139 warn_since: None,
22140 deny_since: None,
22141 },
22142 Lint {
22143 label: "clippy::string_slice",
22144 description: r##"Checks for slice operations on strings"##,
22145 default_severity: Severity::Allow,
22146 warn_since: None,
22147 deny_since: None,
22148 },
22149 Lint {
22150 label: "clippy::string_to_string",
22151 description: r##"This lint checks for `.to_string()` method calls on values of type `String`."##,
22152 default_severity: Severity::Allow,
22153 warn_since: None,
22154 deny_since: None,
22155 },
22156 Lint {
22157 label: "clippy::strlen_on_c_strings",
22158 description: r##"Checks for usage of `libc::strlen` on a `CString` or `CStr` value,
22159and suggest calling `as_bytes().len()` or `to_bytes().len()` respectively instead."##,
22160 default_severity: Severity::Allow,
22161 warn_since: None,
22162 deny_since: None,
22163 },
22164 Lint {
22165 label: "clippy::struct_excessive_bools",
22166 description: r##"Checks for excessive
22167use of bools in structs."##,
22168 default_severity: Severity::Allow,
22169 warn_since: None,
22170 deny_since: None,
22171 },
22172 Lint {
22173 label: "clippy::struct_field_names",
22174 description: r##"Detects struct fields that are prefixed or suffixed
22175by the same characters or the name of the struct itself."##,
22176 default_severity: Severity::Allow,
22177 warn_since: None,
22178 deny_since: None,
22179 },
22180 Lint {
22181 label: "clippy::suboptimal_flops",
22182 description: r##"Looks for floating-point expressions that
22183can be expressed using built-in methods to improve both
22184accuracy and performance."##,
22185 default_severity: Severity::Allow,
22186 warn_since: None,
22187 deny_since: None,
22188 },
22189 Lint {
22190 label: "clippy::suspicious_arithmetic_impl",
22191 description: r##"Lints for suspicious operations in impls of arithmetic operators, e.g.
22192subtracting elements in an Add impl."##,
22193 default_severity: Severity::Allow,
22194 warn_since: None,
22195 deny_since: None,
22196 },
22197 Lint {
22198 label: "clippy::suspicious_assignment_formatting",
22199 description: r##"Checks for usage of the non-existent `=*`, `=!` and `=-`
22200operators."##,
22201 default_severity: Severity::Allow,
22202 warn_since: None,
22203 deny_since: None,
22204 },
22205 Lint {
22206 label: "clippy::suspicious_command_arg_space",
22207 description: r##"Checks for `Command::arg()` invocations that look like they
22208should be multiple arguments instead, such as `arg(-t ext2)`."##,
22209 default_severity: Severity::Allow,
22210 warn_since: None,
22211 deny_since: None,
22212 },
22213 Lint {
22214 label: "clippy::suspicious_doc_comments",
22215 description: r##"Detects the use of outer doc comments (`///`, `/**`) followed by a bang (`!`): `///!`"##,
22216 default_severity: Severity::Allow,
22217 warn_since: None,
22218 deny_since: None,
22219 },
22220 Lint {
22221 label: "clippy::suspicious_else_formatting",
22222 description: r##"Checks for formatting of `else`. It lints if the `else`
22223is followed immediately by a newline or the `else` seems to be missing."##,
22224 default_severity: Severity::Allow,
22225 warn_since: None,
22226 deny_since: None,
22227 },
22228 Lint {
22229 label: "clippy::suspicious_map",
22230 description: r##"Checks for calls to `map` followed by a `count`."##,
22231 default_severity: Severity::Allow,
22232 warn_since: None,
22233 deny_since: None,
22234 },
22235 Lint {
22236 label: "clippy::suspicious_op_assign_impl",
22237 description: r##"Lints for suspicious operations in impls of OpAssign, e.g.
22238subtracting elements in an AddAssign impl."##,
22239 default_severity: Severity::Allow,
22240 warn_since: None,
22241 deny_since: None,
22242 },
22243 Lint {
22244 label: "clippy::suspicious_open_options",
22245 description: r##"Checks for the suspicious use of `OpenOptions::create()`
22246without an explicit `OpenOptions::truncate()`."##,
22247 default_severity: Severity::Allow,
22248 warn_since: None,
22249 deny_since: None,
22250 },
22251 Lint {
22252 label: "clippy::suspicious_operation_groupings",
22253 description: r##"Checks for unlikely usages of binary operators that are almost
22254certainly typos and/or copy/paste errors, given the other usages
22255of binary operators nearby."##,
22256 default_severity: Severity::Allow,
22257 warn_since: None,
22258 deny_since: None,
22259 },
22260 Lint {
22261 label: "clippy::suspicious_splitn",
22262 description: r##"Checks for calls to [`splitn`]
22263(https://doc.rust-lang.org/std/primitive.str.html#method.splitn) and
22264related functions with either zero or one splits."##,
22265 default_severity: Severity::Allow,
22266 warn_since: None,
22267 deny_since: None,
22268 },
22269 Lint {
22270 label: "clippy::suspicious_to_owned",
22271 description: r##"Checks for the usage of `_.to_owned()`, on a `Cow<'_, _>`."##,
22272 default_severity: Severity::Allow,
22273 warn_since: None,
22274 deny_since: None,
22275 },
22276 Lint {
22277 label: "clippy::suspicious_unary_op_formatting",
22278 description: r##"Checks the formatting of a unary operator on the right hand side
22279of a binary operator. It lints if there is no space between the binary and unary operators,
22280but there is a space between the unary and its operand."##,
22281 default_severity: Severity::Allow,
22282 warn_since: None,
22283 deny_since: None,
22284 },
22285 Lint {
22286 label: "clippy::suspicious_xor_used_as_pow",
22287 description: r##"Warns for a Bitwise XOR (`^`) operator being probably confused as a powering. It will not trigger if any of the numbers are not in decimal."##,
22288 default_severity: Severity::Allow,
22289 warn_since: None,
22290 deny_since: None,
22291 },
22292 Lint {
22293 label: "clippy::swap_ptr_to_ref",
22294 description: r##"Checks for calls to `core::mem::swap` where either parameter is derived from a pointer"##,
22295 default_severity: Severity::Allow,
22296 warn_since: None,
22297 deny_since: None,
22298 },
22299 Lint {
22300 label: "clippy::tabs_in_doc_comments",
22301 description: r##"Checks doc comments for usage of tab characters."##,
22302 default_severity: Severity::Allow,
22303 warn_since: None,
22304 deny_since: None,
22305 },
22306 Lint {
22307 label: "clippy::temporary_assignment",
22308 description: r##"Checks for construction of a structure or tuple just to
22309assign a value in it."##,
22310 default_severity: Severity::Allow,
22311 warn_since: None,
22312 deny_since: None,
22313 },
22314 Lint {
22315 label: "clippy::test_attr_in_doctest",
22316 description: r##"Checks for `#[test]` in doctests unless they are marked with
22317either `ignore`, `no_run` or `compile_fail`."##,
22318 default_severity: Severity::Allow,
22319 warn_since: None,
22320 deny_since: None,
22321 },
22322 Lint {
22323 label: "clippy::tests_outside_test_module",
22324 description: r##"Triggers when a testing function (marked with the `#[test]` attribute) isn't inside a testing module
22325(marked with `#[cfg(test)]`)."##,
22326 default_severity: Severity::Allow,
22327 warn_since: None,
22328 deny_since: None,
22329 },
22330 Lint {
22331 label: "clippy::to_digit_is_some",
22332 description: r##"Checks for `.to_digit(..).is_some()` on `char`s."##,
22333 default_severity: Severity::Allow,
22334 warn_since: None,
22335 deny_since: None,
22336 },
22337 Lint {
22338 label: "clippy::to_string_in_format_args",
22339 description: r##"Checks for [`ToString::to_string`](https://doc.rust-lang.org/std/string/trait.ToString.html#tymethod.to_string)
22340applied to a type that implements [`Display`](https://doc.rust-lang.org/std/fmt/trait.Display.html)
22341in a macro that does formatting."##,
22342 default_severity: Severity::Allow,
22343 warn_since: None,
22344 deny_since: None,
22345 },
22346 Lint {
22347 label: "clippy::to_string_trait_impl",
22348 description: r##"Checks for direct implementations of `ToString`."##,
22349 default_severity: Severity::Allow,
22350 warn_since: None,
22351 deny_since: None,
22352 },
22353 Lint {
22354 label: "clippy::todo",
22355 description: r##"Checks for usage of `todo!`."##,
22356 default_severity: Severity::Allow,
22357 warn_since: None,
22358 deny_since: None,
22359 },
22360 Lint {
22361 label: "clippy::too_long_first_doc_paragraph",
22362 description: r##"Checks if the first line in the documentation of items listed in module page is too long."##,
22363 default_severity: Severity::Allow,
22364 warn_since: None,
22365 deny_since: None,
22366 },
22367 Lint {
22368 label: "clippy::too_many_arguments",
22369 description: r##"Checks for functions with too many parameters."##,
22370 default_severity: Severity::Allow,
22371 warn_since: None,
22372 deny_since: None,
22373 },
22374 Lint {
22375 label: "clippy::too_many_lines",
22376 description: r##"Checks for functions with a large amount of lines."##,
22377 default_severity: Severity::Allow,
22378 warn_since: None,
22379 deny_since: None,
22380 },
22381 Lint {
22382 label: "clippy::toplevel_ref_arg",
22383 description: r##"Checks for function arguments and let bindings denoted as
22384`ref`."##,
22385 default_severity: Severity::Allow,
22386 warn_since: None,
22387 deny_since: None,
22388 },
22389 Lint {
22390 label: "clippy::trailing_empty_array",
22391 description: r##"Displays a warning when a struct with a trailing zero-sized array is declared without a `repr` attribute."##,
22392 default_severity: Severity::Allow,
22393 warn_since: None,
22394 deny_since: None,
22395 },
22396 Lint {
22397 label: "clippy::trait_duplication_in_bounds",
22398 description: r##"Checks for cases where generics or trait objects are being used and multiple
22399syntax specifications for trait bounds are used simultaneously."##,
22400 default_severity: Severity::Allow,
22401 warn_since: None,
22402 deny_since: None,
22403 },
22404 Lint {
22405 label: "clippy::transmute_bytes_to_str",
22406 description: r##"Checks for transmutes from a `&[u8]` to a `&str`."##,
22407 default_severity: Severity::Allow,
22408 warn_since: None,
22409 deny_since: None,
22410 },
22411 Lint {
22412 label: "clippy::transmute_float_to_int",
22413 description: r##"Checks for transmutes from a float to an integer."##,
22414 default_severity: Severity::Allow,
22415 warn_since: None,
22416 deny_since: None,
22417 },
22418 Lint {
22419 label: "clippy::transmute_int_to_bool",
22420 description: r##"Checks for transmutes from an integer to a `bool`."##,
22421 default_severity: Severity::Allow,
22422 warn_since: None,
22423 deny_since: None,
22424 },
22425 Lint {
22426 label: "clippy::transmute_int_to_char",
22427 description: r##"Checks for transmutes from an integer to a `char`."##,
22428 default_severity: Severity::Allow,
22429 warn_since: None,
22430 deny_since: None,
22431 },
22432 Lint {
22433 label: "clippy::transmute_int_to_float",
22434 description: r##"Checks for transmutes from an integer to a float."##,
22435 default_severity: Severity::Allow,
22436 warn_since: None,
22437 deny_since: None,
22438 },
22439 Lint {
22440 label: "clippy::transmute_int_to_non_zero",
22441 description: r##"Checks for transmutes from `T` to `NonZero<T>`, and suggests the `new_unchecked`
22442method instead."##,
22443 default_severity: Severity::Allow,
22444 warn_since: None,
22445 deny_since: None,
22446 },
22447 Lint {
22448 label: "clippy::transmute_null_to_fn",
22449 description: r##"Checks for null function pointer creation through transmute."##,
22450 default_severity: Severity::Allow,
22451 warn_since: None,
22452 deny_since: None,
22453 },
22454 Lint {
22455 label: "clippy::transmute_num_to_bytes",
22456 description: r##"Checks for transmutes from a number to an array of `u8`"##,
22457 default_severity: Severity::Allow,
22458 warn_since: None,
22459 deny_since: None,
22460 },
22461 Lint {
22462 label: "clippy::transmute_ptr_to_ptr",
22463 description: r##"Checks for transmutes from a pointer to a pointer, or
22464from a reference to a reference."##,
22465 default_severity: Severity::Allow,
22466 warn_since: None,
22467 deny_since: None,
22468 },
22469 Lint {
22470 label: "clippy::transmute_ptr_to_ref",
22471 description: r##"Checks for transmutes from a pointer to a reference."##,
22472 default_severity: Severity::Allow,
22473 warn_since: None,
22474 deny_since: None,
22475 },
22476 Lint {
22477 label: "clippy::transmute_undefined_repr",
22478 description: r##"Checks for transmutes between types which do not have a representation defined relative to
22479each other."##,
22480 default_severity: Severity::Allow,
22481 warn_since: None,
22482 deny_since: None,
22483 },
22484 Lint {
22485 label: "clippy::transmutes_expressible_as_ptr_casts",
22486 description: r##"Checks for transmutes that could be a pointer cast."##,
22487 default_severity: Severity::Allow,
22488 warn_since: None,
22489 deny_since: None,
22490 },
22491 Lint {
22492 label: "clippy::transmuting_null",
22493 description: r##"Checks for transmute calls which would receive a null pointer."##,
22494 default_severity: Severity::Allow,
22495 warn_since: None,
22496 deny_since: None,
22497 },
22498 Lint {
22499 label: "clippy::trim_split_whitespace",
22500 description: r##"Warns about calling `str::trim` (or variants) before `str::split_whitespace`."##,
22501 default_severity: Severity::Allow,
22502 warn_since: None,
22503 deny_since: None,
22504 },
22505 Lint {
22506 label: "clippy::trivial_regex",
22507 description: r##"Checks for trivial [regex](https://crates.io/crates/regex)
22508creation (with `Regex::new`, `RegexBuilder::new`, or `RegexSet::new`)."##,
22509 default_severity: Severity::Allow,
22510 warn_since: None,
22511 deny_since: None,
22512 },
22513 Lint {
22514 label: "clippy::trivially_copy_pass_by_ref",
22515 description: r##"Checks for functions taking arguments by reference, where
22516the argument type is `Copy` and small enough to be more efficient to always
22517pass by value."##,
22518 default_severity: Severity::Allow,
22519 warn_since: None,
22520 deny_since: None,
22521 },
22522 Lint {
22523 label: "clippy::try_err",
22524 description: r##"Checks for usage of `Err(x)?`."##,
22525 default_severity: Severity::Allow,
22526 warn_since: None,
22527 deny_since: None,
22528 },
22529 Lint {
22530 label: "clippy::tuple_array_conversions",
22531 description: r##"Checks for tuple<=>array conversions that are not done with `.into()`."##,
22532 default_severity: Severity::Allow,
22533 warn_since: None,
22534 deny_since: None,
22535 },
22536 Lint {
22537 label: "clippy::type_complexity",
22538 description: r##"Checks for types used in structs, parameters and `let`
22539declarations above a certain complexity threshold."##,
22540 default_severity: Severity::Allow,
22541 warn_since: None,
22542 deny_since: None,
22543 },
22544 Lint {
22545 label: "clippy::type_id_on_box",
22546 description: r##"Looks for calls to `.type_id()` on a `Box<dyn _>`."##,
22547 default_severity: Severity::Allow,
22548 warn_since: None,
22549 deny_since: None,
22550 },
22551 Lint {
22552 label: "clippy::type_repetition_in_bounds",
22553 description: r##"This lint warns about unnecessary type repetitions in trait bounds"##,
22554 default_severity: Severity::Allow,
22555 warn_since: None,
22556 deny_since: None,
22557 },
22558 Lint {
22559 label: "clippy::unchecked_duration_subtraction",
22560 description: r##"Lints subtraction between an `Instant` and a `Duration`."##,
22561 default_severity: Severity::Allow,
22562 warn_since: None,
22563 deny_since: None,
22564 },
22565 Lint {
22566 label: "clippy::unconditional_recursion",
22567 description: r##"Checks that there isn't an infinite recursion in trait
22568implementations."##,
22569 default_severity: Severity::Allow,
22570 warn_since: None,
22571 deny_since: None,
22572 },
22573 Lint {
22574 label: "clippy::undocumented_unsafe_blocks",
22575 description: r##"Checks for `unsafe` blocks and impls without a `// SAFETY: ` comment
22576explaining why the unsafe operations performed inside
22577the block are safe.
22578
22579Note the comment must appear on the line(s) preceding the unsafe block
22580with nothing appearing in between. The following is ok:
22581```rust
22582foo(
22583 // SAFETY:
22584 // This is a valid safety comment
22585 unsafe { *x }
22586)
22587```
22588But neither of these are:
22589```rust
22590// SAFETY:
22591// This is not a valid safety comment
22592foo(
22593 /* SAFETY: Neither is this */ unsafe { *x },
22594);
22595```"##,
22596 default_severity: Severity::Allow,
22597 warn_since: None,
22598 deny_since: None,
22599 },
22600 Lint {
22601 label: "clippy::unicode_not_nfc",
22602 description: r##"Checks for string literals that contain Unicode in a form
22603that is not equal to its
22604[NFC-recomposition](http://www.unicode.org/reports/tr15/#Norm_Forms)."##,
22605 default_severity: Severity::Allow,
22606 warn_since: None,
22607 deny_since: None,
22608 },
22609 Lint {
22610 label: "clippy::unimplemented",
22611 description: r##"Checks for usage of `unimplemented!`."##,
22612 default_severity: Severity::Allow,
22613 warn_since: None,
22614 deny_since: None,
22615 },
22616 Lint {
22617 label: "clippy::uninhabited_references",
22618 description: r##"It detects references to uninhabited types, such as `!` and
22619warns when those are either dereferenced or returned from a function."##,
22620 default_severity: Severity::Allow,
22621 warn_since: None,
22622 deny_since: None,
22623 },
22624 Lint {
22625 label: "clippy::uninit_assumed_init",
22626 description: r##"Checks for `MaybeUninit::uninit().assume_init()`."##,
22627 default_severity: Severity::Allow,
22628 warn_since: None,
22629 deny_since: None,
22630 },
22631 Lint {
22632 label: "clippy::uninit_vec",
22633 description: r##"Checks for `set_len()` call that creates `Vec` with uninitialized elements.
22634This is commonly caused by calling `set_len()` right after allocating or
22635reserving a buffer with `new()`, `default()`, `with_capacity()`, or `reserve()`."##,
22636 default_severity: Severity::Allow,
22637 warn_since: None,
22638 deny_since: None,
22639 },
22640 Lint {
22641 label: "clippy::uninlined_format_args",
22642 description: r##"Detect when a variable is not inlined in a format string,
22643and suggests to inline it."##,
22644 default_severity: Severity::Allow,
22645 warn_since: None,
22646 deny_since: None,
22647 },
22648 Lint {
22649 label: "clippy::unit_arg",
22650 description: r##"Checks for passing a unit value as an argument to a function without using a
22651unit literal (`()`)."##,
22652 default_severity: Severity::Allow,
22653 warn_since: None,
22654 deny_since: None,
22655 },
22656 Lint {
22657 label: "clippy::unit_cmp",
22658 description: r##"Checks for comparisons to unit. This includes all binary
22659comparisons (like `==` and `<`) and asserts."##,
22660 default_severity: Severity::Allow,
22661 warn_since: None,
22662 deny_since: None,
22663 },
22664 Lint {
22665 label: "clippy::unit_hash",
22666 description: r##"Detects `().hash(_)`."##,
22667 default_severity: Severity::Allow,
22668 warn_since: None,
22669 deny_since: None,
22670 },
22671 Lint {
22672 label: "clippy::unit_return_expecting_ord",
22673 description: r##"Checks for functions that expect closures of type
22674Fn(...) -> Ord where the implemented closure returns the unit type.
22675The lint also suggests to remove the semi-colon at the end of the statement if present."##,
22676 default_severity: Severity::Allow,
22677 warn_since: None,
22678 deny_since: None,
22679 },
22680 Lint {
22681 label: "clippy::unnecessary_box_returns",
22682 description: r##"Checks for a return type containing a `Box<T>` where `T` implements `Sized`
22683
22684The lint ignores `Box<T>` where `T` is larger than `unnecessary_box_size`,
22685as returning a large `T` directly may be detrimental to performance."##,
22686 default_severity: Severity::Allow,
22687 warn_since: None,
22688 deny_since: None,
22689 },
22690 Lint {
22691 label: "clippy::unnecessary_cast",
22692 description: r##"Checks for casts to the same type, casts of int literals to integer
22693types, casts of float literals to float types, and casts between raw
22694pointers that don't change type or constness."##,
22695 default_severity: Severity::Allow,
22696 warn_since: None,
22697 deny_since: None,
22698 },
22699 Lint {
22700 label: "clippy::unnecessary_clippy_cfg",
22701 description: r##"Checks for `#[cfg_attr(clippy, allow(clippy::lint))]`
22702and suggests to replace it with `#[allow(clippy::lint)]`."##,
22703 default_severity: Severity::Allow,
22704 warn_since: None,
22705 deny_since: None,
22706 },
22707 Lint {
22708 label: "clippy::unnecessary_fallible_conversions",
22709 description: r##"Checks for calls to `TryInto::try_into` and `TryFrom::try_from` when their infallible counterparts
22710could be used."##,
22711 default_severity: Severity::Allow,
22712 warn_since: None,
22713 deny_since: None,
22714 },
22715 Lint {
22716 label: "clippy::unnecessary_filter_map",
22717 description: r##"Checks for `filter_map` calls that could be replaced by `filter` or `map`.
22718More specifically it checks if the closure provided is only performing one of the
22719filter or map operations and suggests the appropriate option."##,
22720 default_severity: Severity::Allow,
22721 warn_since: None,
22722 deny_since: None,
22723 },
22724 Lint {
22725 label: "clippy::unnecessary_find_map",
22726 description: r##"Checks for `find_map` calls that could be replaced by `find` or `map`. More
22727specifically it checks if the closure provided is only performing one of the
22728find or map operations and suggests the appropriate option."##,
22729 default_severity: Severity::Allow,
22730 warn_since: None,
22731 deny_since: None,
22732 },
22733 Lint {
22734 label: "clippy::unnecessary_first_then_check",
22735 description: r##"Checks the usage of `.first().is_some()` or `.first().is_none()` to check if a slice is
22736empty."##,
22737 default_severity: Severity::Allow,
22738 warn_since: None,
22739 deny_since: None,
22740 },
22741 Lint {
22742 label: "clippy::unnecessary_fold",
22743 description: r##"Checks for usage of `fold` when a more succinct alternative exists.
22744Specifically, this checks for `fold`s which could be replaced by `any`, `all`,
22745`sum` or `product`."##,
22746 default_severity: Severity::Allow,
22747 warn_since: None,
22748 deny_since: None,
22749 },
22750 Lint {
22751 label: "clippy::unnecessary_get_then_check",
22752 description: r##"Checks the usage of `.get().is_some()` or `.get().is_none()` on std map types."##,
22753 default_severity: Severity::Allow,
22754 warn_since: None,
22755 deny_since: None,
22756 },
22757 Lint {
22758 label: "clippy::unnecessary_join",
22759 description: r##"Checks for usage of `.collect::<Vec<String>>().join()` on iterators."##,
22760 default_severity: Severity::Allow,
22761 warn_since: None,
22762 deny_since: None,
22763 },
22764 Lint {
22765 label: "clippy::unnecessary_lazy_evaluations",
22766 description: r##"As the counterpart to `or_fun_call`, this lint looks for unnecessary
22767lazily evaluated closures on `Option` and `Result`.
22768
22769This lint suggests changing the following functions, when eager evaluation results in
22770simpler code:
22771 - `unwrap_or_else` to `unwrap_or`
22772 - `and_then` to `and`
22773 - `or_else` to `or`
22774 - `get_or_insert_with` to `get_or_insert`
22775 - `ok_or_else` to `ok_or`
22776 - `then` to `then_some` (for msrv >= 1.62.0)"##,
22777 default_severity: Severity::Allow,
22778 warn_since: None,
22779 deny_since: None,
22780 },
22781 Lint {
22782 label: "clippy::unnecessary_literal_unwrap",
22783 description: r##"Checks for `.unwrap()` related calls on `Result`s and `Option`s that are constructed."##,
22784 default_severity: Severity::Allow,
22785 warn_since: None,
22786 deny_since: None,
22787 },
22788 Lint {
22789 label: "clippy::unnecessary_map_on_constructor",
22790 description: r##"Suggests removing the use of a `map()` (or `map_err()`) method when an `Option` or `Result`
22791is being constructed."##,
22792 default_severity: Severity::Allow,
22793 warn_since: None,
22794 deny_since: None,
22795 },
22796 Lint {
22797 label: "clippy::unnecessary_min_or_max",
22798 description: r##"Checks for unnecessary calls to `min()` or `max()` in the following cases
22799- Either both side is constant
22800- One side is clearly larger than the other, like i32::MIN and an i32 variable"##,
22801 default_severity: Severity::Allow,
22802 warn_since: None,
22803 deny_since: None,
22804 },
22805 Lint {
22806 label: "clippy::unnecessary_mut_passed",
22807 description: r##"Detects passing a mutable reference to a function that only
22808requires an immutable reference."##,
22809 default_severity: Severity::Allow,
22810 warn_since: None,
22811 deny_since: None,
22812 },
22813 Lint {
22814 label: "clippy::unnecessary_operation",
22815 description: r##"Checks for expression statements that can be reduced to a
22816sub-expression."##,
22817 default_severity: Severity::Allow,
22818 warn_since: None,
22819 deny_since: None,
22820 },
22821 Lint {
22822 label: "clippy::unnecessary_owned_empty_strings",
22823 description: r##"Detects cases of owned empty strings being passed as an argument to a function expecting `&str`"##,
22824 default_severity: Severity::Allow,
22825 warn_since: None,
22826 deny_since: None,
22827 },
22828 Lint {
22829 label: "clippy::unnecessary_result_map_or_else",
22830 description: r##"Checks for usage of `.map_or_else()` map closure for `Result` type."##,
22831 default_severity: Severity::Allow,
22832 warn_since: None,
22833 deny_since: None,
22834 },
22835 Lint {
22836 label: "clippy::unnecessary_safety_comment",
22837 description: r##"Checks for `// SAFETY: ` comments on safe code."##,
22838 default_severity: Severity::Allow,
22839 warn_since: None,
22840 deny_since: None,
22841 },
22842 Lint {
22843 label: "clippy::unnecessary_safety_doc",
22844 description: r##"Checks for the doc comments of publicly visible
22845safe functions and traits and warns if there is a `# Safety` section."##,
22846 default_severity: Severity::Allow,
22847 warn_since: None,
22848 deny_since: None,
22849 },
22850 Lint {
22851 label: "clippy::unnecessary_self_imports",
22852 description: r##"Checks for imports ending in `::{self}`."##,
22853 default_severity: Severity::Allow,
22854 warn_since: None,
22855 deny_since: None,
22856 },
22857 Lint {
22858 label: "clippy::unnecessary_sort_by",
22859 description: r##"Checks for usage of `Vec::sort_by` passing in a closure
22860which compares the two arguments, either directly or indirectly."##,
22861 default_severity: Severity::Allow,
22862 warn_since: None,
22863 deny_since: None,
22864 },
22865 Lint {
22866 label: "clippy::unnecessary_struct_initialization",
22867 description: r##"Checks for initialization of an identical `struct` from another instance
22868of the type, either by copying a base without setting any field or by
22869moving all fields individually."##,
22870 default_severity: Severity::Allow,
22871 warn_since: None,
22872 deny_since: None,
22873 },
22874 Lint {
22875 label: "clippy::unnecessary_to_owned",
22876 description: r##"Checks for unnecessary calls to [`ToOwned::to_owned`](https://doc.rust-lang.org/std/borrow/trait.ToOwned.html#tymethod.to_owned)
22877and other `to_owned`-like functions."##,
22878 default_severity: Severity::Allow,
22879 warn_since: None,
22880 deny_since: None,
22881 },
22882 Lint {
22883 label: "clippy::unnecessary_unwrap",
22884 description: r##"Checks for calls of `unwrap[_err]()` that cannot fail."##,
22885 default_severity: Severity::Allow,
22886 warn_since: None,
22887 deny_since: None,
22888 },
22889 Lint {
22890 label: "clippy::unnecessary_wraps",
22891 description: r##"Checks for private functions that only return `Ok` or `Some`."##,
22892 default_severity: Severity::Allow,
22893 warn_since: None,
22894 deny_since: None,
22895 },
22896 Lint {
22897 label: "clippy::unneeded_field_pattern",
22898 description: r##"Checks for structure field patterns bound to wildcards."##,
22899 default_severity: Severity::Allow,
22900 warn_since: None,
22901 deny_since: None,
22902 },
22903 Lint {
22904 label: "clippy::unneeded_wildcard_pattern",
22905 description: r##"Checks for tuple patterns with a wildcard
22906pattern (`_`) is next to a rest pattern (`..`).
22907
22908_NOTE_: While `_, ..` means there is at least one element left, `..`
22909means there are 0 or more elements left. This can make a difference
22910when refactoring, but shouldn't result in errors in the refactored code,
22911since the wildcard pattern isn't used anyway."##,
22912 default_severity: Severity::Allow,
22913 warn_since: None,
22914 deny_since: None,
22915 },
22916 Lint {
22917 label: "clippy::unnested_or_patterns",
22918 description: r##"Checks for unnested or-patterns, e.g., `Some(0) | Some(2)` and
22919suggests replacing the pattern with a nested one, `Some(0 | 2)`.
22920
22921Another way to think of this is that it rewrites patterns in
22922*disjunctive normal form (DNF)* into *conjunctive normal form (CNF)*."##,
22923 default_severity: Severity::Allow,
22924 warn_since: None,
22925 deny_since: None,
22926 },
22927 Lint {
22928 label: "clippy::unreachable",
22929 description: r##"Checks for usage of `unreachable!`."##,
22930 default_severity: Severity::Allow,
22931 warn_since: None,
22932 deny_since: None,
22933 },
22934 Lint {
22935 label: "clippy::unreadable_literal",
22936 description: r##"Warns if a long integral or floating-point constant does
22937not contain underscores."##,
22938 default_severity: Severity::Allow,
22939 warn_since: None,
22940 deny_since: None,
22941 },
22942 Lint {
22943 label: "clippy::unsafe_derive_deserialize",
22944 description: r##"Checks for deriving `serde::Deserialize` on a type that
22945has methods using `unsafe`."##,
22946 default_severity: Severity::Allow,
22947 warn_since: None,
22948 deny_since: None,
22949 },
22950 Lint {
22951 label: "clippy::unsafe_removed_from_name",
22952 description: r##"Checks for imports that remove unsafe from an item's
22953name."##,
22954 default_severity: Severity::Allow,
22955 warn_since: None,
22956 deny_since: None,
22957 },
22958 Lint {
22959 label: "clippy::unsafe_vector_initialization",
22960 description: r##"Nothing. This lint has been deprecated"##,
22961 default_severity: Severity::Allow,
22962 warn_since: None,
22963 deny_since: None,
22964 },
22965 Lint {
22966 label: "clippy::unseparated_literal_suffix",
22967 description: r##"Warns if literal suffixes are not separated by an
22968underscore.
22969To enforce unseparated literal suffix style,
22970see the `separated_literal_suffix` lint."##,
22971 default_severity: Severity::Allow,
22972 warn_since: None,
22973 deny_since: None,
22974 },
22975 Lint {
22976 label: "clippy::unsound_collection_transmute",
22977 description: r##"Checks for transmutes between collections whose
22978types have different ABI, size or alignment."##,
22979 default_severity: Severity::Allow,
22980 warn_since: None,
22981 deny_since: None,
22982 },
22983 Lint {
22984 label: "clippy::unstable_as_mut_slice",
22985 description: r##"Nothing. This lint has been deprecated"##,
22986 default_severity: Severity::Allow,
22987 warn_since: None,
22988 deny_since: None,
22989 },
22990 Lint {
22991 label: "clippy::unstable_as_slice",
22992 description: r##"Nothing. This lint has been deprecated"##,
22993 default_severity: Severity::Allow,
22994 warn_since: None,
22995 deny_since: None,
22996 },
22997 Lint {
22998 label: "clippy::unused_async",
22999 description: r##"Checks for functions that are declared `async` but have no `.await`s inside of them."##,
23000 default_severity: Severity::Allow,
23001 warn_since: None,
23002 deny_since: None,
23003 },
23004 Lint {
23005 label: "clippy::unused_collect",
23006 description: r##"Nothing. This lint has been deprecated"##,
23007 default_severity: Severity::Allow,
23008 warn_since: None,
23009 deny_since: None,
23010 },
23011 Lint {
23012 label: "clippy::unused_enumerate_index",
23013 description: r##"Checks for uses of the `enumerate` method where the index is unused (`_`)"##,
23014 default_severity: Severity::Allow,
23015 warn_since: None,
23016 deny_since: None,
23017 },
23018 Lint {
23019 label: "clippy::unused_format_specs",
23020 description: r##"Detects [formatting parameters] that have no effect on the output of
23021`format!()`, `println!()` or similar macros."##,
23022 default_severity: Severity::Allow,
23023 warn_since: None,
23024 deny_since: None,
23025 },
23026 Lint {
23027 label: "clippy::unused_io_amount",
23028 description: r##"Checks for unused written/read amount."##,
23029 default_severity: Severity::Allow,
23030 warn_since: None,
23031 deny_since: None,
23032 },
23033 Lint {
23034 label: "clippy::unused_peekable",
23035 description: r##"Checks for the creation of a `peekable` iterator that is never `.peek()`ed"##,
23036 default_severity: Severity::Allow,
23037 warn_since: None,
23038 deny_since: None,
23039 },
23040 Lint {
23041 label: "clippy::unused_result_ok",
23042 description: r##"Checks for calls to `Result::ok()` without using the returned `Option`."##,
23043 default_severity: Severity::Allow,
23044 warn_since: None,
23045 deny_since: None,
23046 },
23047 Lint {
23048 label: "clippy::unused_rounding",
23049 description: r##"Detects cases where a whole-number literal float is being rounded, using
23050the `floor`, `ceil`, or `round` methods."##,
23051 default_severity: Severity::Allow,
23052 warn_since: None,
23053 deny_since: None,
23054 },
23055 Lint {
23056 label: "clippy::unused_self",
23057 description: r##"Checks methods that contain a `self` argument but don't use it"##,
23058 default_severity: Severity::Allow,
23059 warn_since: None,
23060 deny_since: None,
23061 },
23062 Lint {
23063 label: "clippy::unused_trait_names",
23064 description: r##"Checks for `use Trait` where the Trait is only used for its methods and not referenced by a path directly."##,
23065 default_severity: Severity::Allow,
23066 warn_since: None,
23067 deny_since: None,
23068 },
23069 Lint {
23070 label: "clippy::unused_unit",
23071 description: r##"Checks for unit (`()`) expressions that can be removed."##,
23072 default_severity: Severity::Allow,
23073 warn_since: None,
23074 deny_since: None,
23075 },
23076 Lint {
23077 label: "clippy::unusual_byte_groupings",
23078 description: r##"Warns if hexadecimal or binary literals are not grouped
23079by nibble or byte."##,
23080 default_severity: Severity::Allow,
23081 warn_since: None,
23082 deny_since: None,
23083 },
23084 Lint {
23085 label: "clippy::unwrap_in_result",
23086 description: r##"Checks for functions of type `Result` that contain `expect()` or `unwrap()`"##,
23087 default_severity: Severity::Allow,
23088 warn_since: None,
23089 deny_since: None,
23090 },
23091 Lint {
23092 label: "clippy::unwrap_or_default",
23093 description: r##"Checks for usages of the following functions with an argument that constructs a default value
23094(e.g., `Default::default` or `String::new`):
23095- `unwrap_or`
23096- `unwrap_or_else`
23097- `or_insert`
23098- `or_insert_with`"##,
23099 default_severity: Severity::Allow,
23100 warn_since: None,
23101 deny_since: None,
23102 },
23103 Lint {
23104 label: "clippy::unwrap_used",
23105 description: r##"Checks for `.unwrap()` or `.unwrap_err()` calls on `Result`s and `.unwrap()` call on `Option`s."##,
23106 default_severity: Severity::Allow,
23107 warn_since: None,
23108 deny_since: None,
23109 },
23110 Lint {
23111 label: "clippy::upper_case_acronyms",
23112 description: r##"Checks for fully capitalized names and optionally names containing a capitalized acronym."##,
23113 default_severity: Severity::Allow,
23114 warn_since: None,
23115 deny_since: None,
23116 },
23117 Lint {
23118 label: "clippy::use_debug",
23119 description: r##"Checks for usage of `Debug` formatting. The purpose of this
23120lint is to catch debugging remnants."##,
23121 default_severity: Severity::Allow,
23122 warn_since: None,
23123 deny_since: None,
23124 },
23125 Lint {
23126 label: "clippy::use_self",
23127 description: r##"Checks for unnecessary repetition of structure name when a
23128replacement with `Self` is applicable."##,
23129 default_severity: Severity::Allow,
23130 warn_since: None,
23131 deny_since: None,
23132 },
23133 Lint {
23134 label: "clippy::used_underscore_binding",
23135 description: r##"Checks for the use of bindings with a single leading
23136underscore."##,
23137 default_severity: Severity::Allow,
23138 warn_since: None,
23139 deny_since: None,
23140 },
23141 Lint {
23142 label: "clippy::used_underscore_items",
23143 description: r##"Checks for the use of item with a single leading
23144underscore."##,
23145 default_severity: Severity::Allow,
23146 warn_since: None,
23147 deny_since: None,
23148 },
23149 Lint {
23150 label: "clippy::useless_asref",
23151 description: r##"Checks for usage of `.as_ref()` or `.as_mut()` where the
23152types before and after the call are the same."##,
23153 default_severity: Severity::Allow,
23154 warn_since: None,
23155 deny_since: None,
23156 },
23157 Lint {
23158 label: "clippy::useless_attribute",
23159 description: r##"Checks for `extern crate` and `use` items annotated with
23160lint attributes.
23161
23162This lint permits lint attributes for lints emitted on the items themself.
23163For `use` items these lints are:
23164* ambiguous_glob_reexports
23165* dead_code
23166* deprecated
23167* hidden_glob_reexports
23168* unreachable_pub
23169* unused
23170* unused_braces
23171* unused_import_braces
23172* clippy::disallowed_types
23173* clippy::enum_glob_use
23174* clippy::macro_use_imports
23175* clippy::module_name_repetitions
23176* clippy::redundant_pub_crate
23177* clippy::single_component_path_imports
23178* clippy::unsafe_removed_from_name
23179* clippy::wildcard_imports
23180
23181For `extern crate` items these lints are:
23182* `unused_imports` on items with `#[macro_use]`"##,
23183 default_severity: Severity::Allow,
23184 warn_since: None,
23185 deny_since: None,
23186 },
23187 Lint {
23188 label: "clippy::useless_conversion",
23189 description: r##"Checks for `Into`, `TryInto`, `From`, `TryFrom`, or `IntoIter` calls
23190which uselessly convert to the same type."##,
23191 default_severity: Severity::Allow,
23192 warn_since: None,
23193 deny_since: None,
23194 },
23195 Lint {
23196 label: "clippy::useless_format",
23197 description: r##"Checks for the use of `format!(string literal with no
23198argument)` and `format!({}, foo)` where `foo` is a string."##,
23199 default_severity: Severity::Allow,
23200 warn_since: None,
23201 deny_since: None,
23202 },
23203 Lint {
23204 label: "clippy::useless_let_if_seq",
23205 description: r##"Checks for variable declarations immediately followed by a
23206conditional affectation."##,
23207 default_severity: Severity::Allow,
23208 warn_since: None,
23209 deny_since: None,
23210 },
23211 Lint {
23212 label: "clippy::useless_transmute",
23213 description: r##"Checks for transmutes to the original type of the object
23214and transmutes that could be a cast."##,
23215 default_severity: Severity::Allow,
23216 warn_since: None,
23217 deny_since: None,
23218 },
23219 Lint {
23220 label: "clippy::useless_vec",
23221 description: r##"Checks for usage of `vec![..]` when using `[..]` would
23222be possible."##,
23223 default_severity: Severity::Allow,
23224 warn_since: None,
23225 deny_since: None,
23226 },
23227 Lint {
23228 label: "clippy::vec_box",
23229 description: r##"Checks for usage of `Vec<Box<T>>` where T: Sized anywhere in the code.
23230Check the [Box documentation](https://doc.rust-lang.org/std/boxed/index.html) for more information."##,
23231 default_severity: Severity::Allow,
23232 warn_since: None,
23233 deny_since: None,
23234 },
23235 Lint {
23236 label: "clippy::vec_init_then_push",
23237 description: r##"Checks for calls to `push` immediately after creating a new `Vec`.
23238
23239If the `Vec` is created using `with_capacity` this will only lint if the capacity is a
23240constant and the number of pushes is greater than or equal to the initial capacity.
23241
23242If the `Vec` is extended after the initial sequence of pushes and it was default initialized
23243then this will only lint after there were at least four pushes. This number may change in
23244the future."##,
23245 default_severity: Severity::Allow,
23246 warn_since: None,
23247 deny_since: None,
23248 },
23249 Lint {
23250 label: "clippy::vec_resize_to_zero",
23251 description: r##"Finds occurrences of `Vec::resize(0, an_int)`"##,
23252 default_severity: Severity::Allow,
23253 warn_since: None,
23254 deny_since: None,
23255 },
23256 Lint {
23257 label: "clippy::verbose_bit_mask",
23258 description: r##"Checks for bit masks that can be replaced by a call
23259to `trailing_zeros`"##,
23260 default_severity: Severity::Allow,
23261 warn_since: None,
23262 deny_since: None,
23263 },
23264 Lint {
23265 label: "clippy::verbose_file_reads",
23266 description: r##"Checks for usage of File::read_to_end and File::read_to_string."##,
23267 default_severity: Severity::Allow,
23268 warn_since: None,
23269 deny_since: None,
23270 },
23271 Lint {
23272 label: "clippy::waker_clone_wake",
23273 description: r##"Checks for usage of `waker.clone().wake()`"##,
23274 default_severity: Severity::Allow,
23275 warn_since: None,
23276 deny_since: None,
23277 },
23278 Lint {
23279 label: "clippy::while_float",
23280 description: r##"Checks for while loops comparing floating point values."##,
23281 default_severity: Severity::Allow,
23282 warn_since: None,
23283 deny_since: None,
23284 },
23285 Lint {
23286 label: "clippy::while_immutable_condition",
23287 description: r##"Checks whether variables used within while loop condition
23288can be (and are) mutated in the body."##,
23289 default_severity: Severity::Allow,
23290 warn_since: None,
23291 deny_since: None,
23292 },
23293 Lint {
23294 label: "clippy::while_let_loop",
23295 description: r##"Detects `loop + match` combinations that are easier
23296written as a `while let` loop."##,
23297 default_severity: Severity::Allow,
23298 warn_since: None,
23299 deny_since: None,
23300 },
23301 Lint {
23302 label: "clippy::while_let_on_iterator",
23303 description: r##"Checks for `while let` expressions on iterators."##,
23304 default_severity: Severity::Allow,
23305 warn_since: None,
23306 deny_since: None,
23307 },
23308 Lint {
23309 label: "clippy::wildcard_dependencies",
23310 description: r##"Checks for wildcard dependencies in the `Cargo.toml`."##,
23311 default_severity: Severity::Allow,
23312 warn_since: None,
23313 deny_since: None,
23314 },
23315 Lint {
23316 label: "clippy::wildcard_enum_match_arm",
23317 description: r##"Checks for wildcard enum matches using `_`."##,
23318 default_severity: Severity::Allow,
23319 warn_since: None,
23320 deny_since: None,
23321 },
23322 Lint {
23323 label: "clippy::wildcard_imports",
23324 description: r##"Checks for wildcard imports `use _::*`."##,
23325 default_severity: Severity::Allow,
23326 warn_since: None,
23327 deny_since: None,
23328 },
23329 Lint {
23330 label: "clippy::wildcard_in_or_patterns",
23331 description: r##"Checks for wildcard pattern used with others patterns in same match arm."##,
23332 default_severity: Severity::Allow,
23333 warn_since: None,
23334 deny_since: None,
23335 },
23336 Lint {
23337 label: "clippy::write_literal",
23338 description: r##"This lint warns about the use of literals as `write!`/`writeln!` args."##,
23339 default_severity: Severity::Allow,
23340 warn_since: None,
23341 deny_since: None,
23342 },
23343 Lint {
23344 label: "clippy::write_with_newline",
23345 description: r##"This lint warns when you use `write!()` with a format
23346string that
23347ends in a newline."##,
23348 default_severity: Severity::Allow,
23349 warn_since: None,
23350 deny_since: None,
23351 },
23352 Lint {
23353 label: "clippy::writeln_empty_string",
23354 description: r##"This lint warns when you use `writeln!(buf, )` to
23355print a newline."##,
23356 default_severity: Severity::Allow,
23357 warn_since: None,
23358 deny_since: None,
23359 },
23360 Lint {
23361 label: "clippy::wrong_pub_self_convention",
23362 description: r##"Nothing. This lint has been deprecated"##,
23363 default_severity: Severity::Allow,
23364 warn_since: None,
23365 deny_since: None,
23366 },
23367 Lint {
23368 label: "clippy::wrong_self_convention",
23369 description: r##"Checks for methods with certain name prefixes or suffixes, and which
23370do not adhere to standard conventions regarding how `self` is taken.
23371The actual rules are:
23372
23373|Prefix |Postfix |`self` taken | `self` type |
23374|-------|------------|-------------------------------|--------------|
23375|`as_` | none |`&self` or `&mut self` | any |
23376|`from_`| none | none | any |
23377|`into_`| none |`self` | any |
23378|`is_` | none |`&mut self` or `&self` or none | any |
23379|`to_` | `_mut` |`&mut self` | any |
23380|`to_` | not `_mut` |`self` | `Copy` |
23381|`to_` | not `_mut` |`&self` | not `Copy` |
23382
23383Note: Clippy doesn't trigger methods with `to_` prefix in:
23384- Traits definition.
23385Clippy can not tell if a type that implements a trait is `Copy` or not.
23386- Traits implementation, when `&self` is taken.
23387The method signature is controlled by the trait and often `&self` is required for all types that implement the trait
23388(see e.g. the `std::string::ToString` trait).
23389
23390Clippy allows `Pin<&Self>` and `Pin<&mut Self>` if `&self` and `&mut self` is required.
23391
23392Please find more info here:
23393https://rust-lang.github.io/api-guidelines/naming.html#ad-hoc-conversions-follow-as_-to_-into_-conventions-c-conv"##,
23394 default_severity: Severity::Allow,
23395 warn_since: None,
23396 deny_since: None,
23397 },
23398 Lint {
23399 label: "clippy::wrong_transmute",
23400 description: r##"Checks for transmutes that can't ever be correct on any
23401architecture."##,
23402 default_severity: Severity::Allow,
23403 warn_since: None,
23404 deny_since: None,
23405 },
23406 Lint {
23407 label: "clippy::zero_divided_by_zero",
23408 description: r##"Checks for `0.0 / 0.0`."##,
23409 default_severity: Severity::Allow,
23410 warn_since: None,
23411 deny_since: None,
23412 },
23413 Lint {
23414 label: "clippy::zero_prefixed_literal",
23415 description: r##"Warns if an integral constant literal starts with `0`."##,
23416 default_severity: Severity::Allow,
23417 warn_since: None,
23418 deny_since: None,
23419 },
23420 Lint {
23421 label: "clippy::zero_ptr",
23422 description: r##"Catch casts from `0` to some pointer type"##,
23423 default_severity: Severity::Allow,
23424 warn_since: None,
23425 deny_since: None,
23426 },
23427 Lint {
23428 label: "clippy::zero_repeat_side_effects",
23429 description: r##"Checks for array or vec initializations which call a function or method,
23430but which have a repeat count of zero."##,
23431 default_severity: Severity::Allow,
23432 warn_since: None,
23433 deny_since: None,
23434 },
23435 Lint {
23436 label: "clippy::zero_sized_map_values",
23437 description: r##"Checks for maps with zero-sized value types anywhere in the code."##,
23438 default_severity: Severity::Allow,
23439 warn_since: None,
23440 deny_since: None,
23441 },
23442 Lint {
23443 label: "clippy::zombie_processes",
23444 description: r##"Looks for code that spawns a process but never calls `wait()` on the child."##,
23445 default_severity: Severity::Allow,
23446 warn_since: None,
23447 deny_since: None,
23448 },
23449 Lint {
23450 label: "clippy::zst_offset",
23451 description: r##"Checks for `offset(_)`, `wrapping_`{`add`, `sub`}, etc. on raw pointers to
23452zero-sized types"##,
23453 default_severity: Severity::Allow,
23454 warn_since: None,
23455 deny_since: None,
23456 },
23457];
23458pub const CLIPPY_LINT_GROUPS: &[LintGroup] = &[
23459 LintGroup {
23460 lint: Lint {
23461 label: "clippy::cargo",
23462 description: r##"lint group for: clippy::cargo_common_metadata, clippy::multiple_crate_versions, clippy::negative_feature_names, clippy::redundant_feature_names, clippy::wildcard_dependencies"##,
23463 default_severity: Severity::Allow,
23464 warn_since: None,
23465 deny_since: None,
23466 },
23467 children: &[
23468 "clippy::cargo_common_metadata",
23469 "clippy::multiple_crate_versions",
23470 "clippy::negative_feature_names",
23471 "clippy::redundant_feature_names",
23472 "clippy::wildcard_dependencies",
23473 ],
23474 },
23475 LintGroup {
23476 lint: Lint {
23477 label: "clippy::complexity",
23478 description: r##"lint group for: clippy::bind_instead_of_map, clippy::bool_comparison, clippy::borrow_deref_ref, clippy::borrowed_box, clippy::bytes_count_to_len, clippy::char_lit_as_u8, clippy::clone_on_copy, clippy::crosspointer_transmute, clippy::default_constructed_unit_structs, clippy::deprecated_cfg_attr, clippy::deref_addrof, clippy::derivable_impls, clippy::diverging_sub_expression, clippy::double_comparisons, clippy::double_parens, clippy::duration_subsec, clippy::excessive_nesting, clippy::explicit_auto_deref, clippy::explicit_counter_loop, clippy::explicit_write, clippy::extra_unused_lifetimes, clippy::extra_unused_type_parameters, clippy::filter_map_identity, clippy::filter_next, clippy::flat_map_identity, clippy::get_last_with_len, clippy::identity_op, clippy::implied_bounds_in_impls, clippy::inspect_for_each, clippy::int_plus_one, clippy::iter_count, clippy::iter_kv_map, clippy::let_with_type_underscore, clippy::manual_c_str_literals, clippy::manual_clamp, clippy::manual_div_ceil, clippy::manual_filter, clippy::manual_filter_map, clippy::manual_find, clippy::manual_find_map, clippy::manual_flatten, clippy::manual_hash_one, clippy::manual_inspect, clippy::manual_is_power_of_two, clippy::manual_main_separator_str, clippy::manual_range_patterns, clippy::manual_rem_euclid, clippy::manual_slice_size_calculation, clippy::manual_split_once, clippy::manual_strip, clippy::manual_swap, clippy::manual_unwrap_or, clippy::map_flatten, clippy::map_identity, clippy::match_as_ref, clippy::match_single_binding, clippy::needless_arbitrary_self_type, clippy::needless_bool, clippy::needless_bool_assign, clippy::needless_borrowed_reference, clippy::needless_if, clippy::needless_lifetimes, clippy::needless_match, clippy::needless_option_as_deref, clippy::needless_option_take, clippy::needless_question_mark, clippy::needless_splitn, clippy::needless_update, clippy::neg_cmp_op_on_partial_ord, clippy::no_effect, clippy::nonminimal_bool, clippy::only_used_in_recursion, clippy::option_as_ref_deref, clippy::option_filter_map, clippy::option_map_unit_fn, clippy::or_then_unwrap, clippy::partialeq_ne_impl, clippy::precedence, clippy::ptr_offset_with_cast, clippy::range_zip_with_len, clippy::redundant_as_str, clippy::redundant_async_block, clippy::redundant_at_rest_pattern, clippy::redundant_closure_call, clippy::redundant_guards, clippy::redundant_slicing, clippy::repeat_once, clippy::reserve_after_initialization, clippy::result_filter_map, clippy::result_map_unit_fn, clippy::search_is_some, clippy::seek_from_current, clippy::seek_to_start_instead_of_rewind, clippy::short_circuit_statement, clippy::single_element_loop, clippy::skip_while_next, clippy::string_from_utf8_as_bytes, clippy::strlen_on_c_strings, clippy::temporary_assignment, clippy::too_many_arguments, clippy::transmute_bytes_to_str, clippy::transmute_float_to_int, clippy::transmute_int_to_bool, clippy::transmute_int_to_char, clippy::transmute_int_to_float, clippy::transmute_int_to_non_zero, clippy::transmute_num_to_bytes, clippy::transmute_ptr_to_ref, clippy::transmutes_expressible_as_ptr_casts, clippy::type_complexity, clippy::unit_arg, clippy::unnecessary_cast, clippy::unnecessary_filter_map, clippy::unnecessary_find_map, clippy::unnecessary_first_then_check, clippy::unnecessary_literal_unwrap, clippy::unnecessary_map_on_constructor, clippy::unnecessary_min_or_max, clippy::unnecessary_operation, clippy::unnecessary_sort_by, clippy::unnecessary_unwrap, clippy::unneeded_wildcard_pattern, clippy::unused_format_specs, clippy::useless_asref, clippy::useless_conversion, clippy::useless_format, clippy::useless_transmute, clippy::vec_box, clippy::while_let_loop, clippy::wildcard_in_or_patterns, clippy::zero_divided_by_zero, clippy::zero_prefixed_literal"##,
23479 default_severity: Severity::Allow,
23480 warn_since: None,
23481 deny_since: None,
23482 },
23483 children: &[
23484 "clippy::bind_instead_of_map",
23485 "clippy::bool_comparison",
23486 "clippy::borrow_deref_ref",
23487 "clippy::borrowed_box",
23488 "clippy::bytes_count_to_len",
23489 "clippy::char_lit_as_u8",
23490 "clippy::clone_on_copy",
23491 "clippy::crosspointer_transmute",
23492 "clippy::default_constructed_unit_structs",
23493 "clippy::deprecated_cfg_attr",
23494 "clippy::deref_addrof",
23495 "clippy::derivable_impls",
23496 "clippy::diverging_sub_expression",
23497 "clippy::double_comparisons",
23498 "clippy::double_parens",
23499 "clippy::duration_subsec",
23500 "clippy::excessive_nesting",
23501 "clippy::explicit_auto_deref",
23502 "clippy::explicit_counter_loop",
23503 "clippy::explicit_write",
23504 "clippy::extra_unused_lifetimes",
23505 "clippy::extra_unused_type_parameters",
23506 "clippy::filter_map_identity",
23507 "clippy::filter_next",
23508 "clippy::flat_map_identity",
23509 "clippy::get_last_with_len",
23510 "clippy::identity_op",
23511 "clippy::implied_bounds_in_impls",
23512 "clippy::inspect_for_each",
23513 "clippy::int_plus_one",
23514 "clippy::iter_count",
23515 "clippy::iter_kv_map",
23516 "clippy::let_with_type_underscore",
23517 "clippy::manual_c_str_literals",
23518 "clippy::manual_clamp",
23519 "clippy::manual_div_ceil",
23520 "clippy::manual_filter",
23521 "clippy::manual_filter_map",
23522 "clippy::manual_find",
23523 "clippy::manual_find_map",
23524 "clippy::manual_flatten",
23525 "clippy::manual_hash_one",
23526 "clippy::manual_inspect",
23527 "clippy::manual_is_power_of_two",
23528 "clippy::manual_main_separator_str",
23529 "clippy::manual_range_patterns",
23530 "clippy::manual_rem_euclid",
23531 "clippy::manual_slice_size_calculation",
23532 "clippy::manual_split_once",
23533 "clippy::manual_strip",
23534 "clippy::manual_swap",
23535 "clippy::manual_unwrap_or",
23536 "clippy::map_flatten",
23537 "clippy::map_identity",
23538 "clippy::match_as_ref",
23539 "clippy::match_single_binding",
23540 "clippy::needless_arbitrary_self_type",
23541 "clippy::needless_bool",
23542 "clippy::needless_bool_assign",
23543 "clippy::needless_borrowed_reference",
23544 "clippy::needless_if",
23545 "clippy::needless_lifetimes",
23546 "clippy::needless_match",
23547 "clippy::needless_option_as_deref",
23548 "clippy::needless_option_take",
23549 "clippy::needless_question_mark",
23550 "clippy::needless_splitn",
23551 "clippy::needless_update",
23552 "clippy::neg_cmp_op_on_partial_ord",
23553 "clippy::no_effect",
23554 "clippy::nonminimal_bool",
23555 "clippy::only_used_in_recursion",
23556 "clippy::option_as_ref_deref",
23557 "clippy::option_filter_map",
23558 "clippy::option_map_unit_fn",
23559 "clippy::or_then_unwrap",
23560 "clippy::partialeq_ne_impl",
23561 "clippy::precedence",
23562 "clippy::ptr_offset_with_cast",
23563 "clippy::range_zip_with_len",
23564 "clippy::redundant_as_str",
23565 "clippy::redundant_async_block",
23566 "clippy::redundant_at_rest_pattern",
23567 "clippy::redundant_closure_call",
23568 "clippy::redundant_guards",
23569 "clippy::redundant_slicing",
23570 "clippy::repeat_once",
23571 "clippy::reserve_after_initialization",
23572 "clippy::result_filter_map",
23573 "clippy::result_map_unit_fn",
23574 "clippy::search_is_some",
23575 "clippy::seek_from_current",
23576 "clippy::seek_to_start_instead_of_rewind",
23577 "clippy::short_circuit_statement",
23578 "clippy::single_element_loop",
23579 "clippy::skip_while_next",
23580 "clippy::string_from_utf8_as_bytes",
23581 "clippy::strlen_on_c_strings",
23582 "clippy::temporary_assignment",
23583 "clippy::too_many_arguments",
23584 "clippy::transmute_bytes_to_str",
23585 "clippy::transmute_float_to_int",
23586 "clippy::transmute_int_to_bool",
23587 "clippy::transmute_int_to_char",
23588 "clippy::transmute_int_to_float",
23589 "clippy::transmute_int_to_non_zero",
23590 "clippy::transmute_num_to_bytes",
23591 "clippy::transmute_ptr_to_ref",
23592 "clippy::transmutes_expressible_as_ptr_casts",
23593 "clippy::type_complexity",
23594 "clippy::unit_arg",
23595 "clippy::unnecessary_cast",
23596 "clippy::unnecessary_filter_map",
23597 "clippy::unnecessary_find_map",
23598 "clippy::unnecessary_first_then_check",
23599 "clippy::unnecessary_literal_unwrap",
23600 "clippy::unnecessary_map_on_constructor",
23601 "clippy::unnecessary_min_or_max",
23602 "clippy::unnecessary_operation",
23603 "clippy::unnecessary_sort_by",
23604 "clippy::unnecessary_unwrap",
23605 "clippy::unneeded_wildcard_pattern",
23606 "clippy::unused_format_specs",
23607 "clippy::useless_asref",
23608 "clippy::useless_conversion",
23609 "clippy::useless_format",
23610 "clippy::useless_transmute",
23611 "clippy::vec_box",
23612 "clippy::while_let_loop",
23613 "clippy::wildcard_in_or_patterns",
23614 "clippy::zero_divided_by_zero",
23615 "clippy::zero_prefixed_literal",
23616 ],
23617 },
23618 LintGroup {
23619 lint: Lint {
23620 label: "clippy::correctness",
23621 description: r##"lint group for: clippy::absurd_extreme_comparisons, clippy::almost_swapped, clippy::approx_constant, clippy::async_yields_async, clippy::bad_bit_mask, clippy::cast_slice_different_sizes, clippy::deprecated_semver, clippy::derive_ord_xor_partial_ord, clippy::derived_hash_with_manual_eq, clippy::eager_transmute, clippy::enum_clike_unportable_variant, clippy::eq_op, clippy::erasing_op, clippy::fn_address_comparisons, clippy::if_let_mutex, clippy::ifs_same_cond, clippy::impl_hash_borrow_with_str_and_bytes, clippy::impossible_comparisons, clippy::ineffective_bit_mask, clippy::infinite_iter, clippy::inherent_to_string_shadow_display, clippy::inline_fn_without_body, clippy::invalid_null_ptr_usage, clippy::invalid_regex, clippy::inverted_saturating_sub, clippy::invisible_characters, clippy::iter_next_loop, clippy::iter_skip_zero, clippy::iterator_step_by_zero, clippy::let_underscore_lock, clippy::lint_groups_priority, clippy::match_str_case_mismatch, clippy::mem_replace_with_uninit, clippy::min_max, clippy::mistyped_literal_suffixes, clippy::modulo_one, clippy::mut_from_ref, clippy::never_loop, clippy::non_octal_unix_permissions, clippy::nonsensical_open_options, clippy::not_unsafe_ptr_arg_deref, clippy::option_env_unwrap, clippy::out_of_bounds_indexing, clippy::overly_complex_bool_expr, clippy::panicking_overflow_checks, clippy::panicking_unwrap, clippy::possible_missing_comma, clippy::read_line_without_trim, clippy::recursive_format_impl, clippy::redundant_comparisons, clippy::redundant_locals, clippy::reversed_empty_ranges, clippy::self_assignment, clippy::serde_api_misuse, clippy::size_of_in_element_count, clippy::suspicious_splitn, clippy::transmute_null_to_fn, clippy::transmuting_null, clippy::uninit_assumed_init, clippy::uninit_vec, clippy::unit_cmp, clippy::unit_hash, clippy::unit_return_expecting_ord, clippy::unsound_collection_transmute, clippy::unused_io_amount, clippy::useless_attribute, clippy::vec_resize_to_zero, clippy::while_immutable_condition, clippy::wrong_transmute, clippy::zst_offset"##,
23622 default_severity: Severity::Allow,
23623 warn_since: None,
23624 deny_since: None,
23625 },
23626 children: &[
23627 "clippy::absurd_extreme_comparisons",
23628 "clippy::almost_swapped",
23629 "clippy::approx_constant",
23630 "clippy::async_yields_async",
23631 "clippy::bad_bit_mask",
23632 "clippy::cast_slice_different_sizes",
23633 "clippy::deprecated_semver",
23634 "clippy::derive_ord_xor_partial_ord",
23635 "clippy::derived_hash_with_manual_eq",
23636 "clippy::eager_transmute",
23637 "clippy::enum_clike_unportable_variant",
23638 "clippy::eq_op",
23639 "clippy::erasing_op",
23640 "clippy::fn_address_comparisons",
23641 "clippy::if_let_mutex",
23642 "clippy::ifs_same_cond",
23643 "clippy::impl_hash_borrow_with_str_and_bytes",
23644 "clippy::impossible_comparisons",
23645 "clippy::ineffective_bit_mask",
23646 "clippy::infinite_iter",
23647 "clippy::inherent_to_string_shadow_display",
23648 "clippy::inline_fn_without_body",
23649 "clippy::invalid_null_ptr_usage",
23650 "clippy::invalid_regex",
23651 "clippy::inverted_saturating_sub",
23652 "clippy::invisible_characters",
23653 "clippy::iter_next_loop",
23654 "clippy::iter_skip_zero",
23655 "clippy::iterator_step_by_zero",
23656 "clippy::let_underscore_lock",
23657 "clippy::lint_groups_priority",
23658 "clippy::match_str_case_mismatch",
23659 "clippy::mem_replace_with_uninit",
23660 "clippy::min_max",
23661 "clippy::mistyped_literal_suffixes",
23662 "clippy::modulo_one",
23663 "clippy::mut_from_ref",
23664 "clippy::never_loop",
23665 "clippy::non_octal_unix_permissions",
23666 "clippy::nonsensical_open_options",
23667 "clippy::not_unsafe_ptr_arg_deref",
23668 "clippy::option_env_unwrap",
23669 "clippy::out_of_bounds_indexing",
23670 "clippy::overly_complex_bool_expr",
23671 "clippy::panicking_overflow_checks",
23672 "clippy::panicking_unwrap",
23673 "clippy::possible_missing_comma",
23674 "clippy::read_line_without_trim",
23675 "clippy::recursive_format_impl",
23676 "clippy::redundant_comparisons",
23677 "clippy::redundant_locals",
23678 "clippy::reversed_empty_ranges",
23679 "clippy::self_assignment",
23680 "clippy::serde_api_misuse",
23681 "clippy::size_of_in_element_count",
23682 "clippy::suspicious_splitn",
23683 "clippy::transmute_null_to_fn",
23684 "clippy::transmuting_null",
23685 "clippy::uninit_assumed_init",
23686 "clippy::uninit_vec",
23687 "clippy::unit_cmp",
23688 "clippy::unit_hash",
23689 "clippy::unit_return_expecting_ord",
23690 "clippy::unsound_collection_transmute",
23691 "clippy::unused_io_amount",
23692 "clippy::useless_attribute",
23693 "clippy::vec_resize_to_zero",
23694 "clippy::while_immutable_condition",
23695 "clippy::wrong_transmute",
23696 "clippy::zst_offset",
23697 ],
23698 },
23699 LintGroup {
23700 lint: Lint {
23701 label: "clippy::deprecated",
23702 description: r##"lint group for: clippy::assign_ops, clippy::extend_from_slice, clippy::misaligned_transmute, clippy::pub_enum_variant_names, clippy::range_step_by_zero, clippy::regex_macro, clippy::replace_consts, clippy::should_assert_eq, clippy::unsafe_vector_initialization, clippy::unstable_as_mut_slice, clippy::unstable_as_slice, clippy::unused_collect, clippy::wrong_pub_self_convention"##,
23703 default_severity: Severity::Allow,
23704 warn_since: None,
23705 deny_since: None,
23706 },
23707 children: &[
23708 "clippy::assign_ops",
23709 "clippy::extend_from_slice",
23710 "clippy::misaligned_transmute",
23711 "clippy::pub_enum_variant_names",
23712 "clippy::range_step_by_zero",
23713 "clippy::regex_macro",
23714 "clippy::replace_consts",
23715 "clippy::should_assert_eq",
23716 "clippy::unsafe_vector_initialization",
23717 "clippy::unstable_as_mut_slice",
23718 "clippy::unstable_as_slice",
23719 "clippy::unused_collect",
23720 "clippy::wrong_pub_self_convention",
23721 ],
23722 },
23723 LintGroup {
23724 lint: Lint {
23725 label: "clippy::nursery",
23726 description: r##"lint group for: clippy::as_ptr_cast_mut, clippy::branches_sharing_code, clippy::clear_with_drain, clippy::cognitive_complexity, clippy::collection_is_never_read, clippy::debug_assert_with_mut_call, clippy::derive_partial_eq_without_eq, clippy::equatable_if_let, clippy::fallible_impl_from, clippy::future_not_send, clippy::imprecise_flops, clippy::iter_on_empty_collections, clippy::iter_on_single_items, clippy::iter_with_drain, clippy::large_stack_frames, clippy::missing_const_for_fn, clippy::mutex_integer, clippy::needless_collect, clippy::needless_pass_by_ref_mut, clippy::non_send_fields_in_send_ty, clippy::nonstandard_macro_braces, clippy::option_if_let_else, clippy::or_fun_call, clippy::path_buf_push_overwrite, clippy::read_zero_byte_vec, clippy::redundant_clone, clippy::redundant_pub_crate, clippy::set_contains_or_insert, clippy::significant_drop_in_scrutinee, clippy::significant_drop_tightening, clippy::string_lit_as_bytes, clippy::suboptimal_flops, clippy::suspicious_operation_groupings, clippy::trailing_empty_array, clippy::trait_duplication_in_bounds, clippy::transmute_undefined_repr, clippy::trivial_regex, clippy::tuple_array_conversions, clippy::type_repetition_in_bounds, clippy::uninhabited_references, clippy::unnecessary_struct_initialization, clippy::unused_peekable, clippy::unused_rounding, clippy::use_self, clippy::useless_let_if_seq, clippy::while_float"##,
23727 default_severity: Severity::Allow,
23728 warn_since: None,
23729 deny_since: None,
23730 },
23731 children: &[
23732 "clippy::as_ptr_cast_mut",
23733 "clippy::branches_sharing_code",
23734 "clippy::clear_with_drain",
23735 "clippy::cognitive_complexity",
23736 "clippy::collection_is_never_read",
23737 "clippy::debug_assert_with_mut_call",
23738 "clippy::derive_partial_eq_without_eq",
23739 "clippy::equatable_if_let",
23740 "clippy::fallible_impl_from",
23741 "clippy::future_not_send",
23742 "clippy::imprecise_flops",
23743 "clippy::iter_on_empty_collections",
23744 "clippy::iter_on_single_items",
23745 "clippy::iter_with_drain",
23746 "clippy::large_stack_frames",
23747 "clippy::missing_const_for_fn",
23748 "clippy::mutex_integer",
23749 "clippy::needless_collect",
23750 "clippy::needless_pass_by_ref_mut",
23751 "clippy::non_send_fields_in_send_ty",
23752 "clippy::nonstandard_macro_braces",
23753 "clippy::option_if_let_else",
23754 "clippy::or_fun_call",
23755 "clippy::path_buf_push_overwrite",
23756 "clippy::read_zero_byte_vec",
23757 "clippy::redundant_clone",
23758 "clippy::redundant_pub_crate",
23759 "clippy::set_contains_or_insert",
23760 "clippy::significant_drop_in_scrutinee",
23761 "clippy::significant_drop_tightening",
23762 "clippy::string_lit_as_bytes",
23763 "clippy::suboptimal_flops",
23764 "clippy::suspicious_operation_groupings",
23765 "clippy::trailing_empty_array",
23766 "clippy::trait_duplication_in_bounds",
23767 "clippy::transmute_undefined_repr",
23768 "clippy::trivial_regex",
23769 "clippy::tuple_array_conversions",
23770 "clippy::type_repetition_in_bounds",
23771 "clippy::uninhabited_references",
23772 "clippy::unnecessary_struct_initialization",
23773 "clippy::unused_peekable",
23774 "clippy::unused_rounding",
23775 "clippy::use_self",
23776 "clippy::useless_let_if_seq",
23777 "clippy::while_float",
23778 ],
23779 },
23780 LintGroup {
23781 lint: Lint {
23782 label: "clippy::pedantic",
23783 description: r##"lint group for: clippy::assigning_clones, clippy::bool_to_int_with_if, clippy::borrow_as_ptr, clippy::case_sensitive_file_extension_comparisons, clippy::cast_lossless, clippy::cast_possible_truncation, clippy::cast_possible_wrap, clippy::cast_precision_loss, clippy::cast_ptr_alignment, clippy::cast_sign_loss, clippy::checked_conversions, clippy::cloned_instead_of_copied, clippy::copy_iterator, clippy::default_trait_access, clippy::doc_link_with_quotes, clippy::doc_markdown, clippy::empty_enum, clippy::enum_glob_use, clippy::expl_impl_clone_on_copy, clippy::explicit_deref_methods, clippy::explicit_into_iter_loop, clippy::explicit_iter_loop, clippy::filter_map_next, clippy::flat_map_option, clippy::float_cmp, clippy::fn_params_excessive_bools, clippy::from_iter_instead_of_collect, clippy::if_not_else, clippy::ignored_unit_patterns, clippy::implicit_clone, clippy::implicit_hasher, clippy::inconsistent_struct_constructor, clippy::index_refutable_slice, clippy::inefficient_to_string, clippy::inline_always, clippy::into_iter_without_iter, clippy::invalid_upcast_comparisons, clippy::items_after_statements, clippy::iter_filter_is_ok, clippy::iter_filter_is_some, clippy::iter_not_returning_iterator, clippy::iter_without_into_iter, clippy::large_digit_groups, clippy::large_futures, clippy::large_stack_arrays, clippy::large_types_passed_by_value, clippy::linkedlist, clippy::macro_use_imports, clippy::manual_assert, clippy::manual_instant_elapsed, clippy::manual_is_variant_and, clippy::manual_let_else, clippy::manual_ok_or, clippy::manual_string_new, clippy::many_single_char_names, clippy::map_unwrap_or, clippy::match_bool, clippy::match_on_vec_items, clippy::match_same_arms, clippy::match_wild_err_arm, clippy::match_wildcard_for_single_variants, clippy::maybe_infinite_iter, clippy::mismatching_type_param_order, clippy::missing_errors_doc, clippy::missing_fields_in_debug, clippy::missing_panics_doc, clippy::module_name_repetitions, clippy::must_use_candidate, clippy::mut_mut, clippy::naive_bytecount, clippy::needless_bitwise_bool, clippy::needless_continue, clippy::needless_for_each, clippy::needless_pass_by_value, clippy::needless_raw_string_hashes, clippy::no_effect_underscore_binding, clippy::no_mangle_with_rust_abi, clippy::option_as_ref_cloned, clippy::option_option, clippy::ptr_as_ptr, clippy::ptr_cast_constness, clippy::pub_underscore_fields, clippy::range_minus_one, clippy::range_plus_one, clippy::redundant_closure_for_method_calls, clippy::redundant_else, clippy::ref_as_ptr, clippy::ref_binding_to_reference, clippy::ref_option, clippy::ref_option_ref, clippy::return_self_not_must_use, clippy::same_functions_in_if_condition, clippy::semicolon_if_nothing_returned, clippy::should_panic_without_expect, clippy::similar_names, clippy::single_char_pattern, clippy::single_match_else, clippy::stable_sort_primitive, clippy::str_split_at_newline, clippy::string_add_assign, clippy::struct_excessive_bools, clippy::struct_field_names, clippy::too_many_lines, clippy::transmute_ptr_to_ptr, clippy::trivially_copy_pass_by_ref, clippy::unchecked_duration_subtraction, clippy::unicode_not_nfc, clippy::uninlined_format_args, clippy::unnecessary_box_returns, clippy::unnecessary_join, clippy::unnecessary_wraps, clippy::unnested_or_patterns, clippy::unreadable_literal, clippy::unsafe_derive_deserialize, clippy::unused_async, clippy::unused_self, clippy::used_underscore_binding, clippy::used_underscore_items, clippy::verbose_bit_mask, clippy::wildcard_imports, clippy::zero_sized_map_values"##,
23784 default_severity: Severity::Allow,
23785 warn_since: None,
23786 deny_since: None,
23787 },
23788 children: &[
23789 "clippy::assigning_clones",
23790 "clippy::bool_to_int_with_if",
23791 "clippy::borrow_as_ptr",
23792 "clippy::case_sensitive_file_extension_comparisons",
23793 "clippy::cast_lossless",
23794 "clippy::cast_possible_truncation",
23795 "clippy::cast_possible_wrap",
23796 "clippy::cast_precision_loss",
23797 "clippy::cast_ptr_alignment",
23798 "clippy::cast_sign_loss",
23799 "clippy::checked_conversions",
23800 "clippy::cloned_instead_of_copied",
23801 "clippy::copy_iterator",
23802 "clippy::default_trait_access",
23803 "clippy::doc_link_with_quotes",
23804 "clippy::doc_markdown",
23805 "clippy::empty_enum",
23806 "clippy::enum_glob_use",
23807 "clippy::expl_impl_clone_on_copy",
23808 "clippy::explicit_deref_methods",
23809 "clippy::explicit_into_iter_loop",
23810 "clippy::explicit_iter_loop",
23811 "clippy::filter_map_next",
23812 "clippy::flat_map_option",
23813 "clippy::float_cmp",
23814 "clippy::fn_params_excessive_bools",
23815 "clippy::from_iter_instead_of_collect",
23816 "clippy::if_not_else",
23817 "clippy::ignored_unit_patterns",
23818 "clippy::implicit_clone",
23819 "clippy::implicit_hasher",
23820 "clippy::inconsistent_struct_constructor",
23821 "clippy::index_refutable_slice",
23822 "clippy::inefficient_to_string",
23823 "clippy::inline_always",
23824 "clippy::into_iter_without_iter",
23825 "clippy::invalid_upcast_comparisons",
23826 "clippy::items_after_statements",
23827 "clippy::iter_filter_is_ok",
23828 "clippy::iter_filter_is_some",
23829 "clippy::iter_not_returning_iterator",
23830 "clippy::iter_without_into_iter",
23831 "clippy::large_digit_groups",
23832 "clippy::large_futures",
23833 "clippy::large_stack_arrays",
23834 "clippy::large_types_passed_by_value",
23835 "clippy::linkedlist",
23836 "clippy::macro_use_imports",
23837 "clippy::manual_assert",
23838 "clippy::manual_instant_elapsed",
23839 "clippy::manual_is_variant_and",
23840 "clippy::manual_let_else",
23841 "clippy::manual_ok_or",
23842 "clippy::manual_string_new",
23843 "clippy::many_single_char_names",
23844 "clippy::map_unwrap_or",
23845 "clippy::match_bool",
23846 "clippy::match_on_vec_items",
23847 "clippy::match_same_arms",
23848 "clippy::match_wild_err_arm",
23849 "clippy::match_wildcard_for_single_variants",
23850 "clippy::maybe_infinite_iter",
23851 "clippy::mismatching_type_param_order",
23852 "clippy::missing_errors_doc",
23853 "clippy::missing_fields_in_debug",
23854 "clippy::missing_panics_doc",
23855 "clippy::module_name_repetitions",
23856 "clippy::must_use_candidate",
23857 "clippy::mut_mut",
23858 "clippy::naive_bytecount",
23859 "clippy::needless_bitwise_bool",
23860 "clippy::needless_continue",
23861 "clippy::needless_for_each",
23862 "clippy::needless_pass_by_value",
23863 "clippy::needless_raw_string_hashes",
23864 "clippy::no_effect_underscore_binding",
23865 "clippy::no_mangle_with_rust_abi",
23866 "clippy::option_as_ref_cloned",
23867 "clippy::option_option",
23868 "clippy::ptr_as_ptr",
23869 "clippy::ptr_cast_constness",
23870 "clippy::pub_underscore_fields",
23871 "clippy::range_minus_one",
23872 "clippy::range_plus_one",
23873 "clippy::redundant_closure_for_method_calls",
23874 "clippy::redundant_else",
23875 "clippy::ref_as_ptr",
23876 "clippy::ref_binding_to_reference",
23877 "clippy::ref_option",
23878 "clippy::ref_option_ref",
23879 "clippy::return_self_not_must_use",
23880 "clippy::same_functions_in_if_condition",
23881 "clippy::semicolon_if_nothing_returned",
23882 "clippy::should_panic_without_expect",
23883 "clippy::similar_names",
23884 "clippy::single_char_pattern",
23885 "clippy::single_match_else",
23886 "clippy::stable_sort_primitive",
23887 "clippy::str_split_at_newline",
23888 "clippy::string_add_assign",
23889 "clippy::struct_excessive_bools",
23890 "clippy::struct_field_names",
23891 "clippy::too_many_lines",
23892 "clippy::transmute_ptr_to_ptr",
23893 "clippy::trivially_copy_pass_by_ref",
23894 "clippy::unchecked_duration_subtraction",
23895 "clippy::unicode_not_nfc",
23896 "clippy::uninlined_format_args",
23897 "clippy::unnecessary_box_returns",
23898 "clippy::unnecessary_join",
23899 "clippy::unnecessary_wraps",
23900 "clippy::unnested_or_patterns",
23901 "clippy::unreadable_literal",
23902 "clippy::unsafe_derive_deserialize",
23903 "clippy::unused_async",
23904 "clippy::unused_self",
23905 "clippy::used_underscore_binding",
23906 "clippy::used_underscore_items",
23907 "clippy::verbose_bit_mask",
23908 "clippy::wildcard_imports",
23909 "clippy::zero_sized_map_values",
23910 ],
23911 },
23912 LintGroup {
23913 lint: Lint {
23914 label: "clippy::perf",
23915 description: r##"lint group for: clippy::box_collection, clippy::boxed_local, clippy::cmp_owned, clippy::collapsible_str_replace, clippy::drain_collect, clippy::expect_fun_call, clippy::extend_with_drain, clippy::format_collect, clippy::format_in_format_args, clippy::iter_overeager_cloned, clippy::large_const_arrays, clippy::large_enum_variant, clippy::manual_memcpy, clippy::manual_retain, clippy::manual_str_repeat, clippy::manual_try_fold, clippy::map_entry, clippy::missing_const_for_thread_local, clippy::missing_spin_loop, clippy::readonly_write_lock, clippy::redundant_allocation, clippy::result_large_err, clippy::slow_vector_initialization, clippy::to_string_in_format_args, clippy::unnecessary_to_owned, clippy::useless_vec, clippy::vec_init_then_push, clippy::waker_clone_wake"##,
23916 default_severity: Severity::Allow,
23917 warn_since: None,
23918 deny_since: None,
23919 },
23920 children: &[
23921 "clippy::box_collection",
23922 "clippy::boxed_local",
23923 "clippy::cmp_owned",
23924 "clippy::collapsible_str_replace",
23925 "clippy::drain_collect",
23926 "clippy::expect_fun_call",
23927 "clippy::extend_with_drain",
23928 "clippy::format_collect",
23929 "clippy::format_in_format_args",
23930 "clippy::iter_overeager_cloned",
23931 "clippy::large_const_arrays",
23932 "clippy::large_enum_variant",
23933 "clippy::manual_memcpy",
23934 "clippy::manual_retain",
23935 "clippy::manual_str_repeat",
23936 "clippy::manual_try_fold",
23937 "clippy::map_entry",
23938 "clippy::missing_const_for_thread_local",
23939 "clippy::missing_spin_loop",
23940 "clippy::readonly_write_lock",
23941 "clippy::redundant_allocation",
23942 "clippy::result_large_err",
23943 "clippy::slow_vector_initialization",
23944 "clippy::to_string_in_format_args",
23945 "clippy::unnecessary_to_owned",
23946 "clippy::useless_vec",
23947 "clippy::vec_init_then_push",
23948 "clippy::waker_clone_wake",
23949 ],
23950 },
23951 LintGroup {
23952 lint: Lint {
23953 label: "clippy::restriction",
23954 description: r##"lint group for: clippy::absolute_paths, clippy::alloc_instead_of_core, clippy::allow_attributes, clippy::allow_attributes_without_reason, clippy::arithmetic_side_effects, clippy::as_conversions, clippy::as_underscore, clippy::assertions_on_result_states, clippy::big_endian_bytes, clippy::cfg_not_test, clippy::clone_on_ref_ptr, clippy::create_dir, clippy::dbg_macro, clippy::decimal_literal_representation, clippy::default_numeric_fallback, clippy::default_union_representation, clippy::deref_by_slicing, clippy::disallowed_script_idents, clippy::else_if_without_else, clippy::empty_drop, clippy::empty_enum_variants_with_brackets, clippy::empty_structs_with_brackets, clippy::error_impl_error, clippy::exhaustive_enums, clippy::exhaustive_structs, clippy::exit, clippy::expect_used, clippy::field_scoped_visibility_modifiers, clippy::filetype_is_file, clippy::float_arithmetic, clippy::float_cmp_const, clippy::fn_to_numeric_cast_any, clippy::format_push_string, clippy::get_unwrap, clippy::host_endian_bytes, clippy::if_then_some_else_none, clippy::impl_trait_in_params, clippy::implicit_return, clippy::indexing_slicing, clippy::infinite_loop, clippy::inline_asm_x86_att_syntax, clippy::inline_asm_x86_intel_syntax, clippy::integer_division, clippy::integer_division_remainder_used, clippy::iter_over_hash_type, clippy::large_include_file, clippy::let_underscore_must_use, clippy::let_underscore_untyped, clippy::little_endian_bytes, clippy::lossy_float_literal, clippy::map_err_ignore, clippy::mem_forget, clippy::min_ident_chars, clippy::missing_assert_message, clippy::missing_asserts_for_indexing, clippy::missing_docs_in_private_items, clippy::missing_inline_in_public_items, clippy::missing_trait_methods, clippy::mixed_read_write_in_expression, clippy::mod_module_files, clippy::modulo_arithmetic, clippy::multiple_inherent_impl, clippy::multiple_unsafe_ops_per_block, clippy::mutex_atomic, clippy::needless_raw_strings, clippy::non_ascii_literal, clippy::non_zero_suggestions, clippy::panic, clippy::panic_in_result_fn, clippy::partial_pub_fields, clippy::pathbuf_init_then_push, clippy::pattern_type_mismatch, clippy::print_stderr, clippy::print_stdout, clippy::pub_use, clippy::pub_with_shorthand, clippy::pub_without_shorthand, clippy::question_mark_used, clippy::rc_buffer, clippy::rc_mutex, clippy::redundant_type_annotations, clippy::ref_patterns, clippy::renamed_function_params, clippy::rest_pat_in_fully_bound_structs, clippy::same_name_method, clippy::self_named_module_files, clippy::semicolon_inside_block, clippy::semicolon_outside_block, clippy::separated_literal_suffix, clippy::shadow_reuse, clippy::shadow_same, clippy::shadow_unrelated, clippy::single_call_fn, clippy::single_char_lifetime_names, clippy::std_instead_of_alloc, clippy::std_instead_of_core, clippy::str_to_string, clippy::string_add, clippy::string_lit_chars_any, clippy::string_slice, clippy::string_to_string, clippy::suspicious_xor_used_as_pow, clippy::tests_outside_test_module, clippy::todo, clippy::try_err, clippy::undocumented_unsafe_blocks, clippy::unimplemented, clippy::unnecessary_safety_comment, clippy::unnecessary_safety_doc, clippy::unnecessary_self_imports, clippy::unneeded_field_pattern, clippy::unreachable, clippy::unseparated_literal_suffix, clippy::unused_result_ok, clippy::unused_trait_names, clippy::unwrap_in_result, clippy::unwrap_used, clippy::use_debug, clippy::verbose_file_reads, clippy::wildcard_enum_match_arm"##,
23955 default_severity: Severity::Allow,
23956 warn_since: None,
23957 deny_since: None,
23958 },
23959 children: &[
23960 "clippy::absolute_paths",
23961 "clippy::alloc_instead_of_core",
23962 "clippy::allow_attributes",
23963 "clippy::allow_attributes_without_reason",
23964 "clippy::arithmetic_side_effects",
23965 "clippy::as_conversions",
23966 "clippy::as_underscore",
23967 "clippy::assertions_on_result_states",
23968 "clippy::big_endian_bytes",
23969 "clippy::cfg_not_test",
23970 "clippy::clone_on_ref_ptr",
23971 "clippy::create_dir",
23972 "clippy::dbg_macro",
23973 "clippy::decimal_literal_representation",
23974 "clippy::default_numeric_fallback",
23975 "clippy::default_union_representation",
23976 "clippy::deref_by_slicing",
23977 "clippy::disallowed_script_idents",
23978 "clippy::else_if_without_else",
23979 "clippy::empty_drop",
23980 "clippy::empty_enum_variants_with_brackets",
23981 "clippy::empty_structs_with_brackets",
23982 "clippy::error_impl_error",
23983 "clippy::exhaustive_enums",
23984 "clippy::exhaustive_structs",
23985 "clippy::exit",
23986 "clippy::expect_used",
23987 "clippy::field_scoped_visibility_modifiers",
23988 "clippy::filetype_is_file",
23989 "clippy::float_arithmetic",
23990 "clippy::float_cmp_const",
23991 "clippy::fn_to_numeric_cast_any",
23992 "clippy::format_push_string",
23993 "clippy::get_unwrap",
23994 "clippy::host_endian_bytes",
23995 "clippy::if_then_some_else_none",
23996 "clippy::impl_trait_in_params",
23997 "clippy::implicit_return",
23998 "clippy::indexing_slicing",
23999 "clippy::infinite_loop",
24000 "clippy::inline_asm_x86_att_syntax",
24001 "clippy::inline_asm_x86_intel_syntax",
24002 "clippy::integer_division",
24003 "clippy::integer_division_remainder_used",
24004 "clippy::iter_over_hash_type",
24005 "clippy::large_include_file",
24006 "clippy::let_underscore_must_use",
24007 "clippy::let_underscore_untyped",
24008 "clippy::little_endian_bytes",
24009 "clippy::lossy_float_literal",
24010 "clippy::map_err_ignore",
24011 "clippy::mem_forget",
24012 "clippy::min_ident_chars",
24013 "clippy::missing_assert_message",
24014 "clippy::missing_asserts_for_indexing",
24015 "clippy::missing_docs_in_private_items",
24016 "clippy::missing_inline_in_public_items",
24017 "clippy::missing_trait_methods",
24018 "clippy::mixed_read_write_in_expression",
24019 "clippy::mod_module_files",
24020 "clippy::modulo_arithmetic",
24021 "clippy::multiple_inherent_impl",
24022 "clippy::multiple_unsafe_ops_per_block",
24023 "clippy::mutex_atomic",
24024 "clippy::needless_raw_strings",
24025 "clippy::non_ascii_literal",
24026 "clippy::non_zero_suggestions",
24027 "clippy::panic",
24028 "clippy::panic_in_result_fn",
24029 "clippy::partial_pub_fields",
24030 "clippy::pathbuf_init_then_push",
24031 "clippy::pattern_type_mismatch",
24032 "clippy::print_stderr",
24033 "clippy::print_stdout",
24034 "clippy::pub_use",
24035 "clippy::pub_with_shorthand",
24036 "clippy::pub_without_shorthand",
24037 "clippy::question_mark_used",
24038 "clippy::rc_buffer",
24039 "clippy::rc_mutex",
24040 "clippy::redundant_type_annotations",
24041 "clippy::ref_patterns",
24042 "clippy::renamed_function_params",
24043 "clippy::rest_pat_in_fully_bound_structs",
24044 "clippy::same_name_method",
24045 "clippy::self_named_module_files",
24046 "clippy::semicolon_inside_block",
24047 "clippy::semicolon_outside_block",
24048 "clippy::separated_literal_suffix",
24049 "clippy::shadow_reuse",
24050 "clippy::shadow_same",
24051 "clippy::shadow_unrelated",
24052 "clippy::single_call_fn",
24053 "clippy::single_char_lifetime_names",
24054 "clippy::std_instead_of_alloc",
24055 "clippy::std_instead_of_core",
24056 "clippy::str_to_string",
24057 "clippy::string_add",
24058 "clippy::string_lit_chars_any",
24059 "clippy::string_slice",
24060 "clippy::string_to_string",
24061 "clippy::suspicious_xor_used_as_pow",
24062 "clippy::tests_outside_test_module",
24063 "clippy::todo",
24064 "clippy::try_err",
24065 "clippy::undocumented_unsafe_blocks",
24066 "clippy::unimplemented",
24067 "clippy::unnecessary_safety_comment",
24068 "clippy::unnecessary_safety_doc",
24069 "clippy::unnecessary_self_imports",
24070 "clippy::unneeded_field_pattern",
24071 "clippy::unreachable",
24072 "clippy::unseparated_literal_suffix",
24073 "clippy::unused_result_ok",
24074 "clippy::unused_trait_names",
24075 "clippy::unwrap_in_result",
24076 "clippy::unwrap_used",
24077 "clippy::use_debug",
24078 "clippy::verbose_file_reads",
24079 "clippy::wildcard_enum_match_arm",
24080 ],
24081 },
24082 LintGroup {
24083 lint: Lint {
24084 label: "clippy::style",
24085 description: r##"lint group for: clippy::assertions_on_constants, clippy::assign_op_pattern, clippy::blocks_in_conditions, clippy::bool_assert_comparison, clippy::borrow_interior_mutable_const, clippy::box_default, clippy::builtin_type_shadow, clippy::byte_char_slices, clippy::bytes_nth, clippy::chars_last_cmp, clippy::chars_next_cmp, clippy::cmp_null, clippy::collapsible_else_if, clippy::collapsible_if, clippy::collapsible_match, clippy::comparison_chain, clippy::comparison_to_empty, clippy::declare_interior_mutable_const, clippy::default_instead_of_iter_empty, clippy::disallowed_macros, clippy::disallowed_methods, clippy::disallowed_names, clippy::disallowed_types, clippy::doc_lazy_continuation, clippy::double_must_use, clippy::double_neg, clippy::duplicate_underscore_argument, clippy::enum_variant_names, clippy::err_expect, clippy::excessive_precision, clippy::field_reassign_with_default, clippy::filter_map_bool_then, clippy::fn_to_numeric_cast, clippy::fn_to_numeric_cast_with_truncation, clippy::for_kv_map, clippy::from_over_into, clippy::from_str_radix_10, clippy::get_first, clippy::if_same_then_else, clippy::implicit_saturating_add, clippy::implicit_saturating_sub, clippy::inconsistent_digit_grouping, clippy::infallible_destructuring_match, clippy::inherent_to_string, clippy::init_numbered_fields, clippy::into_iter_on_ref, clippy::is_digit_ascii_radix, clippy::items_after_test_module, clippy::iter_cloned_collect, clippy::iter_next_slice, clippy::iter_nth, clippy::iter_nth_zero, clippy::iter_skip_next, clippy::just_underscores_and_digits, clippy::legacy_numeric_constants, clippy::len_without_is_empty, clippy::len_zero, clippy::let_and_return, clippy::let_unit_value, clippy::main_recursion, clippy::manual_async_fn, clippy::manual_bits, clippy::manual_is_ascii_check, clippy::manual_is_finite, clippy::manual_is_infinite, clippy::manual_map, clippy::manual_next_back, clippy::manual_non_exhaustive, clippy::manual_pattern_char_comparison, clippy::manual_range_contains, clippy::manual_rotate, clippy::manual_saturating_arithmetic, clippy::manual_while_let_some, clippy::map_clone, clippy::map_collect_result_unit, clippy::match_like_matches_macro, clippy::match_overlapping_arm, clippy::match_ref_pats, clippy::match_result_ok, clippy::mem_replace_option_with_none, clippy::mem_replace_with_default, clippy::missing_enforced_import_renames, clippy::missing_safety_doc, clippy::mixed_attributes_style, clippy::mixed_case_hex_literals, clippy::module_inception, clippy::must_use_unit, clippy::mut_mutex_lock, clippy::needless_borrow, clippy::needless_borrows_for_generic_args, clippy::needless_doctest_main, clippy::needless_else, clippy::needless_late_init, clippy::needless_parens_on_range_literals, clippy::needless_pub_self, clippy::needless_range_loop, clippy::needless_return, clippy::needless_return_with_question_mark, clippy::neg_multiply, clippy::new_ret_no_self, clippy::new_without_default, clippy::non_minimal_cfg, clippy::obfuscated_if_else, clippy::ok_expect, clippy::op_ref, clippy::option_map_or_err_ok, clippy::option_map_or_none, clippy::partialeq_to_none, clippy::print_literal, clippy::print_with_newline, clippy::println_empty_string, clippy::ptr_arg, clippy::ptr_eq, clippy::question_mark, clippy::redundant_closure, clippy::redundant_field_names, clippy::redundant_pattern, clippy::redundant_pattern_matching, clippy::redundant_static_lifetimes, clippy::result_map_or_into_option, clippy::result_unit_err, clippy::same_item_push, clippy::self_named_constructors, clippy::should_implement_trait, clippy::single_char_add_str, clippy::single_component_path_imports, clippy::single_match, clippy::string_extend_chars, clippy::tabs_in_doc_comments, clippy::to_digit_is_some, clippy::to_string_trait_impl, clippy::too_long_first_doc_paragraph, clippy::toplevel_ref_arg, clippy::trim_split_whitespace, clippy::unnecessary_fallible_conversions, clippy::unnecessary_fold, clippy::unnecessary_lazy_evaluations, clippy::unnecessary_mut_passed, clippy::unnecessary_owned_empty_strings, clippy::unsafe_removed_from_name, clippy::unused_enumerate_index, clippy::unused_unit, clippy::unusual_byte_groupings, clippy::unwrap_or_default, clippy::upper_case_acronyms, clippy::while_let_on_iterator, clippy::write_literal, clippy::write_with_newline, clippy::writeln_empty_string, clippy::wrong_self_convention, clippy::zero_ptr"##,
24086 default_severity: Severity::Allow,
24087 warn_since: None,
24088 deny_since: None,
24089 },
24090 children: &[
24091 "clippy::assertions_on_constants",
24092 "clippy::assign_op_pattern",
24093 "clippy::blocks_in_conditions",
24094 "clippy::bool_assert_comparison",
24095 "clippy::borrow_interior_mutable_const",
24096 "clippy::box_default",
24097 "clippy::builtin_type_shadow",
24098 "clippy::byte_char_slices",
24099 "clippy::bytes_nth",
24100 "clippy::chars_last_cmp",
24101 "clippy::chars_next_cmp",
24102 "clippy::cmp_null",
24103 "clippy::collapsible_else_if",
24104 "clippy::collapsible_if",
24105 "clippy::collapsible_match",
24106 "clippy::comparison_chain",
24107 "clippy::comparison_to_empty",
24108 "clippy::declare_interior_mutable_const",
24109 "clippy::default_instead_of_iter_empty",
24110 "clippy::disallowed_macros",
24111 "clippy::disallowed_methods",
24112 "clippy::disallowed_names",
24113 "clippy::disallowed_types",
24114 "clippy::doc_lazy_continuation",
24115 "clippy::double_must_use",
24116 "clippy::double_neg",
24117 "clippy::duplicate_underscore_argument",
24118 "clippy::enum_variant_names",
24119 "clippy::err_expect",
24120 "clippy::excessive_precision",
24121 "clippy::field_reassign_with_default",
24122 "clippy::filter_map_bool_then",
24123 "clippy::fn_to_numeric_cast",
24124 "clippy::fn_to_numeric_cast_with_truncation",
24125 "clippy::for_kv_map",
24126 "clippy::from_over_into",
24127 "clippy::from_str_radix_10",
24128 "clippy::get_first",
24129 "clippy::if_same_then_else",
24130 "clippy::implicit_saturating_add",
24131 "clippy::implicit_saturating_sub",
24132 "clippy::inconsistent_digit_grouping",
24133 "clippy::infallible_destructuring_match",
24134 "clippy::inherent_to_string",
24135 "clippy::init_numbered_fields",
24136 "clippy::into_iter_on_ref",
24137 "clippy::is_digit_ascii_radix",
24138 "clippy::items_after_test_module",
24139 "clippy::iter_cloned_collect",
24140 "clippy::iter_next_slice",
24141 "clippy::iter_nth",
24142 "clippy::iter_nth_zero",
24143 "clippy::iter_skip_next",
24144 "clippy::just_underscores_and_digits",
24145 "clippy::legacy_numeric_constants",
24146 "clippy::len_without_is_empty",
24147 "clippy::len_zero",
24148 "clippy::let_and_return",
24149 "clippy::let_unit_value",
24150 "clippy::main_recursion",
24151 "clippy::manual_async_fn",
24152 "clippy::manual_bits",
24153 "clippy::manual_is_ascii_check",
24154 "clippy::manual_is_finite",
24155 "clippy::manual_is_infinite",
24156 "clippy::manual_map",
24157 "clippy::manual_next_back",
24158 "clippy::manual_non_exhaustive",
24159 "clippy::manual_pattern_char_comparison",
24160 "clippy::manual_range_contains",
24161 "clippy::manual_rotate",
24162 "clippy::manual_saturating_arithmetic",
24163 "clippy::manual_while_let_some",
24164 "clippy::map_clone",
24165 "clippy::map_collect_result_unit",
24166 "clippy::match_like_matches_macro",
24167 "clippy::match_overlapping_arm",
24168 "clippy::match_ref_pats",
24169 "clippy::match_result_ok",
24170 "clippy::mem_replace_option_with_none",
24171 "clippy::mem_replace_with_default",
24172 "clippy::missing_enforced_import_renames",
24173 "clippy::missing_safety_doc",
24174 "clippy::mixed_attributes_style",
24175 "clippy::mixed_case_hex_literals",
24176 "clippy::module_inception",
24177 "clippy::must_use_unit",
24178 "clippy::mut_mutex_lock",
24179 "clippy::needless_borrow",
24180 "clippy::needless_borrows_for_generic_args",
24181 "clippy::needless_doctest_main",
24182 "clippy::needless_else",
24183 "clippy::needless_late_init",
24184 "clippy::needless_parens_on_range_literals",
24185 "clippy::needless_pub_self",
24186 "clippy::needless_range_loop",
24187 "clippy::needless_return",
24188 "clippy::needless_return_with_question_mark",
24189 "clippy::neg_multiply",
24190 "clippy::new_ret_no_self",
24191 "clippy::new_without_default",
24192 "clippy::non_minimal_cfg",
24193 "clippy::obfuscated_if_else",
24194 "clippy::ok_expect",
24195 "clippy::op_ref",
24196 "clippy::option_map_or_err_ok",
24197 "clippy::option_map_or_none",
24198 "clippy::partialeq_to_none",
24199 "clippy::print_literal",
24200 "clippy::print_with_newline",
24201 "clippy::println_empty_string",
24202 "clippy::ptr_arg",
24203 "clippy::ptr_eq",
24204 "clippy::question_mark",
24205 "clippy::redundant_closure",
24206 "clippy::redundant_field_names",
24207 "clippy::redundant_pattern",
24208 "clippy::redundant_pattern_matching",
24209 "clippy::redundant_static_lifetimes",
24210 "clippy::result_map_or_into_option",
24211 "clippy::result_unit_err",
24212 "clippy::same_item_push",
24213 "clippy::self_named_constructors",
24214 "clippy::should_implement_trait",
24215 "clippy::single_char_add_str",
24216 "clippy::single_component_path_imports",
24217 "clippy::single_match",
24218 "clippy::string_extend_chars",
24219 "clippy::tabs_in_doc_comments",
24220 "clippy::to_digit_is_some",
24221 "clippy::to_string_trait_impl",
24222 "clippy::too_long_first_doc_paragraph",
24223 "clippy::toplevel_ref_arg",
24224 "clippy::trim_split_whitespace",
24225 "clippy::unnecessary_fallible_conversions",
24226 "clippy::unnecessary_fold",
24227 "clippy::unnecessary_lazy_evaluations",
24228 "clippy::unnecessary_mut_passed",
24229 "clippy::unnecessary_owned_empty_strings",
24230 "clippy::unsafe_removed_from_name",
24231 "clippy::unused_enumerate_index",
24232 "clippy::unused_unit",
24233 "clippy::unusual_byte_groupings",
24234 "clippy::unwrap_or_default",
24235 "clippy::upper_case_acronyms",
24236 "clippy::while_let_on_iterator",
24237 "clippy::write_literal",
24238 "clippy::write_with_newline",
24239 "clippy::writeln_empty_string",
24240 "clippy::wrong_self_convention",
24241 "clippy::zero_ptr",
24242 ],
24243 },
24244 LintGroup {
24245 lint: Lint {
24246 label: "clippy::suspicious",
24247 description: r##"lint group for: clippy::almost_complete_range, clippy::arc_with_non_send_sync, clippy::await_holding_invalid_type, clippy::await_holding_lock, clippy::await_holding_refcell_ref, clippy::blanket_clippy_restriction_lints, clippy::cast_abs_to_unsigned, clippy::cast_enum_constructor, clippy::cast_enum_truncation, clippy::cast_nan_to_int, clippy::cast_slice_from_raw_parts, clippy::const_is_empty, clippy::crate_in_macro_def, clippy::deprecated_clippy_cfg_attr, clippy::drop_non_drop, clippy::duplicate_mod, clippy::duplicated_attributes, clippy::empty_docs, clippy::empty_line_after_doc_comments, clippy::empty_line_after_outer_attr, clippy::empty_loop, clippy::float_equality_without_abs, clippy::forget_non_drop, clippy::four_forward_slashes, clippy::from_raw_with_void_ptr, clippy::incompatible_msrv, clippy::ineffective_open_options, clippy::iter_out_of_bounds, clippy::join_absolute_paths, clippy::let_underscore_future, clippy::lines_filter_map_ok, clippy::macro_metavars_in_unsafe, clippy::manual_unwrap_or_default, clippy::misnamed_getters, clippy::misrefactored_assign_op, clippy::missing_transmute_annotations, clippy::multi_assignments, clippy::multiple_bound_locations, clippy::mut_range_bound, clippy::mutable_key_type, clippy::needless_character_iteration, clippy::needless_maybe_sized, clippy::no_effect_replace, clippy::non_canonical_clone_impl, clippy::non_canonical_partial_ord_impl, clippy::octal_escapes, clippy::path_ends_with_ext, clippy::permissions_set_readonly_false, clippy::pointers_in_nomem_asm_block, clippy::print_in_format_impl, clippy::rc_clone_in_vec_init, clippy::repeat_vec_with_capacity, clippy::single_range_in_vec_init, clippy::size_of_ref, clippy::suspicious_arithmetic_impl, clippy::suspicious_assignment_formatting, clippy::suspicious_command_arg_space, clippy::suspicious_doc_comments, clippy::suspicious_else_formatting, clippy::suspicious_map, clippy::suspicious_op_assign_impl, clippy::suspicious_open_options, clippy::suspicious_to_owned, clippy::suspicious_unary_op_formatting, clippy::swap_ptr_to_ref, clippy::test_attr_in_doctest, clippy::type_id_on_box, clippy::unconditional_recursion, clippy::unnecessary_clippy_cfg, clippy::unnecessary_get_then_check, clippy::unnecessary_result_map_or_else, clippy::zero_repeat_side_effects, clippy::zombie_processes"##,
24248 default_severity: Severity::Allow,
24249 warn_since: None,
24250 deny_since: None,
24251 },
24252 children: &[
24253 "clippy::almost_complete_range",
24254 "clippy::arc_with_non_send_sync",
24255 "clippy::await_holding_invalid_type",
24256 "clippy::await_holding_lock",
24257 "clippy::await_holding_refcell_ref",
24258 "clippy::blanket_clippy_restriction_lints",
24259 "clippy::cast_abs_to_unsigned",
24260 "clippy::cast_enum_constructor",
24261 "clippy::cast_enum_truncation",
24262 "clippy::cast_nan_to_int",
24263 "clippy::cast_slice_from_raw_parts",
24264 "clippy::const_is_empty",
24265 "clippy::crate_in_macro_def",
24266 "clippy::deprecated_clippy_cfg_attr",
24267 "clippy::drop_non_drop",
24268 "clippy::duplicate_mod",
24269 "clippy::duplicated_attributes",
24270 "clippy::empty_docs",
24271 "clippy::empty_line_after_doc_comments",
24272 "clippy::empty_line_after_outer_attr",
24273 "clippy::empty_loop",
24274 "clippy::float_equality_without_abs",
24275 "clippy::forget_non_drop",
24276 "clippy::four_forward_slashes",
24277 "clippy::from_raw_with_void_ptr",
24278 "clippy::incompatible_msrv",
24279 "clippy::ineffective_open_options",
24280 "clippy::iter_out_of_bounds",
24281 "clippy::join_absolute_paths",
24282 "clippy::let_underscore_future",
24283 "clippy::lines_filter_map_ok",
24284 "clippy::macro_metavars_in_unsafe",
24285 "clippy::manual_unwrap_or_default",
24286 "clippy::misnamed_getters",
24287 "clippy::misrefactored_assign_op",
24288 "clippy::missing_transmute_annotations",
24289 "clippy::multi_assignments",
24290 "clippy::multiple_bound_locations",
24291 "clippy::mut_range_bound",
24292 "clippy::mutable_key_type",
24293 "clippy::needless_character_iteration",
24294 "clippy::needless_maybe_sized",
24295 "clippy::no_effect_replace",
24296 "clippy::non_canonical_clone_impl",
24297 "clippy::non_canonical_partial_ord_impl",
24298 "clippy::octal_escapes",
24299 "clippy::path_ends_with_ext",
24300 "clippy::permissions_set_readonly_false",
24301 "clippy::pointers_in_nomem_asm_block",
24302 "clippy::print_in_format_impl",
24303 "clippy::rc_clone_in_vec_init",
24304 "clippy::repeat_vec_with_capacity",
24305 "clippy::single_range_in_vec_init",
24306 "clippy::size_of_ref",
24307 "clippy::suspicious_arithmetic_impl",
24308 "clippy::suspicious_assignment_formatting",
24309 "clippy::suspicious_command_arg_space",
24310 "clippy::suspicious_doc_comments",
24311 "clippy::suspicious_else_formatting",
24312 "clippy::suspicious_map",
24313 "clippy::suspicious_op_assign_impl",
24314 "clippy::suspicious_open_options",
24315 "clippy::suspicious_to_owned",
24316 "clippy::suspicious_unary_op_formatting",
24317 "clippy::swap_ptr_to_ref",
24318 "clippy::test_attr_in_doctest",
24319 "clippy::type_id_on_box",
24320 "clippy::unconditional_recursion",
24321 "clippy::unnecessary_clippy_cfg",
24322 "clippy::unnecessary_get_then_check",
24323 "clippy::unnecessary_result_map_or_else",
24324 "clippy::zero_repeat_side_effects",
24325 "clippy::zombie_processes",
24326 ],
24327 },
24328];