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_always_mismatching_target_features",
577 description: r##"detects when a function annotated with `#[inline(always)]` and `#[target_feature(enable = "..")]` is inlined into a caller without the required target feature"##,
578 default_severity: Severity::Warning,
579 warn_since: None,
580 deny_since: None,
581 },
582 Lint {
583 label: "inline_no_sanitize",
584 description: r##"detects incompatible use of `#[inline(always)]` and `#[sanitize(... = "off")]`"##,
585 default_severity: Severity::Warning,
586 warn_since: None,
587 deny_since: None,
588 },
589 Lint {
590 label: "integer_to_ptr_transmutes",
591 description: r##"detects integer to pointer transmutes"##,
592 default_severity: Severity::Warning,
593 warn_since: None,
594 deny_since: None,
595 },
596 Lint {
597 label: "internal_eq_trait_method_impls",
598 description: r##"manual implementation of the internal `Eq::assert_receiver_is_total_eq` method"##,
599 default_severity: Severity::Warning,
600 warn_since: None,
601 deny_since: None,
602 },
603 Lint {
604 label: "internal_features",
605 description: r##"internal features are not supposed to be used"##,
606 default_severity: Severity::Warning,
607 warn_since: None,
608 deny_since: None,
609 },
610 Lint {
611 label: "invalid_atomic_ordering",
612 description: r##"usage of invalid atomic ordering in atomic operations and memory fences"##,
613 default_severity: Severity::Error,
614 warn_since: None,
615 deny_since: None,
616 },
617 Lint {
618 label: "invalid_doc_attributes",
619 description: r##"detects invalid `#[doc(...)]` attributes"##,
620 default_severity: Severity::Warning,
621 warn_since: None,
622 deny_since: None,
623 },
624 Lint {
625 label: "invalid_from_utf8",
626 description: r##"using a non UTF-8 literal in `std::str::from_utf8`"##,
627 default_severity: Severity::Warning,
628 warn_since: None,
629 deny_since: None,
630 },
631 Lint {
632 label: "invalid_from_utf8_unchecked",
633 description: r##"using a non UTF-8 literal in `std::str::from_utf8_unchecked`"##,
634 default_severity: Severity::Error,
635 warn_since: None,
636 deny_since: None,
637 },
638 Lint {
639 label: "invalid_macro_export_arguments",
640 description: r##""invalid_parameter" isn't a valid argument for `#[macro_export]`"##,
641 default_severity: Severity::Error,
642 warn_since: None,
643 deny_since: None,
644 },
645 Lint {
646 label: "invalid_nan_comparisons",
647 description: r##"detects invalid floating point NaN comparisons"##,
648 default_severity: Severity::Warning,
649 warn_since: None,
650 deny_since: None,
651 },
652 Lint {
653 label: "invalid_null_arguments",
654 description: r##"invalid null pointer in arguments"##,
655 default_severity: Severity::Error,
656 warn_since: None,
657 deny_since: None,
658 },
659 Lint {
660 label: "invalid_reference_casting",
661 description: r##"casts of `&T` to `&mut T` without interior mutability"##,
662 default_severity: Severity::Error,
663 warn_since: None,
664 deny_since: None,
665 },
666 Lint {
667 label: "invalid_type_param_default",
668 description: r##"type parameter default erroneously allowed in invalid location"##,
669 default_severity: Severity::Error,
670 warn_since: None,
671 deny_since: None,
672 },
673 Lint {
674 label: "invalid_value",
675 description: r##"an invalid value is being created (such as a null reference)"##,
676 default_severity: Severity::Warning,
677 warn_since: None,
678 deny_since: None,
679 },
680 Lint {
681 label: "irrefutable_let_patterns",
682 description: r##"detects irrefutable patterns in `if let` and `while let` statements"##,
683 default_severity: Severity::Warning,
684 warn_since: None,
685 deny_since: None,
686 },
687 Lint {
688 label: "keyword_idents_2018",
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: "keyword_idents_2024",
696 description: r##"detects edition keywords being used as an identifier"##,
697 default_severity: Severity::Allow,
698 warn_since: None,
699 deny_since: None,
700 },
701 Lint {
702 label: "large_assignments",
703 description: r##"detects large moves or copies"##,
704 default_severity: Severity::Warning,
705 warn_since: None,
706 deny_since: None,
707 },
708 Lint {
709 label: "late_bound_lifetime_arguments",
710 description: r##"detects generic lifetime arguments in path segments with late bound lifetime parameters"##,
711 default_severity: Severity::Warning,
712 warn_since: None,
713 deny_since: None,
714 },
715 Lint {
716 label: "legacy_derive_helpers",
717 description: r##"detects derive helper attributes that are used before they are introduced"##,
718 default_severity: Severity::Error,
719 warn_since: None,
720 deny_since: None,
721 },
722 Lint {
723 label: "let_underscore_drop",
724 description: r##"non-binding let on a type that has a destructor"##,
725 default_severity: Severity::Allow,
726 warn_since: None,
727 deny_since: None,
728 },
729 Lint {
730 label: "let_underscore_lock",
731 description: r##"non-binding let on a synchronization lock"##,
732 default_severity: Severity::Error,
733 warn_since: None,
734 deny_since: None,
735 },
736 Lint {
737 label: "linker_info",
738 description: r##"linker warnings known to be informational-only and not indicative of a problem"##,
739 default_severity: Severity::Allow,
740 warn_since: None,
741 deny_since: None,
742 },
743 Lint {
744 label: "linker_messages",
745 description: r##"warnings emitted at runtime by the target-specific linker program"##,
746 default_severity: Severity::Warning,
747 warn_since: None,
748 deny_since: None,
749 },
750 Lint {
751 label: "long_running_const_eval",
752 description: r##"detects long const eval operations"##,
753 default_severity: Severity::Error,
754 warn_since: None,
755 deny_since: None,
756 },
757 Lint {
758 label: "lossy_provenance_casts",
759 description: r##"a lossy pointer to integer cast is used"##,
760 default_severity: Severity::Allow,
761 warn_since: None,
762 deny_since: None,
763 },
764 Lint {
765 label: "macro_expanded_macro_exports_accessed_by_absolute_paths",
766 description: r##"macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths"##,
767 default_severity: Severity::Error,
768 warn_since: None,
769 deny_since: None,
770 },
771 Lint {
772 label: "macro_use_extern_crate",
773 description: r##"the `#[macro_use]` attribute is now deprecated in favor of using macros via the module system"##,
774 default_severity: Severity::Allow,
775 warn_since: None,
776 deny_since: None,
777 },
778 Lint {
779 label: "malformed_diagnostic_attributes",
780 description: r##"detects malformed diagnostic attributes"##,
781 default_severity: Severity::Warning,
782 warn_since: None,
783 deny_since: None,
784 },
785 Lint {
786 label: "malformed_diagnostic_format_literals",
787 description: r##"detects diagnostic attribute with malformed diagnostic format literals"##,
788 default_severity: Severity::Warning,
789 warn_since: None,
790 deny_since: None,
791 },
792 Lint {
793 label: "map_unit_fn",
794 description: r##"`Iterator::map` call that discard the iterator's values"##,
795 default_severity: Severity::Warning,
796 warn_since: None,
797 deny_since: None,
798 },
799 Lint {
800 label: "meta_variable_misuse",
801 description: r##"possible meta-variable misuse at macro definition"##,
802 default_severity: Severity::Allow,
803 warn_since: None,
804 deny_since: None,
805 },
806 Lint {
807 label: "mismatched_lifetime_syntaxes",
808 description: r##"detects when a lifetime uses different syntax between arguments and return values"##,
809 default_severity: Severity::Warning,
810 warn_since: None,
811 deny_since: None,
812 },
813 Lint {
814 label: "misplaced_diagnostic_attributes",
815 description: r##"detects diagnostic attributes that are placed on the wrong item"##,
816 default_severity: Severity::Warning,
817 warn_since: None,
818 deny_since: None,
819 },
820 Lint {
821 label: "missing_abi",
822 description: r##"No declared ABI for extern declaration"##,
823 default_severity: Severity::Warning,
824 warn_since: None,
825 deny_since: None,
826 },
827 Lint {
828 label: "missing_copy_implementations",
829 description: r##"detects potentially-forgotten implementations of `Copy`"##,
830 default_severity: Severity::Allow,
831 warn_since: None,
832 deny_since: None,
833 },
834 Lint {
835 label: "missing_debug_implementations",
836 description: r##"detects missing implementations of Debug"##,
837 default_severity: Severity::Allow,
838 warn_since: None,
839 deny_since: None,
840 },
841 Lint {
842 label: "missing_docs",
843 description: r##"detects missing documentation for public members"##,
844 default_severity: Severity::Allow,
845 warn_since: None,
846 deny_since: None,
847 },
848 Lint {
849 label: "missing_gpu_kernel_export_name",
850 description: r##"mangled gpu-kernel function"##,
851 default_severity: Severity::Warning,
852 warn_since: None,
853 deny_since: None,
854 },
855 Lint {
856 label: "missing_unsafe_on_extern",
857 description: r##"detects missing unsafe keyword on extern declarations"##,
858 default_severity: Severity::Allow,
859 warn_since: None,
860 deny_since: None,
861 },
862 Lint {
863 label: "mixed_script_confusables",
864 description: r##"detects Unicode scripts whose mixed script confusables codepoints are solely used"##,
865 default_severity: Severity::Warning,
866 warn_since: None,
867 deny_since: None,
868 },
869 Lint {
870 label: "multiple_supertrait_upcastable",
871 description: r##"detect when a dyn-compatible trait has multiple supertraits"##,
872 default_severity: Severity::Allow,
873 warn_since: None,
874 deny_since: None,
875 },
876 Lint {
877 label: "must_not_suspend",
878 description: r##"use of a `#[must_not_suspend]` value across a yield point"##,
879 default_severity: Severity::Allow,
880 warn_since: None,
881 deny_since: None,
882 },
883 Lint {
884 label: "mutable_transmutes",
885 description: r##"transmuting &T to &mut T is undefined behavior, even if the reference is unused"##,
886 default_severity: Severity::Error,
887 warn_since: None,
888 deny_since: None,
889 },
890 Lint {
891 label: "named_arguments_used_positionally",
892 description: r##"named arguments in format used positionally"##,
893 default_severity: Severity::Warning,
894 warn_since: None,
895 deny_since: None,
896 },
897 Lint {
898 label: "named_asm_labels",
899 description: r##"named labels in inline assembly"##,
900 default_severity: Severity::Error,
901 warn_since: None,
902 deny_since: None,
903 },
904 Lint {
905 label: "never_type_fallback_flowing_into_unsafe",
906 description: r##"never type fallback affecting unsafe function calls"##,
907 default_severity: Severity::Error,
908 warn_since: None,
909 deny_since: None,
910 },
911 Lint {
912 label: "no_mangle_const_items",
913 description: r##"const items will not have their symbols exported"##,
914 default_severity: Severity::Error,
915 warn_since: None,
916 deny_since: None,
917 },
918 Lint {
919 label: "no_mangle_generic_items",
920 description: r##"generic items must be mangled"##,
921 default_severity: Severity::Warning,
922 warn_since: None,
923 deny_since: None,
924 },
925 Lint {
926 label: "non_ascii_idents",
927 description: r##"detects non-ASCII identifiers"##,
928 default_severity: Severity::Allow,
929 warn_since: None,
930 deny_since: None,
931 },
932 Lint {
933 label: "non_camel_case_types",
934 description: r##"types, variants, traits and type parameters should have camel case names"##,
935 default_severity: Severity::Warning,
936 warn_since: None,
937 deny_since: None,
938 },
939 Lint {
940 label: "non_contiguous_range_endpoints",
941 description: r##"detects off-by-one errors with exclusive range patterns"##,
942 default_severity: Severity::Warning,
943 warn_since: None,
944 deny_since: None,
945 },
946 Lint {
947 label: "non_exhaustive_omitted_patterns",
948 description: r##"detect when patterns of types marked `non_exhaustive` are missed"##,
949 default_severity: Severity::Allow,
950 warn_since: None,
951 deny_since: None,
952 },
953 Lint {
954 label: "non_fmt_panics",
955 description: r##"detect single-argument panic!() invocations in which the argument is not a format string"##,
956 default_severity: Severity::Warning,
957 warn_since: None,
958 deny_since: None,
959 },
960 Lint {
961 label: "non_local_definitions",
962 description: r##"checks for non-local definitions"##,
963 default_severity: Severity::Warning,
964 warn_since: None,
965 deny_since: None,
966 },
967 Lint {
968 label: "non_shorthand_field_patterns",
969 description: r##"using `Struct { x: x }` instead of `Struct { x }` in a pattern"##,
970 default_severity: Severity::Warning,
971 warn_since: None,
972 deny_since: None,
973 },
974 Lint {
975 label: "non_snake_case",
976 description: r##"variables, methods, functions, lifetime parameters and modules should have snake case names"##,
977 default_severity: Severity::Warning,
978 warn_since: None,
979 deny_since: None,
980 },
981 Lint {
982 label: "non_upper_case_globals",
983 description: r##"static constants should have uppercase identifiers"##,
984 default_severity: Severity::Warning,
985 warn_since: None,
986 deny_since: None,
987 },
988 Lint {
989 label: "noop_method_call",
990 description: r##"detects the use of well-known noop methods"##,
991 default_severity: Severity::Warning,
992 warn_since: None,
993 deny_since: None,
994 },
995 Lint {
996 label: "opaque_hidden_inferred_bound",
997 description: r##"detects the use of nested `impl Trait` types in associated type bounds that are not general enough"##,
998 default_severity: Severity::Warning,
999 warn_since: None,
1000 deny_since: None,
1001 },
1002 Lint {
1003 label: "out_of_scope_macro_calls",
1004 description: r##"detects out of scope calls to `macro_rules` in key-value attributes"##,
1005 default_severity: Severity::Error,
1006 warn_since: None,
1007 deny_since: None,
1008 },
1009 Lint {
1010 label: "overflowing_literals",
1011 description: r##"literal out of range for its type"##,
1012 default_severity: Severity::Error,
1013 warn_since: None,
1014 deny_since: None,
1015 },
1016 Lint {
1017 label: "overlapping_range_endpoints",
1018 description: r##"detects range patterns with overlapping endpoints"##,
1019 default_severity: Severity::Warning,
1020 warn_since: None,
1021 deny_since: None,
1022 },
1023 Lint {
1024 label: "path_statements",
1025 description: r##"path statements with no effect"##,
1026 default_severity: Severity::Warning,
1027 warn_since: None,
1028 deny_since: None,
1029 },
1030 Lint {
1031 label: "patterns_in_fns_without_body",
1032 description: r##"patterns in functions without body were erroneously allowed"##,
1033 default_severity: Severity::Error,
1034 warn_since: None,
1035 deny_since: None,
1036 },
1037 Lint {
1038 label: "private_bounds",
1039 description: r##"private type in secondary interface of an item"##,
1040 default_severity: Severity::Warning,
1041 warn_since: None,
1042 deny_since: None,
1043 },
1044 Lint {
1045 label: "private_interfaces",
1046 description: r##"private type in primary interface of an item"##,
1047 default_severity: Severity::Warning,
1048 warn_since: None,
1049 deny_since: None,
1050 },
1051 Lint {
1052 label: "proc_macro_derive_resolution_fallback",
1053 description: r##"detects proc macro derives using inaccessible names from parent modules"##,
1054 default_severity: Severity::Error,
1055 warn_since: None,
1056 deny_since: None,
1057 },
1058 Lint {
1059 label: "ptr_to_integer_transmute_in_consts",
1060 description: r##"detects pointer to integer transmutes in const functions and associated constants"##,
1061 default_severity: Severity::Warning,
1062 warn_since: None,
1063 deny_since: None,
1064 },
1065 Lint {
1066 label: "pub_use_of_private_extern_crate",
1067 description: r##"detect public re-exports of private extern crates"##,
1068 default_severity: Severity::Error,
1069 warn_since: None,
1070 deny_since: None,
1071 },
1072 Lint {
1073 label: "redundant_imports",
1074 description: r##"imports that are redundant due to being imported already"##,
1075 default_severity: Severity::Allow,
1076 warn_since: None,
1077 deny_since: None,
1078 },
1079 Lint {
1080 label: "redundant_lifetimes",
1081 description: r##"detects lifetime parameters that are redundant because they are equal to some other named lifetime"##,
1082 default_severity: Severity::Allow,
1083 warn_since: None,
1084 deny_since: None,
1085 },
1086 Lint {
1087 label: "redundant_semicolons",
1088 description: r##"detects unnecessary trailing semicolons"##,
1089 default_severity: Severity::Warning,
1090 warn_since: None,
1091 deny_since: None,
1092 },
1093 Lint {
1094 label: "refining_impl_trait_internal",
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: "refining_impl_trait_reachable",
1102 description: r##"impl trait in impl method signature does not match trait method signature"##,
1103 default_severity: Severity::Warning,
1104 warn_since: None,
1105 deny_since: None,
1106 },
1107 Lint {
1108 label: "renamed_and_removed_lints",
1109 description: r##"lints that have been renamed or removed"##,
1110 default_severity: Severity::Warning,
1111 warn_since: None,
1112 deny_since: None,
1113 },
1114 Lint {
1115 label: "repr_c_enums_larger_than_int",
1116 description: r##"repr(C) enums with discriminant values that do not fit into a C int"##,
1117 default_severity: Severity::Warning,
1118 warn_since: None,
1119 deny_since: None,
1120 },
1121 Lint {
1122 label: "repr_transparent_non_zst_fields",
1123 description: r##"transparent type contains an external ZST that is marked #[non_exhaustive] or contains private fields"##,
1124 default_severity: Severity::Error,
1125 warn_since: None,
1126 deny_since: None,
1127 },
1128 Lint {
1129 label: "resolving_to_items_shadowing_supertrait_items",
1130 description: r##"detects when a supertrait item is shadowed by a subtrait item"##,
1131 default_severity: Severity::Allow,
1132 warn_since: None,
1133 deny_since: None,
1134 },
1135 Lint {
1136 label: "rtsan_nonblocking_async",
1137 description: r##"detects incompatible uses of `#[sanitize(realtime = "nonblocking")]` on async functions"##,
1138 default_severity: Severity::Warning,
1139 warn_since: None,
1140 deny_since: None,
1141 },
1142 Lint {
1143 label: "rust_2021_incompatible_closure_captures",
1144 description: r##"detects closures affected by Rust 2021 changes"##,
1145 default_severity: Severity::Allow,
1146 warn_since: None,
1147 deny_since: None,
1148 },
1149 Lint {
1150 label: "rust_2021_incompatible_or_patterns",
1151 description: r##"detects usage of old versions of or-patterns"##,
1152 default_severity: Severity::Allow,
1153 warn_since: None,
1154 deny_since: None,
1155 },
1156 Lint {
1157 label: "rust_2021_prefixes_incompatible_syntax",
1158 description: r##"identifiers that will be parsed as a prefix in Rust 2021"##,
1159 default_severity: Severity::Allow,
1160 warn_since: None,
1161 deny_since: None,
1162 },
1163 Lint {
1164 label: "rust_2021_prelude_collisions",
1165 description: r##"detects the usage of trait methods which are ambiguous with traits added to the prelude in future editions"##,
1166 default_severity: Severity::Allow,
1167 warn_since: None,
1168 deny_since: None,
1169 },
1170 Lint {
1171 label: "rust_2024_guarded_string_incompatible_syntax",
1172 description: r##"will be parsed as a guarded string in Rust 2024"##,
1173 default_severity: Severity::Allow,
1174 warn_since: None,
1175 deny_since: None,
1176 },
1177 Lint {
1178 label: "rust_2024_incompatible_pat",
1179 description: r##"detects patterns whose meaning will change in Rust 2024"##,
1180 default_severity: Severity::Allow,
1181 warn_since: None,
1182 deny_since: None,
1183 },
1184 Lint {
1185 label: "rust_2024_prelude_collisions",
1186 description: r##"detects the usage of trait methods which are ambiguous with traits added to the prelude in future editions"##,
1187 default_severity: Severity::Allow,
1188 warn_since: None,
1189 deny_since: None,
1190 },
1191 Lint {
1192 label: "self_constructor_from_outer_item",
1193 description: r##"detect unsupported use of `Self` from outer item"##,
1194 default_severity: Severity::Warning,
1195 warn_since: None,
1196 deny_since: None,
1197 },
1198 Lint {
1199 label: "semicolon_in_expressions_from_macros",
1200 description: r##"trailing semicolon in macro body used as expression"##,
1201 default_severity: Severity::Error,
1202 warn_since: None,
1203 deny_since: None,
1204 },
1205 Lint {
1206 label: "shadowing_supertrait_items",
1207 description: r##"detects when a supertrait item is shadowed by a subtrait item"##,
1208 default_severity: Severity::Allow,
1209 warn_since: None,
1210 deny_since: None,
1211 },
1212 Lint {
1213 label: "single_use_lifetimes",
1214 description: r##"detects lifetime parameters that are only used once"##,
1215 default_severity: Severity::Allow,
1216 warn_since: None,
1217 deny_since: None,
1218 },
1219 Lint {
1220 label: "special_module_name",
1221 description: r##"module declarations for files with a special meaning"##,
1222 default_severity: Severity::Warning,
1223 warn_since: None,
1224 deny_since: None,
1225 },
1226 Lint {
1227 label: "stable_features",
1228 description: r##"stable features found in `#[feature]` directive"##,
1229 default_severity: Severity::Warning,
1230 warn_since: None,
1231 deny_since: None,
1232 },
1233 Lint {
1234 label: "static_mut_refs",
1235 description: r##"creating a shared reference to mutable static"##,
1236 default_severity: Severity::Warning,
1237 warn_since: None,
1238 deny_since: Some(Edition::Edition2024),
1239 },
1240 Lint {
1241 label: "suspicious_double_ref_op",
1242 description: r##"suspicious call of trait method on `&&T`"##,
1243 default_severity: Severity::Warning,
1244 warn_since: None,
1245 deny_since: None,
1246 },
1247 Lint {
1248 label: "tail_call_track_caller",
1249 description: r##"detects tail calls of functions marked with `#[track_caller]`"##,
1250 default_severity: Severity::Warning,
1251 warn_since: None,
1252 deny_since: None,
1253 },
1254 Lint {
1255 label: "tail_expr_drop_order",
1256 description: r##"Detect and warn on significant change in drop order in tail expression location"##,
1257 default_severity: Severity::Allow,
1258 warn_since: None,
1259 deny_since: None,
1260 },
1261 Lint {
1262 label: "test_unstable_lint",
1263 description: r##"this unstable lint is only for testing"##,
1264 default_severity: Severity::Error,
1265 warn_since: None,
1266 deny_since: None,
1267 },
1268 Lint {
1269 label: "text_direction_codepoint_in_comment",
1270 description: r##"invisible directionality-changing codepoints in comment"##,
1271 default_severity: Severity::Error,
1272 warn_since: None,
1273 deny_since: None,
1274 },
1275 Lint {
1276 label: "text_direction_codepoint_in_literal",
1277 description: r##"detect special Unicode codepoints that affect the visual representation of text on screen, changing the direction in which text flows"##,
1278 default_severity: Severity::Error,
1279 warn_since: None,
1280 deny_since: None,
1281 },
1282 Lint {
1283 label: "trivial_bounds",
1284 description: r##"these bounds don't depend on an type parameters"##,
1285 default_severity: Severity::Warning,
1286 warn_since: None,
1287 deny_since: None,
1288 },
1289 Lint {
1290 label: "trivial_casts",
1291 description: r##"detects trivial casts which could be removed"##,
1292 default_severity: Severity::Allow,
1293 warn_since: None,
1294 deny_since: None,
1295 },
1296 Lint {
1297 label: "trivial_numeric_casts",
1298 description: r##"detects trivial casts of numeric types which could be removed"##,
1299 default_severity: Severity::Allow,
1300 warn_since: None,
1301 deny_since: None,
1302 },
1303 Lint {
1304 label: "type_alias_bounds",
1305 description: r##"bounds in type aliases are not enforced"##,
1306 default_severity: Severity::Warning,
1307 warn_since: None,
1308 deny_since: None,
1309 },
1310 Lint {
1311 label: "tyvar_behind_raw_pointer",
1312 description: r##"raw pointer to an inference variable"##,
1313 default_severity: Severity::Warning,
1314 warn_since: None,
1315 deny_since: None,
1316 },
1317 Lint {
1318 label: "uncommon_codepoints",
1319 description: r##"detects uncommon Unicode codepoints in identifiers"##,
1320 default_severity: Severity::Warning,
1321 warn_since: None,
1322 deny_since: None,
1323 },
1324 Lint {
1325 label: "unconditional_panic",
1326 description: r##"operation will cause a panic at runtime"##,
1327 default_severity: Severity::Error,
1328 warn_since: None,
1329 deny_since: None,
1330 },
1331 Lint {
1332 label: "unconditional_recursion",
1333 description: r##"functions that cannot return without calling themselves"##,
1334 default_severity: Severity::Warning,
1335 warn_since: None,
1336 deny_since: None,
1337 },
1338 Lint {
1339 label: "uncovered_param_in_projection",
1340 description: r##"impl contains type parameters that are not covered"##,
1341 default_severity: Severity::Warning,
1342 warn_since: None,
1343 deny_since: None,
1344 },
1345 Lint {
1346 label: "undropped_manually_drops",
1347 description: r##"calls to `std::mem::drop` with `std::mem::ManuallyDrop` instead of it's inner value"##,
1348 default_severity: Severity::Error,
1349 warn_since: None,
1350 deny_since: None,
1351 },
1352 Lint {
1353 label: "unexpected_cfgs",
1354 description: r##"detects unexpected names and values in `#[cfg]` conditions"##,
1355 default_severity: Severity::Warning,
1356 warn_since: None,
1357 deny_since: None,
1358 },
1359 Lint {
1360 label: "unfulfilled_lint_expectations",
1361 description: r##"unfulfilled lint expectation"##,
1362 default_severity: Severity::Warning,
1363 warn_since: None,
1364 deny_since: None,
1365 },
1366 Lint {
1367 label: "ungated_async_fn_track_caller",
1368 description: r##"enabling track_caller on an async fn is a no-op unless the async_fn_track_caller feature is enabled"##,
1369 default_severity: Severity::Warning,
1370 warn_since: None,
1371 deny_since: None,
1372 },
1373 Lint {
1374 label: "uninhabited_static",
1375 description: r##"uninhabited static"##,
1376 default_severity: Severity::Error,
1377 warn_since: None,
1378 deny_since: None,
1379 },
1380 Lint {
1381 label: "unit_bindings",
1382 description: r##"binding is useless because it has the unit `()` type"##,
1383 default_severity: Severity::Allow,
1384 warn_since: None,
1385 deny_since: None,
1386 },
1387 Lint {
1388 label: "unknown_crate_types",
1389 description: r##"unknown crate type found in `#[crate_type]` directive"##,
1390 default_severity: Severity::Error,
1391 warn_since: None,
1392 deny_since: None,
1393 },
1394 Lint {
1395 label: "unknown_diagnostic_attributes",
1396 description: r##"detects unknown diagnostic attributes"##,
1397 default_severity: Severity::Warning,
1398 warn_since: None,
1399 deny_since: None,
1400 },
1401 Lint {
1402 label: "unknown_lints",
1403 description: r##"unrecognized lint attribute"##,
1404 default_severity: Severity::Warning,
1405 warn_since: None,
1406 deny_since: None,
1407 },
1408 Lint {
1409 label: "unnameable_test_items",
1410 description: r##"detects an item that cannot be named being marked as `#[test_case]`"##,
1411 default_severity: Severity::Warning,
1412 warn_since: None,
1413 deny_since: None,
1414 },
1415 Lint {
1416 label: "unnameable_types",
1417 description: r##"effective visibility of a type is larger than the area in which it can be named"##,
1418 default_severity: Severity::Allow,
1419 warn_since: None,
1420 deny_since: None,
1421 },
1422 Lint {
1423 label: "unnecessary_transmutes",
1424 description: r##"detects transmutes that can also be achieved by other operations"##,
1425 default_severity: Severity::Warning,
1426 warn_since: None,
1427 deny_since: None,
1428 },
1429 Lint {
1430 label: "unpredictable_function_pointer_comparisons",
1431 description: r##"detects unpredictable function pointer comparisons"##,
1432 default_severity: Severity::Warning,
1433 warn_since: None,
1434 deny_since: None,
1435 },
1436 Lint {
1437 label: "unqualified_local_imports",
1438 description: r##"`use` of a local item without leading `self::`, `super::`, or `crate::`"##,
1439 default_severity: Severity::Allow,
1440 warn_since: None,
1441 deny_since: None,
1442 },
1443 Lint {
1444 label: "unreachable_cfg_select_predicates",
1445 description: r##"detects unreachable configuration predicates in the cfg_select macro"##,
1446 default_severity: Severity::Warning,
1447 warn_since: None,
1448 deny_since: None,
1449 },
1450 Lint {
1451 label: "unreachable_code",
1452 description: r##"detects unreachable code paths"##,
1453 default_severity: Severity::Warning,
1454 warn_since: None,
1455 deny_since: None,
1456 },
1457 Lint {
1458 label: "unreachable_patterns",
1459 description: r##"detects unreachable patterns"##,
1460 default_severity: Severity::Warning,
1461 warn_since: None,
1462 deny_since: None,
1463 },
1464 Lint {
1465 label: "unreachable_pub",
1466 description: r##"`pub` items not reachable from crate root"##,
1467 default_severity: Severity::Allow,
1468 warn_since: None,
1469 deny_since: None,
1470 },
1471 Lint {
1472 label: "unsafe_attr_outside_unsafe",
1473 description: r##"detects unsafe attributes outside of unsafe"##,
1474 default_severity: Severity::Allow,
1475 warn_since: None,
1476 deny_since: None,
1477 },
1478 Lint {
1479 label: "unsafe_code",
1480 description: r##"usage of `unsafe` code and other potentially unsound constructs"##,
1481 default_severity: Severity::Allow,
1482 warn_since: None,
1483 deny_since: None,
1484 },
1485 Lint {
1486 label: "unsafe_op_in_unsafe_fn",
1487 description: r##"unsafe operations in unsafe functions without an explicit unsafe block are deprecated"##,
1488 default_severity: Severity::Allow,
1489 warn_since: Some(Edition::Edition2024),
1490 deny_since: None,
1491 },
1492 Lint {
1493 label: "unstable_features",
1494 description: r##"enabling unstable features"##,
1495 default_severity: Severity::Allow,
1496 warn_since: None,
1497 deny_since: None,
1498 },
1499 Lint {
1500 label: "unstable_name_collisions",
1501 description: r##"detects name collision with an existing but unstable method"##,
1502 default_severity: Severity::Warning,
1503 warn_since: None,
1504 deny_since: None,
1505 },
1506 Lint {
1507 label: "unstable_syntax_pre_expansion",
1508 description: r##"unstable syntax can change at any point in the future, causing a hard error!"##,
1509 default_severity: Severity::Warning,
1510 warn_since: None,
1511 deny_since: None,
1512 },
1513 Lint {
1514 label: "unsupported_calling_conventions",
1515 description: r##"use of unsupported calling convention"##,
1516 default_severity: Severity::Warning,
1517 warn_since: None,
1518 deny_since: None,
1519 },
1520 Lint {
1521 label: "unused_allocation",
1522 description: r##"detects unnecessary allocations that can be eliminated"##,
1523 default_severity: Severity::Warning,
1524 warn_since: None,
1525 deny_since: None,
1526 },
1527 Lint {
1528 label: "unused_assignments",
1529 description: r##"detect assignments that will never be read"##,
1530 default_severity: Severity::Warning,
1531 warn_since: None,
1532 deny_since: None,
1533 },
1534 Lint {
1535 label: "unused_associated_type_bounds",
1536 description: r##"detects unused `Foo = Bar` bounds in `dyn Trait<Foo = Bar>`"##,
1537 default_severity: Severity::Warning,
1538 warn_since: None,
1539 deny_since: None,
1540 },
1541 Lint {
1542 label: "unused_attributes",
1543 description: r##"detects attributes that were not used by the compiler"##,
1544 default_severity: Severity::Warning,
1545 warn_since: None,
1546 deny_since: None,
1547 },
1548 Lint {
1549 label: "unused_braces",
1550 description: r##"unnecessary braces around an expression"##,
1551 default_severity: Severity::Warning,
1552 warn_since: None,
1553 deny_since: None,
1554 },
1555 Lint {
1556 label: "unused_comparisons",
1557 description: r##"comparisons made useless by limits of the types involved"##,
1558 default_severity: Severity::Warning,
1559 warn_since: None,
1560 deny_since: None,
1561 },
1562 Lint {
1563 label: "unused_crate_dependencies",
1564 description: r##"crate dependencies that are never used"##,
1565 default_severity: Severity::Allow,
1566 warn_since: None,
1567 deny_since: None,
1568 },
1569 Lint {
1570 label: "unused_doc_comments",
1571 description: r##"detects doc comments that aren't used by rustdoc"##,
1572 default_severity: Severity::Warning,
1573 warn_since: None,
1574 deny_since: None,
1575 },
1576 Lint {
1577 label: "unused_extern_crates",
1578 description: r##"extern crates that are never used"##,
1579 default_severity: Severity::Allow,
1580 warn_since: None,
1581 deny_since: None,
1582 },
1583 Lint {
1584 label: "unused_features",
1585 description: r##"unused features found in crate-level `#[feature]` directives"##,
1586 default_severity: Severity::Warning,
1587 warn_since: None,
1588 deny_since: None,
1589 },
1590 Lint {
1591 label: "unused_import_braces",
1592 description: r##"unnecessary braces around an imported item"##,
1593 default_severity: Severity::Allow,
1594 warn_since: None,
1595 deny_since: None,
1596 },
1597 Lint {
1598 label: "unused_imports",
1599 description: r##"imports that are never used"##,
1600 default_severity: Severity::Warning,
1601 warn_since: None,
1602 deny_since: None,
1603 },
1604 Lint {
1605 label: "unused_labels",
1606 description: r##"detects labels that are never used"##,
1607 default_severity: Severity::Warning,
1608 warn_since: None,
1609 deny_since: None,
1610 },
1611 Lint {
1612 label: "unused_lifetimes",
1613 description: r##"detects lifetime parameters that are never used"##,
1614 default_severity: Severity::Allow,
1615 warn_since: None,
1616 deny_since: None,
1617 },
1618 Lint {
1619 label: "unused_macro_rules",
1620 description: r##"detects macro rules that were not used"##,
1621 default_severity: Severity::Allow,
1622 warn_since: None,
1623 deny_since: None,
1624 },
1625 Lint {
1626 label: "unused_macros",
1627 description: r##"detects macros that were not used"##,
1628 default_severity: Severity::Warning,
1629 warn_since: None,
1630 deny_since: None,
1631 },
1632 Lint {
1633 label: "unused_must_use",
1634 description: r##"unused result of a type flagged as `#[must_use]`"##,
1635 default_severity: Severity::Warning,
1636 warn_since: None,
1637 deny_since: None,
1638 },
1639 Lint {
1640 label: "unused_mut",
1641 description: r##"detect mut variables which don't need to be mutable"##,
1642 default_severity: Severity::Warning,
1643 warn_since: None,
1644 deny_since: None,
1645 },
1646 Lint {
1647 label: "unused_parens",
1648 description: r##"`if`, `match`, `while` and `return` do not need parentheses"##,
1649 default_severity: Severity::Warning,
1650 warn_since: None,
1651 deny_since: None,
1652 },
1653 Lint {
1654 label: "unused_qualifications",
1655 description: r##"detects unnecessarily qualified names"##,
1656 default_severity: Severity::Allow,
1657 warn_since: None,
1658 deny_since: None,
1659 },
1660 Lint {
1661 label: "unused_results",
1662 description: r##"unused result of an expression in a statement"##,
1663 default_severity: Severity::Allow,
1664 warn_since: None,
1665 deny_since: None,
1666 },
1667 Lint {
1668 label: "unused_unsafe",
1669 description: r##"unnecessary use of an `unsafe` block"##,
1670 default_severity: Severity::Warning,
1671 warn_since: None,
1672 deny_since: None,
1673 },
1674 Lint {
1675 label: "unused_variables",
1676 description: r##"detect variables which are not used in any way"##,
1677 default_severity: Severity::Warning,
1678 warn_since: None,
1679 deny_since: None,
1680 },
1681 Lint {
1682 label: "unused_visibilities",
1683 description: r##"detect visibility qualifiers on `const _` items"##,
1684 default_severity: Severity::Warning,
1685 warn_since: None,
1686 deny_since: None,
1687 },
1688 Lint {
1689 label: "useless_deprecated",
1690 description: r##"detects deprecation attributes with no effect"##,
1691 default_severity: Severity::Error,
1692 warn_since: None,
1693 deny_since: None,
1694 },
1695 Lint {
1696 label: "useless_ptr_null_checks",
1697 description: r##"useless checking of non-null-typed pointer"##,
1698 default_severity: Severity::Warning,
1699 warn_since: None,
1700 deny_since: None,
1701 },
1702 Lint {
1703 label: "uses_power_alignment",
1704 description: r##"Structs do not follow the power alignment rule under repr(C)"##,
1705 default_severity: Severity::Warning,
1706 warn_since: None,
1707 deny_since: None,
1708 },
1709 Lint {
1710 label: "varargs_without_pattern",
1711 description: r##"detects usage of `...` arguments without a pattern in non-foreign items"##,
1712 default_severity: Severity::Error,
1713 warn_since: None,
1714 deny_since: None,
1715 },
1716 Lint {
1717 label: "variant_size_differences",
1718 description: r##"detects enums with widely varying variant sizes"##,
1719 default_severity: Severity::Allow,
1720 warn_since: None,
1721 deny_since: None,
1722 },
1723 Lint {
1724 label: "warnings",
1725 description: r##"mass-change the level for lints which produce warnings"##,
1726 default_severity: Severity::Warning,
1727 warn_since: None,
1728 deny_since: None,
1729 },
1730 Lint {
1731 label: "while_true",
1732 description: r##"suggest using `loop { }` instead of `while true { }`"##,
1733 default_severity: Severity::Warning,
1734 warn_since: None,
1735 deny_since: None,
1736 },
1737 Lint {
1738 label: "deprecated_safe",
1739 description: r##"lint group for: deprecated-safe-2024"##,
1740 default_severity: Severity::Allow,
1741 warn_since: None,
1742 deny_since: None,
1743 },
1744 Lint {
1745 label: "future_incompatible",
1746 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"##,
1747 default_severity: Severity::Allow,
1748 warn_since: None,
1749 deny_since: None,
1750 },
1751 Lint {
1752 label: "keyword_idents",
1753 description: r##"lint group for: keyword-idents-2018, keyword-idents-2024"##,
1754 default_severity: Severity::Allow,
1755 warn_since: None,
1756 deny_since: None,
1757 },
1758 Lint {
1759 label: "let_underscore",
1760 description: r##"lint group for: let-underscore-drop, let-underscore-lock"##,
1761 default_severity: Severity::Allow,
1762 warn_since: None,
1763 deny_since: None,
1764 },
1765 Lint {
1766 label: "nonstandard_style",
1767 description: r##"lint group for: non-camel-case-types, non-snake-case, non-upper-case-globals"##,
1768 default_severity: Severity::Allow,
1769 warn_since: None,
1770 deny_since: None,
1771 },
1772 Lint {
1773 label: "refining_impl_trait",
1774 description: r##"lint group for: refining-impl-trait-reachable, refining-impl-trait-internal"##,
1775 default_severity: Severity::Allow,
1776 warn_since: None,
1777 deny_since: None,
1778 },
1779 Lint {
1780 label: "rust_2018_compatibility",
1781 description: r##"lint group for: keyword-idents-2018, anonymous-parameters, absolute-paths-not-starting-with-crate, tyvar-behind-raw-pointer"##,
1782 default_severity: Severity::Allow,
1783 warn_since: None,
1784 deny_since: None,
1785 },
1786 Lint {
1787 label: "rust_2018_idioms",
1788 description: r##"lint group for: bare-trait-objects, unused-extern-crates, ellipsis-inclusive-range-patterns, elided-lifetimes-in-paths, explicit-outlives-requirements"##,
1789 default_severity: Severity::Allow,
1790 warn_since: None,
1791 deny_since: None,
1792 },
1793 Lint {
1794 label: "rust_2021_compatibility",
1795 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"##,
1796 default_severity: Severity::Allow,
1797 warn_since: None,
1798 deny_since: None,
1799 },
1800 Lint {
1801 label: "rust_2024_compatibility",
1802 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"##,
1803 default_severity: Severity::Allow,
1804 warn_since: None,
1805 deny_since: None,
1806 },
1807 Lint {
1808 label: "unknown_or_malformed_diagnostic_attributes",
1809 description: r##"lint group for: malformed-diagnostic-attributes, malformed-diagnostic-format-literals, misplaced-diagnostic-attributes, unknown-diagnostic-attributes"##,
1810 default_severity: Severity::Allow,
1811 warn_since: None,
1812 deny_since: None,
1813 },
1814 Lint {
1815 label: "unused",
1816 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"##,
1817 default_severity: Severity::Allow,
1818 warn_since: None,
1819 deny_since: None,
1820 },
1821];
1822
1823pub const DEFAULT_LINT_GROUPS: &[LintGroup] = &[
1824 LintGroup {
1825 lint: Lint {
1826 label: "deprecated_safe",
1827 description: r##"lint group for: deprecated-safe-2024"##,
1828 default_severity: Severity::Allow,
1829 warn_since: None,
1830 deny_since: None,
1831 },
1832 children: &["deprecated_safe_2024"],
1833 },
1834 LintGroup {
1835 lint: Lint {
1836 label: "future_incompatible",
1837 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"##,
1838 default_severity: Severity::Allow,
1839 warn_since: None,
1840 deny_since: None,
1841 },
1842 children: &[
1843 "internal_eq_trait_method_impls",
1844 "aarch64_softfloat_neon",
1845 "ambiguous_associated_items",
1846 "ambiguous_derive_helpers",
1847 "ambiguous_glob_imported_traits",
1848 "ambiguous_glob_imports",
1849 "ambiguous_import_visibilities",
1850 "ambiguous_panic_imports",
1851 "coherence_leak_check",
1852 "conflicting_repr_hints",
1853 "const_evaluatable_unchecked",
1854 "elided_lifetimes_in_associated_constant",
1855 "float_literal_f32_fallback",
1856 "forbidden_lint_groups",
1857 "ill_formed_attribute_input",
1858 "invalid_macro_export_arguments",
1859 "invalid_type_param_default",
1860 "late_bound_lifetime_arguments",
1861 "legacy_derive_helpers",
1862 "macro_expanded_macro_exports_accessed_by_absolute_paths",
1863 "out_of_scope_macro_calls",
1864 "patterns_in_fns_without_body",
1865 "proc_macro_derive_resolution_fallback",
1866 "pub_use_of_private_extern_crate",
1867 "repr_c_enums_larger_than_int",
1868 "repr_transparent_non_zst_fields",
1869 "self_constructor_from_outer_item",
1870 "semicolon_in_expressions_from_macros",
1871 "uncovered_param_in_projection",
1872 "uninhabited_static",
1873 "unstable_name_collisions",
1874 "unstable_syntax_pre_expansion",
1875 "unsupported_calling_conventions",
1876 "varargs_without_pattern",
1877 ],
1878 },
1879 LintGroup {
1880 lint: Lint {
1881 label: "keyword_idents",
1882 description: r##"lint group for: keyword-idents-2018, keyword-idents-2024"##,
1883 default_severity: Severity::Allow,
1884 warn_since: None,
1885 deny_since: None,
1886 },
1887 children: &["keyword_idents_2018", "keyword_idents_2024"],
1888 },
1889 LintGroup {
1890 lint: Lint {
1891 label: "let_underscore",
1892 description: r##"lint group for: let-underscore-drop, let-underscore-lock"##,
1893 default_severity: Severity::Allow,
1894 warn_since: None,
1895 deny_since: None,
1896 },
1897 children: &["let_underscore_drop", "let_underscore_lock"],
1898 },
1899 LintGroup {
1900 lint: Lint {
1901 label: "nonstandard_style",
1902 description: r##"lint group for: non-camel-case-types, non-snake-case, non-upper-case-globals"##,
1903 default_severity: Severity::Allow,
1904 warn_since: None,
1905 deny_since: None,
1906 },
1907 children: &["non_camel_case_types", "non_snake_case", "non_upper_case_globals"],
1908 },
1909 LintGroup {
1910 lint: Lint {
1911 label: "refining_impl_trait",
1912 description: r##"lint group for: refining-impl-trait-reachable, refining-impl-trait-internal"##,
1913 default_severity: Severity::Allow,
1914 warn_since: None,
1915 deny_since: None,
1916 },
1917 children: &["refining_impl_trait_reachable", "refining_impl_trait_internal"],
1918 },
1919 LintGroup {
1920 lint: Lint {
1921 label: "rust_2018_compatibility",
1922 description: r##"lint group for: keyword-idents-2018, anonymous-parameters, absolute-paths-not-starting-with-crate, tyvar-behind-raw-pointer"##,
1923 default_severity: Severity::Allow,
1924 warn_since: None,
1925 deny_since: None,
1926 },
1927 children: &[
1928 "keyword_idents_2018",
1929 "anonymous_parameters",
1930 "absolute_paths_not_starting_with_crate",
1931 "tyvar_behind_raw_pointer",
1932 ],
1933 },
1934 LintGroup {
1935 lint: Lint {
1936 label: "rust_2018_idioms",
1937 description: r##"lint group for: bare-trait-objects, unused-extern-crates, ellipsis-inclusive-range-patterns, elided-lifetimes-in-paths, explicit-outlives-requirements"##,
1938 default_severity: Severity::Allow,
1939 warn_since: None,
1940 deny_since: None,
1941 },
1942 children: &[
1943 "bare_trait_objects",
1944 "unused_extern_crates",
1945 "ellipsis_inclusive_range_patterns",
1946 "elided_lifetimes_in_paths",
1947 "explicit_outlives_requirements",
1948 ],
1949 },
1950 LintGroup {
1951 lint: Lint {
1952 label: "rust_2021_compatibility",
1953 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"##,
1954 default_severity: Severity::Allow,
1955 warn_since: None,
1956 deny_since: None,
1957 },
1958 children: &[
1959 "ellipsis_inclusive_range_patterns",
1960 "array_into_iter",
1961 "non_fmt_panics",
1962 "bare_trait_objects",
1963 "rust_2021_incompatible_closure_captures",
1964 "rust_2021_incompatible_or_patterns",
1965 "rust_2021_prefixes_incompatible_syntax",
1966 "rust_2021_prelude_collisions",
1967 ],
1968 },
1969 LintGroup {
1970 lint: Lint {
1971 label: "rust_2024_compatibility",
1972 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"##,
1973 default_severity: Severity::Allow,
1974 warn_since: None,
1975 deny_since: None,
1976 },
1977 children: &[
1978 "keyword_idents_2024",
1979 "edition_2024_expr_fragment_specifier",
1980 "boxed_slice_into_iter",
1981 "impl_trait_overcaptures",
1982 "if_let_rescope",
1983 "static_mut_refs",
1984 "dependency_on_unit_never_type_fallback",
1985 "deprecated_safe_2024",
1986 "missing_unsafe_on_extern",
1987 "never_type_fallback_flowing_into_unsafe",
1988 "rust_2024_guarded_string_incompatible_syntax",
1989 "rust_2024_incompatible_pat",
1990 "rust_2024_prelude_collisions",
1991 "tail_expr_drop_order",
1992 "unsafe_attr_outside_unsafe",
1993 "unsafe_op_in_unsafe_fn",
1994 ],
1995 },
1996 LintGroup {
1997 lint: Lint {
1998 label: "unknown_or_malformed_diagnostic_attributes",
1999 description: r##"lint group for: malformed-diagnostic-attributes, malformed-diagnostic-format-literals, misplaced-diagnostic-attributes, unknown-diagnostic-attributes"##,
2000 default_severity: Severity::Allow,
2001 warn_since: None,
2002 deny_since: None,
2003 },
2004 children: &[
2005 "malformed_diagnostic_attributes",
2006 "malformed_diagnostic_format_literals",
2007 "misplaced_diagnostic_attributes",
2008 "unknown_diagnostic_attributes",
2009 ],
2010 },
2011 LintGroup {
2012 lint: Lint {
2013 label: "unused",
2014 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"##,
2015 default_severity: Severity::Allow,
2016 warn_since: None,
2017 deny_since: None,
2018 },
2019 children: &[
2020 "unused_imports",
2021 "unused_variables",
2022 "unused_visibilities",
2023 "unused_assignments",
2024 "dead_code",
2025 "unused_mut",
2026 "unreachable_code",
2027 "unreachable_patterns",
2028 "unused_must_use",
2029 "unused_unsafe",
2030 "path_statements",
2031 "unused_attributes",
2032 "unused_macros",
2033 "unused_macro_rules",
2034 "unused_allocation",
2035 "unused_doc_comments",
2036 "unused_extern_crates",
2037 "unused_features",
2038 "unused_labels",
2039 "unused_parens",
2040 "unused_braces",
2041 "redundant_semicolons",
2042 "map_unit_fn",
2043 ],
2044 },
2045];
2046
2047pub const RUSTDOC_LINTS: &[Lint] = &[
2048 Lint {
2049 label: "rustdoc::bare_urls",
2050 description: r##"detects URLs that are not hyperlinks"##,
2051 default_severity: Severity::Warning,
2052 warn_since: None,
2053 deny_since: None,
2054 },
2055 Lint {
2056 label: "rustdoc::broken_intra_doc_links",
2057 description: r##"failures in resolving intra-doc link targets"##,
2058 default_severity: Severity::Warning,
2059 warn_since: None,
2060 deny_since: None,
2061 },
2062 Lint {
2063 label: "rustdoc::invalid_codeblock_attributes",
2064 description: r##"codeblock attribute looks a lot like a known one"##,
2065 default_severity: Severity::Warning,
2066 warn_since: None,
2067 deny_since: None,
2068 },
2069 Lint {
2070 label: "rustdoc::invalid_html_tags",
2071 description: r##"detects invalid HTML tags in doc comments"##,
2072 default_severity: Severity::Warning,
2073 warn_since: None,
2074 deny_since: None,
2075 },
2076 Lint {
2077 label: "rustdoc::invalid_rust_codeblocks",
2078 description: r##"codeblock could not be parsed as valid Rust or is empty"##,
2079 default_severity: Severity::Warning,
2080 warn_since: None,
2081 deny_since: None,
2082 },
2083 Lint {
2084 label: "rustdoc::missing_crate_level_docs",
2085 description: r##"detects crates with no crate-level documentation"##,
2086 default_severity: Severity::Allow,
2087 warn_since: None,
2088 deny_since: None,
2089 },
2090 Lint {
2091 label: "rustdoc::missing_doc_code_examples",
2092 description: r##"detects publicly-exported items without code samples in their documentation"##,
2093 default_severity: Severity::Allow,
2094 warn_since: None,
2095 deny_since: None,
2096 },
2097 Lint {
2098 label: "rustdoc::private_doc_tests",
2099 description: r##"detects code samples in docs of private items not documented by rustdoc"##,
2100 default_severity: Severity::Allow,
2101 warn_since: None,
2102 deny_since: None,
2103 },
2104 Lint {
2105 label: "rustdoc::private_intra_doc_links",
2106 description: r##"linking from a public item to a private one"##,
2107 default_severity: Severity::Warning,
2108 warn_since: None,
2109 deny_since: None,
2110 },
2111 Lint {
2112 label: "rustdoc::redundant_explicit_links",
2113 description: r##"detects redundant explicit links in doc comments"##,
2114 default_severity: Severity::Warning,
2115 warn_since: None,
2116 deny_since: None,
2117 },
2118 Lint {
2119 label: "rustdoc::unescaped_backticks",
2120 description: r##"detects unescaped backticks in doc comments"##,
2121 default_severity: Severity::Allow,
2122 warn_since: None,
2123 deny_since: None,
2124 },
2125 Lint {
2126 label: "rustdoc::all",
2127 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"##,
2128 default_severity: Severity::Allow,
2129 warn_since: None,
2130 deny_since: None,
2131 },
2132];
2133
2134pub const RUSTDOC_LINT_GROUPS: &[LintGroup] = &[LintGroup {
2135 lint: Lint {
2136 label: "rustdoc::all",
2137 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"##,
2138 default_severity: Severity::Allow,
2139 warn_since: None,
2140 deny_since: None,
2141 },
2142 children: &[
2143 "rustdoc::broken_intra_doc_links",
2144 "rustdoc::private_intra_doc_links",
2145 "rustdoc::private_doc_tests",
2146 "rustdoc::invalid_codeblock_attributes",
2147 "rustdoc::invalid_rust_codeblocks",
2148 "rustdoc::invalid_html_tags",
2149 "rustdoc::bare_urls",
2150 "rustdoc::missing_crate_level_docs",
2151 "rustdoc::unescaped_backticks",
2152 "rustdoc::redundant_explicit_links",
2153 ],
2154}];
2155
2156pub const FEATURES: &[Lint] = &[
2157 Lint {
2158 label: "aarch64_unstable_target_feature",
2159 description: r##"# `aarch64_unstable_target_feature`
2160
2161The remaining unstable target features on aarch64.
2162
2163The tracking issue for this feature is: [#150244]
2164
2165[#150244]: https://github.com/rust-lang/rust/issues/150244
2166
2167------------------------
2168"##,
2169 default_severity: Severity::Allow,
2170 warn_since: None,
2171 deny_since: None,
2172 },
2173 Lint {
2174 label: "aarch64_ver_target_feature",
2175 description: r##"# `aarch64_ver_target_feature`
2176
2177Instruction set "version" target features on aarch64.
2178
2179The tracking issue for this feature is: [#150245]
2180
2181[#150245]: https://github.com/rust-lang/rust/issues/150245
2182
2183------------------------
2184"##,
2185 default_severity: Severity::Allow,
2186 warn_since: None,
2187 deny_since: None,
2188 },
2189 Lint {
2190 label: "abi_avr_interrupt",
2191 description: r##"# `abi_avr_interrupt`
2192
2193Allows `extern "avr-interrupt" fn()` and `extern "avr-non-blocking-interrupt" fn()`.
2194
2195The tracking issue for this feature is: [#69664]
2196
2197[#69664]: https://github.com/rust-lang/rust/issues/69664
2198
2199------------------------
2200"##,
2201 default_severity: Severity::Allow,
2202 warn_since: None,
2203 deny_since: None,
2204 },
2205 Lint {
2206 label: "abi_cmse_nonsecure_call",
2207 description: r##"# `abi_cmse_nonsecure_call`
2208
2209The tracking issue for this feature is: [#81391]
2210
2211[#81391]: https://github.com/rust-lang/rust/issues/81391
2212
2213------------------------
2214
2215The [TrustZone-M
2216feature](https://developer.arm.com/documentation/100690/latest/) is available
2217for targets with the Armv8-M architecture profile (`thumbv8m` in their target
2218name).
2219LLVM, the Rust compiler and the linker are providing
2220[support](https://developer.arm.com/documentation/ecm0359818/latest/) for the
2221TrustZone-M feature.
2222
2223One of the things provided with this unstable feature is the "cmse-nonsecure-call" function ABI.
2224This ABI is used on function pointers to non-secure code to mark a non-secure function call
2225(see [section 5.5](https://developer.arm.com/documentation/ecm0359818/latest/) for details).
2226
2227With this ABI, the compiler will do the following to perform the call:
2228* save registers needed after the call to Secure memory
2229* clear all registers that might contain confidential information
2230* clear the Least Significant Bit of the function address
2231* branches using the BLXNS instruction
2232
2233To avoid using the non-secure stack, the compiler will constrain the number and
2234type of parameters/return value.
2235
2236<!-- NOTE(ignore) this example is specific to thumbv8m targets -->
2237
2238``` rust,ignore
2239#![no_std]
2240#![feature(abi_cmse_nonsecure_call)]
2241
2242#[no_mangle]
2243pub fn call_nonsecure_function(addr: usize) -> u32 {
2244 let non_secure_function =
2245 unsafe { core::mem::transmute::<usize, extern "cmse-nonsecure-call" fn() -> u32>(addr) };
2246 non_secure_function()
2247}
2248```
2249
2250``` text
2251$ rustc --emit asm --crate-type lib --target thumbv8m.main-none-eabi function.rs
2252
2253call_nonsecure_function:
2254 .fnstart
2255 .save {r7, lr}
2256 push {r7, lr}
2257 .setfp r7, sp
2258 mov r7, sp
2259 .pad #16
2260 sub sp, #16
2261 str r0, [sp, #12]
2262 ldr r0, [sp, #12]
2263 str r0, [sp, #8]
2264 b .LBB0_1
2265.LBB0_1:
2266 ldr r0, [sp, #8]
2267 push.w {r4, r5, r6, r7, r8, r9, r10, r11}
2268 bic r0, r0, #1
2269 mov r1, r0
2270 mov r2, r0
2271 mov r3, r0
2272 mov r4, r0
2273 mov r5, r0
2274 mov r6, r0
2275 mov r7, r0
2276 mov r8, r0
2277 mov r9, r0
2278 mov r10, r0
2279 mov r11, r0
2280 mov r12, r0
2281 msr apsr_nzcvq, r0
2282 blxns r0
2283 pop.w {r4, r5, r6, r7, r8, r9, r10, r11}
2284 str r0, [sp, #4]
2285 b .LBB0_2
2286.LBB0_2:
2287 ldr r0, [sp, #4]
2288 add sp, #16
2289 pop {r7, pc}
2290```
2291"##,
2292 default_severity: Severity::Allow,
2293 warn_since: None,
2294 deny_since: None,
2295 },
2296 Lint {
2297 label: "abi_custom",
2298 description: r##"# `abi_custom`
2299
2300Allows `extern "custom" fn()`.
2301
2302The tracking issue for this feature is: [#140829]
2303
2304[#140829]: https://github.com/rust-lang/rust/issues/140829
2305
2306------------------------
2307"##,
2308 default_severity: Severity::Allow,
2309 warn_since: None,
2310 deny_since: None,
2311 },
2312 Lint {
2313 label: "abi_gpu_kernel",
2314 description: r##"# `abi_gpu_kernel`
2315
2316Allows `extern "gpu-kernel" fn()`.
2317
2318The tracking issue for this feature is: [#135467]
2319
2320[#135467]: https://github.com/rust-lang/rust/issues/135467
2321
2322------------------------
2323"##,
2324 default_severity: Severity::Allow,
2325 warn_since: None,
2326 deny_since: None,
2327 },
2328 Lint {
2329 label: "abi_msp430_interrupt",
2330 description: r##"# `abi_msp430_interrupt`
2331
2332The tracking issue for this feature is: [#38487]
2333
2334[#38487]: https://github.com/rust-lang/rust/issues/38487
2335
2336------------------------
2337
2338In the MSP430 architecture, interrupt handlers have a special calling
2339convention. You can use the `"msp430-interrupt"` ABI to make the compiler apply
2340the right calling convention to the interrupt handlers you define.
2341
2342<!-- NOTE(ignore) this example is specific to the msp430 target -->
2343
2344``` rust,ignore
2345#![feature(abi_msp430_interrupt)]
2346#![no_std]
2347
2348// Place the interrupt handler at the appropriate memory address
2349// (Alternatively, you can use `#[used]` and remove `pub` and `#[no_mangle]`)
2350#[link_section = "__interrupt_vector_10"]
2351#[no_mangle]
2352pub static TIM0_VECTOR: extern "msp430-interrupt" fn() = tim0;
2353
2354// The interrupt handler
2355extern "msp430-interrupt" fn tim0() {
2356 // ..
2357}
2358```
2359
2360``` text
2361$ msp430-elf-objdump -CD ./target/msp430/release/app
2362Disassembly of section __interrupt_vector_10:
2363
23640000fff2 <TIM0_VECTOR>:
2365 fff2: 00 c0 interrupt service routine at 0xc000
2366
2367Disassembly of section .text:
2368
23690000c000 <int::tim0>:
2370 c000: 00 13 reti
2371```
2372"##,
2373 default_severity: Severity::Allow,
2374 warn_since: None,
2375 deny_since: None,
2376 },
2377 Lint {
2378 label: "abi_ptx",
2379 description: r##"# `abi_ptx`
2380
2381The tracking issue for this feature is: [#38788]
2382
2383[#38788]: https://github.com/rust-lang/rust/issues/38788
2384
2385------------------------
2386
2387When emitting PTX code, all vanilla Rust functions (`fn`) get translated to
2388"device" functions. These functions are *not* callable from the host via the
2389CUDA API so a crate with only device functions is not too useful!
2390
2391OTOH, "global" functions *can* be called by the host; you can think of them
2392as the real public API of your crate. To produce a global function use the
2393`"ptx-kernel"` ABI.
2394
2395<!-- NOTE(ignore) this example is specific to the nvptx targets -->
2396
2397``` rust,ignore
2398#![feature(abi_ptx)]
2399#![no_std]
2400
2401pub unsafe extern "ptx-kernel" fn global_function() {
2402 device_function();
2403}
2404
2405pub fn device_function() {
2406 // ..
2407}
2408```
2409
2410``` text
2411$ xargo rustc --target nvptx64-nvidia-cuda --release -- --emit=asm
2412
2413$ cat $(find -name '*.s')
2414//
2415// Generated by LLVM NVPTX Back-End
2416//
2417
2418.version 3.2
2419.target sm_20
2420.address_size 64
2421
2422 // .globl _ZN6kernel15global_function17h46111ebe6516b382E
2423
2424.visible .entry _ZN6kernel15global_function17h46111ebe6516b382E()
2425{
2426
2427
2428 ret;
2429}
2430
2431 // .globl _ZN6kernel15device_function17hd6a0e4993bbf3f78E
2432.visible .func _ZN6kernel15device_function17hd6a0e4993bbf3f78E()
2433{
2434
2435
2436 ret;
2437}
2438```
2439"##,
2440 default_severity: Severity::Allow,
2441 warn_since: None,
2442 deny_since: None,
2443 },
2444 Lint {
2445 label: "abi_riscv_interrupt",
2446 description: r##"# `abi_riscv_interrupt`
2447
2448Allows `extern "riscv-interrupt-m" fn()` and `extern "riscv-interrupt-s" fn()`.
2449
2450The tracking issue for this feature is: [#111889]
2451
2452[#111889]: https://github.com/rust-lang/rust/issues/111889
2453
2454------------------------
2455"##,
2456 default_severity: Severity::Allow,
2457 warn_since: None,
2458 deny_since: None,
2459 },
2460 Lint {
2461 label: "abi_swift",
2462 description: r##"# `abi_swift`
2463
2464Allows `extern "Swift" fn()`.
2465
2466The tracking issue for this feature is: [#156481]
2467
2468[#156481]: https://github.com/rust-lang/rust/issues/156481
2469
2470------------------------
2471"##,
2472 default_severity: Severity::Allow,
2473 warn_since: None,
2474 deny_since: None,
2475 },
2476 Lint {
2477 label: "abi_unadjusted",
2478 description: r##"# `abi_unadjusted`
2479
2480Allows using the `unadjusted` ABI; perma-unstable.
2481
2482This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
2483
2484------------------------
2485"##,
2486 default_severity: Severity::Allow,
2487 warn_since: None,
2488 deny_since: None,
2489 },
2490 Lint {
2491 label: "abi_vectorcall",
2492 description: r##"# `abi_vectorcall`
2493
2494The tracking issue for this feature is: [#124485]
2495
2496[#124485]: https://github.com/rust-lang/rust/issues/124485
2497
2498------------------------
2499
2500Adds support for the Windows `"vectorcall"` ABI, the equivalent of `__vectorcall` in MSVC.
2501
2502```rust,ignore (only-windows-or-x86-or-x86-64)
2503extern "vectorcall" {
2504 fn add_f64s(x: f64, y: f64) -> f64;
2505}
2506
2507fn main() {
2508 println!("{}", add_f64s(2.0, 4.0));
2509}
2510```
2511"##,
2512 default_severity: Severity::Allow,
2513 warn_since: None,
2514 deny_since: None,
2515 },
2516 Lint {
2517 label: "abi_x86_interrupt",
2518 description: r##"# `abi_x86_interrupt`
2519
2520Allows `extern "x86-interrupt" fn()`.
2521
2522The tracking issue for this feature is: [#40180]
2523
2524[#40180]: https://github.com/rust-lang/rust/issues/40180
2525
2526------------------------
2527"##,
2528 default_severity: Severity::Allow,
2529 warn_since: None,
2530 deny_since: None,
2531 },
2532 Lint {
2533 label: "abort_immediate",
2534 description: r##"# `abort_immediate`
2535
2536
2537
2538The tracking issue for this feature is: [#154601]
2539
2540[#154601]: https://github.com/rust-lang/rust/issues/154601
2541
2542------------------------
2543"##,
2544 default_severity: Severity::Allow,
2545 warn_since: None,
2546 deny_since: None,
2547 },
2548 Lint {
2549 label: "abort_unwind",
2550 description: r##"# `abort_unwind`
2551
2552
2553
2554The tracking issue for this feature is: [#130338]
2555
2556[#130338]: https://github.com/rust-lang/rust/issues/130338
2557
2558------------------------
2559"##,
2560 default_severity: Severity::Allow,
2561 warn_since: None,
2562 deny_since: None,
2563 },
2564 Lint {
2565 label: "acceptfilter",
2566 description: r##"# `acceptfilter`
2567
2568
2569
2570The tracking issue for this feature is: [#121891]
2571
2572[#121891]: https://github.com/rust-lang/rust/issues/121891
2573
2574------------------------
2575"##,
2576 default_severity: Severity::Allow,
2577 warn_since: None,
2578 deny_since: None,
2579 },
2580 Lint {
2581 label: "addr_parse_ascii",
2582 description: r##"# `addr_parse_ascii`
2583
2584
2585
2586The tracking issue for this feature is: [#101035]
2587
2588[#101035]: https://github.com/rust-lang/rust/issues/101035
2589
2590------------------------
2591"##,
2592 default_severity: Severity::Allow,
2593 warn_since: None,
2594 deny_since: None,
2595 },
2596 Lint {
2597 label: "adt_const_params",
2598 description: r##"# `adt_const_params`
2599
2600The tracking issue for this feature is: [#95174]
2601
2602[#95174]: https://github.com/rust-lang/rust/issues/95174
2603
2604------------------------
2605
2606Allows for using more complex types for const parameters, such as structs or enums.
2607
2608```rust
2609#![feature(adt_const_params)]
2610#![allow(incomplete_features)]
2611
2612use std::marker::ConstParamTy;
2613
2614#[derive(ConstParamTy, PartialEq, Eq)]
2615enum Foo {
2616 A,
2617 B,
2618 C,
2619}
2620
2621#[derive(ConstParamTy, PartialEq, Eq)]
2622struct Bar {
2623 flag: bool,
2624}
2625
2626fn is_foo_a_and_bar_true<const F: Foo, const B: Bar>() -> bool {
2627 match (F, B.flag) {
2628 (Foo::A, true) => true,
2629 _ => false,
2630 }
2631}
2632```
2633"##,
2634 default_severity: Severity::Allow,
2635 warn_since: None,
2636 deny_since: None,
2637 },
2638 Lint {
2639 label: "align_to_uninit_mut",
2640 description: r##"# `align_to_uninit_mut`
2641
2642
2643
2644The tracking issue for this feature is: [#139062]
2645
2646[#139062]: https://github.com/rust-lang/rust/issues/139062
2647
2648------------------------
2649"##,
2650 default_severity: Severity::Allow,
2651 warn_since: None,
2652 deny_since: None,
2653 },
2654 Lint {
2655 label: "alloc_error_handler",
2656 description: r##"# `alloc_error_handler`
2657
2658Allows defining an `#[alloc_error_handler]`.
2659
2660The tracking issue for this feature is: [#51540]
2661
2662[#51540]: https://github.com/rust-lang/rust/issues/51540
2663
2664------------------------
2665"##,
2666 default_severity: Severity::Allow,
2667 warn_since: None,
2668 deny_since: None,
2669 },
2670 Lint {
2671 label: "alloc_error_hook",
2672 description: r##"# `alloc_error_hook`
2673
2674
2675
2676The tracking issue for this feature is: [#51245]
2677
2678[#51245]: https://github.com/rust-lang/rust/issues/51245
2679
2680------------------------
2681"##,
2682 default_severity: Severity::Allow,
2683 warn_since: None,
2684 deny_since: None,
2685 },
2686 Lint {
2687 label: "alloc_internals",
2688 description: r##"# `alloc_internals`
2689
2690
2691
2692This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
2693
2694------------------------
2695"##,
2696 default_severity: Severity::Allow,
2697 warn_since: None,
2698 deny_since: None,
2699 },
2700 Lint {
2701 label: "alloc_slice_into_array",
2702 description: r##"# `alloc_slice_into_array`
2703
2704
2705
2706The tracking issue for this feature is: [#148082]
2707
2708[#148082]: https://github.com/rust-lang/rust/issues/148082
2709
2710------------------------
2711"##,
2712 default_severity: Severity::Allow,
2713 warn_since: None,
2714 deny_since: None,
2715 },
2716 Lint {
2717 label: "allocator_api",
2718 description: r##"# `allocator_api`
2719
2720The tracking issue for this feature is [#32838]
2721
2722[#32838]: https://github.com/rust-lang/rust/issues/32838
2723
2724------------------------
2725
2726Sometimes you want the memory for one collection to use a different
2727allocator than the memory for another collection. In this case,
2728replacing the global allocator is not a workable option. Instead,
2729you need to pass in an instance of an `AllocRef` to each collection
2730for which you want a custom allocator.
2731
2732TBD
2733"##,
2734 default_severity: Severity::Allow,
2735 warn_since: None,
2736 deny_since: None,
2737 },
2738 Lint {
2739 label: "allocator_internals",
2740 description: r##"# `allocator_internals`
2741
2742This feature does not have a tracking issue, it is an unstable implementation
2743detail of the `global_allocator` feature not intended for use outside the
2744compiler.
2745
2746------------------------
2747"##,
2748 default_severity: Severity::Allow,
2749 warn_since: None,
2750 deny_since: None,
2751 },
2752 Lint {
2753 label: "alloctests",
2754 description: r##"# `alloctests`
2755
2756
2757
2758This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
2759
2760------------------------
2761"##,
2762 default_severity: Severity::Allow,
2763 warn_since: None,
2764 deny_since: None,
2765 },
2766 Lint {
2767 label: "allow_internal_unsafe",
2768 description: r##"# `allow_internal_unsafe`
2769
2770Allows 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).
2771
2772This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
2773
2774------------------------
2775"##,
2776 default_severity: Severity::Allow,
2777 warn_since: None,
2778 deny_since: None,
2779 },
2780 Lint {
2781 label: "allow_internal_unstable",
2782 description: r##"# `allow_internal_unstable`
2783
2784Allows 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).
2785
2786This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
2787
2788------------------------
2789"##,
2790 default_severity: Severity::Allow,
2791 warn_since: None,
2792 deny_since: None,
2793 },
2794 Lint {
2795 label: "anonymous_lifetime_in_impl_trait",
2796 description: r##"# `anonymous_lifetime_in_impl_trait`
2797
2798Allows using anonymous lifetimes in argument-position impl-trait.
2799
2800This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
2801
2802------------------------
2803"##,
2804 default_severity: Severity::Allow,
2805 warn_since: None,
2806 deny_since: None,
2807 },
2808 Lint {
2809 label: "apx_target_feature",
2810 description: r##"# `apx_target_feature`
2811
2812The `apxf` target feature on x86
2813
2814The tracking issue for this feature is: [#139284]
2815
2816[#139284]: https://github.com/rust-lang/rust/issues/139284
2817
2818------------------------
2819"##,
2820 default_severity: Severity::Allow,
2821 warn_since: None,
2822 deny_since: None,
2823 },
2824 Lint {
2825 label: "arbitrary_self_types",
2826 description: r##"# `arbitrary_self_types`
2827
2828The tracking issue for this feature is: [#44874]
2829
2830[#44874]: https://github.com/rust-lang/rust/issues/44874
2831
2832------------------------
2833
2834Allows any type implementing `core::ops::Receiver<Target=T>` to be used as the type
2835of `self` in a method belonging to `T`.
2836
2837For example,
2838
2839```rust
2840#![feature(arbitrary_self_types)]
2841
2842struct A;
2843
2844impl A {
2845 fn f(self: SmartPtr<Self>) -> i32 { 1 } // note self type
2846}
2847
2848struct SmartPtr<T>(T);
2849
2850impl<T> core::ops::Receiver for SmartPtr<T> {
2851 type Target = T;
2852}
2853
2854fn main() {
2855 let smart_ptr = SmartPtr(A);
2856 assert_eq!(smart_ptr.f(), 1);
2857}
2858```
2859
2860The `Receiver` trait has a blanket implementation for all `T: Deref`, so in fact
2861things like this work too:
2862
2863```rust
2864#![feature(arbitrary_self_types)]
2865
2866use std::rc::Rc;
2867
2868struct A;
2869
2870impl A {
2871 fn f(self: Rc<Self>) -> i32 { 1 } // Rc implements Deref
2872}
2873
2874fn main() {
2875 let smart_ptr = Rc::new(A);
2876 assert_eq!(smart_ptr.f(), 1);
2877}
2878```
2879
2880Interestingly, that works even without the `arbitrary_self_types` feature
2881- but that's because certain types are _effectively_ hard coded, including
2882`Rc`. ("Hard coding" isn't quite true; they use a lang-item called
2883`LegacyReceiver` to denote their special-ness in this way). With the
2884`arbitrary_self_types` feature, their special-ness goes away, and custom
2885smart pointers can achieve the same.
2886
2887## Changes to method lookup
2888
2889Method lookup previously used to work by stepping through the `Deref`
2890chain then using the resulting list of steps in two different ways:
2891
2892* To identify types that might contribute methods via their `impl`
2893 blocks (inherent methods) or via traits
2894* To identify the types that the method receiver (`a` in the above
2895 examples) can be converted to.
2896
2897With this feature, these lists are created by instead stepping through
2898the `Receiver` chain. However, a note is kept about whether the type
2899can be reached also via the `Deref` chain.
2900
2901The full chain (via `Receiver` hops) is used for the first purpose
2902(identifying relevant `impl` blocks and traits); whereas the shorter
2903list (reachable via `Deref`) is used for the second purpose. That's
2904because, to convert the method target (`a` in `a.b()`) to the self
2905type, Rust may need to be able to use `Deref::deref`. Type conversions,
2906then, can only proceed as far as the end of the `Deref` chain whereas
2907the longer `Receiver` chain can be used to explore more places where
2908useful methods might reside.
2909
2910## Types suitable for use as smart pointers
2911
2912This feature allows the creation of customised smart pointers - for example
2913your own equivalent to `Rc` or `Box` with whatever capabilities you like.
2914Those smart pointers can either implement `Deref` (if it's safe to
2915create a reference to the referent) or `Receiver` (if it isn't).
2916
2917Either way, smart pointer types should mostly _avoid having methods_.
2918Calling methods on a smart pointer leads to ambiguity about whether you're
2919aiming for a method on the pointer, or on the referent.
2920
2921Best practice is therefore to put smart pointer functionality into
2922associated functions instead - that's what's done in all the smart pointer
2923types within Rust's standard library which implement `Receiver`.
2924
2925If you choose to add any methods to your smart pointer type, your users
2926may run into errors from deshadowing, as described in the next section.
2927
2928## Avoiding shadowing
2929
2930With or without this feature, Rust emits an error if it finds two method
2931candidates, like this:
2932
2933```rust,compile_fail
2934use std::pin::Pin;
2935use std::pin::pin;
2936
2937struct A;
2938
2939impl A {
2940 fn get_ref(self: Pin<&A>) {}
2941}
2942
2943fn main() {
2944 let pinned_a: Pin<&A> = pin!(A).as_ref();
2945 let pinned_a: Pin<&A> = pinned_a.as_ref();
2946 pinned_a.get_ref(); // error[E0034]: multiple applicable items in scope
2947}
2948```
2949
2950(this is why Rust's smart pointers are mostly carefully designed to avoid
2951having methods at all, and shouldn't add new methods in future.)
2952
2953With `arbitrary_self_types`, we take care to spot some other kinds of
2954conflict:
2955
2956```rust,compile_fail
2957#![feature(arbitrary_self_types)]
2958
2959use std::pin::Pin;
2960use std::pin::pin;
2961
2962struct A;
2963
2964impl A {
2965 fn get_ref(self: &Pin<&A>) {} // note &Pin
2966}
2967
2968fn main() {
2969 let pinned_a: Pin<&mut A> = pin!(A);
2970 let pinned_a: Pin<&A> = pinned_a.as_ref();
2971 pinned_a.get_ref();
2972}
2973```
2974
2975This is to guard against the case where an inner (referent) type has a
2976method of a given name, taking the smart pointer by reference, and then
2977the smart pointer implementer adds a similar method taking self by value.
2978As noted in the previous section, the safe option is simply
2979not to add methods to smart pointers, and then these errors can't occur.
2980"##,
2981 default_severity: Severity::Allow,
2982 warn_since: None,
2983 deny_since: None,
2984 },
2985 Lint {
2986 label: "arbitrary_self_types_pointers",
2987 description: r##"# `arbitrary_self_types_pointers`
2988
2989The tracking issue for this feature is: [#44874]
2990
2991[#38788]: https://github.com/rust-lang/rust/issues/44874
2992
2993------------------------
2994
2995This extends the [arbitrary self types] feature to allow methods to
2996receive `self` by pointer. For example:
2997
2998```rust
2999#![feature(arbitrary_self_types_pointers)]
3000
3001struct A;
3002
3003impl A {
3004 fn m(self: *const Self) {}
3005}
3006
3007fn main() {
3008 let a = A;
3009 let a_ptr: *const A = &a as *const A;
3010 a_ptr.m();
3011}
3012```
3013
3014In general this is not advised: it's thought to be better practice to wrap
3015raw pointers in a newtype wrapper which implements the `core::ops::Receiver`
3016trait, then you need "only" the `arbitrary_self_types` feature. For example:
3017
3018```rust
3019#![feature(arbitrary_self_types)]
3020#![allow(dead_code)]
3021
3022struct A;
3023
3024impl A {
3025 fn m(self: Wrapper<Self>) {} // can extract the pointer and do
3026 // what it needs
3027}
3028
3029struct Wrapper<T>(*const T);
3030
3031impl<T> core::ops::Receiver for Wrapper<T> {
3032 type Target = T;
3033}
3034
3035fn main() {
3036 let a = A;
3037 let a_ptr: *const A = &a as *const A;
3038 let a_wrapper = Wrapper(a_ptr);
3039 a_wrapper.m();
3040}
3041```
3042
3043[arbitrary self types]: arbitrary-self-types.md
3044"##,
3045 default_severity: Severity::Allow,
3046 warn_since: None,
3047 deny_since: None,
3048 },
3049 Lint {
3050 label: "arc_is_unique",
3051 description: r##"# `arc_is_unique`
3052
3053
3054
3055The tracking issue for this feature is: [#138938]
3056
3057[#138938]: https://github.com/rust-lang/rust/issues/138938
3058
3059------------------------
3060"##,
3061 default_severity: Severity::Allow,
3062 warn_since: None,
3063 deny_since: None,
3064 },
3065 Lint {
3066 label: "arm_target_feature",
3067 description: r##"# `arm_target_feature`
3068
3069Target features on arm.
3070
3071The tracking issue for this feature is: [#150246]
3072
3073[#150246]: https://github.com/rust-lang/rust/issues/150246
3074
3075------------------------
3076"##,
3077 default_severity: Severity::Allow,
3078 warn_since: None,
3079 deny_since: None,
3080 },
3081 Lint {
3082 label: "array_into_iter_constructors",
3083 description: r##"# `array_into_iter_constructors`
3084
3085
3086
3087The tracking issue for this feature is: [#91583]
3088
3089[#91583]: https://github.com/rust-lang/rust/issues/91583
3090
3091------------------------
3092"##,
3093 default_severity: Severity::Allow,
3094 warn_since: None,
3095 deny_since: None,
3096 },
3097 Lint {
3098 label: "array_ptr_get",
3099 description: r##"# `array_ptr_get`
3100
3101
3102
3103The tracking issue for this feature is: [#119834]
3104
3105[#119834]: https://github.com/rust-lang/rust/issues/119834
3106
3107------------------------
3108"##,
3109 default_severity: Severity::Allow,
3110 warn_since: None,
3111 deny_since: None,
3112 },
3113 Lint {
3114 label: "array_try_from_fn",
3115 description: r##"# `array_try_from_fn`
3116
3117
3118
3119The tracking issue for this feature is: [#89379]
3120
3121[#89379]: https://github.com/rust-lang/rust/issues/89379
3122
3123------------------------
3124"##,
3125 default_severity: Severity::Allow,
3126 warn_since: None,
3127 deny_since: None,
3128 },
3129 Lint {
3130 label: "array_try_map",
3131 description: r##"# `array_try_map`
3132
3133
3134
3135The tracking issue for this feature is: [#79711]
3136
3137[#79711]: https://github.com/rust-lang/rust/issues/79711
3138
3139------------------------
3140"##,
3141 default_severity: Severity::Allow,
3142 warn_since: None,
3143 deny_since: None,
3144 },
3145 Lint {
3146 label: "ascii_char",
3147 description: r##"# `ascii_char`
3148
3149
3150
3151The tracking issue for this feature is: [#110998]
3152
3153[#110998]: https://github.com/rust-lang/rust/issues/110998
3154
3155------------------------
3156"##,
3157 default_severity: Severity::Allow,
3158 warn_since: None,
3159 deny_since: None,
3160 },
3161 Lint {
3162 label: "ascii_char_variants",
3163 description: r##"# `ascii_char_variants`
3164
3165
3166
3167The tracking issue for this feature is: [#110998]
3168
3169[#110998]: https://github.com/rust-lang/rust/issues/110998
3170
3171------------------------
3172"##,
3173 default_severity: Severity::Allow,
3174 warn_since: None,
3175 deny_since: None,
3176 },
3177 Lint {
3178 label: "asm_experimental_arch",
3179 description: r##"# `asm_experimental_arch`
3180
3181The tracking issue for this feature is: [#93335]
3182
3183[#93335]: https://github.com/rust-lang/rust/issues/93335
3184
3185------------------------
3186
3187This feature tracks `asm!` and `global_asm!` support for the following architectures:
3188- NVPTX
3189- Hexagon
3190- MIPS32r2 and MIPS64r2
3191- wasm32
3192- BPF
3193- SPIR-V
3194- AVR
3195- MSP430
3196- M68k
3197- CSKY
3198- SPARC
3199
3200## Register classes
3201
3202| Architecture | Register class | Registers | LLVM constraint code |
3203| ------------ | -------------- | ---------------------------------- | -------------------- |
3204| MIPS | `reg` | `$[2-25]` | `r` |
3205| MIPS | `freg` | `$f[0-31]` | `f` |
3206| NVPTX | `reg16` | None\* | `h` |
3207| NVPTX | `reg32` | None\* | `r` |
3208| NVPTX | `reg64` | None\* | `l` |
3209| Hexagon | `reg` | `r[0-28]` | `r` |
3210| Hexagon | `preg` | `p[0-3]` | Only clobbers |
3211| wasm32 | `local` | None\* | `r` |
3212| BPF | `reg` | `r[0-10]` | `r` |
3213| BPF | `wreg` | `w[0-10]` | `w` |
3214| AVR | `reg` | `r[2-25]`, `XH`, `XL`, `ZH`, `ZL` | `r` |
3215| AVR | `reg_upper` | `r[16-25]`, `XH`, `XL`, `ZH`, `ZL` | `d` |
3216| AVR | `reg_pair` | `r3r2` .. `r25r24`, `X`, `Z` | `r` |
3217| AVR | `reg_iw` | `r25r24`, `X`, `Z` | `w` |
3218| AVR | `reg_ptr` | `X`, `Z` | `e` |
3219| MSP430 | `reg` | `r[0-15]` | `r` |
3220| M68k | `reg` | `d[0-7]`, `a[0-7]` | `r` |
3221| M68k | `reg_data` | `d[0-7]` | `d` |
3222| M68k | `reg_addr` | `a[0-3]` | `a` |
3223| CSKY | `reg` | `r[0-31]` | `r` |
3224| CSKY | `freg` | `f[0-31]` | `f` |
3225| SPARC | `reg` | `r[2-29]` | `r` |
3226| SPARC | `yreg` | `y` | Only clobbers |
3227
3228> **Notes**:
3229> - NVPTX doesn't have a fixed register set, so named registers are not supported.
3230>
3231> - WebAssembly doesn't have registers, so named registers are not supported.
3232
3233# Register class supported types
3234
3235| Architecture | Register class | Target feature | Allowed types |
3236| ------------ | ------------------------------- | -------------- | --------------------------------------- |
3237| MIPS32 | `reg` | None | `i8`, `i16`, `i32`, `f32` |
3238| MIPS32 | `freg` | None | `f32`, `f64` |
3239| MIPS64 | `reg` | None | `i8`, `i16`, `i32`, `i64`, `f32`, `f64` |
3240| MIPS64 | `freg` | None | `f32`, `f64` |
3241| NVPTX | `reg16` | None | `i8`, `i16` |
3242| NVPTX | `reg32` | None | `i8`, `i16`, `i32`, `f32` |
3243| NVPTX | `reg64` | None | `i8`, `i16`, `i32`, `f32`, `i64`, `f64` |
3244| Hexagon | `reg` | None | `i8`, `i16`, `i32`, `f32` |
3245| Hexagon | `preg` | N/A | Only clobbers |
3246| wasm32 | `local` | None | `i8` `i16` `i32` `i64` `f32` `f64` |
3247| BPF | `reg` | None | `i8` `i16` `i32` `i64` |
3248| BPF | `wreg` | `alu32` | `i8` `i16` `i32` |
3249| AVR | `reg`, `reg_upper` | None | `i8` |
3250| AVR | `reg_pair`, `reg_iw`, `reg_ptr` | None | `i16` |
3251| MSP430 | `reg` | None | `i8`, `i16` |
3252| M68k | `reg`, `reg_addr` | None | `i16`, `i32` |
3253| M68k | `reg_data` | None | `i8`, `i16`, `i32` |
3254| CSKY | `reg` | None | `i8`, `i16`, `i32` |
3255| CSKY | `freg` | None | `f32`, |
3256| SPARC | `reg` | None | `i8`, `i16`, `i32`, `i64` (SPARC64 only) |
3257| SPARC | `yreg` | N/A | Only clobbers |
3258
3259## Register aliases
3260
3261| Architecture | Base register | Aliases |
3262| ------------ | ------------- | --------- |
3263| Hexagon | `r29` | `sp` |
3264| Hexagon | `r30` | `fr` |
3265| Hexagon | `r31` | `lr` |
3266| BPF | `r[0-10]` | `w[0-10]` |
3267| AVR | `XH` | `r27` |
3268| AVR | `XL` | `r26` |
3269| AVR | `ZH` | `r31` |
3270| AVR | `ZL` | `r30` |
3271| MSP430 | `r0` | `pc` |
3272| MSP430 | `r1` | `sp` |
3273| MSP430 | `r2` | `sr` |
3274| MSP430 | `r3` | `cg` |
3275| MSP430 | `r4` | `fp` |
3276| M68k | `a5` | `bp` |
3277| M68k | `a6` | `fp` |
3278| M68k | `a7` | `sp`, `usp`, `ssp`, `isp` |
3279| CSKY | `r[0-3]` | `a[0-3]` |
3280| CSKY | `r[4-11]` | `l[0-7]` |
3281| CSKY | `r[12-13]` | `t[0-1]` |
3282| CSKY | `r14` | `sp` |
3283| CSKY | `r15` | `lr` |
3284| CSKY | `r[16-17]` | `l[8-9]` |
3285| CSKY | `r[18-25]` | `t[2-9]` |
3286| CSKY | `r28` | `rgb` |
3287| CSKY | `r29` | `rtb` |
3288| CSKY | `r30` | `svbr` |
3289| CSKY | `r31` | `tls` |
3290| SPARC | `r[0-7]` | `g[0-7]` |
3291| SPARC | `r[8-15]` | `o[0-7]` |
3292| SPARC | `r[16-23]` | `l[0-7]` |
3293| SPARC | `r[24-31]` | `i[0-7]` |
3294
3295> **Notes**:
3296> - TI does not mandate a frame pointer for MSP430, but toolchains are allowed
3297 to use one; LLVM uses `r4`.
3298
3299## Unsupported registers
3300
3301| Architecture | Unsupported register | Reason |
3302| ------------ | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
3303| All | `sp`, `r14`/`o6` (SPARC) | The stack pointer must be restored to its original value at the end of an asm code block. |
3304| 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. |
3305| All | `r19` (Hexagon) | These are used internally by LLVM as "base pointer" for functions with complex stack frames. |
3306| MIPS | `$0` or `$zero` | This is a constant zero register which can't be modified. |
3307| MIPS | `$1` or `$at` | Reserved for assembler. |
3308| MIPS | `$26`/`$k0`, `$27`/`$k1` | OS-reserved registers. |
3309| MIPS | `$28`/`$gp` | Global pointer cannot be used as inputs or outputs. |
3310| MIPS | `$ra` | Return address cannot be used as inputs or outputs. |
3311| Hexagon | `lr` | This is the link register which cannot be used as an input or output. |
3312| 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. |
3313|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. |
3314| M68k | `a4`, `a5` | Used internally by LLVM for the base pointer and global base pointer. |
3315| CSKY | `r7`, `r28` | Used internally by LLVM for the base pointer and global base pointer. |
3316| CSKY | `r8` | Used internally by LLVM for the frame pointer. |
3317| CSKY | `r14` | Used internally by LLVM for the stack pointer. |
3318| CSKY | `r15` | This is the link register. |
3319| CSKY | `r[26-30]` | Reserved by its ABI. |
3320| CSKY | `r31` | This is the TLS register. |
3321| SPARC | `r0`/`g0` | This is always zero and cannot be used as inputs or outputs. |
3322| SPARC | `r1`/`g1` | Used internally by LLVM. |
3323| SPARC | `r5`/`g5` | Reserved for system. (SPARC32 only) |
3324| SPARC | `r6`/`g6`, `r7`/`g7` | Reserved for system. |
3325| SPARC | `r31`/`i7` | Return address cannot be used as inputs or outputs. |
3326
3327
3328## Template modifiers
3329
3330| Architecture | Register class | Modifier | Example output | LLVM modifier |
3331| ------------ | -------------- | -------- | -------------- | ------------- |
3332| MIPS | `reg` | None | `$2` | None |
3333| MIPS | `freg` | None | `$f0` | None |
3334| NVPTX | `reg16` | None | `rs0` | None |
3335| NVPTX | `reg32` | None | `r0` | None |
3336| NVPTX | `reg64` | None | `rd0` | None |
3337| Hexagon | `reg` | None | `r0` | None |
3338| SPARC | `reg` | None | `%o0` | None |
3339| CSKY | `reg` | None | `r0` | None |
3340| CSKY | `freg` | None | `f0` | None |
3341
3342# Flags covered by `preserves_flags`
3343
3344These flags registers must be restored upon exiting the asm block if the `preserves_flags` option is set:
3345- AVR
3346 - The status register `SREG`.
3347- MSP430
3348 - The status register `r2`.
3349- M68k
3350 - The condition code register `ccr`.
3351- SPARC
3352 - Integer condition codes (`icc` and `xcc`)
3353 - Floating-point condition codes (`fcc[0-3]`)
3354- CSKY
3355 - Condition/carry bit (C) in `PSR`.
3356"##,
3357 default_severity: Severity::Allow,
3358 warn_since: None,
3359 deny_since: None,
3360 },
3361 Lint {
3362 label: "asm_experimental_reg",
3363 description: r##"# `asm_experimental_arch`
3364
3365The tracking issue for this feature is: [#133416]
3366
3367[#133416]: https://github.com/rust-lang/rust/issues/133416
3368
3369------------------------
3370
3371This tracks support for additional registers in architectures where inline assembly is already stable.
3372
3373## Register classes
3374
3375| Architecture | Register class | Registers | LLVM constraint code |
3376| ------------ | -------------- | --------- | -------------------- |
3377
3378## Register class supported types
3379
3380| Architecture | Register class | Target feature | Allowed types |
3381| ------------ | -------------- | -------------- | ------------- |
3382| x86 | `xmm_reg` | `sse` | `i128` |
3383| x86 | `ymm_reg` | `avx` | `i128` |
3384| x86 | `zmm_reg` | `avx512f` | `i128` |
3385
3386## Register aliases
3387
3388| Architecture | Base register | Aliases |
3389| ------------ | ------------- | ------- |
3390
3391## Unsupported registers
3392
3393| Architecture | Unsupported register | Reason |
3394| ------------ | -------------------- | ------ |
3395
3396## Template modifiers
3397
3398| Architecture | Register class | Modifier | Example output | LLVM modifier |
3399| ------------ | -------------- | -------- | -------------- | ------------- |
3400"##,
3401 default_severity: Severity::Allow,
3402 warn_since: None,
3403 deny_since: None,
3404 },
3405 Lint {
3406 label: "asm_goto_with_outputs",
3407 description: r##"# `asm_goto_with_outputs`
3408
3409The tracking issue for this feature is: [#119364]
3410
3411[#119364]: https://github.com/rust-lang/rust/issues/119364
3412
3413------------------------
3414
3415This feature allows label operands to be used together with output operands.
3416
3417Example:
3418```rust,ignore (partial-example, x86-only)
3419
3420unsafe {
3421 let a: usize;
3422 asm!(
3423 "mov {}, 1"
3424 "jmp {}",
3425 out(reg) a,
3426 label {
3427 println!("Jumped from asm {}!", a);
3428 }
3429 );
3430}
3431```
3432
3433The output operands are assigned before the label blocks are executed.
3434"##,
3435 default_severity: Severity::Allow,
3436 warn_since: None,
3437 deny_since: None,
3438 },
3439 Lint {
3440 label: "asm_unwind",
3441 description: r##"# `asm_unwind`
3442
3443The tracking issue for this feature is: [#93334]
3444
3445[#93334]: https://github.com/rust-lang/rust/issues/93334
3446
3447------------------------
3448
3449This 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.
3450"##,
3451 default_severity: Severity::Allow,
3452 warn_since: None,
3453 deny_since: None,
3454 },
3455 Lint {
3456 label: "associated_type_defaults",
3457 description: r##"# `associated_type_defaults`
3458
3459Allows associated type defaults.
3460
3461The tracking issue for this feature is: [#29661]
3462
3463[#29661]: https://github.com/rust-lang/rust/issues/29661
3464
3465------------------------
3466"##,
3467 default_severity: Severity::Allow,
3468 warn_since: None,
3469 deny_since: None,
3470 },
3471 Lint {
3472 label: "async_drop",
3473 description: r##"# `async_drop`
3474
3475Allows implementing `AsyncDrop`.
3476
3477The tracking issue for this feature is: [#126482]
3478
3479[#126482]: https://github.com/rust-lang/rust/issues/126482
3480
3481------------------------
3482"##,
3483 default_severity: Severity::Allow,
3484 warn_since: None,
3485 deny_since: None,
3486 },
3487 Lint {
3488 label: "async_fn_in_dyn_trait",
3489 description: r##"# `async_fn_in_dyn_trait`
3490
3491Allows async functions to be called from `dyn Trait`.
3492
3493The tracking issue for this feature is: [#133119]
3494
3495[#133119]: https://github.com/rust-lang/rust/issues/133119
3496
3497------------------------
3498"##,
3499 default_severity: Severity::Allow,
3500 warn_since: None,
3501 deny_since: None,
3502 },
3503 Lint {
3504 label: "async_fn_track_caller",
3505 description: r##"# `async_fn_track_caller`
3506
3507Allows `#[track_caller]` on async functions.
3508
3509The tracking issue for this feature is: [#110011]
3510
3511[#110011]: https://github.com/rust-lang/rust/issues/110011
3512
3513------------------------
3514"##,
3515 default_severity: Severity::Allow,
3516 warn_since: None,
3517 deny_since: None,
3518 },
3519 Lint {
3520 label: "async_fn_traits",
3521 description: r##"# `async_fn_traits`
3522
3523See Also: [`fn_traits`](../library-features/fn-traits.md)
3524
3525----
3526
3527The `async_fn_traits` feature allows for implementation of the [`AsyncFn*`] traits
3528for creating custom closure-like types that return futures.
3529
3530[`AsyncFn*`]: ../../std/ops/trait.AsyncFn.html
3531
3532The main difference to the `Fn*` family of traits is that `AsyncFn` can return a future
3533that borrows from itself (`FnOnce::Output` has no lifetime parameters, while `AsyncFnMut::CallRefFuture` does).
3534"##,
3535 default_severity: Severity::Allow,
3536 warn_since: None,
3537 deny_since: None,
3538 },
3539 Lint {
3540 label: "async_for_loop",
3541 description: r##"# `async_for_loop`
3542
3543Allows `for await` loops.
3544
3545The tracking issue for this feature is: [#118898]
3546
3547[#118898]: https://github.com/rust-lang/rust/issues/118898
3548
3549------------------------
3550"##,
3551 default_severity: Severity::Allow,
3552 warn_since: None,
3553 deny_since: None,
3554 },
3555 Lint {
3556 label: "async_gen_internals",
3557 description: r##"# `async_gen_internals`
3558
3559
3560
3561This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
3562
3563------------------------
3564"##,
3565 default_severity: Severity::Allow,
3566 warn_since: None,
3567 deny_since: None,
3568 },
3569 Lint {
3570 label: "async_iter_from_iter",
3571 description: r##"# `async_iter_from_iter`
3572
3573
3574
3575The tracking issue for this feature is: [#81798]
3576
3577[#81798]: https://github.com/rust-lang/rust/issues/81798
3578
3579------------------------
3580"##,
3581 default_severity: Severity::Allow,
3582 warn_since: None,
3583 deny_since: None,
3584 },
3585 Lint {
3586 label: "async_iterator",
3587 description: r##"# `async_iterator`
3588
3589
3590
3591The tracking issue for this feature is: [#79024]
3592
3593[#79024]: https://github.com/rust-lang/rust/issues/79024
3594
3595------------------------
3596"##,
3597 default_severity: Severity::Allow,
3598 warn_since: None,
3599 deny_since: None,
3600 },
3601 Lint {
3602 label: "async_trait_bounds",
3603 description: r##"# `async_trait_bounds`
3604
3605Allows `async` trait bound modifier.
3606
3607The tracking issue for this feature is: [#62290]
3608
3609[#62290]: https://github.com/rust-lang/rust/issues/62290
3610
3611------------------------
3612"##,
3613 default_severity: Severity::Allow,
3614 warn_since: None,
3615 deny_since: None,
3616 },
3617 Lint {
3618 label: "atomic_from_mut",
3619 description: r##"# `atomic_from_mut`
3620
3621
3622
3623The tracking issue for this feature is: [#76314]
3624
3625[#76314]: https://github.com/rust-lang/rust/issues/76314
3626
3627------------------------
3628"##,
3629 default_severity: Severity::Allow,
3630 warn_since: None,
3631 deny_since: None,
3632 },
3633 Lint {
3634 label: "atomic_internals",
3635 description: r##"# `atomic_internals`
3636
3637
3638
3639This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
3640
3641------------------------
3642"##,
3643 default_severity: Severity::Allow,
3644 warn_since: None,
3645 deny_since: None,
3646 },
3647 Lint {
3648 label: "atomic_ptr_null",
3649 description: r##"# `atomic_ptr_null`
3650
3651
3652
3653The tracking issue for this feature is: [#150733]
3654
3655[#150733]: https://github.com/rust-lang/rust/issues/150733
3656
3657------------------------
3658"##,
3659 default_severity: Severity::Allow,
3660 warn_since: None,
3661 deny_since: None,
3662 },
3663 Lint {
3664 label: "auto_traits",
3665 description: r##"# `auto_traits`
3666
3667The tracking issue for this feature is [#13231]
3668
3669[#13231]: https://github.com/rust-lang/rust/issues/13231
3670
3671----
3672
3673The `auto_traits` feature gate allows you to define auto traits.
3674
3675Auto traits, like [`Send`] or [`Sync`] in the standard library, are marker traits
3676that are automatically implemented for every type, unless the type, or a type it contains,
3677has explicitly opted out via a negative impl. (Negative impls are separately controlled
3678by the `negative_impls` feature.)
3679
3680[`Send`]: ../../std/marker/trait.Send.html
3681[`Sync`]: ../../std/marker/trait.Sync.html
3682
3683```rust,ignore (partial-example)
3684impl !Trait for Type {}
3685```
3686
3687Example:
3688
3689```rust
3690#![feature(negative_impls)]
3691#![feature(auto_traits)]
3692
3693auto trait Valid {}
3694
3695struct True;
3696struct False;
3697
3698impl !Valid for False {}
3699
3700struct MaybeValid<T>(T);
3701
3702fn must_be_valid<T: Valid>(_t: T) { }
3703
3704fn main() {
3705 // works
3706 must_be_valid( MaybeValid(True) );
3707
3708 // compiler error - trait bound not satisfied
3709 // must_be_valid( MaybeValid(False) );
3710}
3711```
3712
3713## Automatic trait implementations
3714
3715When a type is declared as an `auto trait`, we will automatically
3716create impls for every struct/enum/union, unless an explicit impl is
3717provided. These automatic impls contain a where clause for each field
3718of the form `T: AutoTrait`, where `T` is the type of the field and
3719`AutoTrait` is the auto trait in question. As an example, consider the
3720struct `List` and the auto trait `Send`:
3721
3722```rust
3723struct List<T> {
3724 data: T,
3725 next: Option<Box<List<T>>>,
3726}
3727```
3728
3729Presuming that there is no explicit impl of `Send` for `List`, the
3730compiler will supply an automatic impl of the form:
3731
3732```rust
3733struct List<T> {
3734 data: T,
3735 next: Option<Box<List<T>>>,
3736}
3737
3738unsafe impl<T> Send for List<T>
3739where
3740 T: Send, // from the field `data`
3741 Option<Box<List<T>>>: Send, // from the field `next`
3742{ }
3743```
3744
3745Explicit impls may be either positive or negative. They take the form:
3746
3747```rust,ignore (partial-example)
3748impl<...> AutoTrait for StructName<..> { }
3749impl<...> !AutoTrait for StructName<..> { }
3750```
3751
3752## Coinduction: Auto traits permit cyclic matching
3753
3754Unlike ordinary trait matching, auto traits are **coinductive**. This
3755means, in short, that cycles which occur in trait matching are
3756considered ok. As an example, consider the recursive struct `List`
3757introduced in the previous section. In attempting to determine whether
3758`List: Send`, we would wind up in a cycle: to apply the impl, we must
3759show that `Option<Box<List>>: Send`, which will in turn require
3760`Box<List>: Send` and then finally `List: Send` again. Under ordinary
3761trait matching, this cycle would be an error, but for an auto trait it
3762is considered a successful match.
3763
3764## Items
3765
3766Auto traits cannot have any trait items, such as methods or associated types. This ensures that we can generate default implementations.
3767
3768## Supertraits
3769
3770Auto traits cannot have supertraits. This is for soundness reasons, as the interaction of coinduction with implied bounds is difficult to reconcile.
3771"##,
3772 default_severity: Severity::Allow,
3773 warn_since: None,
3774 deny_since: None,
3775 },
3776 Lint {
3777 label: "autodiff",
3778 description: r##"# `autodiff`
3779
3780
3781
3782The tracking issue for this feature is: [#124509]
3783
3784[#124509]: https://github.com/rust-lang/rust/issues/124509
3785
3786------------------------
3787"##,
3788 default_severity: Severity::Allow,
3789 warn_since: None,
3790 deny_since: None,
3791 },
3792 Lint {
3793 label: "avr_target_feature",
3794 description: r##"# `avr_target_feature`
3795
3796Target features on avr.
3797
3798The tracking issue for this feature is: [#146889]
3799
3800[#146889]: https://github.com/rust-lang/rust/issues/146889
3801
3802------------------------
3803"##,
3804 default_severity: Severity::Allow,
3805 warn_since: None,
3806 deny_since: None,
3807 },
3808 Lint {
3809 label: "avx10_target_feature",
3810 description: r##"# `avx10_target_feature`
3811
3812Allows using Intel AVX10 target features and intrinsics
3813
3814The tracking issue for this feature is: [#138843]
3815
3816[#138843]: https://github.com/rust-lang/rust/issues/138843
3817
3818------------------------
3819"##,
3820 default_severity: Severity::Allow,
3821 warn_since: None,
3822 deny_since: None,
3823 },
3824 Lint {
3825 label: "backtrace_frames",
3826 description: r##"# `backtrace_frames`
3827
3828
3829
3830The tracking issue for this feature is: [#79676]
3831
3832[#79676]: https://github.com/rust-lang/rust/issues/79676
3833
3834------------------------
3835"##,
3836 default_severity: Severity::Allow,
3837 warn_since: None,
3838 deny_since: None,
3839 },
3840 Lint {
3841 label: "bikeshed_guaranteed_no_drop",
3842 description: r##"# `bikeshed_guaranteed_no_drop`
3843
3844
3845
3846This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
3847
3848------------------------
3849"##,
3850 default_severity: Severity::Allow,
3851 warn_since: None,
3852 deny_since: None,
3853 },
3854 Lint {
3855 label: "binary_heap_as_mut_slice",
3856 description: r##"# `binary_heap_as_mut_slice`
3857
3858
3859
3860The tracking issue for this feature is: [#154009]
3861
3862[#154009]: https://github.com/rust-lang/rust/issues/154009
3863
3864------------------------
3865"##,
3866 default_severity: Severity::Allow,
3867 warn_since: None,
3868 deny_since: None,
3869 },
3870 Lint {
3871 label: "binary_heap_drain_sorted",
3872 description: r##"# `binary_heap_drain_sorted`
3873
3874
3875
3876The tracking issue for this feature is: [#59278]
3877
3878[#59278]: https://github.com/rust-lang/rust/issues/59278
3879
3880------------------------
3881"##,
3882 default_severity: Severity::Allow,
3883 warn_since: None,
3884 deny_since: None,
3885 },
3886 Lint {
3887 label: "binary_heap_from_raw_vec",
3888 description: r##"# `binary_heap_from_raw_vec`
3889
3890
3891
3892The tracking issue for this feature is: [#152500]
3893
3894[#152500]: https://github.com/rust-lang/rust/issues/152500
3895
3896------------------------
3897"##,
3898 default_severity: Severity::Allow,
3899 warn_since: None,
3900 deny_since: None,
3901 },
3902 Lint {
3903 label: "binary_heap_into_iter_sorted",
3904 description: r##"# `binary_heap_into_iter_sorted`
3905
3906
3907
3908The tracking issue for this feature is: [#59278]
3909
3910[#59278]: https://github.com/rust-lang/rust/issues/59278
3911
3912------------------------
3913"##,
3914 default_severity: Severity::Allow,
3915 warn_since: None,
3916 deny_since: None,
3917 },
3918 Lint {
3919 label: "binary_heap_peek_mut_refresh",
3920 description: r##"# `binary_heap_peek_mut_refresh`
3921
3922
3923
3924The tracking issue for this feature is: [#138355]
3925
3926[#138355]: https://github.com/rust-lang/rust/issues/138355
3927
3928------------------------
3929"##,
3930 default_severity: Severity::Allow,
3931 warn_since: None,
3932 deny_since: None,
3933 },
3934 Lint {
3935 label: "binary_heap_pop_if",
3936 description: r##"# `binary_heap_pop_if`
3937
3938
3939
3940The tracking issue for this feature is: [#151828]
3941
3942[#151828]: https://github.com/rust-lang/rust/issues/151828
3943
3944------------------------
3945"##,
3946 default_severity: Severity::Allow,
3947 warn_since: None,
3948 deny_since: None,
3949 },
3950 Lint {
3951 label: "bool_to_result",
3952 description: r##"# `bool_to_result`
3953
3954
3955
3956The tracking issue for this feature is: [#142748]
3957
3958[#142748]: https://github.com/rust-lang/rust/issues/142748
3959
3960------------------------
3961"##,
3962 default_severity: Severity::Allow,
3963 warn_since: None,
3964 deny_since: None,
3965 },
3966 Lint {
3967 label: "borrowed_buf_init",
3968 description: r##"# `borrowed_buf_init`
3969
3970
3971
3972The tracking issue for this feature is: [#78485]
3973
3974[#78485]: https://github.com/rust-lang/rust/issues/78485
3975
3976------------------------
3977"##,
3978 default_severity: Severity::Allow,
3979 warn_since: None,
3980 deny_since: None,
3981 },
3982 Lint {
3983 label: "bound_as_ref",
3984 description: r##"# `bound_as_ref`
3985
3986
3987
3988The tracking issue for this feature is: [#80996]
3989
3990[#80996]: https://github.com/rust-lang/rust/issues/80996
3991
3992------------------------
3993"##,
3994 default_severity: Severity::Allow,
3995 warn_since: None,
3996 deny_since: None,
3997 },
3998 Lint {
3999 label: "bound_copied",
4000 description: r##"# `bound_copied`
4001
4002
4003
4004The tracking issue for this feature is: [#145966]
4005
4006[#145966]: https://github.com/rust-lang/rust/issues/145966
4007
4008------------------------
4009"##,
4010 default_severity: Severity::Allow,
4011 warn_since: None,
4012 deny_since: None,
4013 },
4014 Lint {
4015 label: "box_as_ptr",
4016 description: r##"# `box_as_ptr`
4017
4018
4019
4020The tracking issue for this feature is: [#129090]
4021
4022[#129090]: https://github.com/rust-lang/rust/issues/129090
4023
4024------------------------
4025"##,
4026 default_severity: Severity::Allow,
4027 warn_since: None,
4028 deny_since: None,
4029 },
4030 Lint {
4031 label: "box_into_boxed_slice",
4032 description: r##"# `box_into_boxed_slice`
4033
4034
4035
4036The tracking issue for this feature is: [#71582]
4037
4038[#71582]: https://github.com/rust-lang/rust/issues/71582
4039
4040------------------------
4041"##,
4042 default_severity: Severity::Allow,
4043 warn_since: None,
4044 deny_since: None,
4045 },
4046 Lint {
4047 label: "box_into_inner",
4048 description: r##"# `box_into_inner`
4049
4050
4051
4052The tracking issue for this feature is: [#80437]
4053
4054[#80437]: https://github.com/rust-lang/rust/issues/80437
4055
4056------------------------
4057"##,
4058 default_severity: Severity::Allow,
4059 warn_since: None,
4060 deny_since: None,
4061 },
4062 Lint {
4063 label: "box_patterns",
4064 description: r##"# `box_patterns`
4065
4066The tracking issue for this feature is: [#29641]
4067
4068[#29641]: https://github.com/rust-lang/rust/issues/29641
4069
4070------------------------
4071
4072> **Note**: This feature will be superseded by [`deref_patterns`] in the future.
4073
4074Box patterns let you match on `Box<T>`s:
4075
4076
4077```rust
4078#![feature(box_patterns)]
4079
4080fn main() {
4081 let b = Some(Box::new(5));
4082 match b {
4083 Some(box n) if n < 0 => {
4084 println!("Box contains negative number {n}");
4085 },
4086 Some(box n) if n >= 0 => {
4087 println!("Box contains non-negative number {n}");
4088 },
4089 None => {
4090 println!("No box");
4091 },
4092 _ => unreachable!()
4093 }
4094}
4095```
4096
4097[`deref_patterns`]: ./deref-patterns.md
4098"##,
4099 default_severity: Severity::Allow,
4100 warn_since: None,
4101 deny_since: None,
4102 },
4103 Lint {
4104 label: "box_take",
4105 description: r##"# `box_take`
4106
4107
4108
4109The tracking issue for this feature is: [#147212]
4110
4111[#147212]: https://github.com/rust-lang/rust/issues/147212
4112
4113------------------------
4114"##,
4115 default_severity: Severity::Allow,
4116 warn_since: None,
4117 deny_since: None,
4118 },
4119 Lint {
4120 label: "box_vec_non_null",
4121 description: r##"# `box_vec_non_null`
4122
4123
4124
4125The tracking issue for this feature is: [#130364]
4126
4127[#130364]: https://github.com/rust-lang/rust/issues/130364
4128
4129------------------------
4130"##,
4131 default_severity: Severity::Allow,
4132 warn_since: None,
4133 deny_since: None,
4134 },
4135 Lint {
4136 label: "bpf_target_feature",
4137 description: r##"# `bpf_target_feature`
4138
4139Target features on bpf.
4140
4141The tracking issue for this feature is: [#150247]
4142
4143[#150247]: https://github.com/rust-lang/rust/issues/150247
4144
4145------------------------
4146"##,
4147 default_severity: Severity::Allow,
4148 warn_since: None,
4149 deny_since: None,
4150 },
4151 Lint {
4152 label: "breakpoint",
4153 description: r##"# `breakpoint`
4154
4155
4156
4157The tracking issue for this feature is: [#133724]
4158
4159[#133724]: https://github.com/rust-lang/rust/issues/133724
4160
4161------------------------
4162"##,
4163 default_severity: Severity::Allow,
4164 warn_since: None,
4165 deny_since: None,
4166 },
4167 Lint {
4168 label: "bstr",
4169 description: r##"# `bstr`
4170
4171
4172
4173The tracking issue for this feature is: [#134915]
4174
4175[#134915]: https://github.com/rust-lang/rust/issues/134915
4176
4177------------------------
4178"##,
4179 default_severity: Severity::Allow,
4180 warn_since: None,
4181 deny_since: None,
4182 },
4183 Lint {
4184 label: "bstr_internals",
4185 description: r##"# `bstr_internals`
4186
4187
4188
4189This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
4190
4191------------------------
4192"##,
4193 default_severity: Severity::Allow,
4194 warn_since: None,
4195 deny_since: None,
4196 },
4197 Lint {
4198 label: "btree_cursors",
4199 description: r##"# `btree_cursors`
4200
4201
4202
4203The tracking issue for this feature is: [#107540]
4204
4205[#107540]: https://github.com/rust-lang/rust/issues/107540
4206
4207------------------------
4208"##,
4209 default_severity: Severity::Allow,
4210 warn_since: None,
4211 deny_since: None,
4212 },
4213 Lint {
4214 label: "btree_merge",
4215 description: r##"# `btree_merge`
4216
4217
4218
4219The tracking issue for this feature is: [#152152]
4220
4221[#152152]: https://github.com/rust-lang/rust/issues/152152
4222
4223------------------------
4224"##,
4225 default_severity: Severity::Allow,
4226 warn_since: None,
4227 deny_since: None,
4228 },
4229 Lint {
4230 label: "btree_set_entry",
4231 description: r##"# `btree_set_entry`
4232
4233
4234
4235The tracking issue for this feature is: [#133549]
4236
4237[#133549]: https://github.com/rust-lang/rust/issues/133549
4238
4239------------------------
4240"##,
4241 default_severity: Severity::Allow,
4242 warn_since: None,
4243 deny_since: None,
4244 },
4245 Lint {
4246 label: "btreemap_alloc",
4247 description: r##"# `btreemap_alloc`
4248
4249
4250
4251The tracking issue for this feature is: [#32838]
4252
4253[#32838]: https://github.com/rust-lang/rust/issues/32838
4254
4255------------------------
4256"##,
4257 default_severity: Severity::Allow,
4258 warn_since: None,
4259 deny_since: None,
4260 },
4261 Lint {
4262 label: "buf_read_has_data_left",
4263 description: r##"# `buf_read_has_data_left`
4264
4265
4266
4267The tracking issue for this feature is: [#86423]
4268
4269[#86423]: https://github.com/rust-lang/rust/issues/86423
4270
4271------------------------
4272"##,
4273 default_severity: Severity::Allow,
4274 warn_since: None,
4275 deny_since: None,
4276 },
4277 Lint {
4278 label: "bufreader_peek",
4279 description: r##"# `bufreader_peek`
4280
4281
4282
4283The tracking issue for this feature is: [#128405]
4284
4285[#128405]: https://github.com/rust-lang/rust/issues/128405
4286
4287------------------------
4288"##,
4289 default_severity: Severity::Allow,
4290 warn_since: None,
4291 deny_since: None,
4292 },
4293 Lint {
4294 label: "builtin_syntax",
4295 description: r##"# `builtin_syntax`
4296
4297Allows builtin # foo() syntax
4298
4299The tracking issue for this feature is: [#110680]
4300
4301[#110680]: https://github.com/rust-lang/rust/issues/110680
4302
4303------------------------
4304"##,
4305 default_severity: Severity::Allow,
4306 warn_since: None,
4307 deny_since: None,
4308 },
4309 Lint {
4310 label: "c_size_t",
4311 description: r##"# `c_size_t`
4312
4313
4314
4315The tracking issue for this feature is: [#88345]
4316
4317[#88345]: https://github.com/rust-lang/rust/issues/88345
4318
4319------------------------
4320"##,
4321 default_severity: Severity::Allow,
4322 warn_since: None,
4323 deny_since: None,
4324 },
4325 Lint {
4326 label: "c_variadic",
4327 description: r##"# `c_variadic`
4328
4329The tracking issue for this feature is: [#44930]
4330
4331[#44930]: https://github.com/rust-lang/rust/issues/44930
4332
4333------------------------
4334
4335The `c_variadic` language feature enables C-variadic functions to be
4336defined in Rust. They may be called both from within Rust and via FFI.
4337
4338## Examples
4339
4340```rust
4341#![feature(c_variadic)]
4342
4343pub unsafe extern "C" fn add(n: usize, mut args: ...) -> usize {
4344 let mut sum = 0;
4345 for _ in 0..n {
4346 sum += args.next_arg::<usize>();
4347 }
4348 sum
4349}
4350```
4351"##,
4352 default_severity: Severity::Allow,
4353 warn_since: None,
4354 deny_since: None,
4355 },
4356 Lint {
4357 label: "c_variadic_experimental_arch",
4358 description: r##"# `c_variadic_experimental_arch`
4359
4360Allows defining c-variadic functions on targets where this feature has not yet undergone sufficient testing for stabilization.
4361
4362The tracking issue for this feature is: [#155973]
4363
4364[#155973]: https://github.com/rust-lang/rust/issues/155973
4365
4366------------------------
4367"##,
4368 default_severity: Severity::Allow,
4369 warn_since: None,
4370 deny_since: None,
4371 },
4372 Lint {
4373 label: "c_variadic_naked_functions",
4374 description: r##"# `c_variadic_naked_functions`
4375
4376Allows defining c-variadic naked functions with any extern ABI that is allowed on c-variadic foreign functions.
4377
4378The tracking issue for this feature is: [#148767]
4379
4380[#148767]: https://github.com/rust-lang/rust/issues/148767
4381
4382------------------------
4383"##,
4384 default_severity: Severity::Allow,
4385 warn_since: None,
4386 deny_since: None,
4387 },
4388 Lint {
4389 label: "c_void_variant",
4390 description: r##"# `c_void_variant`
4391
4392This feature is internal to the Rust compiler and is not intended for general use.
4393
4394------------------------
4395"##,
4396 default_severity: Severity::Allow,
4397 warn_since: None,
4398 deny_since: None,
4399 },
4400 Lint {
4401 label: "can_vector",
4402 description: r##"# `can_vector`
4403
4404
4405
4406The tracking issue for this feature is: [#69941]
4407
4408[#69941]: https://github.com/rust-lang/rust/issues/69941
4409
4410------------------------
4411"##,
4412 default_severity: Severity::Allow,
4413 warn_since: None,
4414 deny_since: None,
4415 },
4416 Lint {
4417 label: "case_ignorable",
4418 description: r##"# `case_ignorable`
4419
4420
4421
4422The tracking issue for this feature is: [#154848]
4423
4424[#154848]: https://github.com/rust-lang/rust/issues/154848
4425
4426------------------------
4427"##,
4428 default_severity: Severity::Allow,
4429 warn_since: None,
4430 deny_since: None,
4431 },
4432 Lint {
4433 label: "cast_maybe_uninit",
4434 description: r##"# `cast_maybe_uninit`
4435
4436
4437
4438The tracking issue for this feature is: [#145036]
4439
4440[#145036]: https://github.com/rust-lang/rust/issues/145036
4441
4442------------------------
4443"##,
4444 default_severity: Severity::Allow,
4445 warn_since: None,
4446 deny_since: None,
4447 },
4448 Lint {
4449 label: "cell_get_cloned",
4450 description: r##"# `cell_get_cloned`
4451
4452
4453
4454The tracking issue for this feature is: [#145329]
4455
4456[#145329]: https://github.com/rust-lang/rust/issues/145329
4457
4458------------------------
4459"##,
4460 default_severity: Severity::Allow,
4461 warn_since: None,
4462 deny_since: None,
4463 },
4464 Lint {
4465 label: "cell_leak",
4466 description: r##"# `cell_leak`
4467
4468
4469
4470The tracking issue for this feature is: [#69099]
4471
4472[#69099]: https://github.com/rust-lang/rust/issues/69099
4473
4474------------------------
4475"##,
4476 default_severity: Severity::Allow,
4477 warn_since: None,
4478 deny_since: None,
4479 },
4480 Lint {
4481 label: "cfg_accessible",
4482 description: r##"# `cfg_accessible`
4483
4484
4485
4486The tracking issue for this feature is: [#64797]
4487
4488[#64797]: https://github.com/rust-lang/rust/issues/64797
4489
4490------------------------
4491"##,
4492 default_severity: Severity::Allow,
4493 warn_since: None,
4494 deny_since: None,
4495 },
4496 Lint {
4497 label: "cfg_contract_checks",
4498 description: r##"# `cfg_contract_checks`
4499
4500Allows the use of `#[cfg(contract_checks)` to check if contract checks are enabled.
4501
4502The tracking issue for this feature is: [#128044]
4503
4504[#128044]: https://github.com/rust-lang/rust/issues/128044
4505
4506------------------------
4507"##,
4508 default_severity: Severity::Allow,
4509 warn_since: None,
4510 deny_since: None,
4511 },
4512 Lint {
4513 label: "cfg_emscripten_wasm_eh",
4514 description: r##"# `cfg_emscripten_wasm_eh`
4515
4516Allows access to the emscripten_wasm_eh config, used by panic_unwind and unwind
4517
4518This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
4519
4520------------------------
4521"##,
4522 default_severity: Severity::Allow,
4523 warn_since: None,
4524 deny_since: None,
4525 },
4526 Lint {
4527 label: "cfg_eval",
4528 description: r##"# `cfg_eval`
4529
4530
4531
4532The tracking issue for this feature is: [#82679]
4533
4534[#82679]: https://github.com/rust-lang/rust/issues/82679
4535
4536------------------------
4537"##,
4538 default_severity: Severity::Allow,
4539 warn_since: None,
4540 deny_since: None,
4541 },
4542 Lint {
4543 label: "cfg_overflow_checks",
4544 description: r##"# `cfg_overflow_checks`
4545
4546Allows the use of `#[cfg(overflow_checks)` to check if integer overflow behaviour.
4547
4548The tracking issue for this feature is: [#111466]
4549
4550[#111466]: https://github.com/rust-lang/rust/issues/111466
4551
4552------------------------
4553"##,
4554 default_severity: Severity::Allow,
4555 warn_since: None,
4556 deny_since: None,
4557 },
4558 Lint {
4559 label: "cfg_relocation_model",
4560 description: r##"# `cfg_relocation_model`
4561
4562Provides the relocation model information as cfg entry
4563
4564The tracking issue for this feature is: [#114929]
4565
4566[#114929]: https://github.com/rust-lang/rust/issues/114929
4567
4568------------------------
4569"##,
4570 default_severity: Severity::Allow,
4571 warn_since: None,
4572 deny_since: None,
4573 },
4574 Lint {
4575 label: "cfg_sanitize",
4576 description: r##"# `cfg_sanitize`
4577
4578The tracking issue for this feature is: [#39699]
4579
4580[#39699]: https://github.com/rust-lang/rust/issues/39699
4581
4582------------------------
4583
4584The `cfg_sanitize` feature makes it possible to execute different code
4585depending on whether a particular sanitizer is enabled or not.
4586
4587## Examples
4588
4589```rust
4590#![feature(cfg_sanitize)]
4591
4592#[cfg(sanitize = "thread")]
4593fn a() {
4594 // ...
4595}
4596
4597#[cfg(not(sanitize = "thread"))]
4598fn a() {
4599 // ...
4600}
4601
4602fn b() {
4603 if cfg!(sanitize = "leak") {
4604 // ...
4605 } else {
4606 // ...
4607 }
4608}
4609```
4610"##,
4611 default_severity: Severity::Allow,
4612 warn_since: None,
4613 deny_since: None,
4614 },
4615 Lint {
4616 label: "cfg_sanitizer_cfi",
4617 description: r##"# `cfg_sanitizer_cfi`
4618
4619Allows `cfg(sanitizer_cfi_generalize_pointers)` and `cfg(sanitizer_cfi_normalize_integers)`.
4620
4621The tracking issue for this feature is: [#89653]
4622
4623[#89653]: https://github.com/rust-lang/rust/issues/89653
4624
4625------------------------
4626"##,
4627 default_severity: Severity::Allow,
4628 warn_since: None,
4629 deny_since: None,
4630 },
4631 Lint {
4632 label: "cfg_target_compact",
4633 description: r##"# `cfg_target_compact`
4634
4635Allows `cfg(target(abi = "..."))`.
4636
4637The tracking issue for this feature is: [#96901]
4638
4639[#96901]: https://github.com/rust-lang/rust/issues/96901
4640
4641------------------------
4642"##,
4643 default_severity: Severity::Allow,
4644 warn_since: None,
4645 deny_since: None,
4646 },
4647 Lint {
4648 label: "cfg_target_has_atomic",
4649 description: r##"# `cfg_target_has_atomic`
4650
4651Allows `cfg(target_has_atomic_load_store = "...")`.
4652
4653The tracking issue for this feature is: [#94039]
4654
4655[#94039]: https://github.com/rust-lang/rust/issues/94039
4656
4657------------------------
4658"##,
4659 default_severity: Severity::Allow,
4660 warn_since: None,
4661 deny_since: None,
4662 },
4663 Lint {
4664 label: "cfg_target_has_atomic_equal_alignment",
4665 description: r##"# `cfg_target_has_atomic_equal_alignment`
4666
4667Allows `cfg(target_has_atomic_equal_alignment = "...")`.
4668
4669The tracking issue for this feature is: [#93822]
4670
4671[#93822]: https://github.com/rust-lang/rust/issues/93822
4672
4673------------------------
4674"##,
4675 default_severity: Severity::Allow,
4676 warn_since: None,
4677 deny_since: None,
4678 },
4679 Lint {
4680 label: "cfg_target_has_reliable_f16_f128",
4681 description: r##"# `cfg_target_has_reliable_f16_f128`
4682
4683Allows checking whether or not the backend correctly supports unstable float types.
4684
4685This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
4686
4687------------------------
4688"##,
4689 default_severity: Severity::Allow,
4690 warn_since: None,
4691 deny_since: None,
4692 },
4693 Lint {
4694 label: "cfg_target_object_format",
4695 description: r##"# `cfg_target_object_format`
4696
4697The tracking issue for this feature is: [#152586]
4698
4699[#152586]: https://github.com/rust-lang/rust/issues/152586
4700
4701------------------------
4702
4703The `cfg_target_object_format` feature makes it possible to execute different code
4704depending on the current target's object file format.
4705
4706## Examples
4707
4708```rust
4709#![feature(cfg_target_object_format)]
4710
4711#[cfg(target_object_format = "elf")]
4712fn a() {
4713 // ...
4714}
4715
4716#[cfg(target_object_format = "mach-o")]
4717fn a() {
4718 // ...
4719}
4720
4721fn b() {
4722 if cfg!(target_object_format = "wasm") {
4723 // ...
4724 } else {
4725 // ...
4726 }
4727}
4728```
4729"##,
4730 default_severity: Severity::Allow,
4731 warn_since: None,
4732 deny_since: None,
4733 },
4734 Lint {
4735 label: "cfg_target_thread_local",
4736 description: r##"# `cfg_target_thread_local`
4737
4738Allows `cfg(target_thread_local)`.
4739
4740The tracking issue for this feature is: [#29594]
4741
4742[#29594]: https://github.com/rust-lang/rust/issues/29594
4743
4744------------------------
4745"##,
4746 default_severity: Severity::Allow,
4747 warn_since: None,
4748 deny_since: None,
4749 },
4750 Lint {
4751 label: "cfg_ub_checks",
4752 description: r##"# `cfg_ub_checks`
4753
4754Allows the use of `#[cfg(ub_checks)` to check if UB checks are enabled.
4755
4756The tracking issue for this feature is: [#123499]
4757
4758[#123499]: https://github.com/rust-lang/rust/issues/123499
4759
4760------------------------
4761"##,
4762 default_severity: Severity::Allow,
4763 warn_since: None,
4764 deny_since: None,
4765 },
4766 Lint {
4767 label: "cfg_version",
4768 description: r##"# `cfg_version`
4769
4770The tracking issue for this feature is: [#64796]
4771
4772[#64796]: https://github.com/rust-lang/rust/issues/64796
4773
4774------------------------
4775
4776The `cfg_version` feature makes it possible to execute different code
4777depending on the compiler version. It will return true if the compiler
4778version is greater than or equal to the specified version.
4779
4780## Examples
4781
4782```rust
4783#![feature(cfg_version)]
4784
4785#[cfg(version("1.42"))] // 1.42 and above
4786fn a() {
4787 // ...
4788}
4789
4790#[cfg(not(version("1.42")))] // 1.41 and below
4791fn a() {
4792 // ...
4793}
4794
4795fn b() {
4796 if cfg!(version("1.42")) {
4797 // ...
4798 } else {
4799 // ...
4800 }
4801}
4802```
4803"##,
4804 default_severity: Severity::Allow,
4805 warn_since: None,
4806 deny_since: None,
4807 },
4808 Lint {
4809 label: "cfi_encoding",
4810 description: r##"# `cfi_encoding`
4811
4812The tracking issue for this feature is: [#89653]
4813
4814[#89653]: https://github.com/rust-lang/rust/issues/89653
4815
4816------------------------
4817
4818The `cfi_encoding` feature allows the user to define a CFI encoding for a type.
4819It allows the user to use a different names for types that otherwise would be
4820required to have the same name as used in externally defined C functions.
4821
4822## Examples
4823
4824```rust
4825#![feature(cfi_encoding, extern_types)]
4826
4827#[cfi_encoding = "3Foo"]
4828pub struct Type1(i32);
4829
4830extern {
4831 #[cfi_encoding = "3Bar"]
4832 type Type2;
4833}
4834```
4835"##,
4836 default_severity: Severity::Allow,
4837 warn_since: None,
4838 deny_since: None,
4839 },
4840 Lint {
4841 label: "char_internals",
4842 description: r##"# `char_internals`
4843
4844
4845
4846This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
4847
4848------------------------
4849"##,
4850 default_severity: Severity::Allow,
4851 warn_since: None,
4852 deny_since: None,
4853 },
4854 Lint {
4855 label: "clamp_magnitude",
4856 description: r##"# `clamp_magnitude`
4857
4858
4859
4860The tracking issue for this feature is: [#148519]
4861
4862[#148519]: https://github.com/rust-lang/rust/issues/148519
4863
4864------------------------
4865"##,
4866 default_severity: Severity::Allow,
4867 warn_since: None,
4868 deny_since: None,
4869 },
4870 Lint {
4871 label: "clone_from_ref",
4872 description: r##"# `clone_from_ref`
4873
4874
4875
4876The tracking issue for this feature is: [#149075]
4877
4878[#149075]: https://github.com/rust-lang/rust/issues/149075
4879
4880------------------------
4881"##,
4882 default_severity: Severity::Allow,
4883 warn_since: None,
4884 deny_since: None,
4885 },
4886 Lint {
4887 label: "clone_to_uninit",
4888 description: r##"# `clone_to_uninit`
4889
4890
4891
4892The tracking issue for this feature is: [#126799]
4893
4894[#126799]: https://github.com/rust-lang/rust/issues/126799
4895
4896------------------------
4897"##,
4898 default_severity: Severity::Allow,
4899 warn_since: None,
4900 deny_since: None,
4901 },
4902 Lint {
4903 label: "closure_lifetime_binder",
4904 description: r##"# `closure_lifetime_binder`
4905
4906Allows `for<...>` on closures and coroutines.
4907
4908The tracking issue for this feature is: [#97362]
4909
4910[#97362]: https://github.com/rust-lang/rust/issues/97362
4911
4912------------------------
4913"##,
4914 default_severity: Severity::Allow,
4915 warn_since: None,
4916 deny_since: None,
4917 },
4918 Lint {
4919 label: "closure_track_caller",
4920 description: r##"# `closure_track_caller`
4921
4922The tracking issue for this feature is: [#87417]
4923
4924[#87417]: https://github.com/rust-lang/rust/issues/87417
4925
4926------------------------
4927
4928Allows using the `#[track_caller]` attribute on closures and coroutines.
4929Calls made to the closure or coroutine will have caller information
4930available through `std::panic::Location::caller()`, just like using
4931`#[track_caller]` on a function.
4932"##,
4933 default_severity: Severity::Allow,
4934 warn_since: None,
4935 deny_since: None,
4936 },
4937 Lint {
4938 label: "cmp_minmax",
4939 description: r##"# `cmp_minmax`
4940
4941
4942
4943The tracking issue for this feature is: [#115939]
4944
4945[#115939]: https://github.com/rust-lang/rust/issues/115939
4946
4947------------------------
4948"##,
4949 default_severity: Severity::Allow,
4950 warn_since: None,
4951 deny_since: None,
4952 },
4953 Lint {
4954 label: "cmse_nonsecure_entry",
4955 description: r##"# `cmse_nonsecure_entry`
4956
4957The tracking issue for this feature is: [#75835]
4958
4959[#75835]: https://github.com/rust-lang/rust/issues/75835
4960
4961------------------------
4962
4963The [TrustZone-M
4964feature](https://developer.arm.com/documentation/100690/latest/) is available
4965for targets with the Armv8-M architecture profile (`thumbv8m` in their target
4966name).
4967LLVM, the Rust compiler and the linker are providing
4968[support](https://developer.arm.com/documentation/ecm0359818/latest/) for the
4969TrustZone-M feature.
4970
4971One of the things provided with this unstable feature is the "cmse-nonsecure-entry" ABI.
4972This ABI marks a Secure function as an entry function (see
4973[section 5.4](https://developer.arm.com/documentation/ecm0359818/latest/) for details).
4974With this ABI, the compiler will do the following:
4975* add a special symbol on the function which is the `__acle_se_` prefix and the
4976 standard function name
4977* constrain the number of parameters to avoid using the Non-Secure stack
4978* before returning from the function, clear registers that might contain Secure
4979 information
4980* use the `BXNS` instruction to return
4981
4982Because the stack can not be used to pass parameters, there will be compilation
4983errors if:
4984* the total size of all parameters is too big (for example, more than four 32-bit integers)
4985
4986The special symbol `__acle_se_` will be used by the linker to generate a secure
4987gateway veneer.
4988
4989<!-- NOTE(ignore) this example is specific to thumbv8m targets -->
4990
4991``` rust,ignore
4992#![no_std]
4993#![feature(cmse_nonsecure_entry)]
4994
4995#[no_mangle]
4996pub extern "cmse-nonsecure-entry" fn entry_function(input: u32) -> u32 {
4997 input + 6
4998}
4999```
5000
5001``` text
5002$ rustc --emit obj --crate-type lib --target thumbv8m.main-none-eabi function.rs
5003$ arm-none-eabi-objdump -D function.o
5004
500500000000 <entry_function>:
5006 0: b580 push {r7, lr}
5007 2: 466f mov r7, sp
5008 4: b082 sub sp, #8
5009 6: 9001 str r0, [sp, #4]
5010 8: 1d81 adds r1, r0, #6
5011 a: 460a mov r2, r1
5012 c: 4281 cmp r1, r0
5013 e: 9200 str r2, [sp, #0]
5014 10: d30b bcc.n 2a <entry_function+0x2a>
5015 12: e7ff b.n 14 <entry_function+0x14>
5016 14: 9800 ldr r0, [sp, #0]
5017 16: b002 add sp, #8
5018 18: e8bd 4080 ldmia.w sp!, {r7, lr}
5019 1c: 4671 mov r1, lr
5020 1e: 4672 mov r2, lr
5021 20: 4673 mov r3, lr
5022 22: 46f4 mov ip, lr
5023 24: f38e 8800 msr CPSR_f, lr
5024 28: 4774 bxns lr
5025 2a: f240 0000 movw r0, #0
5026 2e: f2c0 0000 movt r0, #0
5027 32: f240 0200 movw r2, #0
5028 36: f2c0 0200 movt r2, #0
5029 3a: 211c movs r1, #28
5030 3c: f7ff fffe bl 0 <_ZN4core9panicking5panic17h5c028258ca2fb3f5E>
5031 40: defe udf #254 ; 0xfe
5032```
5033"##,
5034 default_severity: Severity::Allow,
5035 warn_since: None,
5036 deny_since: None,
5037 },
5038 Lint {
5039 label: "coerce_pointee_validated",
5040 description: r##"# `coerce_pointee_validated`
5041
5042
5043
5044This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
5045
5046------------------------
5047"##,
5048 default_severity: Severity::Allow,
5049 warn_since: None,
5050 deny_since: None,
5051 },
5052 Lint {
5053 label: "coerce_unsized",
5054 description: r##"# `coerce_unsized`
5055
5056
5057
5058The tracking issue for this feature is: [#18598]
5059
5060[#18598]: https://github.com/rust-lang/rust/issues/18598
5061
5062------------------------
5063"##,
5064 default_severity: Severity::Allow,
5065 warn_since: None,
5066 deny_since: None,
5067 },
5068 Lint {
5069 label: "command_resolved_envs",
5070 description: r##"# `command_resolved_envs`
5071
5072
5073
5074The tracking issue for this feature is: [#149070]
5075
5076[#149070]: https://github.com/rust-lang/rust/issues/149070
5077
5078------------------------
5079"##,
5080 default_severity: Severity::Allow,
5081 warn_since: None,
5082 deny_since: None,
5083 },
5084 Lint {
5085 label: "compiler_builtins",
5086 description: r##"# `compiler_builtins`
5087
5088This feature is internal to the Rust compiler and is not intended for general use.
5089
5090------------------------
5091"##,
5092 default_severity: Severity::Allow,
5093 warn_since: None,
5094 deny_since: None,
5095 },
5096 Lint {
5097 label: "concat_bytes",
5098 description: r##"# `concat_bytes`
5099
5100
5101
5102The tracking issue for this feature is: [#87555]
5103
5104[#87555]: https://github.com/rust-lang/rust/issues/87555
5105
5106------------------------
5107"##,
5108 default_severity: Severity::Allow,
5109 warn_since: None,
5110 deny_since: None,
5111 },
5112 Lint {
5113 label: "const_alloc_error",
5114 description: r##"# `const_alloc_error`
5115
5116
5117
5118The tracking issue for this feature is: [#92523]
5119
5120[#92523]: https://github.com/rust-lang/rust/issues/92523
5121
5122------------------------
5123"##,
5124 default_severity: Severity::Allow,
5125 warn_since: None,
5126 deny_since: None,
5127 },
5128 Lint {
5129 label: "const_array",
5130 description: r##"# `const_array`
5131
5132
5133
5134The tracking issue for this feature is: [#147606]
5135
5136[#147606]: https://github.com/rust-lang/rust/issues/147606
5137
5138------------------------
5139"##,
5140 default_severity: Severity::Allow,
5141 warn_since: None,
5142 deny_since: None,
5143 },
5144 Lint {
5145 label: "const_async_blocks",
5146 description: r##"# `const_async_blocks`
5147
5148Allows `async {}` expressions in const contexts.
5149
5150The tracking issue for this feature is: [#85368]
5151
5152[#85368]: https://github.com/rust-lang/rust/issues/85368
5153
5154------------------------
5155"##,
5156 default_severity: Severity::Allow,
5157 warn_since: None,
5158 deny_since: None,
5159 },
5160 Lint {
5161 label: "const_block_items",
5162 description: r##"# `const_block_items`
5163
5164Allows `const { ... }` as a shorthand for `const _: () = const { ... };` for module items.
5165
5166The tracking issue for this feature is: [#149226]
5167
5168[#149226]: https://github.com/rust-lang/rust/issues/149226
5169
5170------------------------
5171"##,
5172 default_severity: Severity::Allow,
5173 warn_since: None,
5174 deny_since: None,
5175 },
5176 Lint {
5177 label: "const_bool",
5178 description: r##"# `const_bool`
5179
5180
5181
5182The tracking issue for this feature is: [#151531]
5183
5184[#151531]: https://github.com/rust-lang/rust/issues/151531
5185
5186------------------------
5187"##,
5188 default_severity: Severity::Allow,
5189 warn_since: None,
5190 deny_since: None,
5191 },
5192 Lint {
5193 label: "const_btree_len",
5194 description: r##"# `const_btree_len`
5195
5196
5197
5198This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
5199
5200------------------------
5201"##,
5202 default_severity: Severity::Allow,
5203 warn_since: None,
5204 deny_since: None,
5205 },
5206 Lint {
5207 label: "const_c_variadic",
5208 description: r##"# `const_c_variadic`
5209
5210Allows defining and calling c-variadic functions in const contexts.
5211
5212The tracking issue for this feature is: [#151787]
5213
5214[#151787]: https://github.com/rust-lang/rust/issues/151787
5215
5216------------------------
5217"##,
5218 default_severity: Severity::Allow,
5219 warn_since: None,
5220 deny_since: None,
5221 },
5222 Lint {
5223 label: "const_carrying_mul_add",
5224 description: r##"# `const_carrying_mul_add`
5225
5226
5227
5228The tracking issue for this feature is: [#85532]
5229
5230[#85532]: https://github.com/rust-lang/rust/issues/85532
5231
5232------------------------
5233"##,
5234 default_severity: Severity::Allow,
5235 warn_since: None,
5236 deny_since: None,
5237 },
5238 Lint {
5239 label: "const_cell_traits",
5240 description: r##"# `const_cell_traits`
5241
5242
5243
5244The tracking issue for this feature is: [#147787]
5245
5246[#147787]: https://github.com/rust-lang/rust/issues/147787
5247
5248------------------------
5249"##,
5250 default_severity: Severity::Allow,
5251 warn_since: None,
5252 deny_since: None,
5253 },
5254 Lint {
5255 label: "const_clone",
5256 description: r##"# `const_clone`
5257
5258
5259
5260The tracking issue for this feature is: [#142757]
5261
5262[#142757]: https://github.com/rust-lang/rust/issues/142757
5263
5264------------------------
5265"##,
5266 default_severity: Severity::Allow,
5267 warn_since: None,
5268 deny_since: None,
5269 },
5270 Lint {
5271 label: "const_closures",
5272 description: r##"# `const_closures`
5273
5274Allows `const || {}` closures in const contexts.
5275
5276The tracking issue for this feature is: [#106003]
5277
5278[#106003]: https://github.com/rust-lang/rust/issues/106003
5279
5280------------------------
5281"##,
5282 default_severity: Severity::Allow,
5283 warn_since: None,
5284 deny_since: None,
5285 },
5286 Lint {
5287 label: "const_cmp",
5288 description: r##"# `const_cmp`
5289
5290
5291
5292The tracking issue for this feature is: [#143800]
5293
5294[#143800]: https://github.com/rust-lang/rust/issues/143800
5295
5296------------------------
5297"##,
5298 default_severity: Severity::Allow,
5299 warn_since: None,
5300 deny_since: None,
5301 },
5302 Lint {
5303 label: "const_control_flow",
5304 description: r##"# `const_control_flow`
5305
5306
5307
5308The tracking issue for this feature is: [#148739]
5309
5310[#148739]: https://github.com/rust-lang/rust/issues/148739
5311
5312------------------------
5313"##,
5314 default_severity: Severity::Allow,
5315 warn_since: None,
5316 deny_since: None,
5317 },
5318 Lint {
5319 label: "const_convert",
5320 description: r##"# `const_convert`
5321
5322
5323
5324The tracking issue for this feature is: [#143773]
5325
5326[#143773]: https://github.com/rust-lang/rust/issues/143773
5327
5328------------------------
5329"##,
5330 default_severity: Severity::Allow,
5331 warn_since: None,
5332 deny_since: None,
5333 },
5334 Lint {
5335 label: "const_default",
5336 description: r##"# `const_default`
5337
5338
5339
5340The tracking issue for this feature is: [#143894]
5341
5342[#143894]: https://github.com/rust-lang/rust/issues/143894
5343
5344------------------------
5345"##,
5346 default_severity: Severity::Allow,
5347 warn_since: None,
5348 deny_since: None,
5349 },
5350 Lint {
5351 label: "const_destruct",
5352 description: r##"# `const_destruct`
5353
5354Allows using `[const] Destruct` bounds and calling drop impls in const contexts.
5355
5356The tracking issue for this feature is: [#133214]
5357
5358[#133214]: https://github.com/rust-lang/rust/issues/133214
5359
5360------------------------
5361"##,
5362 default_severity: Severity::Allow,
5363 warn_since: None,
5364 deny_since: None,
5365 },
5366 Lint {
5367 label: "const_drop_guard",
5368 description: r##"# `const_drop_guard`
5369
5370
5371
5372This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
5373
5374------------------------
5375"##,
5376 default_severity: Severity::Allow,
5377 warn_since: None,
5378 deny_since: None,
5379 },
5380 Lint {
5381 label: "const_drop_in_place",
5382 description: r##"# `const_drop_in_place`
5383
5384
5385
5386The tracking issue for this feature is: [#109342]
5387
5388[#109342]: https://github.com/rust-lang/rust/issues/109342
5389
5390------------------------
5391"##,
5392 default_severity: Severity::Allow,
5393 warn_since: None,
5394 deny_since: None,
5395 },
5396 Lint {
5397 label: "const_eval_select",
5398 description: r##"# `const_eval_select`
5399
5400
5401
5402The tracking issue for this feature is: [#124625]
5403
5404[#124625]: https://github.com/rust-lang/rust/issues/124625
5405
5406------------------------
5407"##,
5408 default_severity: Severity::Allow,
5409 warn_since: None,
5410 deny_since: None,
5411 },
5412 Lint {
5413 label: "const_for",
5414 description: r##"# `const_for`
5415
5416Allows `for _ in _` loops in const contexts.
5417
5418The tracking issue for this feature is: [#87575]
5419
5420[#87575]: https://github.com/rust-lang/rust/issues/87575
5421
5422------------------------
5423"##,
5424 default_severity: Severity::Allow,
5425 warn_since: None,
5426 deny_since: None,
5427 },
5428 Lint {
5429 label: "const_format_args",
5430 description: r##"# `const_format_args`
5431
5432
5433
5434This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
5435
5436------------------------
5437"##,
5438 default_severity: Severity::Allow,
5439 warn_since: None,
5440 deny_since: None,
5441 },
5442 Lint {
5443 label: "const_heap",
5444 description: r##"# `const_heap`
5445
5446
5447
5448The tracking issue for this feature is: [#79597]
5449
5450[#79597]: https://github.com/rust-lang/rust/issues/79597
5451
5452------------------------
5453"##,
5454 default_severity: Severity::Allow,
5455 warn_since: None,
5456 deny_since: None,
5457 },
5458 Lint {
5459 label: "const_index",
5460 description: r##"# `const_index`
5461
5462
5463
5464The tracking issue for this feature is: [#143775]
5465
5466[#143775]: https://github.com/rust-lang/rust/issues/143775
5467
5468------------------------
5469"##,
5470 default_severity: Severity::Allow,
5471 warn_since: None,
5472 deny_since: None,
5473 },
5474 Lint {
5475 label: "const_iter",
5476 description: r##"# `const_iter`
5477
5478
5479
5480The tracking issue for this feature is: [#92476]
5481
5482[#92476]: https://github.com/rust-lang/rust/issues/92476
5483
5484------------------------
5485"##,
5486 default_severity: Severity::Allow,
5487 warn_since: None,
5488 deny_since: None,
5489 },
5490 Lint {
5491 label: "const_manually_drop_take",
5492 description: r##"# `const_manually_drop_take`
5493
5494
5495
5496The tracking issue for this feature is: [#148773]
5497
5498[#148773]: https://github.com/rust-lang/rust/issues/148773
5499
5500------------------------
5501"##,
5502 default_severity: Severity::Allow,
5503 warn_since: None,
5504 deny_since: None,
5505 },
5506 Lint {
5507 label: "const_never_short_circuit",
5508 description: r##"# `const_never_short_circuit`
5509
5510
5511
5512This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
5513
5514------------------------
5515"##,
5516 default_severity: Severity::Allow,
5517 warn_since: None,
5518 deny_since: None,
5519 },
5520 Lint {
5521 label: "const_nonnull_with_exposed_provenance",
5522 description: r##"# `const_nonnull_with_exposed_provenance`
5523
5524
5525
5526The tracking issue for this feature is: [#154215]
5527
5528[#154215]: https://github.com/rust-lang/rust/issues/154215
5529
5530------------------------
5531"##,
5532 default_severity: Severity::Allow,
5533 warn_since: None,
5534 deny_since: None,
5535 },
5536 Lint {
5537 label: "const_ops",
5538 description: r##"# `const_ops`
5539
5540
5541
5542The tracking issue for this feature is: [#143802]
5543
5544[#143802]: https://github.com/rust-lang/rust/issues/143802
5545
5546------------------------
5547"##,
5548 default_severity: Severity::Allow,
5549 warn_since: None,
5550 deny_since: None,
5551 },
5552 Lint {
5553 label: "const_option_ops",
5554 description: r##"# `const_option_ops`
5555
5556
5557
5558The tracking issue for this feature is: [#143956]
5559
5560[#143956]: https://github.com/rust-lang/rust/issues/143956
5561
5562------------------------
5563"##,
5564 default_severity: Severity::Allow,
5565 warn_since: None,
5566 deny_since: None,
5567 },
5568 Lint {
5569 label: "const_param_ty_trait",
5570 description: r##"# `const_param_ty_trait`
5571
5572
5573
5574The tracking issue for this feature is: [#95174]
5575
5576[#95174]: https://github.com/rust-lang/rust/issues/95174
5577
5578------------------------
5579"##,
5580 default_severity: Severity::Allow,
5581 warn_since: None,
5582 deny_since: None,
5583 },
5584 Lint {
5585 label: "const_param_ty_unchecked",
5586 description: r##"# `const_param_ty_unchecked`
5587
5588Allows skipping `ConstParamTy_` trait implementation checks
5589
5590This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
5591
5592------------------------
5593"##,
5594 default_severity: Severity::Allow,
5595 warn_since: None,
5596 deny_since: None,
5597 },
5598 Lint {
5599 label: "const_path_separators",
5600 description: r##"# `const_path_separators`
5601
5602
5603
5604The tracking issue for this feature is: [#153106]
5605
5606[#153106]: https://github.com/rust-lang/rust/issues/153106
5607
5608------------------------
5609"##,
5610 default_severity: Severity::Allow,
5611 warn_since: None,
5612 deny_since: None,
5613 },
5614 Lint {
5615 label: "const_precise_live_drops",
5616 description: r##"# `const_precise_live_drops`
5617
5618Be more precise when looking for live drops in a const context.
5619
5620The tracking issue for this feature is: [#73255]
5621
5622[#73255]: https://github.com/rust-lang/rust/issues/73255
5623
5624------------------------
5625"##,
5626 default_severity: Severity::Allow,
5627 warn_since: None,
5628 deny_since: None,
5629 },
5630 Lint {
5631 label: "const_range",
5632 description: r##"# `const_range`
5633
5634
5635
5636This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
5637
5638------------------------
5639"##,
5640 default_severity: Severity::Allow,
5641 warn_since: None,
5642 deny_since: None,
5643 },
5644 Lint {
5645 label: "const_range_bounds",
5646 description: r##"# `const_range_bounds`
5647
5648
5649
5650The tracking issue for this feature is: [#108082]
5651
5652[#108082]: https://github.com/rust-lang/rust/issues/108082
5653
5654------------------------
5655"##,
5656 default_severity: Severity::Allow,
5657 warn_since: None,
5658 deny_since: None,
5659 },
5660 Lint {
5661 label: "const_raw_ptr_comparison",
5662 description: r##"# `const_raw_ptr_comparison`
5663
5664
5665
5666The tracking issue for this feature is: [#53020]
5667
5668[#53020]: https://github.com/rust-lang/rust/issues/53020
5669
5670------------------------
5671"##,
5672 default_severity: Severity::Allow,
5673 warn_since: None,
5674 deny_since: None,
5675 },
5676 Lint {
5677 label: "const_ref_cell",
5678 description: r##"# `const_ref_cell`
5679
5680
5681
5682The tracking issue for this feature is: [#137844]
5683
5684[#137844]: https://github.com/rust-lang/rust/issues/137844
5685
5686------------------------
5687"##,
5688 default_severity: Severity::Allow,
5689 warn_since: None,
5690 deny_since: None,
5691 },
5692 Lint {
5693 label: "const_result_trait_fn",
5694 description: r##"# `const_result_trait_fn`
5695
5696
5697
5698The tracking issue for this feature is: [#144211]
5699
5700[#144211]: https://github.com/rust-lang/rust/issues/144211
5701
5702------------------------
5703"##,
5704 default_severity: Severity::Allow,
5705 warn_since: None,
5706 deny_since: None,
5707 },
5708 Lint {
5709 label: "const_result_unwrap_unchecked",
5710 description: r##"# `const_result_unwrap_unchecked`
5711
5712
5713
5714The tracking issue for this feature is: [#148714]
5715
5716[#148714]: https://github.com/rust-lang/rust/issues/148714
5717
5718------------------------
5719"##,
5720 default_severity: Severity::Allow,
5721 warn_since: None,
5722 deny_since: None,
5723 },
5724 Lint {
5725 label: "const_select_unpredictable",
5726 description: r##"# `const_select_unpredictable`
5727
5728
5729
5730The tracking issue for this feature is: [#145938]
5731
5732[#145938]: https://github.com/rust-lang/rust/issues/145938
5733
5734------------------------
5735"##,
5736 default_severity: Severity::Allow,
5737 warn_since: None,
5738 deny_since: None,
5739 },
5740 Lint {
5741 label: "const_slice_from_mut_ptr_range",
5742 description: r##"# `const_slice_from_mut_ptr_range`
5743
5744
5745
5746The tracking issue for this feature is: [#89792]
5747
5748[#89792]: https://github.com/rust-lang/rust/issues/89792
5749
5750------------------------
5751"##,
5752 default_severity: Severity::Allow,
5753 warn_since: None,
5754 deny_since: None,
5755 },
5756 Lint {
5757 label: "const_slice_from_ptr_range",
5758 description: r##"# `const_slice_from_ptr_range`
5759
5760
5761
5762The tracking issue for this feature is: [#89792]
5763
5764[#89792]: https://github.com/rust-lang/rust/issues/89792
5765
5766------------------------
5767"##,
5768 default_severity: Severity::Allow,
5769 warn_since: None,
5770 deny_since: None,
5771 },
5772 Lint {
5773 label: "const_slice_make_iter",
5774 description: r##"# `const_slice_make_iter`
5775
5776
5777
5778The tracking issue for this feature is: [#137737]
5779
5780[#137737]: https://github.com/rust-lang/rust/issues/137737
5781
5782------------------------
5783"##,
5784 default_severity: Severity::Allow,
5785 warn_since: None,
5786 deny_since: None,
5787 },
5788 Lint {
5789 label: "const_split_off_first_last",
5790 description: r##"# `const_split_off_first_last`
5791
5792
5793
5794The tracking issue for this feature is: [#138539]
5795
5796[#138539]: https://github.com/rust-lang/rust/issues/138539
5797
5798------------------------
5799"##,
5800 default_severity: Severity::Allow,
5801 warn_since: None,
5802 deny_since: None,
5803 },
5804 Lint {
5805 label: "const_swap_with_slice",
5806 description: r##"# `const_swap_with_slice`
5807
5808
5809
5810The tracking issue for this feature is: [#142204]
5811
5812[#142204]: https://github.com/rust-lang/rust/issues/142204
5813
5814------------------------
5815"##,
5816 default_severity: Severity::Allow,
5817 warn_since: None,
5818 deny_since: None,
5819 },
5820 Lint {
5821 label: "const_trait_impl",
5822 description: r##"# `const_trait_impl`
5823
5824Allows `impl const Trait for T` syntax.
5825
5826The tracking issue for this feature is: [#143874]
5827
5828[#143874]: https://github.com/rust-lang/rust/issues/143874
5829
5830------------------------
5831"##,
5832 default_severity: Severity::Allow,
5833 warn_since: None,
5834 deny_since: None,
5835 },
5836 Lint {
5837 label: "const_try",
5838 description: r##"# `const_try`
5839
5840Allows the `?` operator in const contexts.
5841
5842The tracking issue for this feature is: [#74935]
5843
5844[#74935]: https://github.com/rust-lang/rust/issues/74935
5845
5846------------------------
5847"##,
5848 default_severity: Severity::Allow,
5849 warn_since: None,
5850 deny_since: None,
5851 },
5852 Lint {
5853 label: "const_try_residual",
5854 description: r##"# `const_try_residual`
5855
5856
5857
5858The tracking issue for this feature is: [#91285]
5859
5860[#91285]: https://github.com/rust-lang/rust/issues/91285
5861
5862------------------------
5863"##,
5864 default_severity: Severity::Allow,
5865 warn_since: None,
5866 deny_since: None,
5867 },
5868 Lint {
5869 label: "const_type_name",
5870 description: r##"# `const_type_name`
5871
5872
5873
5874The tracking issue for this feature is: [#63084]
5875
5876[#63084]: https://github.com/rust-lang/rust/issues/63084
5877
5878------------------------
5879"##,
5880 default_severity: Severity::Allow,
5881 warn_since: None,
5882 deny_since: None,
5883 },
5884 Lint {
5885 label: "const_unsigned_bigint_helpers",
5886 description: r##"# `const_unsigned_bigint_helpers`
5887
5888
5889
5890The tracking issue for this feature is: [#152015]
5891
5892[#152015]: https://github.com/rust-lang/rust/issues/152015
5893
5894------------------------
5895"##,
5896 default_severity: Severity::Allow,
5897 warn_since: None,
5898 deny_since: None,
5899 },
5900 Lint {
5901 label: "container_error_extra",
5902 description: r##"# `container_error_extra`
5903
5904
5905
5906This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
5907
5908------------------------
5909"##,
5910 default_severity: Severity::Allow,
5911 warn_since: None,
5912 deny_since: None,
5913 },
5914 Lint {
5915 label: "context_ext",
5916 description: r##"# `context_ext`
5917
5918
5919
5920The tracking issue for this feature is: [#123392]
5921
5922[#123392]: https://github.com/rust-lang/rust/issues/123392
5923
5924------------------------
5925"##,
5926 default_severity: Severity::Allow,
5927 warn_since: None,
5928 deny_since: None,
5929 },
5930 Lint {
5931 label: "contracts",
5932 description: r##"# `contracts`
5933
5934Allows use of contracts attributes.
5935
5936The tracking issue for this feature is: [#128044]
5937
5938[#128044]: https://github.com/rust-lang/rust/issues/128044
5939
5940------------------------
5941"##,
5942 default_severity: Severity::Allow,
5943 warn_since: None,
5944 deny_since: None,
5945 },
5946 Lint {
5947 label: "contracts_internals",
5948 description: r##"# `contracts_internals`
5949
5950Allows access to internal machinery used to implement contracts.
5951
5952The tracking issue for this feature is: [#128044]
5953
5954[#128044]: https://github.com/rust-lang/rust/issues/128044
5955
5956------------------------
5957"##,
5958 default_severity: Severity::Allow,
5959 warn_since: None,
5960 deny_since: None,
5961 },
5962 Lint {
5963 label: "control_flow_into_value",
5964 description: r##"# `control_flow_into_value`
5965
5966
5967
5968The tracking issue for this feature is: [#137461]
5969
5970[#137461]: https://github.com/rust-lang/rust/issues/137461
5971
5972------------------------
5973"##,
5974 default_severity: Severity::Allow,
5975 warn_since: None,
5976 deny_since: None,
5977 },
5978 Lint {
5979 label: "convert_float_to_int",
5980 description: r##"# `convert_float_to_int`
5981
5982
5983
5984The tracking issue for this feature is: [#67057]
5985
5986[#67057]: https://github.com/rust-lang/rust/issues/67057
5987
5988------------------------
5989"##,
5990 default_severity: Severity::Allow,
5991 warn_since: None,
5992 deny_since: None,
5993 },
5994 Lint {
5995 label: "copied_into_inner",
5996 description: r##"# `copied_into_inner`
5997
5998
5999
6000This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
6001
6002------------------------
6003"##,
6004 default_severity: Severity::Allow,
6005 warn_since: None,
6006 deny_since: None,
6007 },
6008 Lint {
6009 label: "core_float_math",
6010 description: r##"# `core_float_math`
6011
6012
6013
6014The tracking issue for this feature is: [#137578]
6015
6016[#137578]: https://github.com/rust-lang/rust/issues/137578
6017
6018------------------------
6019"##,
6020 default_severity: Severity::Allow,
6021 warn_since: None,
6022 deny_since: None,
6023 },
6024 Lint {
6025 label: "core_intrinsics",
6026 description: r##"# `core_intrinsics`
6027
6028This feature is internal to the Rust compiler and is not intended for general use.
6029
6030------------------------
6031"##,
6032 default_severity: Severity::Allow,
6033 warn_since: None,
6034 deny_since: None,
6035 },
6036 Lint {
6037 label: "core_intrinsics_fallbacks",
6038 description: r##"# `core_intrinsics_fallbacks`
6039
6040
6041
6042This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
6043
6044------------------------
6045"##,
6046 default_severity: Severity::Allow,
6047 warn_since: None,
6048 deny_since: None,
6049 },
6050 Lint {
6051 label: "core_io",
6052 description: r##"# `core_io`
6053
6054
6055
6056The tracking issue for this feature is: [#154046]
6057
6058[#154046]: https://github.com/rust-lang/rust/issues/154046
6059
6060------------------------
6061"##,
6062 default_severity: Severity::Allow,
6063 warn_since: None,
6064 deny_since: None,
6065 },
6066 Lint {
6067 label: "core_io_borrowed_buf",
6068 description: r##"# `core_io_borrowed_buf`
6069
6070
6071
6072The tracking issue for this feature is: [#117693]
6073
6074[#117693]: https://github.com/rust-lang/rust/issues/117693
6075
6076------------------------
6077"##,
6078 default_severity: Severity::Allow,
6079 warn_since: None,
6080 deny_since: None,
6081 },
6082 Lint {
6083 label: "core_io_internals",
6084 description: r##"# `core_io_internals`
6085
6086
6087
6088This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
6089
6090------------------------
6091"##,
6092 default_severity: Severity::Allow,
6093 warn_since: None,
6094 deny_since: None,
6095 },
6096 Lint {
6097 label: "core_private_bignum",
6098 description: r##"# `core_private_bignum`
6099
6100This feature is internal to the Rust compiler and is not intended for general use.
6101
6102------------------------
6103"##,
6104 default_severity: Severity::Allow,
6105 warn_since: None,
6106 deny_since: None,
6107 },
6108 Lint {
6109 label: "core_private_diy_float",
6110 description: r##"# `core_private_diy_float`
6111
6112This feature is internal to the Rust compiler and is not intended for general use.
6113
6114------------------------
6115"##,
6116 default_severity: Severity::Allow,
6117 warn_since: None,
6118 deny_since: None,
6119 },
6120 Lint {
6121 label: "coroutine_clone",
6122 description: r##"# `coroutine_clone`
6123
6124Allows coroutines to be cloned.
6125
6126The tracking issue for this feature is: [#95360]
6127
6128[#95360]: https://github.com/rust-lang/rust/issues/95360
6129
6130------------------------
6131"##,
6132 default_severity: Severity::Allow,
6133 warn_since: None,
6134 deny_since: None,
6135 },
6136 Lint {
6137 label: "coroutine_trait",
6138 description: r##"# `coroutine_trait`
6139
6140
6141
6142The tracking issue for this feature is: [#43122]
6143
6144[#43122]: https://github.com/rust-lang/rust/issues/43122
6145
6146------------------------
6147"##,
6148 default_severity: Severity::Allow,
6149 warn_since: None,
6150 deny_since: None,
6151 },
6152 Lint {
6153 label: "coroutines",
6154 description: r##"# `coroutines`
6155
6156The tracking issue for this feature is: [#43122]
6157
6158[#43122]: https://github.com/rust-lang/rust/issues/43122
6159
6160------------------------
6161
6162The `coroutines` feature gate in Rust allows you to define coroutine or
6163coroutine literals. A coroutine is a "resumable function" that syntactically
6164resembles a closure but compiles to much different semantics in the compiler
6165itself. The primary feature of a coroutine is that it can be suspended during
6166execution to be resumed at a later date. Coroutines use the `yield` keyword to
6167"return", and then the caller can `resume` a coroutine to resume execution just
6168after the `yield` keyword.
6169
6170Coroutines are an extra-unstable feature in the compiler right now. Added in
6171[RFC 2033] they're mostly intended right now as a information/constraint
6172gathering phase. The intent is that experimentation can happen on the nightly
6173compiler before actual stabilization. A further RFC will be required to
6174stabilize coroutines and will likely contain at least a few small
6175tweaks to the overall design.
6176
6177[RFC 2033]: https://github.com/rust-lang/rfcs/pull/2033
6178
6179A syntactical example of a coroutine is:
6180
6181```rust
6182#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
6183
6184use std::ops::{Coroutine, CoroutineState};
6185use std::pin::Pin;
6186
6187fn main() {
6188 let mut coroutine = #[coroutine] || {
6189 yield 1;
6190 return "foo"
6191 };
6192
6193 match Pin::new(&mut coroutine).resume(()) {
6194 CoroutineState::Yielded(1) => {}
6195 _ => panic!("unexpected value from resume"),
6196 }
6197 match Pin::new(&mut coroutine).resume(()) {
6198 CoroutineState::Complete("foo") => {}
6199 _ => panic!("unexpected value from resume"),
6200 }
6201}
6202```
6203
6204Coroutines are closure-like literals which are annotated with `#[coroutine]`
6205and can contain a `yield` statement. The
6206`yield` statement takes an optional expression of a value to yield out of the
6207coroutine. All coroutine literals implement the `Coroutine` trait in the
6208`std::ops` module. The `Coroutine` trait has one main method, `resume`, which
6209resumes execution of the coroutine at the previous suspension point.
6210
6211An example of the control flow of coroutines is that the following example
6212prints all numbers in order:
6213
6214```rust
6215#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
6216
6217use std::ops::Coroutine;
6218use std::pin::Pin;
6219
6220fn main() {
6221 let mut coroutine = #[coroutine] || {
6222 println!("2");
6223 yield;
6224 println!("4");
6225 };
6226
6227 println!("1");
6228 Pin::new(&mut coroutine).resume(());
6229 println!("3");
6230 Pin::new(&mut coroutine).resume(());
6231 println!("5");
6232}
6233```
6234
6235At this time the main use case of coroutines is an implementation
6236primitive for `async`/`await` and `gen` syntax, but coroutines
6237will likely be extended to other primitives in the future.
6238Feedback on the design and usage is always appreciated!
6239
6240### The `Coroutine` trait
6241
6242The `Coroutine` trait in `std::ops` currently looks like:
6243
6244```rust
6245# #![feature(arbitrary_self_types, coroutine_trait)]
6246# use std::ops::CoroutineState;
6247# use std::pin::Pin;
6248
6249pub trait Coroutine<R = ()> {
6250 type Yield;
6251 type Return;
6252 fn resume(self: Pin<&mut Self>, resume: R) -> CoroutineState<Self::Yield, Self::Return>;
6253}
6254```
6255
6256The `Coroutine::Yield` type is the type of values that can be yielded with the
6257`yield` statement. The `Coroutine::Return` type is the returned type of the
6258coroutine. This is typically the last expression in a coroutine's definition or
6259any value passed to `return` in a coroutine. The `resume` function is the entry
6260point for executing the `Coroutine` itself.
6261
6262The return value of `resume`, `CoroutineState`, looks like:
6263
6264```rust
6265pub enum CoroutineState<Y, R> {
6266 Yielded(Y),
6267 Complete(R),
6268}
6269```
6270
6271The `Yielded` variant indicates that the coroutine can later be resumed. This
6272corresponds to a `yield` point in a coroutine. The `Complete` variant indicates
6273that the coroutine is complete and cannot be resumed again. Calling `resume`
6274after a coroutine has returned `Complete` will likely result in a panic of the
6275program.
6276
6277### Closure-like semantics
6278
6279The closure-like syntax for coroutines alludes to the fact that they also have
6280closure-like semantics. Namely:
6281
6282* When created, a coroutine executes no code. A closure literal does not
6283 actually execute any of the closure's code on construction, and similarly a
6284 coroutine literal does not execute any code inside the coroutine when
6285 constructed.
6286
6287* Coroutines can capture outer variables by reference or by move, and this can
6288 be tweaked with the `move` keyword at the beginning of the closure. Like
6289 closures all coroutines will have an implicit environment which is inferred by
6290 the compiler. Outer variables can be moved into a coroutine for use as the
6291 coroutine progresses.
6292
6293* Coroutine literals produce a value with a unique type which implements the
6294 `std::ops::Coroutine` trait. This allows actual execution of the coroutine
6295 through the `Coroutine::resume` method as well as also naming it in return
6296 types and such.
6297
6298* Traits like `Send` and `Sync` are automatically implemented for a `Coroutine`
6299 depending on the captured variables of the environment. Unlike closures,
6300 coroutines also depend on variables live across suspension points. This means
6301 that although the ambient environment may be `Send` or `Sync`, the coroutine
6302 itself may not be due to internal variables live across `yield` points being
6303 not-`Send` or not-`Sync`. Note that coroutines do
6304 not implement traits like `Copy` or `Clone` automatically.
6305
6306* Whenever a coroutine is dropped it will drop all captured environment
6307 variables.
6308
6309### Coroutines as state machines
6310
6311In the compiler, coroutines are currently compiled as state machines. Each
6312`yield` expression will correspond to a different state that stores all live
6313variables over that suspension point. Resumption of a coroutine will dispatch on
6314the current state and then execute internally until a `yield` is reached, at
6315which point all state is saved off in the coroutine and a value is returned.
6316
6317Let's take a look at an example to see what's going on here:
6318
6319```rust
6320#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
6321
6322use std::ops::Coroutine;
6323use std::pin::Pin;
6324
6325fn main() {
6326 let ret = "foo";
6327 let mut coroutine = #[coroutine] move || {
6328 yield 1;
6329 return ret
6330 };
6331
6332 Pin::new(&mut coroutine).resume(());
6333 Pin::new(&mut coroutine).resume(());
6334}
6335```
6336
6337This coroutine literal will compile down to something similar to:
6338
6339```rust
6340#![feature(arbitrary_self_types, coroutine_trait)]
6341
6342use std::ops::{Coroutine, CoroutineState};
6343use std::pin::Pin;
6344
6345fn main() {
6346 let ret = "foo";
6347 let mut coroutine = {
6348 enum __Coroutine {
6349 Start(&'static str),
6350 Yield1(&'static str),
6351 Done,
6352 }
6353
6354 impl Coroutine for __Coroutine {
6355 type Yield = i32;
6356 type Return = &'static str;
6357
6358 fn resume(mut self: Pin<&mut Self>, resume: ()) -> CoroutineState<i32, &'static str> {
6359 use std::mem;
6360 match mem::replace(&mut *self, __Coroutine::Done) {
6361 __Coroutine::Start(s) => {
6362 *self = __Coroutine::Yield1(s);
6363 CoroutineState::Yielded(1)
6364 }
6365
6366 __Coroutine::Yield1(s) => {
6367 *self = __Coroutine::Done;
6368 CoroutineState::Complete(s)
6369 }
6370
6371 __Coroutine::Done => {
6372 panic!("coroutine resumed after completion")
6373 }
6374 }
6375 }
6376 }
6377
6378 __Coroutine::Start(ret)
6379 };
6380
6381 Pin::new(&mut coroutine).resume(());
6382 Pin::new(&mut coroutine).resume(());
6383}
6384```
6385
6386Notably here we can see that the compiler is generating a fresh type,
6387`__Coroutine` in this case. This type has a number of states (represented here
6388as an `enum`) corresponding to each of the conceptual states of the coroutine.
6389At the beginning we're closing over our outer variable `foo` and then that
6390variable is also live over the `yield` point, so it's stored in both states.
6391
6392When the coroutine starts it'll immediately yield 1, but it saves off its state
6393just before it does so indicating that it has reached the yield point. Upon
6394resuming again we'll execute the `return ret` which returns the `Complete`
6395state.
6396
6397Here we can also note that the `Done` state, if resumed, panics immediately as
6398it's invalid to resume a completed coroutine. It's also worth noting that this
6399is just a rough desugaring, not a normative specification for what the compiler
6400does.
6401"##,
6402 default_severity: Severity::Allow,
6403 warn_since: None,
6404 deny_since: None,
6405 },
6406 Lint {
6407 label: "coverage_attribute",
6408 description: r##"# `coverage_attribute`
6409
6410The tracking issue for this feature is: [#84605]
6411
6412[#84605]: https://github.com/rust-lang/rust/issues/84605
6413
6414---
6415
6416The `coverage` attribute can be used to selectively disable coverage
6417instrumentation in an annotated function. This might be useful to:
6418
6419- Avoid instrumentation overhead in a performance critical function
6420- Avoid generating coverage for a function that is not meant to be executed,
6421 but still target 100% coverage for the rest of the program.
6422
6423## Example
6424
6425```rust
6426#![feature(coverage_attribute)]
6427
6428// `foo()` will get coverage instrumentation (by default)
6429fn foo() {
6430 // ...
6431}
6432
6433#[coverage(off)]
6434fn bar() {
6435 // ...
6436}
6437```
6438"##,
6439 default_severity: Severity::Allow,
6440 warn_since: None,
6441 deny_since: None,
6442 },
6443 Lint {
6444 label: "cow_is_borrowed",
6445 description: r##"# `cow_is_borrowed`
6446
6447
6448
6449The tracking issue for this feature is: [#65143]
6450
6451[#65143]: https://github.com/rust-lang/rust/issues/65143
6452
6453------------------------
6454"##,
6455 default_severity: Severity::Allow,
6456 warn_since: None,
6457 deny_since: None,
6458 },
6459 Lint {
6460 label: "csky_target_feature",
6461 description: r##"# `csky_target_feature`
6462
6463Target features on csky.
6464
6465The tracking issue for this feature is: [#150248]
6466
6467[#150248]: https://github.com/rust-lang/rust/issues/150248
6468
6469------------------------
6470"##,
6471 default_severity: Severity::Allow,
6472 warn_since: None,
6473 deny_since: None,
6474 },
6475 Lint {
6476 label: "cstr_bytes",
6477 description: r##"# `cstr_bytes`
6478
6479
6480
6481The tracking issue for this feature is: [#112115]
6482
6483[#112115]: https://github.com/rust-lang/rust/issues/112115
6484
6485------------------------
6486"##,
6487 default_severity: Severity::Allow,
6488 warn_since: None,
6489 deny_since: None,
6490 },
6491 Lint {
6492 label: "cstr_display",
6493 description: r##"# `cstr_display`
6494
6495
6496
6497The tracking issue for this feature is: [#139984]
6498
6499[#139984]: https://github.com/rust-lang/rust/issues/139984
6500
6501------------------------
6502"##,
6503 default_severity: Severity::Allow,
6504 warn_since: None,
6505 deny_since: None,
6506 },
6507 Lint {
6508 label: "cstr_internals",
6509 description: r##"# `cstr_internals`
6510
6511
6512
6513This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
6514
6515------------------------
6516"##,
6517 default_severity: Severity::Allow,
6518 warn_since: None,
6519 deny_since: None,
6520 },
6521 Lint {
6522 label: "current_thread_id",
6523 description: r##"# `current_thread_id`
6524
6525
6526
6527The tracking issue for this feature is: [#147194]
6528
6529[#147194]: https://github.com/rust-lang/rust/issues/147194
6530
6531------------------------
6532"##,
6533 default_severity: Severity::Allow,
6534 warn_since: None,
6535 deny_since: None,
6536 },
6537 Lint {
6538 label: "cursor_split",
6539 description: r##"# `cursor_split`
6540
6541
6542
6543The tracking issue for this feature is: [#86369]
6544
6545[#86369]: https://github.com/rust-lang/rust/issues/86369
6546
6547------------------------
6548"##,
6549 default_severity: Severity::Allow,
6550 warn_since: None,
6551 deny_since: None,
6552 },
6553 Lint {
6554 label: "custom_inner_attributes",
6555 description: r##"# `custom_inner_attributes`
6556
6557Allows non-builtin attributes in inner attribute position.
6558
6559The tracking issue for this feature is: [#54726]
6560
6561[#54726]: https://github.com/rust-lang/rust/issues/54726
6562
6563------------------------
6564"##,
6565 default_severity: Severity::Allow,
6566 warn_since: None,
6567 deny_since: None,
6568 },
6569 Lint {
6570 label: "custom_mir",
6571 description: r##"# `custom_mir`
6572
6573Allows writing custom MIR
6574
6575This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
6576
6577------------------------
6578"##,
6579 default_severity: Severity::Allow,
6580 warn_since: None,
6581 deny_since: None,
6582 },
6583 Lint {
6584 label: "custom_test_frameworks",
6585 description: r##"# `custom_test_frameworks`
6586
6587The tracking issue for this feature is: [#50297]
6588
6589[#50297]: https://github.com/rust-lang/rust/issues/50297
6590
6591------------------------
6592
6593The `custom_test_frameworks` feature allows the use of `#[test_case]` and `#![test_runner]`.
6594Any function, const, or static can be annotated with `#[test_case]` causing it to be aggregated (like `#[test]`)
6595and be passed to the test runner determined by the `#![test_runner]` crate attribute.
6596
6597```rust
6598#![feature(custom_test_frameworks)]
6599#![test_runner(my_runner)]
6600
6601fn my_runner(tests: &[&i32]) {
6602 for t in tests {
6603 if **t == 0 {
6604 println!("PASSED");
6605 } else {
6606 println!("FAILED");
6607 }
6608 }
6609}
6610
6611#[test_case]
6612const WILL_PASS: i32 = 0;
6613
6614#[test_case]
6615const WILL_FAIL: i32 = 4;
6616```
6617"##,
6618 default_severity: Severity::Allow,
6619 warn_since: None,
6620 deny_since: None,
6621 },
6622 Lint {
6623 label: "darwin_objc",
6624 description: r##"# `darwin_objc`
6625
6626
6627
6628The tracking issue for this feature is: [#145496]
6629
6630[#145496]: https://github.com/rust-lang/rust/issues/145496
6631
6632------------------------
6633"##,
6634 default_severity: Severity::Allow,
6635 warn_since: None,
6636 deny_since: None,
6637 },
6638 Lint {
6639 label: "deadline_api",
6640 description: r##"# `deadline_api`
6641
6642
6643
6644The tracking issue for this feature is: [#46316]
6645
6646[#46316]: https://github.com/rust-lang/rust/issues/46316
6647
6648------------------------
6649"##,
6650 default_severity: Severity::Allow,
6651 warn_since: None,
6652 deny_since: None,
6653 },
6654 Lint {
6655 label: "debug_closure_helpers",
6656 description: r##"# `debug_closure_helpers`
6657
6658
6659
6660The tracking issue for this feature is: [#117729]
6661
6662[#117729]: https://github.com/rust-lang/rust/issues/117729
6663
6664------------------------
6665"##,
6666 default_severity: Severity::Allow,
6667 warn_since: None,
6668 deny_since: None,
6669 },
6670 Lint {
6671 label: "dec2flt",
6672 description: r##"# `dec2flt`
6673
6674This feature is internal to the Rust compiler and is not intended for general use.
6675
6676------------------------
6677"##,
6678 default_severity: Severity::Allow,
6679 warn_since: None,
6680 deny_since: None,
6681 },
6682 Lint {
6683 label: "decl_macro",
6684 description: r##"# `decl_macro`
6685
6686Allows declarative macros 2.0 (`macro`).
6687
6688The tracking issue for this feature is: [#39412]
6689
6690[#39412]: https://github.com/rust-lang/rust/issues/39412
6691
6692------------------------
6693"##,
6694 default_severity: Severity::Allow,
6695 warn_since: None,
6696 deny_since: None,
6697 },
6698 Lint {
6699 label: "default_field_values",
6700 description: r##"# `default_field_values`
6701
6702The tracking issue for this feature is: [#132162]
6703
6704[#132162]: https://github.com/rust-lang/rust/issues/132162
6705
6706The RFC for this feature is: [#3681]
6707
6708[#3681]: https://github.com/rust-lang/rfcs/blob/master/text/3681-default-field-values.md
6709
6710------------------------
6711
6712The `default_field_values` feature allows users to specify a const value for
6713individual fields in struct definitions, allowing those to be omitted from
6714initializers.
6715
6716## Examples
6717
6718```rust
6719#![feature(default_field_values)]
6720
6721#[derive(Default)]
6722struct Pet {
6723 name: Option<String>, // impl Default for Pet will use Default::default() for name
6724 age: i128 = 42, // impl Default for Pet will use the literal 42 for age
6725}
6726
6727fn main() {
6728 let a = Pet { name: Some(String::new()), .. }; // Pet { name: Some(""), age: 42 }
6729 let b = Pet::default(); // Pet { name: None, age: 42 }
6730 assert_eq!(a.age, b.age);
6731 // The following would be a compilation error: `name` needs to be specified
6732 // let _ = Pet { .. };
6733}
6734```
6735
6736## `#[derive(Default)]`
6737
6738When deriving Default, the provided values are then used. On enum variants,
6739the variant must still be marked with `#[default]` and have all its fields
6740with default values.
6741
6742```rust
6743#![feature(default_field_values)]
6744
6745#[derive(Default)]
6746enum A {
6747 #[default]
6748 B {
6749 x: i32 = 0,
6750 y: i32 = 0,
6751 },
6752 C,
6753}
6754```
6755
6756## Enum variants
6757
6758This feature also supports enum variants for both specifying default values
6759and `#[derive(Default)]`.
6760
6761## Interaction with `#[non_exhaustive]`
6762
6763A struct or enum variant marked with `#[non_exhaustive]` is not allowed to
6764have default field values.
6765
6766## Lints
6767
6768When manually implementing the `Default` trait for a type that has default
6769field values, if any of these are overridden in the impl the
6770`default_overrides_default_fields` lint will trigger. This lint is in place
6771to avoid surprising diverging behavior between `S { .. }` and
6772`S::default()`, where using the same type in both ways could result in
6773different values. The appropriate way to write a manual `Default`
6774implementation is to use the functional update syntax:
6775
6776```rust
6777#![feature(default_field_values)]
6778
6779struct Pet {
6780 name: String,
6781 age: i128 = 42, // impl Default for Pet will use the literal 42 for age
6782}
6783
6784impl Default for Pet {
6785 fn default() -> Pet {
6786 Pet {
6787 name: "no-name".to_string(),
6788 ..
6789 }
6790 }
6791}
6792```
6793"##,
6794 default_severity: Severity::Allow,
6795 warn_since: None,
6796 deny_since: None,
6797 },
6798 Lint {
6799 label: "deprecated_suggestion",
6800 description: r##"# `deprecated_suggestion`
6801
6802Allows having using `suggestion` in the `#[deprecated]` attribute.
6803
6804The tracking issue for this feature is: [#94785]
6805
6806[#94785]: https://github.com/rust-lang/rust/issues/94785
6807
6808------------------------
6809"##,
6810 default_severity: Severity::Allow,
6811 warn_since: None,
6812 deny_since: None,
6813 },
6814 Lint {
6815 label: "deque_extend_front",
6816 description: r##"# `deque_extend_front`
6817
6818
6819
6820The tracking issue for this feature is: [#146975]
6821
6822[#146975]: https://github.com/rust-lang/rust/issues/146975
6823
6824------------------------
6825"##,
6826 default_severity: Severity::Allow,
6827 warn_since: None,
6828 deny_since: None,
6829 },
6830 Lint {
6831 label: "deref_patterns",
6832 description: r##"# `deref_patterns`
6833
6834The tracking issue for this feature is: [#87121]
6835
6836[#87121]: https://github.com/rust-lang/rust/issues/87121
6837
6838------------------------
6839
6840> **Note**: This feature supersedes [`box_patterns`].
6841
6842This feature permits pattern matching on [smart pointers in the standard library] through their
6843`Deref` target types, either implicitly or with explicit `deref!(_)` patterns (the syntax of which
6844is currently a placeholder).
6845
6846```rust
6847#![feature(deref_patterns)]
6848
6849let mut v = vec![Box::new(Some(0))];
6850
6851// Implicit dereferences are inserted when a pattern can match against the
6852// result of repeatedly dereferencing but can't match against a smart
6853// pointer itself. This works alongside match ergonomics for references.
6854if let [Some(x)] = &mut v {
6855 *x += 1;
6856}
6857
6858// Explicit `deref!(_)` patterns may instead be used when finer control is
6859// needed, e.g. to dereference only a single smart pointer, or to bind the
6860// the result of dereferencing to a variable.
6861if let deref!([deref!(opt_x @ Some(1))]) = &mut v {
6862 opt_x.as_mut().map(|x| *x += 1);
6863}
6864
6865assert_eq!(v, [Box::new(Some(2))]);
6866```
6867
6868Without this feature, it may be necessary to introduce temporaries to represent dereferenced places
6869when matching on nested structures:
6870
6871```rust
6872let mut v = vec![Box::new(Some(0))];
6873if let [b] = &mut *v {
6874 if let Some(x) = &mut **b {
6875 *x += 1;
6876 }
6877}
6878if let [b] = &mut *v {
6879 if let opt_x @ Some(1) = &mut **b {
6880 opt_x.as_mut().map(|x| *x += 1);
6881 }
6882}
6883assert_eq!(v, [Box::new(Some(2))]);
6884```
6885
6886Like [`box_patterns`], deref patterns may move out of boxes:
6887
6888```rust
6889# #![feature(deref_patterns)]
6890struct NoCopy;
6891let deref!(x) = Box::new(NoCopy);
6892drop::<NoCopy>(x);
6893```
6894
6895Additionally, `deref_patterns` implements changes to string and byte string literal patterns,
6896allowing then to be used in deref patterns:
6897
6898```rust
6899# #![feature(deref_patterns)]
6900match ("test".to_string(), Box::from("test"), b"test".to_vec()) {
6901 ("test", "test", b"test") => {}
6902 _ => panic!(),
6903}
6904
6905// This works through multiple layers of reference and smart pointer:
6906match (&Box::new(&"test".to_string()), &&&"test") {
6907 ("test", "test") => {}
6908 _ => panic!(),
6909}
6910
6911// `deref!("...")` syntax may also be used:
6912match "test".to_string() {
6913 deref!("test") => {}
6914 _ => panic!(),
6915}
6916
6917// Matching on slices and arrays using literals is possible elsewhere as well:
6918match *"test" {
6919 "test" => {}
6920 _ => panic!(),
6921}
6922match *b"test" {
6923 b"test" => {}
6924 _ => panic!(),
6925}
6926match *(b"test" as &[u8]) {
6927 b"test" => {}
6928 _ => panic!(),
6929}
6930```
6931
6932[`box_patterns`]: ./box-patterns.md
6933[smart pointers in the standard library]: https://doc.rust-lang.org/std/ops/trait.DerefPure.html#implementors
6934"##,
6935 default_severity: Severity::Allow,
6936 warn_since: None,
6937 deny_since: None,
6938 },
6939 Lint {
6940 label: "deref_pure_trait",
6941 description: r##"# `deref_pure_trait`
6942
6943
6944
6945The tracking issue for this feature is: [#87121]
6946
6947[#87121]: https://github.com/rust-lang/rust/issues/87121
6948
6949------------------------
6950"##,
6951 default_severity: Severity::Allow,
6952 warn_since: None,
6953 deny_since: None,
6954 },
6955 Lint {
6956 label: "derive_clone_copy_internals",
6957 description: r##"# `derive_clone_copy_internals`
6958
6959This feature is internal to the Rust compiler and is not intended for general use.
6960
6961------------------------
6962"##,
6963 default_severity: Severity::Allow,
6964 warn_since: None,
6965 deny_since: None,
6966 },
6967 Lint {
6968 label: "derive_coerce_pointee",
6969 description: r##"# `derive_coerce_pointee`
6970
6971
6972
6973The tracking issue for this feature is: [#123430]
6974
6975[#123430]: https://github.com/rust-lang/rust/issues/123430
6976
6977------------------------
6978"##,
6979 default_severity: Severity::Allow,
6980 warn_since: None,
6981 deny_since: None,
6982 },
6983 Lint {
6984 label: "derive_const",
6985 description: r##"# `derive_const`
6986
6987
6988
6989The tracking issue for this feature is: [#118304]
6990
6991[#118304]: https://github.com/rust-lang/rust/issues/118304
6992
6993------------------------
6994"##,
6995 default_severity: Severity::Allow,
6996 warn_since: None,
6997 deny_since: None,
6998 },
6999 Lint {
7000 label: "derive_eq_internals",
7001 description: r##"# `derive_eq_internals`
7002
7003This feature is internal to the Rust compiler and is not intended for general use.
7004
7005------------------------
7006"##,
7007 default_severity: Severity::Allow,
7008 warn_since: None,
7009 deny_since: None,
7010 },
7011 Lint {
7012 label: "derive_from",
7013 description: r##"# `derive_from`
7014
7015Allows deriving the From trait on single-field structs.
7016
7017The tracking issue for this feature is: [#144889]
7018
7019[#144889]: https://github.com/rust-lang/rust/issues/144889
7020
7021------------------------
7022"##,
7023 default_severity: Severity::Allow,
7024 warn_since: None,
7025 deny_since: None,
7026 },
7027 Lint {
7028 label: "derive_macro_global_path",
7029 description: r##"# `derive_macro_global_path`
7030
7031
7032
7033The tracking issue for this feature is: [#154645]
7034
7035[#154645]: https://github.com/rust-lang/rust/issues/154645
7036
7037------------------------
7038"##,
7039 default_severity: Severity::Allow,
7040 warn_since: None,
7041 deny_since: None,
7042 },
7043 Lint {
7044 label: "diagnostic_on_const",
7045 description: r##"# `diagnostic_on_const`
7046
7047Allows giving non-const impls custom diagnostic messages if attempted to be used as const
7048
7049The tracking issue for this feature is: [#143874]
7050
7051[#143874]: https://github.com/rust-lang/rust/issues/143874
7052
7053------------------------
7054"##,
7055 default_severity: Severity::Allow,
7056 warn_since: None,
7057 deny_since: None,
7058 },
7059 Lint {
7060 label: "diagnostic_on_move",
7061 description: r##"# `diagnostic_on_move`
7062
7063The tracking issue for this feature is: [#154181]
7064
7065------------------------
7066
7067The `diagnostic_on_move` feature allows use of the `#[diagnostic::on_move]` attribute. It should be
7068placed on struct, enum and union declarations, though it is not an error to be located in other
7069positions. This attribute is a hint to the compiler to supplement the error message when the
7070annotated type is involved in a borrowcheck error.
7071
7072For example, [`File`] is annotated as such:
7073```rust
7074#![feature(diagnostic_on_move)]
7075
7076#[diagnostic::on_move(note = "you can use `File::try_clone` \
7077 to duplicate a `File` instance")]
7078pub struct File {
7079 // ...
7080}
7081```
7082
7083When you try to use a `File` after it's already been moved, it will helpfully tell you about `try_clone`.
7084
7085The message and label can also be customized:
7086
7087```rust
7088#![feature(diagnostic_on_move)]
7089
7090use std::marker::PhantomData;
7091
7092#[diagnostic::on_move(
7093 message = "`{Self}` cannot be used multiple times",
7094 label = "this token may only be used once",
7095 note = "you can create a new `Token` with `Token::conjure()`"
7096)]
7097pub struct Token<'brand> {
7098 spooky: PhantomData<&'brand ()>,
7099}
7100
7101impl Token<'_> {
7102 pub fn conjure<'u>() -> Token<'u> {
7103 Token {
7104 spooky: PhantomData,
7105 }
7106 }
7107}
7108```
7109The user may try to use it like this:
7110```rust,compile_fail,E0382
7111# #![feature(diagnostic_on_move)]
7112#
7113# use std::marker::PhantomData;
7114#
7115# #[diagnostic::on_move(
7116# message = "`{Self}` cannot be used multiple times",
7117# label = "this token may only be used once",
7118# note = "you can create a new `Token` with `Token::conjure()`"
7119# )]
7120# pub struct Token<'brand> {
7121# spooky: PhantomData<&'brand ()>,
7122# }
7123#
7124# impl Token<'_> {
7125# pub fn conjure<'u>() -> Token<'u> {
7126# Token {
7127# spooky: PhantomData,
7128# }
7129# }
7130# }
7131# fn main() {
7132let token = Token::conjure();
7133let _ = (token, token);
7134# }
7135```
7136This will result in the following error:
7137```text
7138error[E0382]: `Token` cannot be used multiple times
7139 --> src/main.rs:24:21
7140 |
7141 1 | let token = Token::conjure();
7142 | ----- this token may only be used once
7143 2 | let _ = (token, token);
7144 | ----- ^^^^^ value used here after move
7145 | |
7146 | value moved here
7147 |
7148 = note: you can create a new `Token` with `Token::conjure()`
7149```
7150
7151[`File`]: https://doc.rust-lang.org/nightly/std/fs/struct.File.html "File in std::fs"
7152[#154181]: https://github.com/rust-lang/rust/issues/154181 "Tracking Issue for #[diagnostic::on_move]"
7153"##,
7154 default_severity: Severity::Allow,
7155 warn_since: None,
7156 deny_since: None,
7157 },
7158 Lint {
7159 label: "diagnostic_on_unknown",
7160 description: r##"# `diagnostic_on_unknown`
7161
7162Allows giving unresolved imports a custom diagnostic message
7163
7164The tracking issue for this feature is: [#152900]
7165
7166[#152900]: https://github.com/rust-lang/rust/issues/152900
7167
7168------------------------
7169"##,
7170 default_severity: Severity::Allow,
7171 warn_since: None,
7172 deny_since: None,
7173 },
7174 Lint {
7175 label: "diagnostic_on_unmatch_args",
7176 description: r##"# `diagnostic_on_unmatch_args`
7177
7178The tracking issue for this feature is: [#155642]
7179
7180[#155642]: https://github.com/rust-lang/rust/issues/155642
7181
7182------------------------
7183
7184The `diagnostic_on_unmatch_args` feature adds the
7185`#[diagnostic::on_unmatch_args(...)]` attribute for declarative macros.
7186It lets a macro definition customize diagnostics for matcher failures after all arms have been
7187tried, such as incomplete invocations or trailing extra arguments.
7188
7189This attribute currently applies to declarative macros such as `macro_rules!` and `pub macro`.
7190It is currently used for errors emitted by declarative macro matching itself; fragment parser
7191errors still use their existing diagnostics.
7192
7193```rust,compile_fail
7194#![feature(diagnostic_on_unmatch_args)]
7195
7196#[diagnostic::on_unmatch_args(
7197 message = "invalid arguments to {This} macro invocation",
7198 label = "expected a type and value here",
7199 note = "this macro expects a type and a value, like `pair!(u8, 0)`",
7200 note = "see <link/to/docs>",
7201)]
7202macro_rules! pair {
7203 ($ty:ty, $value:expr) => {};
7204}
7205
7206pair!(u8);
7207```
7208
7209This emits output like:
7210
7211```text
7212error: invalid arguments to pair macro invocation
7213 --> example.rs:13:9
7214 |
72159 | macro_rules! pair {
7216 | ----------------- when calling this macro
7217...
721813 | pair!(u8);
7219 | ^ expected a type and value here
7220 |
7221note: while trying to match `,`
7222 --> example.rs:10:12
7223 |
722410 | ($ty:ty, $value:expr) => {};
7225 | ^
7226 = note: this macro expects a type and a value, like `pair!(u8, 0)`
7227 = note: see <link/to/docs>
7228```
7229"##,
7230 default_severity: Severity::Allow,
7231 warn_since: None,
7232 deny_since: None,
7233 },
7234 Lint {
7235 label: "dir_entry_ext2",
7236 description: r##"# `dir_entry_ext2`
7237
7238
7239
7240The tracking issue for this feature is: [#85573]
7241
7242[#85573]: https://github.com/rust-lang/rust/issues/85573
7243
7244------------------------
7245"##,
7246 default_severity: Severity::Allow,
7247 warn_since: None,
7248 deny_since: None,
7249 },
7250 Lint {
7251 label: "dirfd",
7252 description: r##"# `dirfd`
7253
7254
7255
7256The tracking issue for this feature is: [#120426]
7257
7258[#120426]: https://github.com/rust-lang/rust/issues/120426
7259
7260------------------------
7261"##,
7262 default_severity: Severity::Allow,
7263 warn_since: None,
7264 deny_since: None,
7265 },
7266 Lint {
7267 label: "dirhandle",
7268 description: r##"# `dirhandle`
7269
7270
7271
7272The tracking issue for this feature is: [#120426]
7273
7274[#120426]: https://github.com/rust-lang/rust/issues/120426
7275
7276------------------------
7277"##,
7278 default_severity: Severity::Allow,
7279 warn_since: None,
7280 deny_since: None,
7281 },
7282 Lint {
7283 label: "discriminant_kind",
7284 description: r##"# `discriminant_kind`
7285
7286
7287
7288This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
7289
7290------------------------
7291"##,
7292 default_severity: Severity::Allow,
7293 warn_since: None,
7294 deny_since: None,
7295 },
7296 Lint {
7297 label: "disjoint_bitor",
7298 description: r##"# `disjoint_bitor`
7299
7300
7301
7302The tracking issue for this feature is: [#135758]
7303
7304[#135758]: https://github.com/rust-lang/rust/issues/135758
7305
7306------------------------
7307"##,
7308 default_severity: Severity::Allow,
7309 warn_since: None,
7310 deny_since: None,
7311 },
7312 Lint {
7313 label: "dispatch_from_dyn",
7314 description: r##"# `dispatch_from_dyn`
7315
7316
7317
7318This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
7319
7320------------------------
7321"##,
7322 default_severity: Severity::Allow,
7323 warn_since: None,
7324 deny_since: None,
7325 },
7326 Lint {
7327 label: "doc_cfg",
7328 description: r##"# `doc_cfg`
7329
7330The tracking issue for this feature is: [#43781]
7331
7332------
7333
7334The `doc_cfg` feature allows an API be documented as only available in some specific platforms.
7335This attribute has two effects:
7336
73371. In the annotated item's documentation, there will be a message saying "Available on
7338 (platform) only".
7339
73402. The item's doc-tests will only run on the specific platform.
7341
7342In addition to allowing the use of the `#[doc(cfg)]` attribute, this feature enables the use of a
7343special conditional compilation flag, `#[cfg(doc)]`, set whenever building documentation on your
7344crate.
7345
7346This feature was introduced as part of PR [#43348] to allow the platform-specific parts of the
7347standard library be documented.
7348
7349```rust
7350#![feature(doc_cfg)]
7351
7352#[cfg(any(windows, doc))]
7353#[doc(cfg(windows))]
7354/// The application's icon in the notification area (a.k.a. system tray).
7355///
7356/// # Examples
7357///
7358/// ```no_run
7359/// extern crate my_awesome_ui_library;
7360/// use my_awesome_ui_library::current_app;
7361/// use my_awesome_ui_library::windows::notification;
7362///
7363/// let icon = current_app().get::<notification::Icon>();
7364/// icon.show();
7365/// icon.show_message("Hello");
7366/// ```
7367pub struct Icon {
7368 // ...
7369}
7370```
7371
7372[#43781]: https://github.com/rust-lang/rust/issues/43781
7373[#43348]: https://github.com/rust-lang/rust/issues/43348
7374"##,
7375 default_severity: Severity::Allow,
7376 warn_since: None,
7377 deny_since: None,
7378 },
7379 Lint {
7380 label: "doc_masked",
7381 description: r##"# `doc_masked`
7382
7383The tracking issue for this feature is: [#44027]
7384
7385-----
7386
7387The `doc_masked` feature allows a crate to exclude types from a given crate from appearing in lists
7388of trait implementations. The specifics of the feature are as follows:
7389
73901. When rustdoc encounters an `extern crate` statement annotated with a `#[doc(masked)]` attribute,
7391 it marks the crate as being masked.
7392
73932. When listing traits a given type implements, rustdoc ensures that traits from masked crates are
7394 not emitted into the documentation.
7395
73963. When listing types that implement a given trait, rustdoc ensures that types from masked crates
7397 are not emitted into the documentation.
7398
7399This feature was introduced in PR [#44026] to ensure that compiler-internal and
7400implementation-specific types and traits were not included in the standard library's documentation.
7401Such types would introduce broken links into the documentation.
7402
7403[#44026]: https://github.com/rust-lang/rust/pull/44026
7404[#44027]: https://github.com/rust-lang/rust/pull/44027
7405"##,
7406 default_severity: Severity::Allow,
7407 warn_since: None,
7408 deny_since: None,
7409 },
7410 Lint {
7411 label: "doc_notable_trait",
7412 description: r##"# `doc_notable_trait`
7413
7414The tracking issue for this feature is: [#45040]
7415
7416The `doc_notable_trait` feature allows the use of the `#[doc(notable_trait)]`
7417attribute, which will display the trait in a "Notable traits" dialog for
7418functions returning types that implement the trait. For example, this attribute
7419is applied to the `Iterator`, `Future`, `io::Read`, and `io::Write` traits in
7420the standard library.
7421
7422You can do this on your own traits like so:
7423
7424```
7425#![feature(doc_notable_trait)]
7426
7427#[doc(notable_trait)]
7428pub trait MyTrait {}
7429
7430pub struct MyStruct;
7431impl MyTrait for MyStruct {}
7432
7433/// The docs for this function will have a button that displays a dialog about
7434/// `MyStruct` implementing `MyTrait`.
7435pub fn my_fn() -> MyStruct { MyStruct }
7436```
7437
7438This feature was originally implemented in PR [#45039].
7439
7440See also its documentation in [the rustdoc book][rustdoc-book-notable_trait].
7441
7442[#45040]: https://github.com/rust-lang/rust/issues/45040
7443[#45039]: https://github.com/rust-lang/rust/pull/45039
7444[rustdoc-book-notable_trait]: ../../rustdoc/unstable-features.html#adding-your-trait-to-the-notable-traits-dialog
7445"##,
7446 default_severity: Severity::Allow,
7447 warn_since: None,
7448 deny_since: None,
7449 },
7450 Lint {
7451 label: "downcast_unchecked",
7452 description: r##"# `downcast_unchecked`
7453
7454
7455
7456The tracking issue for this feature is: [#90850]
7457
7458[#90850]: https://github.com/rust-lang/rust/issues/90850
7459
7460------------------------
7461"##,
7462 default_severity: Severity::Allow,
7463 warn_since: None,
7464 deny_since: None,
7465 },
7466 Lint {
7467 label: "drain_keep_rest",
7468 description: r##"# `drain_keep_rest`
7469
7470
7471
7472The tracking issue for this feature is: [#101122]
7473
7474[#101122]: https://github.com/rust-lang/rust/issues/101122
7475
7476------------------------
7477"##,
7478 default_severity: Severity::Allow,
7479 warn_since: None,
7480 deny_since: None,
7481 },
7482 Lint {
7483 label: "drop_guard",
7484 description: r##"# `drop_guard`
7485
7486
7487
7488The tracking issue for this feature is: [#144426]
7489
7490[#144426]: https://github.com/rust-lang/rust/issues/144426
7491
7492------------------------
7493"##,
7494 default_severity: Severity::Allow,
7495 warn_since: None,
7496 deny_since: None,
7497 },
7498 Lint {
7499 label: "dropck_eyepatch",
7500 description: r##"# `dropck_eyepatch`
7501
7502Allows using the `may_dangle` attribute (RFC 1327).
7503
7504The tracking issue for this feature is: [#34761]
7505
7506[#34761]: https://github.com/rust-lang/rust/issues/34761
7507
7508------------------------
7509"##,
7510 default_severity: Severity::Allow,
7511 warn_since: None,
7512 deny_since: None,
7513 },
7514 Lint {
7515 label: "duration_constants",
7516 description: r##"# `duration_constants`
7517
7518
7519
7520The tracking issue for this feature is: [#57391]
7521
7522[#57391]: https://github.com/rust-lang/rust/issues/57391
7523
7524------------------------
7525"##,
7526 default_severity: Severity::Allow,
7527 warn_since: None,
7528 deny_since: None,
7529 },
7530 Lint {
7531 label: "duration_constructors",
7532 description: r##"# `duration_constructors`
7533
7534The tracking issue for this feature is: [#120301]
7535
7536[#120301]: https://github.com/rust-lang/rust/issues/120301
7537
7538------------------------
7539
7540Add the methods `from_days` and `from_weeks` to `Duration`.
7541"##,
7542 default_severity: Severity::Allow,
7543 warn_since: None,
7544 deny_since: None,
7545 },
7546 Lint {
7547 label: "duration_integer_division",
7548 description: r##"# `duration_integer_division`
7549
7550
7551
7552The tracking issue for this feature is: [#149573]
7553
7554[#149573]: https://github.com/rust-lang/rust/issues/149573
7555
7556------------------------
7557"##,
7558 default_severity: Severity::Allow,
7559 warn_since: None,
7560 deny_since: None,
7561 },
7562 Lint {
7563 label: "duration_millis_float",
7564 description: r##"# `duration_millis_float`
7565
7566
7567
7568The tracking issue for this feature is: [#122451]
7569
7570[#122451]: https://github.com/rust-lang/rust/issues/122451
7571
7572------------------------
7573"##,
7574 default_severity: Severity::Allow,
7575 warn_since: None,
7576 deny_since: None,
7577 },
7578 Lint {
7579 label: "duration_units",
7580 description: r##"# `duration_units`
7581
7582
7583
7584The tracking issue for this feature is: [#120301]
7585
7586[#120301]: https://github.com/rust-lang/rust/issues/120301
7587
7588------------------------
7589"##,
7590 default_severity: Severity::Allow,
7591 warn_since: None,
7592 deny_since: None,
7593 },
7594 Lint {
7595 label: "edition_panic",
7596 description: r##"# `edition_panic`
7597
7598
7599
7600This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
7601
7602------------------------
7603"##,
7604 default_severity: Severity::Allow,
7605 warn_since: None,
7606 deny_since: None,
7607 },
7608 Lint {
7609 label: "effective_target_features",
7610 description: r##"# `effective_target_features`
7611
7612Allows features to allow target_feature to better interact with traits.
7613
7614The tracking issue for this feature is: [#143352]
7615
7616[#143352]: https://github.com/rust-lang/rust/issues/143352
7617
7618------------------------
7619"##,
7620 default_severity: Severity::Allow,
7621 warn_since: None,
7622 deny_since: None,
7623 },
7624 Lint {
7625 label: "eii_internals",
7626 description: r##"# `eii_internals`
7627
7628Implementation details of externally implementable items
7629
7630This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
7631
7632------------------------
7633"##,
7634 default_severity: Severity::Allow,
7635 warn_since: None,
7636 deny_since: None,
7637 },
7638 Lint {
7639 label: "ergonomic_clones",
7640 description: r##"# `ergonomic_clones`
7641
7642Allows the .use postfix syntax `x.use` and use closures `use |x| { ... }`
7643
7644The tracking issue for this feature is: [#132290]
7645
7646[#132290]: https://github.com/rust-lang/rust/issues/132290
7647
7648------------------------
7649"##,
7650 default_severity: Severity::Allow,
7651 warn_since: None,
7652 deny_since: None,
7653 },
7654 Lint {
7655 label: "ermsb_target_feature",
7656 description: r##"# `ermsb_target_feature`
7657
7658ermsb target feature on x86.
7659
7660The tracking issue for this feature is: [#150249]
7661
7662[#150249]: https://github.com/rust-lang/rust/issues/150249
7663
7664------------------------
7665"##,
7666 default_severity: Severity::Allow,
7667 warn_since: None,
7668 deny_since: None,
7669 },
7670 Lint {
7671 label: "error_generic_member_access",
7672 description: r##"# `error_generic_member_access`
7673
7674
7675
7676The tracking issue for this feature is: [#99301]
7677
7678[#99301]: https://github.com/rust-lang/rust/issues/99301
7679
7680------------------------
7681"##,
7682 default_severity: Severity::Allow,
7683 warn_since: None,
7684 deny_since: None,
7685 },
7686 Lint {
7687 label: "error_iter",
7688 description: r##"# `error_iter`
7689
7690
7691
7692The tracking issue for this feature is: [#58520]
7693
7694[#58520]: https://github.com/rust-lang/rust/issues/58520
7695
7696------------------------
7697"##,
7698 default_severity: Severity::Allow,
7699 warn_since: None,
7700 deny_since: None,
7701 },
7702 Lint {
7703 label: "error_reporter",
7704 description: r##"# `error_reporter`
7705
7706
7707
7708The tracking issue for this feature is: [#90172]
7709
7710[#90172]: https://github.com/rust-lang/rust/issues/90172
7711
7712------------------------
7713"##,
7714 default_severity: Severity::Allow,
7715 warn_since: None,
7716 deny_since: None,
7717 },
7718 Lint {
7719 label: "error_type_id",
7720 description: r##"# `error_type_id`
7721
7722
7723
7724The tracking issue for this feature is: [#60784]
7725
7726[#60784]: https://github.com/rust-lang/rust/issues/60784
7727
7728------------------------
7729"##,
7730 default_severity: Severity::Allow,
7731 warn_since: None,
7732 deny_since: None,
7733 },
7734 Lint {
7735 label: "exact_bitshifts",
7736 description: r##"# `exact_bitshifts`
7737
7738
7739
7740The tracking issue for this feature is: [#144336]
7741
7742[#144336]: https://github.com/rust-lang/rust/issues/144336
7743
7744------------------------
7745"##,
7746 default_severity: Severity::Allow,
7747 warn_since: None,
7748 deny_since: None,
7749 },
7750 Lint {
7751 label: "exact_div",
7752 description: r##"# `exact_div`
7753
7754
7755
7756The tracking issue for this feature is: [#139911]
7757
7758[#139911]: https://github.com/rust-lang/rust/issues/139911
7759
7760------------------------
7761"##,
7762 default_severity: Severity::Allow,
7763 warn_since: None,
7764 deny_since: None,
7765 },
7766 Lint {
7767 label: "exact_size_is_empty",
7768 description: r##"# `exact_size_is_empty`
7769
7770
7771
7772The tracking issue for this feature is: [#35428]
7773
7774[#35428]: https://github.com/rust-lang/rust/issues/35428
7775
7776------------------------
7777"##,
7778 default_severity: Severity::Allow,
7779 warn_since: None,
7780 deny_since: None,
7781 },
7782 Lint {
7783 label: "exclusive_wrapper",
7784 description: r##"# `exclusive_wrapper`
7785
7786
7787
7788The tracking issue for this feature is: [#98407]
7789
7790[#98407]: https://github.com/rust-lang/rust/issues/98407
7791
7792------------------------
7793"##,
7794 default_severity: Severity::Allow,
7795 warn_since: None,
7796 deny_since: None,
7797 },
7798 Lint {
7799 label: "exhaustive_patterns",
7800 description: r##"# `exhaustive_patterns`
7801
7802Allows exhaustive pattern matching on types that contain uninhabited types.
7803
7804The tracking issue for this feature is: [#51085]
7805
7806[#51085]: https://github.com/rust-lang/rust/issues/51085
7807
7808------------------------
7809"##,
7810 default_severity: Severity::Allow,
7811 warn_since: None,
7812 deny_since: None,
7813 },
7814 Lint {
7815 label: "exit_status_error",
7816 description: r##"# `exit_status_error`
7817
7818
7819
7820The tracking issue for this feature is: [#84908]
7821
7822[#84908]: https://github.com/rust-lang/rust/issues/84908
7823
7824------------------------
7825"##,
7826 default_severity: Severity::Allow,
7827 warn_since: None,
7828 deny_since: None,
7829 },
7830 Lint {
7831 label: "exitcode_exit_method",
7832 description: r##"# `exitcode_exit_method`
7833
7834
7835
7836The tracking issue for this feature is: [#97100]
7837
7838[#97100]: https://github.com/rust-lang/rust/issues/97100
7839
7840------------------------
7841"##,
7842 default_severity: Severity::Allow,
7843 warn_since: None,
7844 deny_since: None,
7845 },
7846 Lint {
7847 label: "explicit_extern_abis",
7848 description: r##"# `explicit_extern_abis`
7849
7850The tracking issue for this feature is: [#134986]
7851
7852------
7853
7854Disallow `extern` without an explicit ABI. We should write `extern "C"`
7855(or another ABI) instead of just `extern`.
7856
7857By making the ABI explicit, it becomes much clearer that "C" is just one of the
7858possible choices, rather than the "standard" way for external functions.
7859Removing the default makes it easier to add a new ABI on equal footing as "C".
7860
7861```rust,editionfuture,compile_fail
7862#![feature(explicit_extern_abis)]
7863
7864extern fn function1() {} // ERROR `extern` declarations without an explicit ABI
7865 // are disallowed
7866
7867extern "C" fn function2() {} // compiles
7868
7869extern "aapcs" fn function3() {} // compiles
7870```
7871
7872[#134986]: https://github.com/rust-lang/rust/issues/134986
7873"##,
7874 default_severity: Severity::Allow,
7875 warn_since: None,
7876 deny_since: None,
7877 },
7878 Lint {
7879 label: "explicit_tail_calls",
7880 description: r##"# `explicit_tail_calls`
7881
7882Allows explicit tail calls via `become` expression.
7883
7884The tracking issue for this feature is: [#112788]
7885
7886[#112788]: https://github.com/rust-lang/rust/issues/112788
7887
7888------------------------
7889"##,
7890 default_severity: Severity::Allow,
7891 warn_since: None,
7892 deny_since: None,
7893 },
7894 Lint {
7895 label: "export_stable",
7896 description: r##"# `export_stable`
7897
7898Allows using `#[export_stable]` which indicates that an item is exportable.
7899
7900The tracking issue for this feature is: [#139939]
7901
7902[#139939]: https://github.com/rust-lang/rust/issues/139939
7903
7904------------------------
7905"##,
7906 default_severity: Severity::Allow,
7907 warn_since: None,
7908 deny_since: None,
7909 },
7910 Lint {
7911 label: "extend_one",
7912 description: r##"# `extend_one`
7913
7914
7915
7916The tracking issue for this feature is: [#72631]
7917
7918[#72631]: https://github.com/rust-lang/rust/issues/72631
7919
7920------------------------
7921"##,
7922 default_severity: Severity::Allow,
7923 warn_since: None,
7924 deny_since: None,
7925 },
7926 Lint {
7927 label: "extend_one_unchecked",
7928 description: r##"# `extend_one_unchecked`
7929
7930
7931
7932This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
7933
7934------------------------
7935"##,
7936 default_severity: Severity::Allow,
7937 warn_since: None,
7938 deny_since: None,
7939 },
7940 Lint {
7941 label: "extern_item_impls",
7942 description: r##"# `extern_item_impls`
7943
7944Externally implementable items
7945
7946The tracking issue for this feature is: [#125418]
7947
7948[#125418]: https://github.com/rust-lang/rust/issues/125418
7949
7950------------------------
7951"##,
7952 default_severity: Severity::Allow,
7953 warn_since: None,
7954 deny_since: None,
7955 },
7956 Lint {
7957 label: "extern_types",
7958 description: r##"# `extern_types`
7959
7960Allows defining `extern type`s.
7961
7962The tracking issue for this feature is: [#43467]
7963
7964[#43467]: https://github.com/rust-lang/rust/issues/43467
7965
7966------------------------
7967"##,
7968 default_severity: Severity::Allow,
7969 warn_since: None,
7970 deny_since: None,
7971 },
7972 Lint {
7973 label: "f128",
7974 description: r##"# `f128`
7975
7976The tracking issue for this feature is: [#116909]
7977
7978[#116909]: https://github.com/rust-lang/rust/issues/116909
7979
7980---
7981
7982Enable the `f128` type for IEEE 128-bit floating numbers (quad precision).
7983"##,
7984 default_severity: Severity::Allow,
7985 warn_since: None,
7986 deny_since: None,
7987 },
7988 Lint {
7989 label: "f16",
7990 description: r##"# `f16`
7991
7992The tracking issue for this feature is: [#116909]
7993
7994[#116909]: https://github.com/rust-lang/rust/issues/116909
7995
7996---
7997
7998Enable the `f16` type for IEEE 16-bit floating numbers (half precision).
7999"##,
8000 default_severity: Severity::Allow,
8001 warn_since: None,
8002 deny_since: None,
8003 },
8004 Lint {
8005 label: "f32_from_f16",
8006 description: r##"# `f32_from_f16`
8007
8008
8009
8010The tracking issue for this feature is: [#154005]
8011
8012[#154005]: https://github.com/rust-lang/rust/issues/154005
8013
8014------------------------
8015"##,
8016 default_severity: Severity::Allow,
8017 warn_since: None,
8018 deny_since: None,
8019 },
8020 Lint {
8021 label: "fd",
8022 description: r##"# `fd`
8023
8024This feature is internal to the Rust compiler and is not intended for general use.
8025
8026------------------------
8027"##,
8028 default_severity: Severity::Allow,
8029 warn_since: None,
8030 deny_since: None,
8031 },
8032 Lint {
8033 label: "ffi_const",
8034 description: r##"# `ffi_const`
8035
8036The tracking issue for this feature is: [#58328]
8037
8038------
8039
8040The `#[ffi_const]` attribute applies clang's `const` attribute to foreign
8041functions declarations.
8042
8043That is, `#[ffi_const]` functions shall have no effects except for its return
8044value, which can only depend on the values of the function parameters, and is
8045not affected by changes to the observable state of the program.
8046
8047Applying the `#[ffi_const]` attribute to a function that violates these
8048requirements is undefined behaviour.
8049
8050This attribute enables Rust to perform common optimizations, like sub-expression
8051elimination, and it can avoid emitting some calls in repeated invocations of the
8052function with the same argument values regardless of other operations being
8053performed in between these functions calls (as opposed to `#[ffi_pure]`
8054functions).
8055
8056## Pitfalls
8057
8058A `#[ffi_const]` function can only read global memory that would not affect
8059its return value for the whole execution of the program (e.g. immutable global
8060memory). `#[ffi_const]` functions are referentially-transparent and therefore
8061more strict than `#[ffi_pure]` functions.
8062
8063A common pitfall involves applying the `#[ffi_const]` attribute to a
8064function that reads memory through pointer arguments which do not necessarily
8065point to immutable global memory.
8066
8067A `#[ffi_const]` function that returns unit has no effect on the abstract
8068machine's state, and a `#[ffi_const]` function cannot be `#[ffi_pure]`.
8069
8070A `#[ffi_const]` function must not diverge, neither via a side effect (e.g. a
8071call to `abort`) nor by infinite loops.
8072
8073When translating C headers to Rust FFI, it is worth verifying for which targets
8074the `const` attribute is enabled in those headers, and using the appropriate
8075`cfg` macros in the Rust side to match those definitions. While the semantics of
8076`const` are implemented identically by many C and C++ compilers, e.g., clang,
8077[GCC], [ARM C/C++ compiler], [IBM ILE C/C++], etc. they are not necessarily
8078implemented in this way on all of them. It is therefore also worth verifying
8079that the semantics of the C toolchain used to compile the binary being linked
8080against are compatible with those of the `#[ffi_const]`.
8081
8082[#58328]: https://github.com/rust-lang/rust/issues/58328
8083[ARM C/C++ compiler]: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0491c/Cacgigch.html
8084[GCC]: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-const-function-attribute
8085[IBM ILE C/C++]: https://www.ibm.com/support/knowledgecenter/fr/ssw_ibm_i_71/rzarg/fn_attrib_const.htm
8086"##,
8087 default_severity: Severity::Allow,
8088 warn_since: None,
8089 deny_since: None,
8090 },
8091 Lint {
8092 label: "ffi_pure",
8093 description: r##"# `ffi_pure`
8094
8095The tracking issue for this feature is: [#58329]
8096
8097------
8098
8099The `#[ffi_pure]` attribute applies clang's `pure` attribute to foreign
8100functions declarations.
8101
8102That is, `#[ffi_pure]` functions shall have no effects except for its return
8103value, which shall not change across two consecutive function calls with
8104the same parameters.
8105
8106Applying the `#[ffi_pure]` attribute to a function that violates these
8107requirements is undefined behavior.
8108
8109This attribute enables Rust to perform common optimizations, like sub-expression
8110elimination and loop optimizations. Some common examples of pure functions are
8111`strlen` or `memcmp`.
8112
8113These optimizations are only applicable when the compiler can prove that no
8114program state observable by the `#[ffi_pure]` function has changed between calls
8115of the function, which could alter the result. See also the `#[ffi_const]`
8116attribute, which provides stronger guarantees regarding the allowable behavior
8117of a function, enabling further optimization.
8118
8119## Pitfalls
8120
8121A `#[ffi_pure]` function can read global memory through the function
8122parameters (e.g. pointers), globals, etc. `#[ffi_pure]` functions are not
8123referentially-transparent, and are therefore more relaxed than `#[ffi_const]`
8124functions.
8125
8126However, accessing global memory through volatile or atomic reads can violate the
8127requirement that two consecutive function calls shall return the same value.
8128
8129A `pure` function that returns unit has no effect on the abstract machine's
8130state.
8131
8132A `#[ffi_pure]` function must not diverge, neither via a side effect (e.g. a
8133call to `abort`) nor by infinite loops.
8134
8135When translating C headers to Rust FFI, it is worth verifying for which targets
8136the `pure` attribute is enabled in those headers, and using the appropriate
8137`cfg` macros in the Rust side to match those definitions. While the semantics of
8138`pure` are implemented identically by many C and C++ compilers, e.g., clang,
8139[GCC], [ARM C/C++ compiler], [IBM ILE C/C++], etc. they are not necessarily
8140implemented in this way on all of them. It is therefore also worth verifying
8141that the semantics of the C toolchain used to compile the binary being linked
8142against are compatible with those of the `#[ffi_pure]`.
8143
8144
8145[#58329]: https://github.com/rust-lang/rust/issues/58329
8146[ARM C/C++ compiler]: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0491c/Cacigdac.html
8147[GCC]: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-pure-function-attribute
8148[IBM ILE C/C++]: https://www.ibm.com/support/knowledgecenter/fr/ssw_ibm_i_71/rzarg/fn_attrib_pure.htm
8149"##,
8150 default_severity: Severity::Allow,
8151 warn_since: None,
8152 deny_since: None,
8153 },
8154 Lint {
8155 label: "field_projections",
8156 description: r##"# `field_projections`
8157
8158Experimental field projections.
8159
8160The tracking issue for this feature is: [#145383]
8161
8162[#145383]: https://github.com/rust-lang/rust/issues/145383
8163
8164------------------------
8165"##,
8166 default_severity: Severity::Allow,
8167 warn_since: None,
8168 deny_since: None,
8169 },
8170 Lint {
8171 label: "field_representing_type_raw",
8172 description: r##"# `field_representing_type_raw`
8173
8174Implementation details of field representing types.
8175
8176This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
8177
8178------------------------
8179"##,
8180 default_severity: Severity::Allow,
8181 warn_since: None,
8182 deny_since: None,
8183 },
8184 Lint {
8185 label: "file_buffered",
8186 description: r##"# `file_buffered`
8187
8188
8189
8190The tracking issue for this feature is: [#130804]
8191
8192[#130804]: https://github.com/rust-lang/rust/issues/130804
8193
8194------------------------
8195"##,
8196 default_severity: Severity::Allow,
8197 warn_since: None,
8198 deny_since: None,
8199 },
8200 Lint {
8201 label: "final_associated_functions",
8202 description: r##"# `final_associated_functions`
8203
8204Allows marking trait functions as `final` to prevent overriding impls
8205
8206The tracking issue for this feature is: [#131179]
8207
8208[#131179]: https://github.com/rust-lang/rust/issues/131179
8209
8210------------------------
8211"##,
8212 default_severity: Severity::Allow,
8213 warn_since: None,
8214 deny_since: None,
8215 },
8216 Lint {
8217 label: "float_algebraic",
8218 description: r##"# `float_algebraic`
8219
8220
8221
8222The tracking issue for this feature is: [#136469]
8223
8224[#136469]: https://github.com/rust-lang/rust/issues/136469
8225
8226------------------------
8227"##,
8228 default_severity: Severity::Allow,
8229 warn_since: None,
8230 deny_since: None,
8231 },
8232 Lint {
8233 label: "float_bits_const",
8234 description: r##"# `float_bits_const`
8235
8236
8237
8238The tracking issue for this feature is: [#151073]
8239
8240[#151073]: https://github.com/rust-lang/rust/issues/151073
8241
8242------------------------
8243"##,
8244 default_severity: Severity::Allow,
8245 warn_since: None,
8246 deny_since: None,
8247 },
8248 Lint {
8249 label: "float_erf",
8250 description: r##"# `float_erf`
8251
8252
8253
8254The tracking issue for this feature is: [#136321]
8255
8256[#136321]: https://github.com/rust-lang/rust/issues/136321
8257
8258------------------------
8259"##,
8260 default_severity: Severity::Allow,
8261 warn_since: None,
8262 deny_since: None,
8263 },
8264 Lint {
8265 label: "float_exact_integer_constants",
8266 description: r##"# `float_exact_integer_constants`
8267
8268
8269
8270The tracking issue for this feature is: [#152466]
8271
8272[#152466]: https://github.com/rust-lang/rust/issues/152466
8273
8274------------------------
8275"##,
8276 default_severity: Severity::Allow,
8277 warn_since: None,
8278 deny_since: None,
8279 },
8280 Lint {
8281 label: "float_gamma",
8282 description: r##"# `float_gamma`
8283
8284
8285
8286The tracking issue for this feature is: [#99842]
8287
8288[#99842]: https://github.com/rust-lang/rust/issues/99842
8289
8290------------------------
8291"##,
8292 default_severity: Severity::Allow,
8293 warn_since: None,
8294 deny_since: None,
8295 },
8296 Lint {
8297 label: "float_masks",
8298 description: r##"# `float_masks`
8299
8300
8301
8302The tracking issue for this feature is: [#154064]
8303
8304[#154064]: https://github.com/rust-lang/rust/issues/154064
8305
8306------------------------
8307"##,
8308 default_severity: Severity::Allow,
8309 warn_since: None,
8310 deny_since: None,
8311 },
8312 Lint {
8313 label: "float_minimum_maximum",
8314 description: r##"# `float_minimum_maximum`
8315
8316
8317
8318The tracking issue for this feature is: [#91079]
8319
8320[#91079]: https://github.com/rust-lang/rust/issues/91079
8321
8322------------------------
8323"##,
8324 default_severity: Severity::Allow,
8325 warn_since: None,
8326 deny_since: None,
8327 },
8328 Lint {
8329 label: "flt2dec",
8330 description: r##"# `flt2dec`
8331
8332This feature is internal to the Rust compiler and is not intended for general use.
8333
8334------------------------
8335"##,
8336 default_severity: Severity::Allow,
8337 warn_since: None,
8338 deny_since: None,
8339 },
8340 Lint {
8341 label: "fma4_target_feature",
8342 description: r##"# `fma4_target_feature`
8343
8344fma4 target feature on x86.
8345
8346The tracking issue for this feature is: [#155233]
8347
8348[#155233]: https://github.com/rust-lang/rust/issues/155233
8349
8350------------------------
8351"##,
8352 default_severity: Severity::Allow,
8353 warn_since: None,
8354 deny_since: None,
8355 },
8356 Lint {
8357 label: "fmt_arguments_from_str",
8358 description: r##"# `fmt_arguments_from_str`
8359
8360
8361
8362The tracking issue for this feature is: [#148905]
8363
8364[#148905]: https://github.com/rust-lang/rust/issues/148905
8365
8366------------------------
8367"##,
8368 default_severity: Severity::Allow,
8369 warn_since: None,
8370 deny_since: None,
8371 },
8372 Lint {
8373 label: "fmt_debug",
8374 description: r##"# `fmt_debug`
8375
8376Controlling the behavior of fmt::Debug
8377
8378The tracking issue for this feature is: [#129709]
8379
8380[#129709]: https://github.com/rust-lang/rust/issues/129709
8381
8382------------------------
8383"##,
8384 default_severity: Severity::Allow,
8385 warn_since: None,
8386 deny_since: None,
8387 },
8388 Lint {
8389 label: "fmt_helpers_for_derive",
8390 description: r##"# `fmt_helpers_for_derive`
8391
8392
8393
8394This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
8395
8396------------------------
8397"##,
8398 default_severity: Severity::Allow,
8399 warn_since: None,
8400 deny_since: None,
8401 },
8402 Lint {
8403 label: "fmt_internals",
8404 description: r##"# `fmt_internals`
8405
8406This feature is internal to the Rust compiler and is not intended for general use.
8407
8408------------------------
8409"##,
8410 default_severity: Severity::Allow,
8411 warn_since: None,
8412 deny_since: None,
8413 },
8414 Lint {
8415 label: "fn_align",
8416 description: r##"# `fn_align`
8417
8418Allows using `#[align(...)]` on function items
8419
8420The tracking issue for this feature is: [#82232]
8421
8422[#82232]: https://github.com/rust-lang/rust/issues/82232
8423
8424------------------------
8425"##,
8426 default_severity: Severity::Allow,
8427 warn_since: None,
8428 deny_since: None,
8429 },
8430 Lint {
8431 label: "fn_delegation",
8432 description: r##"# `fn_delegation`
8433
8434Support delegating implementation of functions to other already implemented functions.
8435
8436The tracking issue for this feature is: [#118212]
8437
8438[#118212]: https://github.com/rust-lang/rust/issues/118212
8439
8440------------------------
8441"##,
8442 default_severity: Severity::Allow,
8443 warn_since: None,
8444 deny_since: None,
8445 },
8446 Lint {
8447 label: "fn_ptr_trait",
8448 description: r##"# `fn_ptr_trait`
8449
8450
8451
8452This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
8453
8454------------------------
8455"##,
8456 default_severity: Severity::Allow,
8457 warn_since: None,
8458 deny_since: None,
8459 },
8460 Lint {
8461 label: "fn_traits",
8462 description: r##"# `fn_traits`
8463
8464The tracking issue for this feature is [#29625]
8465
8466See Also: [`unboxed_closures`](../language-features/unboxed-closures.md)
8467
8468[#29625]: https://github.com/rust-lang/rust/issues/29625
8469
8470----
8471
8472The `fn_traits` feature allows for implementation of the [`Fn*`] traits
8473for creating custom closure-like types.
8474
8475[`Fn*`]: ../../std/ops/trait.Fn.html
8476
8477```rust
8478#![feature(unboxed_closures)]
8479#![feature(fn_traits)]
8480
8481struct Adder {
8482 a: u32
8483}
8484
8485impl FnOnce<(u32, )> for Adder {
8486 type Output = u32;
8487 extern "rust-call" fn call_once(self, b: (u32, )) -> Self::Output {
8488 self.a + b.0
8489 }
8490}
8491
8492fn main() {
8493 let adder = Adder { a: 3 };
8494 assert_eq!(adder(2), 5);
8495}
8496```
8497"##,
8498 default_severity: Severity::Allow,
8499 warn_since: None,
8500 deny_since: None,
8501 },
8502 Lint {
8503 label: "forget_unsized",
8504 description: r##"# `forget_unsized`
8505
8506
8507
8508This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
8509
8510------------------------
8511"##,
8512 default_severity: Severity::Allow,
8513 warn_since: None,
8514 deny_since: None,
8515 },
8516 Lint {
8517 label: "format_args_nl",
8518 description: r##"# `format_args_nl`
8519
8520
8521
8522This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
8523
8524------------------------
8525"##,
8526 default_severity: Severity::Allow,
8527 warn_since: None,
8528 deny_since: None,
8529 },
8530 Lint {
8531 label: "formatting_options",
8532 description: r##"# `formatting_options`
8533
8534
8535
8536The tracking issue for this feature is: [#118117]
8537
8538[#118117]: https://github.com/rust-lang/rust/issues/118117
8539
8540------------------------
8541"##,
8542 default_severity: Severity::Allow,
8543 warn_since: None,
8544 deny_since: None,
8545 },
8546 Lint {
8547 label: "freeze",
8548 description: r##"# `freeze`
8549
8550
8551
8552The tracking issue for this feature is: [#121675]
8553
8554[#121675]: https://github.com/rust-lang/rust/issues/121675
8555
8556------------------------
8557"##,
8558 default_severity: Severity::Allow,
8559 warn_since: None,
8560 deny_since: None,
8561 },
8562 Lint {
8563 label: "freeze_impls",
8564 description: r##"# `freeze_impls`
8565
8566Allows impls for the Freeze trait.
8567
8568The tracking issue for this feature is: [#121675]
8569
8570[#121675]: https://github.com/rust-lang/rust/issues/121675
8571
8572------------------------
8573"##,
8574 default_severity: Severity::Allow,
8575 warn_since: None,
8576 deny_since: None,
8577 },
8578 Lint {
8579 label: "frontmatter",
8580 description: r##"# `frontmatter`
8581
8582The tracking issue for this feature is: [#136889]
8583
8584------
8585
8586The `frontmatter` feature allows an extra metadata block at the top of files for consumption by
8587external tools. For example, it can be used by [`cargo-script`] files to specify dependencies.
8588
8589```rust
8590#!/usr/bin/env -S cargo -Zscript
8591---
8592[dependencies]
8593libc = "0.2.172"
8594---
8595#![feature(frontmatter)]
8596# mod libc { pub type c_int = i32; }
8597
8598fn main() {
8599 let x: libc::c_int = 1i32;
8600}
8601```
8602
8603[#136889]: https://github.com/rust-lang/rust/issues/136889
8604[`cargo-script`]: https://rust-lang.github.io/rfcs/3502-cargo-script.html
8605"##,
8606 default_severity: Severity::Allow,
8607 warn_since: None,
8608 deny_since: None,
8609 },
8610 Lint {
8611 label: "fs_set_times",
8612 description: r##"# `fs_set_times`
8613
8614
8615
8616The tracking issue for this feature is: [#147455]
8617
8618[#147455]: https://github.com/rust-lang/rust/issues/147455
8619
8620------------------------
8621"##,
8622 default_severity: Severity::Allow,
8623 warn_since: None,
8624 deny_since: None,
8625 },
8626 Lint {
8627 label: "fundamental",
8628 description: r##"# `fundamental`
8629
8630Allows using the `#[fundamental]` attribute.
8631
8632The tracking issue for this feature is: [#29635]
8633
8634[#29635]: https://github.com/rust-lang/rust/issues/29635
8635
8636------------------------
8637"##,
8638 default_severity: Severity::Allow,
8639 warn_since: None,
8640 deny_since: None,
8641 },
8642 Lint {
8643 label: "funnel_shifts",
8644 description: r##"# `funnel_shifts`
8645
8646
8647
8648The tracking issue for this feature is: [#145686]
8649
8650[#145686]: https://github.com/rust-lang/rust/issues/145686
8651
8652------------------------
8653"##,
8654 default_severity: Severity::Allow,
8655 warn_since: None,
8656 deny_since: None,
8657 },
8658 Lint {
8659 label: "future_join",
8660 description: r##"# `future_join`
8661
8662
8663
8664The tracking issue for this feature is: [#91642]
8665
8666[#91642]: https://github.com/rust-lang/rust/issues/91642
8667
8668------------------------
8669"##,
8670 default_severity: Severity::Allow,
8671 warn_since: None,
8672 deny_since: None,
8673 },
8674 Lint {
8675 label: "gen_blocks",
8676 description: r##"# `gen_blocks`
8677
8678Allows defining gen blocks and `gen fn`.
8679
8680The tracking issue for this feature is: [#117078]
8681
8682[#117078]: https://github.com/rust-lang/rust/issues/117078
8683
8684------------------------
8685"##,
8686 default_severity: Severity::Allow,
8687 warn_since: None,
8688 deny_since: None,
8689 },
8690 Lint {
8691 label: "gen_future",
8692 description: r##"# `gen_future`
8693
8694
8695
8696This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
8697
8698------------------------
8699"##,
8700 default_severity: Severity::Allow,
8701 warn_since: None,
8702 deny_since: None,
8703 },
8704 Lint {
8705 label: "generic_assert",
8706 description: r##"# `generic_assert`
8707
8708Outputs useful `assert!` messages
8709
8710This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
8711
8712------------------------
8713"##,
8714 default_severity: Severity::Allow,
8715 warn_since: None,
8716 deny_since: None,
8717 },
8718 Lint {
8719 label: "generic_assert_internals",
8720 description: r##"# `generic_assert_internals`
8721
8722
8723
8724The tracking issue for this feature is: [#44838]
8725
8726[#44838]: https://github.com/rust-lang/rust/issues/44838
8727
8728------------------------
8729"##,
8730 default_severity: Severity::Allow,
8731 warn_since: None,
8732 deny_since: None,
8733 },
8734 Lint {
8735 label: "generic_atomic",
8736 description: r##"# `generic_atomic`
8737
8738
8739
8740The tracking issue for this feature is: [#130539]
8741
8742[#130539]: https://github.com/rust-lang/rust/issues/130539
8743
8744------------------------
8745"##,
8746 default_severity: Severity::Allow,
8747 warn_since: None,
8748 deny_since: None,
8749 },
8750 Lint {
8751 label: "generic_const_args",
8752 description: r##"# generic_const_args
8753
8754Allows using generics in more complex const expressions, based on definitional equality.
8755
8756The tracking issue for this feature is: [#151972]
8757
8758[#151972]: https://github.com/rust-lang/rust/issues/151972
8759
8760------------------------
8761
8762Warning: This feature is incomplete; its design and syntax may change.
8763
8764This feature enables many of the same use cases supported by [generic_const_exprs],
8765but based on the machinery developed for [min_generic_const_args]. In a way, it is
8766meant to be an interim successor for GCE (though it might not currently support all
8767the valid cases that supported by GCE).
8768
8769See also: [generic_const_items]
8770
8771[min_generic_const_args]: min-generic-const-args.md
8772[generic_const_exprs]: generic-const-exprs.md
8773[generic_const_items]: generic-const-items.md
8774
8775## Examples
8776
8777<!-- NOTE(ignore) generic_const_args requires -Znext-solver to compile -->
8778```rust,ignore (requires-Z-next-solver)
8779#![feature(generic_const_items)]
8780#![feature(min_generic_const_args)]
8781#![feature(generic_const_args)]
8782#![expect(incomplete_features)]
8783
8784type const ADD1<const N: usize>: usize = const { N + 1 };
8785
8786type const INC<const N: usize>: usize = ADD1::<N>;
8787
8788const ARR: [(); ADD1::<0>] = [(); INC::<0>];
8789```
8790"##,
8791 default_severity: Severity::Allow,
8792 warn_since: None,
8793 deny_since: None,
8794 },
8795 Lint {
8796 label: "generic_const_exprs",
8797 description: r##"# generic_const_exprs
8798
8799Allows non-trivial generic constants which have to be shown to successfully evaluate
8800to a value by being part of an item signature.
8801
8802The tracking issue for this feature is: [#76560]
8803
8804
8805[#76560]: https://github.com/rust-lang/rust/issues/76560
8806
8807------------------------
8808
8809Warning: This feature is incomplete; its design and syntax may change.
8810
8811See also: [min_generic_const_args], [generic_const_args]
8812
8813[min_generic_const_args]: min-generic-const-args.md
8814[generic_const_args]: generic-const-args.md
8815
8816## Examples
8817
8818```rust
8819#![allow(incomplete_features)]
8820#![feature(generic_const_exprs)]
8821
8822// Use parameters that depend on a generic argument.
8823struct Foo<const N: usize>
8824where
8825 [(); N + 1]:,
8826{
8827 array: [usize; N + 1],
8828}
8829
8830// Use generic parameters in const operations.
8831trait Bar {
8832 const X: usize;
8833 const Y: usize;
8834}
8835
8836// Note `B::X * B::Y`.
8837const fn baz<B: Bar>(x: [usize; B::X], y: [usize; B::Y]) -> [usize; B::X * B::Y] {
8838 let mut out = [0; B::X * B::Y];
8839 let mut i = 0;
8840 while i < B::Y {
8841 let mut j = 0;
8842 while j < B::X {
8843 out[i * B::X + j] = y[i].saturating_mul(x[j]);
8844 j += 1;
8845 }
8846 i += 1;
8847 }
8848 out
8849}
8850
8851
8852// Create a new type based on a generic argument.
8853pub struct Grow<const N: usize> {
8854 arr: [usize; N],
8855}
8856
8857impl<const N: usize> Grow<N> {
8858 pub const fn grow(self, val: usize) -> Grow<{ N + 1 }> {
8859 let mut new_arr = [0; { N + 1 }];
8860 let mut idx = 0;
8861 while idx < N {
8862 new_arr[idx] = self.arr[idx];
8863 idx += 1;
8864 }
8865 new_arr[N] = val;
8866 Grow { arr: new_arr }
8867 }
8868}
8869```
8870"##,
8871 default_severity: Severity::Allow,
8872 warn_since: None,
8873 deny_since: None,
8874 },
8875 Lint {
8876 label: "generic_const_items",
8877 description: r##"# generic_const_items
8878
8879Allows generic parameters and where-clauses on free & associated const items.
8880
8881The tracking issue for this feature is: [#113521]
8882
8883[#113521]: https://github.com/rust-lang/rust/issues/113521
8884
8885------------------------
8886
8887Warning: This feature is an [experiment] and lacks an RFC.
8888There are no guarantees that it will ever be stabilized.
8889
8890See also: [generic_const_exprs], [min_generic_const_args].
8891
8892[experiment]: https://lang-team.rust-lang.org/how_to/experiment.html
8893[generic_const_exprs]: generic-const-exprs.md
8894[min_generic_const_args]: min-generic-const-args.md
8895
8896## Examples
8897
8898### Generic constant values
8899
8900```rust
8901#![allow(incomplete_features)]
8902#![feature(generic_const_items)]
8903
8904const GENERIC_VAL<const ARG: usize>: usize = ARG + 1;
8905
8906#[test]
8907fn generic_const_arg() {
8908 assert_eq!(GENERIC_VAL::<1>, 2);
8909 assert_eq!(GENERIC_VAL::<2>, 3);
8910}
8911```
8912
8913### Conditional constants
8914
8915```rust
8916#![allow(incomplete_features)]
8917#![feature(generic_const_items)]
8918
8919// `GENERIC_VAL::<0>` will fail to compile
8920const GENERIC_VAL<const ARG: usize>: usize = if ARG > 0 { ARG + 1 } else { panic!("0 value") };
8921
8922// Will fail to compile if the `Copy` derive is removed.
8923const COPY_MARKER<C: Copy>: () = ();
8924
8925#[derive(Clone, Copy)]
8926struct Foo;
8927
8928const FOO_IS_COPY: () = COPY_MARKER::<Foo>;
8929```
8930"##,
8931 default_severity: Severity::Allow,
8932 warn_since: None,
8933 deny_since: None,
8934 },
8935 Lint {
8936 label: "generic_const_parameter_types",
8937 description: r##"# `generic_const_parameter_types`
8938
8939Allows the type of const generics to depend on generic parameters
8940
8941The tracking issue for this feature is: [#137626]
8942
8943[#137626]: https://github.com/rust-lang/rust/issues/137626
8944
8945------------------------
8946"##,
8947 default_severity: Severity::Allow,
8948 warn_since: None,
8949 deny_since: None,
8950 },
8951 Lint {
8952 label: "generic_pattern_types",
8953 description: r##"# `generic_pattern_types`
8954
8955Allows any generic constants being used as pattern type range ends
8956
8957The tracking issue for this feature is: [#136574]
8958
8959[#136574]: https://github.com/rust-lang/rust/issues/136574
8960
8961------------------------
8962"##,
8963 default_severity: Severity::Allow,
8964 warn_since: None,
8965 deny_since: None,
8966 },
8967 Lint {
8968 label: "get_disjoint_mut_helpers",
8969 description: r##"# `get_disjoint_mut_helpers`
8970
8971
8972
8973This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
8974
8975------------------------
8976"##,
8977 default_severity: Severity::Allow,
8978 warn_since: None,
8979 deny_since: None,
8980 },
8981 Lint {
8982 label: "get_mut_unchecked",
8983 description: r##"# `get_mut_unchecked`
8984
8985
8986
8987The tracking issue for this feature is: [#63292]
8988
8989[#63292]: https://github.com/rust-lang/rust/issues/63292
8990
8991------------------------
8992"##,
8993 default_severity: Severity::Allow,
8994 warn_since: None,
8995 deny_since: None,
8996 },
8997 Lint {
8998 label: "gethostname",
8999 description: r##"# `gethostname`
9000
9001
9002
9003The tracking issue for this feature is: [#135142]
9004
9005[#135142]: https://github.com/rust-lang/rust/issues/135142
9006
9007------------------------
9008"##,
9009 default_severity: Severity::Allow,
9010 warn_since: None,
9011 deny_since: None,
9012 },
9013 Lint {
9014 label: "global_registration",
9015 description: r##"# `global_registration`
9016
9017Allows registering static items globally, possibly across crates, to iterate over at runtime.
9018
9019The tracking issue for this feature is: [#125119]
9020
9021[#125119]: https://github.com/rust-lang/rust/issues/125119
9022
9023------------------------
9024"##,
9025 default_severity: Severity::Allow,
9026 warn_since: None,
9027 deny_since: None,
9028 },
9029 Lint {
9030 label: "gpu_intrinsics",
9031 description: r##"# `gpu_intrinsics`
9032
9033
9034
9035This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
9036
9037------------------------
9038"##,
9039 default_severity: Severity::Allow,
9040 warn_since: None,
9041 deny_since: None,
9042 },
9043 Lint {
9044 label: "gpu_launch_sized_workgroup_mem",
9045 description: r##"# `gpu_launch_sized_workgroup_mem`
9046
9047
9048
9049The tracking issue for this feature is: [#135513]
9050
9051[#135513]: https://github.com/rust-lang/rust/issues/135513
9052
9053------------------------
9054"##,
9055 default_severity: Severity::Allow,
9056 warn_since: None,
9057 deny_since: None,
9058 },
9059 Lint {
9060 label: "guard_patterns",
9061 description: r##"# `guard_patterns`
9062
9063Allows using guards in patterns.
9064
9065The tracking issue for this feature is: [#129967]
9066
9067[#129967]: https://github.com/rust-lang/rust/issues/129967
9068
9069------------------------
9070"##,
9071 default_severity: Severity::Allow,
9072 warn_since: None,
9073 deny_since: None,
9074 },
9075 Lint {
9076 label: "half_open_range_patterns_in_slices",
9077 description: r##"# `half_open_range_patterns_in_slices`
9078
9079The tracking issue for this feature is: [#67264]
9080It is a future part of the `exclusive_range_pattern` feature,
9081tracked at [#37854].
9082
9083[#67264]: https://github.com/rust-lang/rust/issues/67264
9084[#37854]: https://github.com/rust-lang/rust/issues/37854
9085-----
9086
9087This feature allow using top-level half-open range patterns in slices.
9088
9089```rust
9090#![feature(half_open_range_patterns_in_slices)]
9091
9092fn main() {
9093 let xs = [13, 1, 5, 2, 3, 1, 21, 8];
9094 let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs else { return; };
9095}
9096```
9097
9098Note that this feature is not required if the patterns are wrapped between parenthesis.
9099
9100```rust
9101fn main() {
9102 let xs = [13, 1];
9103 let [(a @ 3..), c] = xs else { return; };
9104}
9105```
9106"##,
9107 default_severity: Severity::Allow,
9108 warn_since: None,
9109 deny_since: None,
9110 },
9111 Lint {
9112 label: "hash_map_internals",
9113 description: r##"# `hash_map_internals`
9114
9115
9116
9117This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
9118
9119------------------------
9120"##,
9121 default_severity: Severity::Allow,
9122 warn_since: None,
9123 deny_since: None,
9124 },
9125 Lint {
9126 label: "hash_map_macro",
9127 description: r##"# `hash_map_macro`
9128
9129
9130
9131The tracking issue for this feature is: [#144032]
9132
9133[#144032]: https://github.com/rust-lang/rust/issues/144032
9134
9135------------------------
9136"##,
9137 default_severity: Severity::Allow,
9138 warn_since: None,
9139 deny_since: None,
9140 },
9141 Lint {
9142 label: "hash_set_entry",
9143 description: r##"# `hash_set_entry`
9144
9145
9146
9147The tracking issue for this feature is: [#60896]
9148
9149[#60896]: https://github.com/rust-lang/rust/issues/60896
9150
9151------------------------
9152"##,
9153 default_severity: Severity::Allow,
9154 warn_since: None,
9155 deny_since: None,
9156 },
9157 Lint {
9158 label: "hasher_prefixfree_extras",
9159 description: r##"# `hasher_prefixfree_extras`
9160
9161
9162
9163The tracking issue for this feature is: [#96762]
9164
9165[#96762]: https://github.com/rust-lang/rust/issues/96762
9166
9167------------------------
9168"##,
9169 default_severity: Severity::Allow,
9170 warn_since: None,
9171 deny_since: None,
9172 },
9173 Lint {
9174 label: "hashmap_internals",
9175 description: r##"# `hashmap_internals`
9176
9177
9178
9179This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
9180
9181------------------------
9182"##,
9183 default_severity: Severity::Allow,
9184 warn_since: None,
9185 deny_since: None,
9186 },
9187 Lint {
9188 label: "hexagon_target_feature",
9189 description: r##"# `hexagon_target_feature`
9190
9191Target features on hexagon.
9192
9193The tracking issue for this feature is: [#150250]
9194
9195[#150250]: https://github.com/rust-lang/rust/issues/150250
9196
9197------------------------
9198"##,
9199 default_severity: Severity::Allow,
9200 warn_since: None,
9201 deny_since: None,
9202 },
9203 Lint {
9204 label: "hint_must_use",
9205 description: r##"# `hint_must_use`
9206
9207
9208
9209The tracking issue for this feature is: [#94745]
9210
9211[#94745]: https://github.com/rust-lang/rust/issues/94745
9212
9213------------------------
9214"##,
9215 default_severity: Severity::Allow,
9216 warn_since: None,
9217 deny_since: None,
9218 },
9219 Lint {
9220 label: "hint_prefetch",
9221 description: r##"# `hint_prefetch`
9222
9223
9224
9225The tracking issue for this feature is: [#146941]
9226
9227[#146941]: https://github.com/rust-lang/rust/issues/146941
9228
9229------------------------
9230"##,
9231 default_severity: Severity::Allow,
9232 warn_since: None,
9233 deny_since: None,
9234 },
9235 Lint {
9236 label: "impl_restriction",
9237 description: r##"# `impl_restriction`
9238
9239Allows `impl(crate) trait Foo` restrictions.
9240
9241The tracking issue for this feature is: [#105077]
9242
9243[#105077]: https://github.com/rust-lang/rust/issues/105077
9244
9245------------------------
9246"##,
9247 default_severity: Severity::Allow,
9248 warn_since: None,
9249 deny_since: None,
9250 },
9251 Lint {
9252 label: "impl_trait_in_assoc_type",
9253 description: r##"# `impl_trait_in_assoc_type`
9254
9255Allows `impl Trait` to be used inside associated types (RFC 2515).
9256
9257The tracking issue for this feature is: [#63063]
9258
9259[#63063]: https://github.com/rust-lang/rust/issues/63063
9260
9261------------------------
9262"##,
9263 default_severity: Severity::Allow,
9264 warn_since: None,
9265 deny_since: None,
9266 },
9267 Lint {
9268 label: "impl_trait_in_bindings",
9269 description: r##"# `impl_trait_in_bindings`
9270
9271Allows `impl Trait` in bindings (`let`).
9272
9273The tracking issue for this feature is: [#63065]
9274
9275[#63065]: https://github.com/rust-lang/rust/issues/63065
9276
9277------------------------
9278"##,
9279 default_severity: Severity::Allow,
9280 warn_since: None,
9281 deny_since: None,
9282 },
9283 Lint {
9284 label: "impl_trait_in_fn_trait_return",
9285 description: r##"# `impl_trait_in_fn_trait_return`
9286
9287Allows `impl Trait` as output type in `Fn` traits in return position of functions.
9288
9289The tracking issue for this feature is: [#99697]
9290
9291[#99697]: https://github.com/rust-lang/rust/issues/99697
9292
9293------------------------
9294"##,
9295 default_severity: Severity::Allow,
9296 warn_since: None,
9297 deny_since: None,
9298 },
9299 Lint {
9300 label: "import_trait_associated_functions",
9301 description: r##"# import_trait_associated_functions
9302
9303The tracking issue for this feature is: [#134691]
9304
9305[#134691]: https://github.com/rust-lang/rust/issues/134691
9306
9307------------------------
9308
9309This feature allows importing associated functions and constants from traits and then using them like regular items.
9310
9311```rust
9312#![feature(import_trait_associated_functions)]
9313
9314use std::ops::Add::add;
9315
9316fn main() {
9317 let numbers = vec![1, 2, 3, 4, 5, 6];
9318 let sum = numbers.into_iter().reduce(add); // instead of `.reduce(Add:add)`
9319
9320 assert_eq!(sum, Some(21));
9321}
9322```
9323"##,
9324 default_severity: Severity::Allow,
9325 warn_since: None,
9326 deny_since: None,
9327 },
9328 Lint {
9329 label: "inherent_associated_types",
9330 description: r##"# `inherent_associated_types`
9331
9332Allows associated types in inherent impls.
9333
9334The tracking issue for this feature is: [#8995]
9335
9336[#8995]: https://github.com/rust-lang/rust/issues/8995
9337
9338------------------------
9339"##,
9340 default_severity: Severity::Allow,
9341 warn_since: None,
9342 deny_since: None,
9343 },
9344 Lint {
9345 label: "inplace_iteration",
9346 description: r##"# `inplace_iteration`
9347
9348
9349
9350This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
9351
9352------------------------
9353"##,
9354 default_severity: Severity::Allow,
9355 warn_since: None,
9356 deny_since: None,
9357 },
9358 Lint {
9359 label: "int_format_into",
9360 description: r##"# `int_format_into`
9361
9362
9363
9364The tracking issue for this feature is: [#138215]
9365
9366[#138215]: https://github.com/rust-lang/rust/issues/138215
9367
9368------------------------
9369"##,
9370 default_severity: Severity::Allow,
9371 warn_since: None,
9372 deny_since: None,
9373 },
9374 Lint {
9375 label: "int_from_ascii",
9376 description: r##"# `int_from_ascii`
9377
9378
9379
9380The tracking issue for this feature is: [#134821]
9381
9382[#134821]: https://github.com/rust-lang/rust/issues/134821
9383
9384------------------------
9385"##,
9386 default_severity: Severity::Allow,
9387 warn_since: None,
9388 deny_since: None,
9389 },
9390 Lint {
9391 label: "int_roundings",
9392 description: r##"# `int_roundings`
9393
9394
9395
9396The tracking issue for this feature is: [#88581]
9397
9398[#88581]: https://github.com/rust-lang/rust/issues/88581
9399
9400------------------------
9401"##,
9402 default_severity: Severity::Allow,
9403 warn_since: None,
9404 deny_since: None,
9405 },
9406 Lint {
9407 label: "integer_atomics",
9408 description: r##"# `integer_atomics`
9409
9410
9411
9412The tracking issue for this feature is: [#99069]
9413
9414[#99069]: https://github.com/rust-lang/rust/issues/99069
9415
9416------------------------
9417"##,
9418 default_severity: Severity::Allow,
9419 warn_since: None,
9420 deny_since: None,
9421 },
9422 Lint {
9423 label: "integer_cast_extras",
9424 description: r##"# `integer_cast_extras`
9425
9426
9427
9428The tracking issue for this feature is: [#154650]
9429
9430[#154650]: https://github.com/rust-lang/rust/issues/154650
9431
9432------------------------
9433"##,
9434 default_severity: Severity::Allow,
9435 warn_since: None,
9436 deny_since: None,
9437 },
9438 Lint {
9439 label: "integer_widen_truncate",
9440 description: r##"# `integer_widen_truncate`
9441
9442
9443
9444The tracking issue for this feature is: [#154330]
9445
9446[#154330]: https://github.com/rust-lang/rust/issues/154330
9447
9448------------------------
9449"##,
9450 default_severity: Severity::Allow,
9451 warn_since: None,
9452 deny_since: None,
9453 },
9454 Lint {
9455 label: "internal_output_capture",
9456 description: r##"# `internal_output_capture`
9457
9458This feature is internal to the Rust compiler and is not intended for general use.
9459
9460------------------------
9461"##,
9462 default_severity: Severity::Allow,
9463 warn_since: None,
9464 deny_since: None,
9465 },
9466 Lint {
9467 label: "intra_doc_pointers",
9468 description: r##"# `intra-doc-pointers`
9469
9470The tracking issue for this feature is: [#80896]
9471
9472[#80896]: https://github.com/rust-lang/rust/issues/80896
9473
9474------------------------
9475
9476Rustdoc does not currently allow disambiguating between `*const` and `*mut`, and
9477raw pointers in intra-doc links are unstable until it does.
9478
9479```rust
9480#![feature(intra_doc_pointers)]
9481//! [pointer::add]
9482```
9483"##,
9484 default_severity: Severity::Allow,
9485 warn_since: None,
9486 deny_since: None,
9487 },
9488 Lint {
9489 label: "intrinsics",
9490 description: r##"# `intrinsics`
9491
9492The tracking issue for this feature is: None.
9493
9494Intrinsics are rarely intended to be stable directly, but are usually
9495exported in some sort of stable manner. Prefer using the stable interfaces to
9496the intrinsic directly when you can.
9497
9498------------------------
9499
9500
9501## Intrinsics with fallback logic
9502
9503Many intrinsics can be written in pure rust, albeit inefficiently or without supporting
9504some features that only exist on some backends. Backends can simply not implement those
9505intrinsics without causing any code miscompilations or failures to compile.
9506All intrinsic fallback bodies are automatically made cross-crate inlineable (like `#[inline]`)
9507by the codegen backend, but not the MIR inliner.
9508
9509```rust
9510#![feature(intrinsics)]
9511#![allow(internal_features)]
9512
9513#[rustc_intrinsic]
9514const unsafe fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {}
9515```
9516
9517Since these are just regular functions, it is perfectly ok to create the intrinsic twice:
9518
9519```rust
9520#![feature(intrinsics)]
9521#![allow(internal_features)]
9522
9523#[rustc_intrinsic]
9524const unsafe fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {}
9525
9526mod foo {
9527 #[rustc_intrinsic]
9528 const unsafe fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {
9529 panic!("noisy const dealloc")
9530 }
9531}
9532
9533```
9534
9535The behaviour on backends that override the intrinsic is exactly the same. On other
9536backends, the intrinsic behaviour depends on which implementation is called, just like
9537with any regular function.
9538
9539## Intrinsics lowered to MIR instructions
9540
9541Various intrinsics have native MIR operations that they correspond to. Instead of requiring
9542backends to implement both the intrinsic and the MIR operation, the `lower_intrinsics` pass
9543will convert the calls to the MIR operation. Backends do not need to know about these intrinsics
9544at all. These intrinsics only make sense without a body, and can be declared as a `#[rustc_intrinsic]`.
9545The body is never used as the lowering pass implements support for all backends, so we never have to
9546use the fallback logic.
9547
9548## Intrinsics without fallback logic
9549
9550These must be implemented by all backends.
9551
9552### `#[rustc_intrinsic]` declarations
9553
9554These are written without a body:
9555```rust
9556#![feature(intrinsics)]
9557#![allow(internal_features)]
9558
9559#[rustc_intrinsic]
9560pub fn abort() -> !;
9561```
9562"##,
9563 default_severity: Severity::Allow,
9564 warn_since: None,
9565 deny_since: None,
9566 },
9567 Lint {
9568 label: "io_const_error",
9569 description: r##"# `io_const_error`
9570
9571
9572
9573The tracking issue for this feature is: [#133448]
9574
9575[#133448]: https://github.com/rust-lang/rust/issues/133448
9576
9577------------------------
9578"##,
9579 default_severity: Severity::Allow,
9580 warn_since: None,
9581 deny_since: None,
9582 },
9583 Lint {
9584 label: "io_const_error_internals",
9585 description: r##"# `io_const_error_internals`
9586
9587
9588
9589This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
9590
9591------------------------
9592"##,
9593 default_severity: Severity::Allow,
9594 warn_since: None,
9595 deny_since: None,
9596 },
9597 Lint {
9598 label: "io_error_inprogress",
9599 description: r##"# `io_error_inprogress`
9600
9601
9602
9603The tracking issue for this feature is: [#130840]
9604
9605[#130840]: https://github.com/rust-lang/rust/issues/130840
9606
9607------------------------
9608"##,
9609 default_severity: Severity::Allow,
9610 warn_since: None,
9611 deny_since: None,
9612 },
9613 Lint {
9614 label: "io_error_more",
9615 description: r##"# `io_error_more`
9616
9617
9618
9619The tracking issue for this feature is: [#86442]
9620
9621[#86442]: https://github.com/rust-lang/rust/issues/86442
9622
9623------------------------
9624"##,
9625 default_severity: Severity::Allow,
9626 warn_since: None,
9627 deny_since: None,
9628 },
9629 Lint {
9630 label: "io_error_uncategorized",
9631 description: r##"# `io_error_uncategorized`
9632
9633
9634
9635This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
9636
9637------------------------
9638"##,
9639 default_severity: Severity::Allow,
9640 warn_since: None,
9641 deny_since: None,
9642 },
9643 Lint {
9644 label: "io_slice_as_bytes",
9645 description: r##"# `io_slice_as_bytes`
9646
9647
9648
9649The tracking issue for this feature is: [#132818]
9650
9651[#132818]: https://github.com/rust-lang/rust/issues/132818
9652
9653------------------------
9654"##,
9655 default_severity: Severity::Allow,
9656 warn_since: None,
9657 deny_since: None,
9658 },
9659 Lint {
9660 label: "ip",
9661 description: r##"# `ip`
9662
9663
9664
9665The tracking issue for this feature is: [#27709]
9666
9667[#27709]: https://github.com/rust-lang/rust/issues/27709
9668
9669------------------------
9670"##,
9671 default_severity: Severity::Allow,
9672 warn_since: None,
9673 deny_since: None,
9674 },
9675 Lint {
9676 label: "ip_as_octets",
9677 description: r##"# `ip_as_octets`
9678
9679
9680
9681The tracking issue for this feature is: [#137259]
9682
9683[#137259]: https://github.com/rust-lang/rust/issues/137259
9684
9685------------------------
9686"##,
9687 default_severity: Severity::Allow,
9688 warn_since: None,
9689 deny_since: None,
9690 },
9691 Lint {
9692 label: "ip_multicast_reserved",
9693 description: r##"# `ip_multicast_reserved`
9694
9695
9696
9697This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
9698
9699------------------------
9700"##,
9701 default_severity: Severity::Allow,
9702 warn_since: None,
9703 deny_since: None,
9704 },
9705 Lint {
9706 label: "is_ascii_octdigit",
9707 description: r##"# `is_ascii_octdigit`
9708
9709
9710
9711The tracking issue for this feature is: [#101288]
9712
9713[#101288]: https://github.com/rust-lang/rust/issues/101288
9714
9715------------------------
9716"##,
9717 default_severity: Severity::Allow,
9718 warn_since: None,
9719 deny_since: None,
9720 },
9721 Lint {
9722 label: "is_loongarch_feature_detected",
9723 description: r##"# `is_loongarch_feature_detected`
9724
9725
9726
9727The tracking issue for this feature is: [#117425]
9728
9729[#117425]: https://github.com/rust-lang/rust/issues/117425
9730
9731------------------------
9732"##,
9733 default_severity: Severity::Allow,
9734 warn_since: None,
9735 deny_since: None,
9736 },
9737 Lint {
9738 label: "is_riscv_feature_detected",
9739 description: r##"# `is_riscv_feature_detected`
9740
9741
9742
9743The tracking issue for this feature is: [#111192]
9744
9745[#111192]: https://github.com/rust-lang/rust/issues/111192
9746
9747------------------------
9748"##,
9749 default_severity: Severity::Allow,
9750 warn_since: None,
9751 deny_since: None,
9752 },
9753 Lint {
9754 label: "iter_advance_by",
9755 description: r##"# `iter_advance_by`
9756
9757
9758
9759The tracking issue for this feature is: [#77404]
9760
9761[#77404]: https://github.com/rust-lang/rust/issues/77404
9762
9763------------------------
9764"##,
9765 default_severity: Severity::Allow,
9766 warn_since: None,
9767 deny_since: None,
9768 },
9769 Lint {
9770 label: "iter_array_chunks",
9771 description: r##"# `iter_array_chunks`
9772
9773
9774
9775The tracking issue for this feature is: [#100450]
9776
9777[#100450]: https://github.com/rust-lang/rust/issues/100450
9778
9779------------------------
9780"##,
9781 default_severity: Severity::Allow,
9782 warn_since: None,
9783 deny_since: None,
9784 },
9785 Lint {
9786 label: "iter_collect_into",
9787 description: r##"# `iter_collect_into`
9788
9789
9790
9791The tracking issue for this feature is: [#94780]
9792
9793[#94780]: https://github.com/rust-lang/rust/issues/94780
9794
9795------------------------
9796"##,
9797 default_severity: Severity::Allow,
9798 warn_since: None,
9799 deny_since: None,
9800 },
9801 Lint {
9802 label: "iter_from_coroutine",
9803 description: r##"# `iter_from_coroutine`
9804
9805
9806
9807The tracking issue for this feature is: [#43122]
9808
9809[#43122]: https://github.com/rust-lang/rust/issues/43122
9810
9811------------------------
9812"##,
9813 default_severity: Severity::Allow,
9814 warn_since: None,
9815 deny_since: None,
9816 },
9817 Lint {
9818 label: "iter_intersperse",
9819 description: r##"# `iter_intersperse`
9820
9821
9822
9823The tracking issue for this feature is: [#79524]
9824
9825[#79524]: https://github.com/rust-lang/rust/issues/79524
9826
9827------------------------
9828"##,
9829 default_severity: Severity::Allow,
9830 warn_since: None,
9831 deny_since: None,
9832 },
9833 Lint {
9834 label: "iter_is_partitioned",
9835 description: r##"# `iter_is_partitioned`
9836
9837
9838
9839The tracking issue for this feature is: [#62544]
9840
9841[#62544]: https://github.com/rust-lang/rust/issues/62544
9842
9843------------------------
9844"##,
9845 default_severity: Severity::Allow,
9846 warn_since: None,
9847 deny_since: None,
9848 },
9849 Lint {
9850 label: "iter_macro",
9851 description: r##"# `iter_macro`
9852
9853
9854
9855The tracking issue for this feature is: [#142269]
9856
9857[#142269]: https://github.com/rust-lang/rust/issues/142269
9858
9859------------------------
9860"##,
9861 default_severity: Severity::Allow,
9862 warn_since: None,
9863 deny_since: None,
9864 },
9865 Lint {
9866 label: "iter_map_windows",
9867 description: r##"# `iter_map_windows`
9868
9869
9870
9871The tracking issue for this feature is: [#87155]
9872
9873[#87155]: https://github.com/rust-lang/rust/issues/87155
9874
9875------------------------
9876"##,
9877 default_severity: Severity::Allow,
9878 warn_since: None,
9879 deny_since: None,
9880 },
9881 Lint {
9882 label: "iter_next_chunk",
9883 description: r##"# `iter_next_chunk`
9884
9885
9886
9887The tracking issue for this feature is: [#98326]
9888
9889[#98326]: https://github.com/rust-lang/rust/issues/98326
9890
9891------------------------
9892"##,
9893 default_severity: Severity::Allow,
9894 warn_since: None,
9895 deny_since: None,
9896 },
9897 Lint {
9898 label: "iter_order_by",
9899 description: r##"# `iter_order_by`
9900
9901
9902
9903The tracking issue for this feature is: [#64295]
9904
9905[#64295]: https://github.com/rust-lang/rust/issues/64295
9906
9907------------------------
9908"##,
9909 default_severity: Severity::Allow,
9910 warn_since: None,
9911 deny_since: None,
9912 },
9913 Lint {
9914 label: "iter_partition_in_place",
9915 description: r##"# `iter_partition_in_place`
9916
9917
9918
9919The tracking issue for this feature is: [#62543]
9920
9921[#62543]: https://github.com/rust-lang/rust/issues/62543
9922
9923------------------------
9924"##,
9925 default_severity: Severity::Allow,
9926 warn_since: None,
9927 deny_since: None,
9928 },
9929 Lint {
9930 label: "iterator_try_collect",
9931 description: r##"# `iterator_try_collect`
9932
9933
9934
9935The tracking issue for this feature is: [#94047]
9936
9937[#94047]: https://github.com/rust-lang/rust/issues/94047
9938
9939------------------------
9940"##,
9941 default_severity: Severity::Allow,
9942 warn_since: None,
9943 deny_since: None,
9944 },
9945 Lint {
9946 label: "iterator_try_reduce",
9947 description: r##"# `iterator_try_reduce`
9948
9949
9950
9951The tracking issue for this feature is: [#87053]
9952
9953[#87053]: https://github.com/rust-lang/rust/issues/87053
9954
9955------------------------
9956"##,
9957 default_severity: Severity::Allow,
9958 warn_since: None,
9959 deny_since: None,
9960 },
9961 Lint {
9962 label: "junction_point",
9963 description: r##"# `junction_point`
9964
9965
9966
9967The tracking issue for this feature is: [#121709]
9968
9969[#121709]: https://github.com/rust-lang/rust/issues/121709
9970
9971------------------------
9972"##,
9973 default_severity: Severity::Allow,
9974 warn_since: None,
9975 deny_since: None,
9976 },
9977 Lint {
9978 label: "lahfsahf_target_feature",
9979 description: r##"# `lahfsahf_target_feature`
9980
9981lahfsahf target feature on x86.
9982
9983The tracking issue for this feature is: [#150251]
9984
9985[#150251]: https://github.com/rust-lang/rust/issues/150251
9986
9987------------------------
9988"##,
9989 default_severity: Severity::Allow,
9990 warn_since: None,
9991 deny_since: None,
9992 },
9993 Lint {
9994 label: "lang_items",
9995 description: r##"# `lang_items`
9996
9997The tracking issue for this feature is: None.
9998
9999------------------------
10000
10001The `rustc` compiler has certain pluggable operations, that is,
10002functionality that isn't hard-coded into the language, but is
10003implemented in libraries, with a special marker to tell the compiler
10004it exists. The marker is the attribute `#[lang = "..."]` and there are
10005various different values of `...`, i.e. various different 'lang
10006items'. Most of them can only be defined once.
10007
10008Lang items are loaded lazily by the compiler; e.g. if one never uses `Box`
10009then there is no need to define a function for `exchange_malloc`.
10010`rustc` will emit an error when an item is needed but not found in the current
10011crate or any that it depends on.
10012
10013Some features provided by lang items:
10014
10015- overloadable operators via traits: the traits corresponding to the
10016 `==`, `<`, dereferencing (`*`) and `+` (etc.) operators are all
10017 marked with lang items; those specific four are `eq`, `partial_ord`,
10018 `deref`/`deref_mut`, and `add` respectively.
10019- panicking: the `panic` and `panic_impl` lang items, among others.
10020- stack unwinding: the lang item `eh_personality` is a function used by the
10021 failure mechanisms of the compiler. This is often mapped to GCC's personality
10022 function (see the [`std` implementation][personality] for more information),
10023 but programs which don't trigger a panic can be assured that this function is
10024 never called. Additionally, a `eh_catch_typeinfo` static is needed for certain
10025 targets which implement Rust panics on top of C++ exceptions.
10026- the traits in `core::marker` used to indicate types of
10027 various kinds; e.g. lang items `sized`, `sync` and `copy`.
10028- memory allocation, see below.
10029
10030Most lang items are defined by `core`, but if you're trying to build
10031an executable without the `std` crate, you might run into the need
10032for lang item definitions.
10033
10034[personality]: https://github.com/rust-lang/rust/blob/HEAD/library/std/src/sys/personality/gcc.rs
10035
10036## Example: Implementing a `Box`
10037
10038`Box` pointers require two lang items: one for the type itself and one for
10039allocation. A freestanding program that uses the `Box` sugar for dynamic
10040allocations via `malloc` and `free`:
10041
10042```rust,ignore (libc-is-finicky)
10043#![feature(lang_items, core_intrinsics, rustc_private, panic_unwind, rustc_attrs)]
10044#![allow(internal_features)]
10045#![no_std]
10046#![no_main]
10047
10048extern crate libc;
10049extern crate unwind;
10050
10051use core::ffi::{c_int, c_void};
10052use core::intrinsics;
10053use core::panic::PanicInfo;
10054use core::ptr::NonNull;
10055
10056pub struct Global; // the global allocator
10057struct Unique<T>(NonNull<T>);
10058
10059#[lang = "owned_box"]
10060pub struct Box<T, A = Global>(Unique<T>, A);
10061
10062impl<T> Box<T> {
10063 pub fn new(x: T) -> Self {
10064 #[rustc_box]
10065 Box::new(x)
10066 }
10067}
10068
10069impl<T, A> Drop for Box<T, A> {
10070 fn drop(&mut self) {
10071 unsafe {
10072 libc::free(self.0.0.as_ptr() as *mut c_void);
10073 }
10074 }
10075}
10076
10077#[lang = "exchange_malloc"]
10078unsafe fn allocate(size: usize, _align: usize) -> *mut u8 {
10079 let p = libc::malloc(size) as *mut u8;
10080
10081 // Check if `malloc` failed:
10082 if p.is_null() {
10083 intrinsics::abort();
10084 }
10085
10086 p
10087}
10088
10089#[no_mangle]
10090extern "C" fn main(_argc: c_int, _argv: *const *const u8) -> c_int {
10091 let _x = Box::new(1);
10092
10093 0
10094}
10095
10096#[lang = "eh_personality"]
10097fn rust_eh_personality() {}
10098
10099#[panic_handler]
10100fn panic_handler(_info: &PanicInfo) -> ! { intrinsics::abort() }
10101```
10102
10103Note the use of `abort`: the `exchange_malloc` lang item is assumed to
10104return a valid pointer, and so needs to do the check internally.
10105
10106## List of all language items
10107
10108An up-to-date list of all language items can be found [here] in the compiler code.
10109
10110[here]: https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc_hir/src/lang_items.rs
10111"##,
10112 default_severity: Severity::Allow,
10113 warn_since: None,
10114 deny_since: None,
10115 },
10116 Lint {
10117 label: "large_assignments",
10118 description: r##"# `large_assignments`
10119
10120Allows setting the threshold for the `large_assignments` lint.
10121
10122The tracking issue for this feature is: [#83518]
10123
10124[#83518]: https://github.com/rust-lang/rust/issues/83518
10125
10126------------------------
10127"##,
10128 default_severity: Severity::Allow,
10129 warn_since: None,
10130 deny_since: None,
10131 },
10132 Lint {
10133 label: "layout_for_ptr",
10134 description: r##"# `layout_for_ptr`
10135
10136
10137
10138The tracking issue for this feature is: [#69835]
10139
10140[#69835]: https://github.com/rust-lang/rust/issues/69835
10141
10142------------------------
10143"##,
10144 default_severity: Severity::Allow,
10145 warn_since: None,
10146 deny_since: None,
10147 },
10148 Lint {
10149 label: "lazy_cell_into_inner",
10150 description: r##"# `lazy_cell_into_inner`
10151
10152
10153
10154The tracking issue for this feature is: [#125623]
10155
10156[#125623]: https://github.com/rust-lang/rust/issues/125623
10157
10158------------------------
10159"##,
10160 default_severity: Severity::Allow,
10161 warn_since: None,
10162 deny_since: None,
10163 },
10164 Lint {
10165 label: "lazy_type_alias",
10166 description: r##"# `lazy_type_alias`
10167
10168Allow to have type alias types for inter-crate use.
10169
10170The tracking issue for this feature is: [#112792]
10171
10172[#112792]: https://github.com/rust-lang/rust/issues/112792
10173
10174------------------------
10175"##,
10176 default_severity: Severity::Allow,
10177 warn_since: None,
10178 deny_since: None,
10179 },
10180 Lint {
10181 label: "legacy_receiver_trait",
10182 description: r##"# `legacy_receiver_trait`
10183
10184
10185
10186This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
10187
10188------------------------
10189"##,
10190 default_severity: Severity::Allow,
10191 warn_since: None,
10192 deny_since: None,
10193 },
10194 Lint {
10195 label: "liballoc_internals",
10196 description: r##"# `liballoc_internals`
10197
10198
10199
10200This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
10201
10202------------------------
10203"##,
10204 default_severity: Severity::Allow,
10205 warn_since: None,
10206 deny_since: None,
10207 },
10208 Lint {
10209 label: "libstd_sys_internals",
10210 description: r##"# `libstd_sys_internals`
10211
10212This feature is internal to the Rust compiler and is not intended for general use.
10213
10214------------------------
10215"##,
10216 default_severity: Severity::Allow,
10217 warn_since: None,
10218 deny_since: None,
10219 },
10220 Lint {
10221 label: "likely_unlikely",
10222 description: r##"# `likely_unlikely`
10223
10224
10225
10226The tracking issue for this feature is: [#151619]
10227
10228[#151619]: https://github.com/rust-lang/rust/issues/151619
10229
10230------------------------
10231"##,
10232 default_severity: Severity::Allow,
10233 warn_since: None,
10234 deny_since: None,
10235 },
10236 Lint {
10237 label: "link_arg_attribute",
10238 description: r##"# `link_arg_attribute`
10239
10240The tracking issue for this feature is: [#99427]
10241
10242------
10243
10244The `link_arg_attribute` feature allows passing arguments into the linker
10245from inside of the source code. Order is preserved for link attributes as
10246they were defined on a single extern block:
10247
10248```rust,no_run
10249#![feature(link_arg_attribute)]
10250
10251#[link(kind = "link-arg", name = "--start-group")]
10252#[link(kind = "static", name = "c")]
10253#[link(kind = "static", name = "gcc")]
10254#[link(kind = "link-arg", name = "--end-group")]
10255extern "C" {}
10256```
10257
10258[#99427]: https://github.com/rust-lang/rust/issues/99427
10259"##,
10260 default_severity: Severity::Allow,
10261 warn_since: None,
10262 deny_since: None,
10263 },
10264 Lint {
10265 label: "link_cfg",
10266 description: r##"# `link_cfg`
10267
10268This feature is internal to the Rust compiler and is not intended for general use.
10269
10270------------------------
10271"##,
10272 default_severity: Severity::Allow,
10273 warn_since: None,
10274 deny_since: None,
10275 },
10276 Lint {
10277 label: "link_llvm_intrinsics",
10278 description: r##"# `link_llvm_intrinsics`
10279
10280Allows using `#[link_name="llvm.*"]`.
10281
10282The tracking issue for this feature is: [#29602]
10283
10284[#29602]: https://github.com/rust-lang/rust/issues/29602
10285
10286------------------------
10287"##,
10288 default_severity: Severity::Allow,
10289 warn_since: None,
10290 deny_since: None,
10291 },
10292 Lint {
10293 label: "linkage",
10294 description: r##"# `linkage`
10295
10296Allows using the `#[linkage = ".."]` attribute.
10297
10298The tracking issue for this feature is: [#29603]
10299
10300[#29603]: https://github.com/rust-lang/rust/issues/29603
10301
10302------------------------
10303"##,
10304 default_severity: Severity::Allow,
10305 warn_since: None,
10306 deny_since: None,
10307 },
10308 Lint {
10309 label: "linked_list_cursors",
10310 description: r##"# `linked_list_cursors`
10311
10312
10313
10314The tracking issue for this feature is: [#58533]
10315
10316[#58533]: https://github.com/rust-lang/rust/issues/58533
10317
10318------------------------
10319"##,
10320 default_severity: Severity::Allow,
10321 warn_since: None,
10322 deny_since: None,
10323 },
10324 Lint {
10325 label: "linked_list_remove",
10326 description: r##"# `linked_list_remove`
10327
10328
10329
10330The tracking issue for this feature is: [#69210]
10331
10332[#69210]: https://github.com/rust-lang/rust/issues/69210
10333
10334------------------------
10335"##,
10336 default_severity: Severity::Allow,
10337 warn_since: None,
10338 deny_since: None,
10339 },
10340 Lint {
10341 label: "linked_list_retain",
10342 description: r##"# `linked_list_retain`
10343
10344
10345
10346The tracking issue for this feature is: [#114135]
10347
10348[#114135]: https://github.com/rust-lang/rust/issues/114135
10349
10350------------------------
10351"##,
10352 default_severity: Severity::Allow,
10353 warn_since: None,
10354 deny_since: None,
10355 },
10356 Lint {
10357 label: "linux_pidfd",
10358 description: r##"# `linux_pidfd`
10359
10360
10361
10362The tracking issue for this feature is: [#82971]
10363
10364[#82971]: https://github.com/rust-lang/rust/issues/82971
10365
10366------------------------
10367"##,
10368 default_severity: Severity::Allow,
10369 warn_since: None,
10370 deny_since: None,
10371 },
10372 Lint {
10373 label: "local_key_cell_update",
10374 description: r##"# `local_key_cell_update`
10375
10376
10377
10378The tracking issue for this feature is: [#143989]
10379
10380[#143989]: https://github.com/rust-lang/rust/issues/143989
10381
10382------------------------
10383"##,
10384 default_severity: Severity::Allow,
10385 warn_since: None,
10386 deny_since: None,
10387 },
10388 Lint {
10389 label: "local_waker",
10390 description: r##"# `local_waker`
10391
10392
10393
10394The tracking issue for this feature is: [#118959]
10395
10396[#118959]: https://github.com/rust-lang/rust/issues/118959
10397
10398------------------------
10399"##,
10400 default_severity: Severity::Allow,
10401 warn_since: None,
10402 deny_since: None,
10403 },
10404 Lint {
10405 label: "lock_value_accessors",
10406 description: r##"# `lock_value_accessors`
10407
10408
10409
10410The tracking issue for this feature is: [#133407]
10411
10412[#133407]: https://github.com/rust-lang/rust/issues/133407
10413
10414------------------------
10415"##,
10416 default_severity: Severity::Allow,
10417 warn_since: None,
10418 deny_since: None,
10419 },
10420 Lint {
10421 label: "log_syntax",
10422 description: r##"# `log_syntax`
10423
10424
10425
10426The tracking issue for this feature is: [#29598]
10427
10428[#29598]: https://github.com/rust-lang/rust/issues/29598
10429
10430------------------------
10431"##,
10432 default_severity: Severity::Allow,
10433 warn_since: None,
10434 deny_since: None,
10435 },
10436 Lint {
10437 label: "loongarch_target_feature",
10438 description: r##"# `loongarch_target_feature`
10439
10440Target features on loongarch.
10441
10442The tracking issue for this feature is: [#150252]
10443
10444[#150252]: https://github.com/rust-lang/rust/issues/150252
10445
10446------------------------
10447"##,
10448 default_severity: Severity::Allow,
10449 warn_since: None,
10450 deny_since: None,
10451 },
10452 Lint {
10453 label: "loop_match",
10454 description: r##"# `loop_match`
10455
10456The tracking issue for this feature is: [#132306]
10457
10458[#132306]: https://github.com/rust-lang/rust/issues/132306
10459
10460------
10461
10462The `#[loop_match]` and `#[const_continue]` attributes can be used to improve the code
10463generation of logic that fits this shape:
10464
10465```ignore (pseudo-rust)
10466loop {
10467 state = 'blk: {
10468 match state {
10469 State::A => {
10470 break 'blk State::B
10471 }
10472 State::B => { /* ... */ }
10473 /* ... */
10474 }
10475 }
10476}
10477```
10478
10479Here the loop itself can be annotated with `#[loop_match]`, and any `break 'blk` with
10480`#[const_continue]` if the value is know at compile time:
10481
10482```ignore (pseudo-rust)
10483#[loop_match]
10484loop {
10485 state = 'blk: {
10486 match state {
10487 State::A => {
10488 #[const_continue]
10489 break 'blk State::B
10490 }
10491 State::B => { /* ... */ }
10492 /* ... */
10493 }
10494 }
10495}
10496```
10497
10498The observable behavior of this loop is exactly the same as without the extra attributes.
10499The difference is in the generated output: normally, when the state is `A`, control flow
10500moves from the `A` branch, back to the top of the loop, then to the `B` branch. With the
10501attributes, The `A` branch will immediately jump to the `B` branch.
10502
10503Removing the indirection can be beneficial for stack usage and branch prediction, and
10504enables other optimizations by clearly splitting out the control flow paths that your
10505program will actually use.
10506"##,
10507 default_severity: Severity::Allow,
10508 warn_since: None,
10509 deny_since: None,
10510 },
10511 Lint {
10512 label: "m68k_target_feature",
10513 description: r##"# `m68k_target_feature`
10514
10515Target features on m68k.
10516
10517The tracking issue for this feature is: [#134328]
10518
10519[#134328]: https://github.com/rust-lang/rust/issues/134328
10520
10521------------------------
10522"##,
10523 default_severity: Severity::Allow,
10524 warn_since: None,
10525 deny_since: None,
10526 },
10527 Lint {
10528 label: "macro_attr",
10529 description: r##"# `macro_attr`
10530
10531Allow `macro_rules!` attribute rules
10532
10533The tracking issue for this feature is: [#143547]
10534
10535[#143547]: https://github.com/rust-lang/rust/issues/143547
10536
10537------------------------
10538"##,
10539 default_severity: Severity::Allow,
10540 warn_since: None,
10541 deny_since: None,
10542 },
10543 Lint {
10544 label: "macro_derive",
10545 description: r##"# `macro_derive`
10546
10547Allow `macro_rules!` derive rules
10548
10549The tracking issue for this feature is: [#143549]
10550
10551[#143549]: https://github.com/rust-lang/rust/issues/143549
10552
10553------------------------
10554"##,
10555 default_severity: Severity::Allow,
10556 warn_since: None,
10557 deny_since: None,
10558 },
10559 Lint {
10560 label: "macro_guard_matcher",
10561 description: r##"# `macro_guard_matcher`
10562
10563Allow `$x:guard` matcher in macros
10564
10565The tracking issue for this feature is: [#153104]
10566
10567[#153104]: https://github.com/rust-lang/rust/issues/153104
10568
10569------------------------
10570"##,
10571 default_severity: Severity::Allow,
10572 warn_since: None,
10573 deny_since: None,
10574 },
10575 Lint {
10576 label: "macro_metavar_expr",
10577 description: r##"# `macro_metavar_expr`
10578
10579The tracking issue for this feature is: [#83527]
10580
10581------------------------
10582
10583> This feature is not to be confused with [`macro_metavar_expr_concat`].
10584
10585[`macro_metavar_expr_concat`]: ./macro-metavar-expr-concat.md
10586[#83527]: https://github.com/rust-lang/rust/issues/83527
10587"##,
10588 default_severity: Severity::Allow,
10589 warn_since: None,
10590 deny_since: None,
10591 },
10592 Lint {
10593 label: "macro_metavar_expr_concat",
10594 description: r##"# `macro_metavar_expr_concat`
10595
10596The tracking issue for this feature is: [#124225]
10597
10598------------------------
10599
10600In 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`].
10601 `#![feature(macro_metavar_expr_concat)]` introduces a way to do this, using the concat metavariable expression.
10602
10603> This feature uses the syntax from [`macro_metavar_expr`] but is otherwise
10604> independent. It replaces the since-removed unstable feature
10605> [`concat_idents`].
10606
10607> This is an experimental feature; it and its syntax will require a RFC before stabilization.
10608
10609
10610### Overview
10611
10612`#![feature(macro_metavar_expr_concat)]` provides the `concat` metavariable expression for creating new identifiers:
10613
10614```rust
10615#![feature(macro_metavar_expr_concat)]
10616
10617macro_rules! create_some_structs {
10618 ($name:ident) => {
10619 pub struct ${ concat(First, $name) };
10620 pub struct ${ concat(Second, $name) };
10621 pub struct ${ concat(Third, $name) };
10622 }
10623}
10624
10625create_some_structs!(Thing);
10626```
10627
10628This macro invocation expands to:
10629
10630```rust
10631pub struct FirstThing;
10632pub struct SecondThing;
10633pub struct ThirdThing;
10634```
10635
10636### Syntax
10637
10638This feature builds upon the metavariable expression syntax `${ .. }` as specified in [RFC 3086] ([`macro_metavar_expr`]).
10639 `concat` is available like `${ concat(items) }`, where `items` is a comma separated sequence of idents and/or literals.
10640
10641### Examples
10642
10643#### Create a function or method with a concatenated name
10644
10645```rust
10646#![feature(macro_metavar_expr_concat)]
10647
10648macro_rules! make_getter {
10649 ($name:ident, $field: ident, $ret:ty) => {
10650 impl $name {
10651 pub fn ${ concat(get_, $field) }(&self) -> &$ret {
10652 &self.$field
10653 }
10654 }
10655 }
10656}
10657
10658pub struct Thing {
10659 description: String,
10660}
10661
10662make_getter!(Thing, description, String);
10663```
10664
10665This expands to:
10666
10667```rust
10668pub struct Thing {
10669 description: String,
10670}
10671
10672impl Thing {
10673 pub fn get_description(&self) -> &String {
10674 &self.description
10675 }
10676}
10677```
10678
10679#### Create names for macro generated tests
10680
10681```rust
10682#![feature(macro_metavar_expr_concat)]
10683
10684macro_rules! test_math {
10685 ($integer:ident) => {
10686 #[test]
10687 fn ${ concat(test_, $integer, _, addition) } () {
10688 let a: $integer = 73;
10689 let b: $integer = 42;
10690 assert_eq!(a + b, 115)
10691 }
10692
10693 #[test]
10694 fn ${ concat(test_, $integer, _, subtraction) } () {
10695 let a: $integer = 73;
10696 let b: $integer = 42;
10697 assert_eq!(a - b, 31)
10698 }
10699 }
10700}
10701
10702test_math!(i32);
10703test_math!(u64);
10704test_math!(u128);
10705```
10706
10707Running this returns the following output:
10708
10709```text
10710running 6 tests
10711test test_i32_subtraction ... ok
10712test test_i32_addition ... ok
10713test test_u128_addition ... ok
10714test test_u128_subtraction ... ok
10715test test_u64_addition ... ok
10716test test_u64_subtraction ... ok
10717
10718test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
10719```
10720
10721[`paste`]: https://crates.io/crates/paste
10722[RFC 3086]: https://rust-lang.github.io/rfcs/3086-macro-metavar-expr.html
10723[`macro_metavar_expr`]: ../language-features/macro-metavar-expr.md
10724[`concat_idents`]: https://github.com/rust-lang/rust/issues/29599
10725[#124225]: https://github.com/rust-lang/rust/issues/124225
10726[declarative macros]: https://doc.rust-lang.org/stable/reference/macros-by-example.html
10727"##,
10728 default_severity: Severity::Allow,
10729 warn_since: None,
10730 deny_since: None,
10731 },
10732 Lint {
10733 label: "map_try_insert",
10734 description: r##"# `map_try_insert`
10735
10736
10737
10738The tracking issue for this feature is: [#82766]
10739
10740[#82766]: https://github.com/rust-lang/rust/issues/82766
10741
10742------------------------
10743"##,
10744 default_severity: Severity::Allow,
10745 warn_since: None,
10746 deny_since: None,
10747 },
10748 Lint {
10749 label: "mapped_lock_guards",
10750 description: r##"# `mapped_lock_guards`
10751
10752
10753
10754The tracking issue for this feature is: [#117108]
10755
10756[#117108]: https://github.com/rust-lang/rust/issues/117108
10757
10758------------------------
10759"##,
10760 default_severity: Severity::Allow,
10761 warn_since: None,
10762 deny_since: None,
10763 },
10764 Lint {
10765 label: "marker_trait_attr",
10766 description: r##"# `marker_trait_attr`
10767
10768The tracking issue for this feature is: [#29864]
10769
10770[#29864]: https://github.com/rust-lang/rust/issues/29864
10771
10772------------------------
10773
10774Normally, Rust keeps you from adding trait implementations that could
10775overlap with each other, as it would be ambiguous which to use. This
10776feature, however, carves out an exception to that rule: a trait can
10777opt-in to having overlapping implementations, at the cost that those
10778implementations are not allowed to override anything (and thus the
10779trait itself cannot have any associated items, as they're pointless
10780when they'd need to do the same thing for every type anyway).
10781
10782```rust
10783#![feature(marker_trait_attr)]
10784
10785#[marker] trait CheapToClone: Clone {}
10786
10787impl<T: Copy> CheapToClone for T {}
10788
10789// These could potentially overlap with the blanket implementation above,
10790// so are only allowed because CheapToClone is a marker trait.
10791impl<T: CheapToClone, U: CheapToClone> CheapToClone for (T, U) {}
10792impl<T: CheapToClone> CheapToClone for std::ops::Range<T> {}
10793
10794fn cheap_clone<T: CheapToClone>(t: T) -> T {
10795 t.clone()
10796}
10797```
10798
10799This is expected to replace the unstable `overlapping_marker_traits`
10800feature, which applied to all empty traits (without needing an opt-in).
10801"##,
10802 default_severity: Severity::Allow,
10803 warn_since: None,
10804 deny_since: None,
10805 },
10806 Lint {
10807 label: "maybe_dangling",
10808 description: r##"# `maybe_dangling`
10809
10810
10811
10812The tracking issue for this feature is: [#118166]
10813
10814[#118166]: https://github.com/rust-lang/rust/issues/118166
10815
10816------------------------
10817"##,
10818 default_severity: Severity::Allow,
10819 warn_since: None,
10820 deny_since: None,
10821 },
10822 Lint {
10823 label: "maybe_uninit_array_assume_init",
10824 description: r##"# `maybe_uninit_array_assume_init`
10825
10826
10827
10828The tracking issue for this feature is: [#96097]
10829
10830[#96097]: https://github.com/rust-lang/rust/issues/96097
10831
10832------------------------
10833"##,
10834 default_severity: Severity::Allow,
10835 warn_since: None,
10836 deny_since: None,
10837 },
10838 Lint {
10839 label: "maybe_uninit_as_bytes",
10840 description: r##"# `maybe_uninit_as_bytes`
10841
10842
10843
10844The tracking issue for this feature is: [#93092]
10845
10846[#93092]: https://github.com/rust-lang/rust/issues/93092
10847
10848------------------------
10849"##,
10850 default_severity: Severity::Allow,
10851 warn_since: None,
10852 deny_since: None,
10853 },
10854 Lint {
10855 label: "maybe_uninit_fill",
10856 description: r##"# `maybe_uninit_fill`
10857
10858
10859
10860The tracking issue for this feature is: [#117428]
10861
10862[#117428]: https://github.com/rust-lang/rust/issues/117428
10863
10864------------------------
10865"##,
10866 default_severity: Severity::Allow,
10867 warn_since: None,
10868 deny_since: None,
10869 },
10870 Lint {
10871 label: "maybe_uninit_uninit_array_transpose",
10872 description: r##"# `maybe_uninit_uninit_array_transpose`
10873
10874
10875
10876The tracking issue for this feature is: [#96097]
10877
10878[#96097]: https://github.com/rust-lang/rust/issues/96097
10879
10880------------------------
10881"##,
10882 default_severity: Severity::Allow,
10883 warn_since: None,
10884 deny_since: None,
10885 },
10886 Lint {
10887 label: "mem_conjure_zst",
10888 description: r##"# `mem_conjure_zst`
10889
10890
10891
10892The tracking issue for this feature is: [#95383]
10893
10894[#95383]: https://github.com/rust-lang/rust/issues/95383
10895
10896------------------------
10897"##,
10898 default_severity: Severity::Allow,
10899 warn_since: None,
10900 deny_since: None,
10901 },
10902 Lint {
10903 label: "mem_copy_fn",
10904 description: r##"# `mem_copy_fn`
10905
10906
10907
10908The tracking issue for this feature is: [#98262]
10909
10910[#98262]: https://github.com/rust-lang/rust/issues/98262
10911
10912------------------------
10913"##,
10914 default_severity: Severity::Allow,
10915 warn_since: None,
10916 deny_since: None,
10917 },
10918 Lint {
10919 label: "mgca_type_const_syntax",
10920 description: r##"# `mgca_type_const_syntax`
10921
10922Enable mgca `type const` syntax before expansion.
10923
10924The tracking issue for this feature is: [#132980]
10925
10926[#132980]: https://github.com/rust-lang/rust/issues/132980
10927
10928------------------------
10929"##,
10930 default_severity: Severity::Allow,
10931 warn_since: None,
10932 deny_since: None,
10933 },
10934 Lint {
10935 label: "min_adt_const_params",
10936 description: r##"# `min_adt_const_params`
10937
10938Allows 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.
10939
10940The tracking issue for this feature is: [#154042]
10941
10942[#154042]: https://github.com/rust-lang/rust/issues/154042
10943
10944------------------------
10945"##,
10946 default_severity: Severity::Allow,
10947 warn_since: None,
10948 deny_since: None,
10949 },
10950 Lint {
10951 label: "min_generic_const_args",
10952 description: r##"# min_generic_const_args
10953
10954Enables the generic const args MVP (paths to type const items and constructors for ADTs and primitives).
10955
10956The tracking issue for this feature is: [#132980]
10957
10958[#132980]: https://github.com/rust-lang/rust/issues/132980
10959
10960------------------------
10961
10962Warning: This feature is incomplete; its design and syntax may change.
10963
10964This feature acts as a minimal alternative to [generic_const_exprs] that allows a smaller subset of functionality,
10965and uses a different approach for implementation. It is intentionally more restrictive, which helps with avoiding edge
10966cases that make the `generic_const_exprs` hard to implement properly. See [Feature background][feature_background]
10967for more details.
10968
10969Related features: [generic_const_args], [generic_const_items].
10970
10971[feature_background]: https://github.com/rust-lang/project-const-generics/blob/main/documents/min_const_generics_plan.md
10972[generic_const_exprs]: generic-const-exprs.md
10973[generic_const_args]: generic-const-args.md
10974[generic_const_items]: generic-const-items.md
10975
10976## `type const` syntax
10977
10978This feature introduces new syntax: `type const`.
10979Constants marked as `type const` are allowed to be used in type contexts, e.g.:
10980
10981```compile_fail
10982#![allow(incomplete_features)]
10983#![feature(min_generic_const_args)]
10984
10985type const X: usize = 1;
10986const Y: usize = 1;
10987
10988struct Foo {
10989 good_arr: [(); X], // Allowed
10990 bad_arr: [(); Y], // Will not compile, `Y` must be `type const`.
10991}
10992```
10993
10994## Examples
10995
10996```rust
10997#![allow(incomplete_features)]
10998#![feature(min_generic_const_args)]
10999
11000trait Bar {
11001 type const VAL: usize;
11002 type const VAL2: usize;
11003}
11004
11005struct Baz;
11006
11007impl Bar for Baz {
11008 type const VAL: usize = 2;
11009 type const VAL2: usize = const { Self::VAL * 2 };
11010}
11011
11012struct Foo<B: Bar> {
11013 arr1: [usize; B::VAL],
11014 arr2: [usize; B::VAL2],
11015}
11016```
11017
11018Note that with [generic_const_exprs] the same example would look as follows:
11019
11020```rust
11021#![allow(incomplete_features)]
11022#![feature(generic_const_exprs)]
11023
11024trait Bar {
11025 const VAL: usize;
11026 const VAL2: usize;
11027}
11028
11029struct Baz;
11030
11031impl Bar for Baz {
11032 const VAL: usize = 2;
11033 const VAL2: usize = const { Self::VAL * 2 };
11034}
11035
11036struct Foo<B: Bar>
11037where
11038 [(); B::VAL]:,
11039 [(); B::VAL2]:,
11040{
11041 arr1: [usize; B::VAL],
11042 arr2: [usize; B::VAL2],
11043}
11044```
11045
11046Use of const functions is allowed:
11047
11048```rust
11049#![allow(incomplete_features)]
11050#![feature(min_generic_const_args)]
11051
11052const VAL: usize = 1;
11053
11054const fn inc(val: usize) -> usize {
11055 val + 1
11056}
11057
11058type const INC: usize = const { inc(VAL) };
11059
11060const ARR: [usize; INC] = [0; INC];
11061```
11062"##,
11063 default_severity: Severity::Allow,
11064 warn_since: None,
11065 deny_since: None,
11066 },
11067 Lint {
11068 label: "min_specialization",
11069 description: r##"# `min_specialization`
11070
11071A minimal, sound subset of specialization intended to be used by the standard library until the soundness issues with specialization are fixed.
11072
11073The tracking issue for this feature is: [#31844]
11074
11075[#31844]: https://github.com/rust-lang/rust/issues/31844
11076
11077------------------------
11078"##,
11079 default_severity: Severity::Allow,
11080 warn_since: None,
11081 deny_since: None,
11082 },
11083 Lint {
11084 label: "mips_target_feature",
11085 description: r##"# `mips_target_feature`
11086
11087Target features on mips.
11088
11089The tracking issue for this feature is: [#150253]
11090
11091[#150253]: https://github.com/rust-lang/rust/issues/150253
11092
11093------------------------
11094"##,
11095 default_severity: Severity::Allow,
11096 warn_since: None,
11097 deny_since: None,
11098 },
11099 Lint {
11100 label: "more_float_constants",
11101 description: r##"# `more_float_constants`
11102
11103
11104
11105The tracking issue for this feature is: [#146939]
11106
11107[#146939]: https://github.com/rust-lang/rust/issues/146939
11108
11109------------------------
11110"##,
11111 default_severity: Severity::Allow,
11112 warn_since: None,
11113 deny_since: None,
11114 },
11115 Lint {
11116 label: "more_maybe_bounds",
11117 description: r##"# `more_maybe_bounds`
11118
11119Allows using `?Trait` trait bounds in more contexts.
11120
11121This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
11122
11123------------------------
11124"##,
11125 default_severity: Severity::Allow,
11126 warn_since: None,
11127 deny_since: None,
11128 },
11129 Lint {
11130 label: "more_qualified_paths",
11131 description: r##"# `more_qualified_paths`
11132
11133The `more_qualified_paths` feature can be used in order to enable the
11134use of qualified paths in patterns.
11135
11136The tracking issue for this feature is: [#86935](https://github.com/rust-lang/rust/issues/86935).
11137
11138------------------------
11139
11140## Example
11141
11142```rust
11143#![feature(more_qualified_paths)]
11144
11145fn main() {
11146 // destructure through a qualified path
11147 let <Foo as A>::Assoc { br } = StructStruct { br: 2 };
11148}
11149
11150struct StructStruct {
11151 br: i8,
11152}
11153
11154struct Foo;
11155
11156trait A {
11157 type Assoc;
11158}
11159
11160impl A for Foo {
11161 type Assoc = StructStruct;
11162}
11163```
11164"##,
11165 default_severity: Severity::Allow,
11166 warn_since: None,
11167 deny_since: None,
11168 },
11169 Lint {
11170 label: "motor_ext",
11171 description: r##"# `motor_ext`
11172
11173
11174
11175The tracking issue for this feature is: [#147456]
11176
11177[#147456]: https://github.com/rust-lang/rust/issues/147456
11178
11179------------------------
11180"##,
11181 default_severity: Severity::Allow,
11182 warn_since: None,
11183 deny_since: None,
11184 },
11185 Lint {
11186 label: "move_expr",
11187 description: r##"# `move_expr`
11188
11189Allows `move(expr)` in closures.
11190
11191The tracking issue for this feature is: [#155050]
11192
11193[#155050]: https://github.com/rust-lang/rust/issues/155050
11194
11195------------------------
11196"##,
11197 default_severity: Severity::Allow,
11198 warn_since: None,
11199 deny_since: None,
11200 },
11201 Lint {
11202 label: "movrs_target_feature",
11203 description: r##"# `movrs_target_feature`
11204
11205The `movrs` target feature on x86.
11206
11207The tracking issue for this feature is: [#137976]
11208
11209[#137976]: https://github.com/rust-lang/rust/issues/137976
11210
11211------------------------
11212"##,
11213 default_severity: Severity::Allow,
11214 warn_since: None,
11215 deny_since: None,
11216 },
11217 Lint {
11218 label: "mpmc_channel",
11219 description: r##"# `mpmc_channel`
11220
11221
11222
11223The tracking issue for this feature is: [#126840]
11224
11225[#126840]: https://github.com/rust-lang/rust/issues/126840
11226
11227------------------------
11228"##,
11229 default_severity: Severity::Allow,
11230 warn_since: None,
11231 deny_since: None,
11232 },
11233 Lint {
11234 label: "mpsc_is_disconnected",
11235 description: r##"# `mpsc_is_disconnected`
11236
11237
11238
11239The tracking issue for this feature is: [#153668]
11240
11241[#153668]: https://github.com/rust-lang/rust/issues/153668
11242
11243------------------------
11244"##,
11245 default_severity: Severity::Allow,
11246 warn_since: None,
11247 deny_since: None,
11248 },
11249 Lint {
11250 label: "multiple_supertrait_upcastable",
11251 description: r##"# `multiple_supertrait_upcastable`
11252
11253Allows the `multiple_supertrait_upcastable` lint.
11254
11255The tracking issue for this feature is: [#150833]
11256
11257[#150833]: https://github.com/rust-lang/rust/issues/150833
11258
11259------------------------
11260"##,
11261 default_severity: Severity::Allow,
11262 warn_since: None,
11263 deny_since: None,
11264 },
11265 Lint {
11266 label: "must_not_suspend",
11267 description: r##"# `must_not_suspend`
11268
11269Allows the `#[must_not_suspend]` attribute.
11270
11271The tracking issue for this feature is: [#83310]
11272
11273[#83310]: https://github.com/rust-lang/rust/issues/83310
11274
11275------------------------
11276"##,
11277 default_severity: Severity::Allow,
11278 warn_since: None,
11279 deny_since: None,
11280 },
11281 Lint {
11282 label: "mut_ref",
11283 description: r##"# `mut_ref`
11284
11285Allows `mut ref` and `mut ref mut` identifier patterns.
11286
11287The tracking issue for this feature is: [#123076]
11288
11289[#123076]: https://github.com/rust-lang/rust/issues/123076
11290
11291------------------------
11292"##,
11293 default_severity: Severity::Allow,
11294 warn_since: None,
11295 deny_since: None,
11296 },
11297 Lint {
11298 label: "mutex_data_ptr",
11299 description: r##"# `mutex_data_ptr`
11300
11301
11302
11303The tracking issue for this feature is: [#140368]
11304
11305[#140368]: https://github.com/rust-lang/rust/issues/140368
11306
11307------------------------
11308"##,
11309 default_severity: Severity::Allow,
11310 warn_since: None,
11311 deny_since: None,
11312 },
11313 Lint {
11314 label: "naked_functions_rustic_abi",
11315 description: r##"# `naked_functions_rustic_abi`
11316
11317Allows using `#[naked]` on `extern "Rust"` functions.
11318
11319The tracking issue for this feature is: [#138997]
11320
11321[#138997]: https://github.com/rust-lang/rust/issues/138997
11322
11323------------------------
11324"##,
11325 default_severity: Severity::Allow,
11326 warn_since: None,
11327 deny_since: None,
11328 },
11329 Lint {
11330 label: "naked_functions_target_feature",
11331 description: r##"# `naked_functions_target_feature`
11332
11333Allows using `#[target_feature(enable = "...")]` on `#[naked]` on functions.
11334
11335The tracking issue for this feature is: [#138568]
11336
11337[#138568]: https://github.com/rust-lang/rust/issues/138568
11338
11339------------------------
11340"##,
11341 default_severity: Severity::Allow,
11342 warn_since: None,
11343 deny_since: None,
11344 },
11345 Lint {
11346 label: "native_link_modifiers_as_needed",
11347 description: r##"# `native_link_modifiers_as_needed`
11348
11349The tracking issue for this feature is: [#81490]
11350
11351[#81490]: https://github.com/rust-lang/rust/issues/81490
11352
11353------------------------
11354
11355The `native_link_modifiers_as_needed` feature allows you to use the `as-needed` modifier.
11356
11357`as-needed` is only compatible with the `dynamic` and `framework` linking kinds. Using any other kind will result in a compiler error.
11358
11359`+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.
11360
11361This modifier translates to `--as-needed` for ld-like linkers, and to `-dead_strip_dylibs` / `-needed_library` / `-needed_framework` for ld64.
11362The modifier does nothing for linkers that don't support it (e.g. `link.exe`).
11363
11364The 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.
11365"##,
11366 default_severity: Severity::Allow,
11367 warn_since: None,
11368 deny_since: None,
11369 },
11370 Lint {
11371 label: "needs_panic_runtime",
11372 description: r##"# `needs_panic_runtime`
11373
11374Allows declaring with `#![needs_panic_runtime]` that a panic runtime is needed.
11375
11376The tracking issue for this feature is: [#32837]
11377
11378[#32837]: https://github.com/rust-lang/rust/issues/32837
11379
11380------------------------
11381"##,
11382 default_severity: Severity::Allow,
11383 warn_since: None,
11384 deny_since: None,
11385 },
11386 Lint {
11387 label: "negative_bounds",
11388 description: r##"# `negative_bounds`
11389
11390Allow negative trait bounds. This is an internal-only feature for testing the trait solver!
11391
11392This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
11393
11394------------------------
11395"##,
11396 default_severity: Severity::Allow,
11397 warn_since: None,
11398 deny_since: None,
11399 },
11400 Lint {
11401 label: "negative_impls",
11402 description: r##"# `negative_impls`
11403
11404The tracking issue for this feature is [#68318].
11405
11406[#68318]: https://github.com/rust-lang/rust/issues/68318
11407
11408----
11409
11410With the feature gate `negative_impls`, you can write negative impls as well as positive ones:
11411
11412```rust
11413#![feature(negative_impls)]
11414trait DerefMut { }
11415impl<T: ?Sized> !DerefMut for &T { }
11416```
11417
11418Negative 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.
11419
11420Negative impls have the following characteristics:
11421
11422* They do not have any items.
11423* They must obey the orphan rules as if they were a positive impl.
11424* They cannot "overlap" with any positive impls.
11425
11426## Semver interaction
11427
11428It is a breaking change to remove a negative impl. Negative impls are a commitment not to implement the given trait for the named types.
11429
11430## Orphan and overlap rules
11431
11432Negative 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.
11433
11434Similarly, 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.)
11435
11436## Interaction with auto traits
11437
11438Declaring a negative impl `impl !SomeAutoTrait for SomeType` for an
11439auto-trait serves two purposes:
11440
11441* as with any trait, it declares that `SomeType` will never implement `SomeAutoTrait`;
11442* it disables the automatic `SomeType: SomeAutoTrait` impl that would otherwise have been generated.
11443
11444Note that, at present, there is no way to indicate that a given type
11445does not implement an auto trait *but that it may do so in the
11446future*. For ordinary types, this is done by simply not declaring any
11447impl at all, but that is not an option for auto traits. A workaround
11448is that one could embed a marker type as one of the fields, where the
11449marker type is `!AutoTrait`.
11450
11451## Immediate uses
11452
11453Negative 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).
11454
11455This serves two purposes:
11456
11457* For proving the correctness of unsafe code, we can use that impl as evidence that no `DerefMut` or `Clone` impl exists.
11458* It prevents downstream crates from creating such impls.
11459"##,
11460 default_severity: Severity::Allow,
11461 warn_since: None,
11462 deny_since: None,
11463 },
11464 Lint {
11465 label: "never_patterns",
11466 description: r##"# `never_patterns`
11467
11468Allows the `!` pattern.
11469
11470The tracking issue for this feature is: [#118155]
11471
11472[#118155]: https://github.com/rust-lang/rust/issues/118155
11473
11474------------------------
11475"##,
11476 default_severity: Severity::Allow,
11477 warn_since: None,
11478 deny_since: None,
11479 },
11480 Lint {
11481 label: "never_type",
11482 description: r##"# `never_type`
11483
11484Allows the `!` type. Does not imply 'exhaustive_patterns' (below) any more.
11485
11486The tracking issue for this feature is: [#35121]
11487
11488[#35121]: https://github.com/rust-lang/rust/issues/35121
11489
11490------------------------
11491"##,
11492 default_severity: Severity::Allow,
11493 warn_since: None,
11494 deny_since: None,
11495 },
11496 Lint {
11497 label: "new_range",
11498 description: r##"# `new_range`
11499
11500The tracking issue for this feature is: [#123741]
11501
11502[#123741]: https://github.com/rust-lang/rust/issues/123741
11503
11504---
11505
11506Switch the syntaxes `a..`, `a..b`, and `a..=b` to resolve the new range types.
11507"##,
11508 default_severity: Severity::Allow,
11509 warn_since: None,
11510 deny_since: None,
11511 },
11512 Lint {
11513 label: "new_range_api_legacy",
11514 description: r##"# `new_range_api_legacy`
11515
11516
11517
11518The tracking issue for this feature is: [#125687]
11519
11520[#125687]: https://github.com/rust-lang/rust/issues/125687
11521
11522------------------------
11523"##,
11524 default_severity: Severity::Allow,
11525 warn_since: None,
11526 deny_since: None,
11527 },
11528 Lint {
11529 label: "new_range_remainder",
11530 description: r##"# `new_range_remainder`
11531
11532
11533
11534The tracking issue for this feature is: [#154458]
11535
11536[#154458]: https://github.com/rust-lang/rust/issues/154458
11537
11538------------------------
11539"##,
11540 default_severity: Severity::Allow,
11541 warn_since: None,
11542 deny_since: None,
11543 },
11544 Lint {
11545 label: "next_index",
11546 description: r##"# `next_index`
11547
11548
11549
11550The tracking issue for this feature is: [#130711]
11551
11552[#130711]: https://github.com/rust-lang/rust/issues/130711
11553
11554------------------------
11555"##,
11556 default_severity: Severity::Allow,
11557 warn_since: None,
11558 deny_since: None,
11559 },
11560 Lint {
11561 label: "no_core",
11562 description: r##"# `no_core`
11563
11564Allows `#![no_core]`.
11565
11566The tracking issue for this feature is: [#29639]
11567
11568[#29639]: https://github.com/rust-lang/rust/issues/29639
11569
11570------------------------
11571"##,
11572 default_severity: Severity::Allow,
11573 warn_since: None,
11574 deny_since: None,
11575 },
11576 Lint {
11577 label: "non_exhaustive_omitted_patterns_lint",
11578 description: r##"# `non_exhaustive_omitted_patterns_lint`
11579
11580Allows using the `non_exhaustive_omitted_patterns` lint.
11581
11582The tracking issue for this feature is: [#89554]
11583
11584[#89554]: https://github.com/rust-lang/rust/issues/89554
11585
11586------------------------
11587"##,
11588 default_severity: Severity::Allow,
11589 warn_since: None,
11590 deny_since: None,
11591 },
11592 Lint {
11593 label: "non_lifetime_binders",
11594 description: r##"# `non_lifetime_binders`
11595
11596Allows `for<T>` binders in where-clauses
11597
11598The tracking issue for this feature is: [#108185]
11599
11600[#108185]: https://github.com/rust-lang/rust/issues/108185
11601
11602------------------------
11603"##,
11604 default_severity: Severity::Allow,
11605 warn_since: None,
11606 deny_since: None,
11607 },
11608 Lint {
11609 label: "nonpoison_condvar",
11610 description: r##"# `nonpoison_condvar`
11611
11612
11613
11614The tracking issue for this feature is: [#134645]
11615
11616[#134645]: https://github.com/rust-lang/rust/issues/134645
11617
11618------------------------
11619"##,
11620 default_severity: Severity::Allow,
11621 warn_since: None,
11622 deny_since: None,
11623 },
11624 Lint {
11625 label: "nonpoison_mutex",
11626 description: r##"# `nonpoison_mutex`
11627
11628
11629
11630The tracking issue for this feature is: [#134645]
11631
11632[#134645]: https://github.com/rust-lang/rust/issues/134645
11633
11634------------------------
11635"##,
11636 default_severity: Severity::Allow,
11637 warn_since: None,
11638 deny_since: None,
11639 },
11640 Lint {
11641 label: "nonpoison_rwlock",
11642 description: r##"# `nonpoison_rwlock`
11643
11644
11645
11646The tracking issue for this feature is: [#134645]
11647
11648[#134645]: https://github.com/rust-lang/rust/issues/134645
11649
11650------------------------
11651"##,
11652 default_severity: Severity::Allow,
11653 warn_since: None,
11654 deny_since: None,
11655 },
11656 Lint {
11657 label: "nonzero_bitwise",
11658 description: r##"# `nonzero_bitwise`
11659
11660
11661
11662The tracking issue for this feature is: [#128281]
11663
11664[#128281]: https://github.com/rust-lang/rust/issues/128281
11665
11666------------------------
11667"##,
11668 default_severity: Severity::Allow,
11669 warn_since: None,
11670 deny_since: None,
11671 },
11672 Lint {
11673 label: "nonzero_from_mut",
11674 description: r##"# `nonzero_from_mut`
11675
11676
11677
11678The tracking issue for this feature is: [#106290]
11679
11680[#106290]: https://github.com/rust-lang/rust/issues/106290
11681
11682------------------------
11683"##,
11684 default_severity: Severity::Allow,
11685 warn_since: None,
11686 deny_since: None,
11687 },
11688 Lint {
11689 label: "nonzero_from_str_radix",
11690 description: r##"# `nonzero_from_str_radix`
11691
11692
11693
11694The tracking issue for this feature is: [#152193]
11695
11696[#152193]: https://github.com/rust-lang/rust/issues/152193
11697
11698------------------------
11699"##,
11700 default_severity: Severity::Allow,
11701 warn_since: None,
11702 deny_since: None,
11703 },
11704 Lint {
11705 label: "nonzero_internals",
11706 description: r##"# `nonzero_internals`
11707
11708
11709
11710This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
11711
11712------------------------
11713"##,
11714 default_severity: Severity::Allow,
11715 warn_since: None,
11716 deny_since: None,
11717 },
11718 Lint {
11719 label: "nonzero_ops",
11720 description: r##"# `nonzero_ops`
11721
11722
11723
11724The tracking issue for this feature is: [#84186]
11725
11726[#84186]: https://github.com/rust-lang/rust/issues/84186
11727
11728------------------------
11729"##,
11730 default_severity: Severity::Allow,
11731 warn_since: None,
11732 deny_since: None,
11733 },
11734 Lint {
11735 label: "normalize_lexically",
11736 description: r##"# `normalize_lexically`
11737
11738
11739
11740The tracking issue for this feature is: [#134694]
11741
11742[#134694]: https://github.com/rust-lang/rust/issues/134694
11743
11744------------------------
11745"##,
11746 default_severity: Severity::Allow,
11747 warn_since: None,
11748 deny_since: None,
11749 },
11750 Lint {
11751 label: "num_internals",
11752 description: r##"# `num_internals`
11753
11754
11755
11756This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
11757
11758------------------------
11759"##,
11760 default_severity: Severity::Allow,
11761 warn_since: None,
11762 deny_since: None,
11763 },
11764 Lint {
11765 label: "numfmt",
11766 description: r##"# `numfmt`
11767
11768
11769
11770This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
11771
11772------------------------
11773"##,
11774 default_severity: Severity::Allow,
11775 warn_since: None,
11776 deny_since: None,
11777 },
11778 Lint {
11779 label: "nvptx_target_feature",
11780 description: r##"# `nvptx_target_feature`
11781
11782Target feaures on nvptx.
11783
11784The tracking issue for this feature is: [#150254]
11785
11786[#150254]: https://github.com/rust-lang/rust/issues/150254
11787
11788------------------------
11789"##,
11790 default_severity: Severity::Allow,
11791 warn_since: None,
11792 deny_since: None,
11793 },
11794 Lint {
11795 label: "objc_class_variant",
11796 description: r##"# `objc_class_variant`
11797
11798
11799
11800This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
11801
11802------------------------
11803"##,
11804 default_severity: Severity::Allow,
11805 warn_since: None,
11806 deny_since: None,
11807 },
11808 Lint {
11809 label: "objc_selector_variant",
11810 description: r##"# `objc_selector_variant`
11811
11812
11813
11814This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
11815
11816------------------------
11817"##,
11818 default_severity: Severity::Allow,
11819 warn_since: None,
11820 deny_since: None,
11821 },
11822 Lint {
11823 label: "offset_of_enum",
11824 description: r##"# `offset_of_enum`
11825
11826The tracking issue for this feature is: [#120141]
11827
11828[#120141]: https://github.com/rust-lang/rust/issues/120141
11829
11830------------------------
11831
11832When the `offset_of_enum` feature is enabled, the [`offset_of!`] macro may be used to obtain the
11833offsets of fields of `enum`s; to express this, `enum` variants may be traversed as if they were
11834fields. Variants themselves do not have an offset, so they cannot appear as the last path component.
11835
11836```rust
11837#![feature(offset_of_enum)]
11838use std::mem;
11839
11840#[repr(u8)]
11841enum Enum {
11842 A(u8, u16),
11843 B { one: u8, two: u16 },
11844}
11845
11846assert_eq!(mem::offset_of!(Enum, A.0), 1);
11847assert_eq!(mem::offset_of!(Enum, B.two), 2);
11848
11849assert_eq!(mem::offset_of!(Option<&u8>, Some.0), 0);
11850```
11851
11852[`offset_of!`]: ../../std/mem/macro.offset_of.html
11853"##,
11854 default_severity: Severity::Allow,
11855 warn_since: None,
11856 deny_since: None,
11857 },
11858 Lint {
11859 label: "offset_of_slice",
11860 description: r##"# `offset_of_slice`
11861
11862The tracking issue for this feature is: [#126151]
11863
11864[#126151]: https://github.com/rust-lang/rust/issues/126151
11865
11866------------------------
11867
11868When the `offset_of_slice` feature is enabled, the [`offset_of!`] macro may be used to determine
11869the offset of fields whose type is `[T]`, that is, a slice of dynamic size.
11870
11871In general, fields whose type is dynamically sized do not have statically known offsets because
11872they do not have statically known alignments. However, `[T]` has the same alignment as `T`, so
11873it specifically may be allowed.
11874
11875```rust
11876#![feature(offset_of_slice)]
11877
11878#[repr(C)]
11879pub struct Struct {
11880 head: u32,
11881 tail: [u8],
11882}
11883
11884fn main() {
11885 assert_eq!(std::mem::offset_of!(Struct, tail), 4);
11886}
11887```
11888
11889[`offset_of!`]: ../../std/mem/macro.offset_of.html
11890"##,
11891 default_severity: Severity::Allow,
11892 warn_since: None,
11893 deny_since: None,
11894 },
11895 Lint {
11896 label: "once_cell_get_mut",
11897 description: r##"# `once_cell_get_mut`
11898
11899
11900
11901The tracking issue for this feature is: [#121641]
11902
11903[#121641]: https://github.com/rust-lang/rust/issues/121641
11904
11905------------------------
11906"##,
11907 default_severity: Severity::Allow,
11908 warn_since: None,
11909 deny_since: None,
11910 },
11911 Lint {
11912 label: "once_cell_try",
11913 description: r##"# `once_cell_try`
11914
11915
11916
11917The tracking issue for this feature is: [#109737]
11918
11919[#109737]: https://github.com/rust-lang/rust/issues/109737
11920
11921------------------------
11922"##,
11923 default_severity: Severity::Allow,
11924 warn_since: None,
11925 deny_since: None,
11926 },
11927 Lint {
11928 label: "once_cell_try_insert",
11929 description: r##"# `once_cell_try_insert`
11930
11931
11932
11933The tracking issue for this feature is: [#116693]
11934
11935[#116693]: https://github.com/rust-lang/rust/issues/116693
11936
11937------------------------
11938"##,
11939 default_severity: Severity::Allow,
11940 warn_since: None,
11941 deny_since: None,
11942 },
11943 Lint {
11944 label: "one_sided_range",
11945 description: r##"# `one_sided_range`
11946
11947
11948
11949The tracking issue for this feature is: [#69780]
11950
11951[#69780]: https://github.com/rust-lang/rust/issues/69780
11952
11953------------------------
11954"##,
11955 default_severity: Severity::Allow,
11956 warn_since: None,
11957 deny_since: None,
11958 },
11959 Lint {
11960 label: "oneshot_channel",
11961 description: r##"# `oneshot_channel`
11962
11963
11964
11965The tracking issue for this feature is: [#143674]
11966
11967[#143674]: https://github.com/rust-lang/rust/issues/143674
11968
11969------------------------
11970"##,
11971 default_severity: Severity::Allow,
11972 warn_since: None,
11973 deny_since: None,
11974 },
11975 Lint {
11976 label: "optimize_attribute",
11977 description: r##"# `optimize_attribute`
11978
11979Allows using `#[optimize(X)]`.
11980
11981The tracking issue for this feature is: [#54882]
11982
11983[#54882]: https://github.com/rust-lang/rust/issues/54882
11984
11985------------------------
11986"##,
11987 default_severity: Severity::Allow,
11988 warn_since: None,
11989 deny_since: None,
11990 },
11991 Lint {
11992 label: "option_array_transpose",
11993 description: r##"# `option_array_transpose`
11994
11995
11996
11997The tracking issue for this feature is: [#130828]
11998
11999[#130828]: https://github.com/rust-lang/rust/issues/130828
12000
12001------------------------
12002"##,
12003 default_severity: Severity::Allow,
12004 warn_since: None,
12005 deny_since: None,
12006 },
12007 Lint {
12008 label: "option_get_or_try_insert_with",
12009 description: r##"# `option_get_or_try_insert_with`
12010
12011
12012
12013The tracking issue for this feature is: [#143648]
12014
12015[#143648]: https://github.com/rust-lang/rust/issues/143648
12016
12017------------------------
12018"##,
12019 default_severity: Severity::Allow,
12020 warn_since: None,
12021 deny_since: None,
12022 },
12023 Lint {
12024 label: "option_into_flat_iter",
12025 description: r##"# `option_into_flat_iter`
12026
12027
12028
12029The tracking issue for this feature is: [#148441]
12030
12031[#148441]: https://github.com/rust-lang/rust/issues/148441
12032
12033------------------------
12034"##,
12035 default_severity: Severity::Allow,
12036 warn_since: None,
12037 deny_since: None,
12038 },
12039 Lint {
12040 label: "option_reduce",
12041 description: r##"# `option_reduce`
12042
12043
12044
12045The tracking issue for this feature is: [#144273]
12046
12047[#144273]: https://github.com/rust-lang/rust/issues/144273
12048
12049------------------------
12050"##,
12051 default_severity: Severity::Allow,
12052 warn_since: None,
12053 deny_since: None,
12054 },
12055 Lint {
12056 label: "option_reference_flattening",
12057 description: r##"# `option_reference_flattening`
12058
12059
12060
12061The tracking issue for this feature is: [#149221]
12062
12063[#149221]: https://github.com/rust-lang/rust/issues/149221
12064
12065------------------------
12066"##,
12067 default_severity: Severity::Allow,
12068 warn_since: None,
12069 deny_since: None,
12070 },
12071 Lint {
12072 label: "option_zip",
12073 description: r##"# `option_zip`
12074
12075
12076
12077The tracking issue for this feature is: [#70086]
12078
12079[#70086]: https://github.com/rust-lang/rust/issues/70086
12080
12081------------------------
12082"##,
12083 default_severity: Severity::Allow,
12084 warn_since: None,
12085 deny_since: None,
12086 },
12087 Lint {
12088 label: "os_str_slice",
12089 description: r##"# `os_str_slice`
12090
12091
12092
12093The tracking issue for this feature is: [#118485]
12094
12095[#118485]: https://github.com/rust-lang/rust/issues/118485
12096
12097------------------------
12098"##,
12099 default_severity: Severity::Allow,
12100 warn_since: None,
12101 deny_since: None,
12102 },
12103 Lint {
12104 label: "os_string_truncate",
12105 description: r##"# `os_string_truncate`
12106
12107
12108
12109The tracking issue for this feature is: [#133262]
12110
12111[#133262]: https://github.com/rust-lang/rust/issues/133262
12112
12113------------------------
12114"##,
12115 default_severity: Severity::Allow,
12116 warn_since: None,
12117 deny_since: None,
12118 },
12119 Lint {
12120 label: "panic_abort",
12121 description: r##"# `panic_abort`
12122
12123
12124
12125The tracking issue for this feature is: [#32837]
12126
12127[#32837]: https://github.com/rust-lang/rust/issues/32837
12128
12129------------------------
12130"##,
12131 default_severity: Severity::Allow,
12132 warn_since: None,
12133 deny_since: None,
12134 },
12135 Lint {
12136 label: "panic_always_abort",
12137 description: r##"# `panic_always_abort`
12138
12139
12140
12141The tracking issue for this feature is: [#84438]
12142
12143[#84438]: https://github.com/rust-lang/rust/issues/84438
12144
12145------------------------
12146"##,
12147 default_severity: Severity::Allow,
12148 warn_since: None,
12149 deny_since: None,
12150 },
12151 Lint {
12152 label: "panic_backtrace_config",
12153 description: r##"# `panic_backtrace_config`
12154
12155
12156
12157The tracking issue for this feature is: [#93346]
12158
12159[#93346]: https://github.com/rust-lang/rust/issues/93346
12160
12161------------------------
12162"##,
12163 default_severity: Severity::Allow,
12164 warn_since: None,
12165 deny_since: None,
12166 },
12167 Lint {
12168 label: "panic_can_unwind",
12169 description: r##"# `panic_can_unwind`
12170
12171
12172
12173The tracking issue for this feature is: [#92988]
12174
12175[#92988]: https://github.com/rust-lang/rust/issues/92988
12176
12177------------------------
12178"##,
12179 default_severity: Severity::Allow,
12180 warn_since: None,
12181 deny_since: None,
12182 },
12183 Lint {
12184 label: "panic_internals",
12185 description: r##"# `panic_internals`
12186
12187
12188
12189This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12190
12191------------------------
12192"##,
12193 default_severity: Severity::Allow,
12194 warn_since: None,
12195 deny_since: None,
12196 },
12197 Lint {
12198 label: "panic_runtime",
12199 description: r##"# `panic_runtime`
12200
12201Allows using the `#![panic_runtime]` attribute.
12202
12203The tracking issue for this feature is: [#32837]
12204
12205[#32837]: https://github.com/rust-lang/rust/issues/32837
12206
12207------------------------
12208"##,
12209 default_severity: Severity::Allow,
12210 warn_since: None,
12211 deny_since: None,
12212 },
12213 Lint {
12214 label: "panic_unwind",
12215 description: r##"# `panic_unwind`
12216
12217
12218
12219The tracking issue for this feature is: [#32837]
12220
12221[#32837]: https://github.com/rust-lang/rust/issues/32837
12222
12223------------------------
12224"##,
12225 default_severity: Severity::Allow,
12226 warn_since: None,
12227 deny_since: None,
12228 },
12229 Lint {
12230 label: "panic_update_hook",
12231 description: r##"# `panic_update_hook`
12232
12233
12234
12235The tracking issue for this feature is: [#92649]
12236
12237[#92649]: https://github.com/rust-lang/rust/issues/92649
12238
12239------------------------
12240"##,
12241 default_severity: Severity::Allow,
12242 warn_since: None,
12243 deny_since: None,
12244 },
12245 Lint {
12246 label: "partial_ord_chaining_methods",
12247 description: r##"# `partial_ord_chaining_methods`
12248
12249
12250
12251This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12252
12253------------------------
12254"##,
12255 default_severity: Severity::Allow,
12256 warn_since: None,
12257 deny_since: None,
12258 },
12259 Lint {
12260 label: "patchable_function_entry",
12261 description: r##"# `patchable_function_entry`
12262
12263Allows specifying nop padding on functions for dynamic patching.
12264
12265The tracking issue for this feature is: [#123115]
12266
12267[#123115]: https://github.com/rust-lang/rust/issues/123115
12268
12269------------------------
12270"##,
12271 default_severity: Severity::Allow,
12272 warn_since: None,
12273 deny_since: None,
12274 },
12275 Lint {
12276 label: "path_absolute_method",
12277 description: r##"# `path_absolute_method`
12278
12279
12280
12281The tracking issue for this feature is: [#153328]
12282
12283[#153328]: https://github.com/rust-lang/rust/issues/153328
12284
12285------------------------
12286"##,
12287 default_severity: Severity::Allow,
12288 warn_since: None,
12289 deny_since: None,
12290 },
12291 Lint {
12292 label: "path_is_empty",
12293 description: r##"# `path_is_empty`
12294
12295
12296
12297The tracking issue for this feature is: [#148494]
12298
12299[#148494]: https://github.com/rust-lang/rust/issues/148494
12300
12301------------------------
12302"##,
12303 default_severity: Severity::Allow,
12304 warn_since: None,
12305 deny_since: None,
12306 },
12307 Lint {
12308 label: "path_trailing_sep",
12309 description: r##"# `path_trailing_sep`
12310
12311
12312
12313The tracking issue for this feature is: [#142503]
12314
12315[#142503]: https://github.com/rust-lang/rust/issues/142503
12316
12317------------------------
12318"##,
12319 default_severity: Severity::Allow,
12320 warn_since: None,
12321 deny_since: None,
12322 },
12323 Lint {
12324 label: "pathbuf_into_string",
12325 description: r##"# `pathbuf_into_string`
12326
12327
12328
12329The tracking issue for this feature is: [#156203]
12330
12331[#156203]: https://github.com/rust-lang/rust/issues/156203
12332
12333------------------------
12334"##,
12335 default_severity: Severity::Allow,
12336 warn_since: None,
12337 deny_since: None,
12338 },
12339 Lint {
12340 label: "pattern",
12341 description: r##"# `pattern`
12342
12343
12344
12345The tracking issue for this feature is: [#27721]
12346
12347[#27721]: https://github.com/rust-lang/rust/issues/27721
12348
12349------------------------
12350"##,
12351 default_severity: Severity::Allow,
12352 warn_since: None,
12353 deny_since: None,
12354 },
12355 Lint {
12356 label: "pattern_complexity_limit",
12357 description: r##"# `pattern_complexity_limit`
12358
12359Set the maximum pattern complexity allowed (not limited by default).
12360
12361This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12362
12363------------------------
12364"##,
12365 default_severity: Severity::Allow,
12366 warn_since: None,
12367 deny_since: None,
12368 },
12369 Lint {
12370 label: "pattern_type_macro",
12371 description: r##"# `pattern_type_macro`
12372
12373
12374
12375The tracking issue for this feature is: [#123646]
12376
12377[#123646]: https://github.com/rust-lang/rust/issues/123646
12378
12379------------------------
12380"##,
12381 default_severity: Severity::Allow,
12382 warn_since: None,
12383 deny_since: None,
12384 },
12385 Lint {
12386 label: "pattern_type_range_trait",
12387 description: r##"# `pattern_type_range_trait`
12388
12389
12390
12391The tracking issue for this feature is: [#123646]
12392
12393[#123646]: https://github.com/rust-lang/rust/issues/123646
12394
12395------------------------
12396"##,
12397 default_severity: Severity::Allow,
12398 warn_since: None,
12399 deny_since: None,
12400 },
12401 Lint {
12402 label: "pattern_types",
12403 description: r##"# `pattern_types`
12404
12405Allows using pattern types.
12406
12407The tracking issue for this feature is: [#123646]
12408
12409[#123646]: https://github.com/rust-lang/rust/issues/123646
12410
12411------------------------
12412"##,
12413 default_severity: Severity::Allow,
12414 warn_since: None,
12415 deny_since: None,
12416 },
12417 Lint {
12418 label: "peer_credentials_unix_socket",
12419 description: r##"# `peer_credentials_unix_socket`
12420
12421
12422
12423The tracking issue for this feature is: [#42839]
12424
12425[#42839]: https://github.com/rust-lang/rust/issues/42839
12426
12427------------------------
12428"##,
12429 default_severity: Severity::Allow,
12430 warn_since: None,
12431 deny_since: None,
12432 },
12433 Lint {
12434 label: "phantom_variance_markers",
12435 description: r##"# `phantom_variance_markers`
12436
12437
12438
12439The tracking issue for this feature is: [#135806]
12440
12441[#135806]: https://github.com/rust-lang/rust/issues/135806
12442
12443------------------------
12444"##,
12445 default_severity: Severity::Allow,
12446 warn_since: None,
12447 deny_since: None,
12448 },
12449 Lint {
12450 label: "pin_coerce_unsized_trait",
12451 description: r##"# `pin_coerce_unsized_trait`
12452
12453
12454
12455The tracking issue for this feature is: [#150112]
12456
12457[#150112]: https://github.com/rust-lang/rust/issues/150112
12458
12459------------------------
12460"##,
12461 default_severity: Severity::Allow,
12462 warn_since: None,
12463 deny_since: None,
12464 },
12465 Lint {
12466 label: "pin_derefmut_internals",
12467 description: r##"# `pin_derefmut_internals`
12468
12469
12470
12471This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12472
12473------------------------
12474"##,
12475 default_severity: Severity::Allow,
12476 warn_since: None,
12477 deny_since: None,
12478 },
12479 Lint {
12480 label: "pin_ergonomics",
12481 description: r##"# `pin_ergonomics`
12482
12483Experimental features that make `Pin` more ergonomic.
12484
12485The tracking issue for this feature is: [#130494]
12486
12487[#130494]: https://github.com/rust-lang/rust/issues/130494
12488
12489------------------------
12490"##,
12491 default_severity: Severity::Allow,
12492 warn_since: None,
12493 deny_since: None,
12494 },
12495 Lint {
12496 label: "pin_macro_internals",
12497 description: r##"# `pin_macro_internals`
12498
12499
12500
12501This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12502
12503------------------------
12504"##,
12505 default_severity: Severity::Allow,
12506 warn_since: None,
12507 deny_since: None,
12508 },
12509 Lint {
12510 label: "pointer_is_aligned_to",
12511 description: r##"# `pointer_is_aligned_to`
12512
12513
12514
12515The tracking issue for this feature is: [#96284]
12516
12517[#96284]: https://github.com/rust-lang/rust/issues/96284
12518
12519------------------------
12520"##,
12521 default_severity: Severity::Allow,
12522 warn_since: None,
12523 deny_since: None,
12524 },
12525 Lint {
12526 label: "pointer_try_cast_aligned",
12527 description: r##"# `pointer_try_cast_aligned`
12528
12529
12530
12531The tracking issue for this feature is: [#141221]
12532
12533[#141221]: https://github.com/rust-lang/rust/issues/141221
12534
12535------------------------
12536"##,
12537 default_severity: Severity::Allow,
12538 warn_since: None,
12539 deny_since: None,
12540 },
12541 Lint {
12542 label: "portable_simd",
12543 description: r##"# `portable_simd`
12544
12545
12546
12547The tracking issue for this feature is: [#86656]
12548
12549[#86656]: https://github.com/rust-lang/rust/issues/86656
12550
12551------------------------
12552"##,
12553 default_severity: Severity::Allow,
12554 warn_since: None,
12555 deny_since: None,
12556 },
12557 Lint {
12558 label: "postfix_match",
12559 description: r##"# `postfix-match`
12560
12561`postfix-match` adds the feature for matching upon values postfix
12562the expressions that generate the values.
12563
12564The tracking issue for this feature is: [#121618](https://github.com/rust-lang/rust/issues/121618).
12565
12566------------------------
12567
12568```rust,edition2021
12569#![feature(postfix_match)]
12570
12571enum Foo {
12572 Bar,
12573 Baz
12574}
12575
12576fn get_foo() -> Foo {
12577 Foo::Bar
12578}
12579
12580get_foo().match {
12581 Foo::Bar => {},
12582 Foo::Baz => panic!(),
12583}
12584```
12585"##,
12586 default_severity: Severity::Allow,
12587 warn_since: None,
12588 deny_since: None,
12589 },
12590 Lint {
12591 label: "powerpc_target_feature",
12592 description: r##"# `powerpc_target_feature`
12593
12594Target features on powerpc.
12595
12596The tracking issue for this feature is: [#150255]
12597
12598[#150255]: https://github.com/rust-lang/rust/issues/150255
12599
12600------------------------
12601"##,
12602 default_severity: Severity::Allow,
12603 warn_since: None,
12604 deny_since: None,
12605 },
12606 Lint {
12607 label: "prelude_future",
12608 description: r##"# `prelude_future`
12609
12610
12611
12612This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12613
12614------------------------
12615"##,
12616 default_severity: Severity::Allow,
12617 warn_since: None,
12618 deny_since: None,
12619 },
12620 Lint {
12621 label: "prelude_import",
12622 description: r##"# `prelude_import`
12623
12624Allows using `#[prelude_import]` on glob `use` items.
12625
12626This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12627
12628------------------------
12629"##,
12630 default_severity: Severity::Allow,
12631 warn_since: None,
12632 deny_since: None,
12633 },
12634 Lint {
12635 label: "prelude_next",
12636 description: r##"# `prelude_next`
12637
12638
12639
12640This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12641
12642------------------------
12643"##,
12644 default_severity: Severity::Allow,
12645 warn_since: None,
12646 deny_since: None,
12647 },
12648 Lint {
12649 label: "prfchw_target_feature",
12650 description: r##"# `prfchw_target_feature`
12651
12652The prfchw target feature on x86.
12653
12654The tracking issue for this feature is: [#150256]
12655
12656[#150256]: https://github.com/rust-lang/rust/issues/150256
12657
12658------------------------
12659"##,
12660 default_severity: Severity::Allow,
12661 warn_since: None,
12662 deny_since: None,
12663 },
12664 Lint {
12665 label: "print_internals",
12666 description: r##"# `print_internals`
12667
12668This feature is internal to the Rust compiler and is not intended for general use.
12669
12670------------------------
12671"##,
12672 default_severity: Severity::Allow,
12673 warn_since: None,
12674 deny_since: None,
12675 },
12676 Lint {
12677 label: "proc_macro_def_site",
12678 description: r##"# `proc_macro_def_site`
12679
12680
12681
12682The tracking issue for this feature is: [#54724]
12683
12684[#54724]: https://github.com/rust-lang/rust/issues/54724
12685
12686------------------------
12687"##,
12688 default_severity: Severity::Allow,
12689 warn_since: None,
12690 deny_since: None,
12691 },
12692 Lint {
12693 label: "proc_macro_diagnostic",
12694 description: r##"# `proc_macro_diagnostic`
12695
12696
12697
12698The tracking issue for this feature is: [#54140]
12699
12700[#54140]: https://github.com/rust-lang/rust/issues/54140
12701
12702------------------------
12703"##,
12704 default_severity: Severity::Allow,
12705 warn_since: None,
12706 deny_since: None,
12707 },
12708 Lint {
12709 label: "proc_macro_expand",
12710 description: r##"# `proc_macro_expand`
12711
12712
12713
12714The tracking issue for this feature is: [#90765]
12715
12716[#90765]: https://github.com/rust-lang/rust/issues/90765
12717
12718------------------------
12719"##,
12720 default_severity: Severity::Allow,
12721 warn_since: None,
12722 deny_since: None,
12723 },
12724 Lint {
12725 label: "proc_macro_hygiene",
12726 description: r##"# `proc_macro_hygiene`
12727
12728Allows macro attributes on expressions, statements and non-inline modules.
12729
12730The tracking issue for this feature is: [#54727]
12731
12732[#54727]: https://github.com/rust-lang/rust/issues/54727
12733
12734------------------------
12735"##,
12736 default_severity: Severity::Allow,
12737 warn_since: None,
12738 deny_since: None,
12739 },
12740 Lint {
12741 label: "proc_macro_internals",
12742 description: r##"# `proc_macro_internals`
12743
12744
12745
12746The tracking issue for this feature is: [#27812]
12747
12748[#27812]: https://github.com/rust-lang/rust/issues/27812
12749
12750------------------------
12751"##,
12752 default_severity: Severity::Allow,
12753 warn_since: None,
12754 deny_since: None,
12755 },
12756 Lint {
12757 label: "proc_macro_quote",
12758 description: r##"# `proc_macro_quote`
12759
12760
12761
12762The tracking issue for this feature is: [#54722]
12763
12764[#54722]: https://github.com/rust-lang/rust/issues/54722
12765
12766------------------------
12767"##,
12768 default_severity: Severity::Allow,
12769 warn_since: None,
12770 deny_since: None,
12771 },
12772 Lint {
12773 label: "proc_macro_span",
12774 description: r##"# `proc_macro_span`
12775
12776
12777
12778The tracking issue for this feature is: [#54725]
12779
12780[#54725]: https://github.com/rust-lang/rust/issues/54725
12781
12782------------------------
12783"##,
12784 default_severity: Severity::Allow,
12785 warn_since: None,
12786 deny_since: None,
12787 },
12788 Lint {
12789 label: "proc_macro_totokens",
12790 description: r##"# `proc_macro_totokens`
12791
12792
12793
12794The tracking issue for this feature is: [#130977]
12795
12796[#130977]: https://github.com/rust-lang/rust/issues/130977
12797
12798------------------------
12799"##,
12800 default_severity: Severity::Allow,
12801 warn_since: None,
12802 deny_since: None,
12803 },
12804 Lint {
12805 label: "proc_macro_tracked_env",
12806 description: r##"# `proc_macro_tracked_env`
12807
12808
12809
12810The tracking issue for this feature is: [#99515]
12811
12812[#99515]: https://github.com/rust-lang/rust/issues/99515
12813
12814------------------------
12815"##,
12816 default_severity: Severity::Allow,
12817 warn_since: None,
12818 deny_since: None,
12819 },
12820 Lint {
12821 label: "proc_macro_tracked_path",
12822 description: r##"# `proc_macro_tracked_path`
12823
12824
12825
12826The tracking issue for this feature is: [#99515]
12827
12828[#99515]: https://github.com/rust-lang/rust/issues/99515
12829
12830------------------------
12831"##,
12832 default_severity: Severity::Allow,
12833 warn_since: None,
12834 deny_since: None,
12835 },
12836 Lint {
12837 label: "proc_macro_value",
12838 description: r##"# `proc_macro_value`
12839
12840
12841
12842The tracking issue for this feature is: [#136652]
12843
12844[#136652]: https://github.com/rust-lang/rust/issues/136652
12845
12846------------------------
12847"##,
12848 default_severity: Severity::Allow,
12849 warn_since: None,
12850 deny_since: None,
12851 },
12852 Lint {
12853 label: "process_chroot",
12854 description: r##"# `process_chroot`
12855
12856
12857
12858The tracking issue for this feature is: [#141298]
12859
12860[#141298]: https://github.com/rust-lang/rust/issues/141298
12861
12862------------------------
12863"##,
12864 default_severity: Severity::Allow,
12865 warn_since: None,
12866 deny_since: None,
12867 },
12868 Lint {
12869 label: "process_exitcode_internals",
12870 description: r##"# `process_exitcode_internals`
12871
12872
12873
12874This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12875
12876------------------------
12877"##,
12878 default_severity: Severity::Allow,
12879 warn_since: None,
12880 deny_since: None,
12881 },
12882 Lint {
12883 label: "process_internals",
12884 description: r##"# `process_internals`
12885
12886
12887
12888This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
12889
12890------------------------
12891"##,
12892 default_severity: Severity::Allow,
12893 warn_since: None,
12894 deny_since: None,
12895 },
12896 Lint {
12897 label: "process_setsid",
12898 description: r##"# `process_setsid`
12899
12900
12901
12902The tracking issue for this feature is: [#105376]
12903
12904[#105376]: https://github.com/rust-lang/rust/issues/105376
12905
12906------------------------
12907"##,
12908 default_severity: Severity::Allow,
12909 warn_since: None,
12910 deny_since: None,
12911 },
12912 Lint {
12913 label: "profiler_runtime",
12914 description: r##"# `profiler_runtime`
12915
12916The tracking issue for this feature is: [#42524](https://github.com/rust-lang/rust/issues/42524).
12917
12918------------------------
12919"##,
12920 default_severity: Severity::Allow,
12921 warn_since: None,
12922 deny_since: None,
12923 },
12924 Lint {
12925 label: "profiler_runtime_lib",
12926 description: r##"# `profiler_runtime_lib`
12927
12928This feature is internal to the Rust compiler and is not intended for general use.
12929
12930------------------------
12931"##,
12932 default_severity: Severity::Allow,
12933 warn_since: None,
12934 deny_since: None,
12935 },
12936 Lint {
12937 label: "profiling_marker_api",
12938 description: r##"# `profiling_marker_api`
12939
12940
12941
12942The tracking issue for this feature is: [#148197]
12943
12944[#148197]: https://github.com/rust-lang/rust/issues/148197
12945
12946------------------------
12947"##,
12948 default_severity: Severity::Allow,
12949 warn_since: None,
12950 deny_since: None,
12951 },
12952 Lint {
12953 label: "ptr_alignment_type",
12954 description: r##"# `ptr_alignment_type`
12955
12956
12957
12958The tracking issue for this feature is: [#102070]
12959
12960[#102070]: https://github.com/rust-lang/rust/issues/102070
12961
12962------------------------
12963"##,
12964 default_severity: Severity::Allow,
12965 warn_since: None,
12966 deny_since: None,
12967 },
12968 Lint {
12969 label: "ptr_as_uninit",
12970 description: r##"# `ptr_as_uninit`
12971
12972
12973
12974The tracking issue for this feature is: [#75402]
12975
12976[#75402]: https://github.com/rust-lang/rust/issues/75402
12977
12978------------------------
12979"##,
12980 default_severity: Severity::Allow,
12981 warn_since: None,
12982 deny_since: None,
12983 },
12984 Lint {
12985 label: "ptr_cast_array",
12986 description: r##"# `ptr_cast_array`
12987
12988
12989
12990The tracking issue for this feature is: [#144514]
12991
12992[#144514]: https://github.com/rust-lang/rust/issues/144514
12993
12994------------------------
12995"##,
12996 default_severity: Severity::Allow,
12997 warn_since: None,
12998 deny_since: None,
12999 },
13000 Lint {
13001 label: "ptr_cast_slice",
13002 description: r##"# `ptr_cast_slice`
13003
13004
13005
13006The tracking issue for this feature is: [#149103]
13007
13008[#149103]: https://github.com/rust-lang/rust/issues/149103
13009
13010------------------------
13011"##,
13012 default_severity: Severity::Allow,
13013 warn_since: None,
13014 deny_since: None,
13015 },
13016 Lint {
13017 label: "ptr_internals",
13018 description: r##"# `ptr_internals`
13019
13020
13021
13022This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
13023
13024------------------------
13025"##,
13026 default_severity: Severity::Allow,
13027 warn_since: None,
13028 deny_since: None,
13029 },
13030 Lint {
13031 label: "ptr_mask",
13032 description: r##"# `ptr_mask`
13033
13034
13035
13036The tracking issue for this feature is: [#98290]
13037
13038[#98290]: https://github.com/rust-lang/rust/issues/98290
13039
13040------------------------
13041"##,
13042 default_severity: Severity::Allow,
13043 warn_since: None,
13044 deny_since: None,
13045 },
13046 Lint {
13047 label: "ptr_metadata",
13048 description: r##"# `ptr_metadata`
13049
13050
13051
13052The tracking issue for this feature is: [#81513]
13053
13054[#81513]: https://github.com/rust-lang/rust/issues/81513
13055
13056------------------------
13057"##,
13058 default_severity: Severity::Allow,
13059 warn_since: None,
13060 deny_since: None,
13061 },
13062 Lint {
13063 label: "pub_crate_should_not_need_unstable_attr",
13064 description: r##"# `pub_crate_should_not_need_unstable_attr`
13065
13066
13067
13068This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
13069
13070------------------------
13071"##,
13072 default_severity: Severity::Allow,
13073 warn_since: None,
13074 deny_since: None,
13075 },
13076 Lint {
13077 label: "random",
13078 description: r##"# `random`
13079
13080
13081
13082The tracking issue for this feature is: [#130703]
13083
13084[#130703]: https://github.com/rust-lang/rust/issues/130703
13085
13086------------------------
13087"##,
13088 default_severity: Severity::Allow,
13089 warn_since: None,
13090 deny_since: None,
13091 },
13092 Lint {
13093 label: "range_bounds_is_empty",
13094 description: r##"# `range_bounds_is_empty`
13095
13096
13097
13098The tracking issue for this feature is: [#137300]
13099
13100[#137300]: https://github.com/rust-lang/rust/issues/137300
13101
13102------------------------
13103"##,
13104 default_severity: Severity::Allow,
13105 warn_since: None,
13106 deny_since: None,
13107 },
13108 Lint {
13109 label: "range_into_bounds",
13110 description: r##"# `range_into_bounds`
13111
13112
13113
13114The tracking issue for this feature is: [#136903]
13115
13116[#136903]: https://github.com/rust-lang/rust/issues/136903
13117
13118------------------------
13119"##,
13120 default_severity: Severity::Allow,
13121 warn_since: None,
13122 deny_since: None,
13123 },
13124 Lint {
13125 label: "raw_dylib_elf",
13126 description: r##"# `raw_dylib_elf`
13127
13128Allows the use of raw-dylibs on ELF platforms
13129
13130The tracking issue for this feature is: [#135694]
13131
13132[#135694]: https://github.com/rust-lang/rust/issues/135694
13133
13134------------------------
13135"##,
13136 default_severity: Severity::Allow,
13137 warn_since: None,
13138 deny_since: None,
13139 },
13140 Lint {
13141 label: "raw_os_error_ty",
13142 description: r##"# `raw_os_error_ty`
13143
13144
13145
13146The tracking issue for this feature is: [#107792]
13147
13148[#107792]: https://github.com/rust-lang/rust/issues/107792
13149
13150------------------------
13151"##,
13152 default_severity: Severity::Allow,
13153 warn_since: None,
13154 deny_since: None,
13155 },
13156 Lint {
13157 label: "raw_slice_split",
13158 description: r##"# `raw_slice_split`
13159
13160
13161
13162The tracking issue for this feature is: [#95595]
13163
13164[#95595]: https://github.com/rust-lang/rust/issues/95595
13165
13166------------------------
13167"##,
13168 default_severity: Severity::Allow,
13169 warn_since: None,
13170 deny_since: None,
13171 },
13172 Lint {
13173 label: "raw_vec_internals",
13174 description: r##"# `raw_vec_internals`
13175
13176
13177
13178This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
13179
13180------------------------
13181"##,
13182 default_severity: Severity::Allow,
13183 warn_since: None,
13184 deny_since: None,
13185 },
13186 Lint {
13187 label: "read_array",
13188 description: r##"# `read_array`
13189
13190
13191
13192The tracking issue for this feature is: [#148848]
13193
13194[#148848]: https://github.com/rust-lang/rust/issues/148848
13195
13196------------------------
13197"##,
13198 default_severity: Severity::Allow,
13199 warn_since: None,
13200 deny_since: None,
13201 },
13202 Lint {
13203 label: "read_buf",
13204 description: r##"# `read_buf`
13205
13206
13207
13208The tracking issue for this feature is: [#78485]
13209
13210[#78485]: https://github.com/rust-lang/rust/issues/78485
13211
13212------------------------
13213"##,
13214 default_severity: Severity::Allow,
13215 warn_since: None,
13216 deny_since: None,
13217 },
13218 Lint {
13219 label: "read_buf_at",
13220 description: r##"# `read_buf_at`
13221
13222
13223
13224The tracking issue for this feature is: [#140771]
13225
13226[#140771]: https://github.com/rust-lang/rust/issues/140771
13227
13228------------------------
13229"##,
13230 default_severity: Severity::Allow,
13231 warn_since: None,
13232 deny_since: None,
13233 },
13234 Lint {
13235 label: "reborrow",
13236 description: r##"# `reborrow`
13237
13238
13239
13240The tracking issue for this feature is: [#145612]
13241
13242[#145612]: https://github.com/rust-lang/rust/issues/145612
13243
13244------------------------
13245"##,
13246 default_severity: Severity::Allow,
13247 warn_since: None,
13248 deny_since: None,
13249 },
13250 Lint {
13251 label: "reentrant_lock",
13252 description: r##"# `reentrant_lock`
13253
13254
13255
13256The tracking issue for this feature is: [#121440]
13257
13258[#121440]: https://github.com/rust-lang/rust/issues/121440
13259
13260------------------------
13261"##,
13262 default_severity: Severity::Allow,
13263 warn_since: None,
13264 deny_since: None,
13265 },
13266 Lint {
13267 label: "reentrant_lock_data_ptr",
13268 description: r##"# `reentrant_lock_data_ptr`
13269
13270
13271
13272The tracking issue for this feature is: [#140368]
13273
13274[#140368]: https://github.com/rust-lang/rust/issues/140368
13275
13276------------------------
13277"##,
13278 default_severity: Severity::Allow,
13279 warn_since: None,
13280 deny_since: None,
13281 },
13282 Lint {
13283 label: "ref_pat_eat_one_layer_2024",
13284 description: r##"# `ref_pat_eat_one_layer_2024`
13285
13286The tracking issue for this feature is: [#123076]
13287
13288[#123076]: https://github.com/rust-lang/rust/issues/123076
13289
13290---
13291
13292This feature is incomplete and not yet intended for general use.
13293
13294This implements experimental, Edition-dependent match ergonomics under consideration for inclusion
13295in Rust, allowing `&` patterns in more places. For example:
13296
13297```rust,edition2024
13298#![feature(ref_pat_eat_one_layer_2024)]
13299#![allow(incomplete_features)]
13300#
13301# // Tests type equality in a way that avoids coercing `&&T` or `&mut T` to `&T`.
13302# trait Eq<T> {}
13303# impl<T> Eq<T> for T {}
13304# fn has_type<T>(_: impl Eq<T>) {}
13305
13306// `&` can match against a `ref` binding mode instead of a reference type:
13307let (x, &y) = &(0, 1);
13308has_type::<&u8>(x);
13309has_type::<u8>(y);
13310
13311// `&` can match against `&mut` references:
13312let &z = &mut 2;
13313has_type::<u8>(z);
13314```
13315
13316For specifics, see the corresponding typing rules for [Editions 2021 and earlier] and for
13317[Editions 2024 and later]. For more information on binding modes, see [The Rust Reference].
13318
13319For alternative experimental match ergonomics, see the feature
13320[`ref_pat_eat_one_layer_2024_structural`](./ref-pat-eat-one-layer-2024-structural.md).
13321
13322[Editions 2021 and earlier]: https://nadrieril.github.io/typing-rust-patterns/?compare=false&opts1=AQEBAQIBAQABAAAAAQEBAAEBAAABAAA%3D&mode=rules&do_cmp=false
13323[Editions 2024 and later]: https://nadrieril.github.io/typing-rust-patterns/?compare=false&opts1=AQEBAAABAQABAgIAAQEBAAEBAAABAAA%3D&mode=rules&do_cmp=false
13324[The Rust Reference]: https://doc.rust-lang.org/reference/patterns.html#binding-modes
13325"##,
13326 default_severity: Severity::Allow,
13327 warn_since: None,
13328 deny_since: None,
13329 },
13330 Lint {
13331 label: "ref_pat_eat_one_layer_2024_structural",
13332 description: r##"# `ref_pat_eat_one_layer_2024_structural`
13333
13334The tracking issue for this feature is: [#123076]
13335
13336[#123076]: https://github.com/rust-lang/rust/issues/123076
13337
13338---
13339
13340This feature is incomplete and not yet intended for general use.
13341
13342This implements experimental, Edition-dependent match ergonomics under consideration for inclusion
13343in Rust, allowing `&` patterns in more places. For example:
13344```rust,edition2024
13345#![feature(ref_pat_eat_one_layer_2024_structural)]
13346#![allow(incomplete_features)]
13347#
13348# // Tests type equality in a way that avoids coercing `&&T` or `&mut T` to `&T`.
13349# trait Eq<T> {}
13350# impl<T> Eq<T> for T {}
13351# fn has_type<T>(_: impl Eq<T>) {}
13352
13353// `&` can match against a `ref` binding mode instead of a reference type:
13354let (x, &y) = &(0, 1);
13355has_type::<&u8>(x);
13356has_type::<u8>(y);
13357
13358// `&` can match against `&mut` references:
13359let &z = &mut 2;
13360has_type::<u8>(z);
13361```
13362
13363For specifics, see the corresponding typing rules for [Editions 2021 and earlier] and for
13364[Editions 2024 and later]. For more information on binding modes, see [The Rust Reference].
13365
13366For alternative experimental match ergonomics, see the feature
13367[`ref_pat_eat_one_layer_2024`](./ref-pat-eat-one-layer-2024.md).
13368
13369[Editions 2021 and earlier]: https://nadrieril.github.io/typing-rust-patterns/?compare=false&opts1=AQEBAQIBAQEBAAAAAAAAAAAAAAAAAAA%3D&mode=rules&do_cmp=false
13370[Editions 2024 and later]: https://nadrieril.github.io/typing-rust-patterns/?compare=false&opts1=AQEBAgEBAQEBAgIAAAAAAAAAAAAAAAA%3D&mode=rules&do_cmp=false
13371[The Rust Reference]: https://doc.rust-lang.org/reference/patterns.html#binding-modes
13372"##,
13373 default_severity: Severity::Allow,
13374 warn_since: None,
13375 deny_since: None,
13376 },
13377 Lint {
13378 label: "refcell_try_map",
13379 description: r##"# `refcell_try_map`
13380
13381
13382
13383The tracking issue for this feature is: [#143801]
13384
13385[#143801]: https://github.com/rust-lang/rust/issues/143801
13386
13387------------------------
13388"##,
13389 default_severity: Severity::Allow,
13390 warn_since: None,
13391 deny_since: None,
13392 },
13393 Lint {
13394 label: "register_tool",
13395 description: r##"# `register_tool`
13396
13397The tracking issue for this feature is: [#66079]
13398
13399[#66079]: https://github.com/rust-lang/rust/issues/66079
13400
13401------------------------
13402
13403The `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.
13404
13405`register_tool` also allows configuring lint levels for external tools.
13406
13407Tool 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).
13408
13409------------------------
13410
13411`#![register_tool(tool)]` is an attribute, and is only valid at the crate root.
13412Attributes 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.
13413
13414Semantically, `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.
13415When compiling with `-Z unstable-features`, `rustc::*` lints can also be used. Like `rustdoc`, the `rustc` namespace can only be used with lints, not attributes.
13416
13417The compiler will emit an error if it encounters a lint/attribute whose namespace isn't a registered tool.
13418
13419Tool namespaces cannot be nested; `register_tool(main_tool::subtool)` is an error.
13420
13421## Examples
13422
13423Tool attributes:
13424
13425```rust
13426#![feature(register_tool)]
13427#![register_tool(c2rust)]
13428
13429// Mark which C header file this module was generated from.
13430#[c2rust::header_src = "operations.h"]
13431pub mod operations_h {
13432 use std::ffi::c_int;
13433
13434 // Mark which source line this struct was generated from.
13435 #[c2rust::src_loc = "11:0"]
13436 pub struct Point {
13437 pub x: c_int,
13438 pub y: c_int,
13439 }
13440}
13441```
13442
13443Tool lints:
13444
13445```
13446#![feature(register_tool)]
13447#![register_tool(bevy)]
13448#![deny(bevy::duplicate_bevy_dependencies)]
13449```
13450"##,
13451 default_severity: Severity::Allow,
13452 warn_since: None,
13453 deny_since: None,
13454 },
13455 Lint {
13456 label: "repr_simd",
13457 description: r##"# `repr_simd`
13458
13459Allows `repr(simd)` and importing the various simd intrinsics.
13460
13461The tracking issue for this feature is: [#27731]
13462
13463[#27731]: https://github.com/rust-lang/rust/issues/27731
13464
13465------------------------
13466"##,
13467 default_severity: Severity::Allow,
13468 warn_since: None,
13469 deny_since: None,
13470 },
13471 Lint {
13472 label: "restricted_std",
13473 description: r##"# `restricted_std`
13474
13475
13476
13477This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
13478
13479------------------------
13480"##,
13481 default_severity: Severity::Allow,
13482 warn_since: None,
13483 deny_since: None,
13484 },
13485 Lint {
13486 label: "result_option_map_or_default",
13487 description: r##"# `result_option_map_or_default`
13488
13489
13490
13491The tracking issue for this feature is: [#138099]
13492
13493[#138099]: https://github.com/rust-lang/rust/issues/138099
13494
13495------------------------
13496"##,
13497 default_severity: Severity::Allow,
13498 warn_since: None,
13499 deny_since: None,
13500 },
13501 Lint {
13502 label: "return_address",
13503 description: r##"# `return_address`
13504
13505
13506
13507The tracking issue for this feature is: [#154966]
13508
13509[#154966]: https://github.com/rust-lang/rust/issues/154966
13510
13511------------------------
13512"##,
13513 default_severity: Severity::Allow,
13514 warn_since: None,
13515 deny_since: None,
13516 },
13517 Lint {
13518 label: "return_type_notation",
13519 description: r##"# `return_type_notation`
13520
13521Allows bounding the return type of AFIT/RPITIT.
13522
13523The tracking issue for this feature is: [#109417]
13524
13525[#109417]: https://github.com/rust-lang/rust/issues/109417
13526
13527------------------------
13528"##,
13529 default_severity: Severity::Allow,
13530 warn_since: None,
13531 deny_since: None,
13532 },
13533 Lint {
13534 label: "rev_into_inner",
13535 description: r##"# `rev_into_inner`
13536
13537
13538
13539The tracking issue for this feature is: [#144277]
13540
13541[#144277]: https://github.com/rust-lang/rust/issues/144277
13542
13543------------------------
13544"##,
13545 default_severity: Severity::Allow,
13546 warn_since: None,
13547 deny_since: None,
13548 },
13549 Lint {
13550 label: "riscv_target_feature",
13551 description: r##"# `riscv_target_feature`
13552
13553Target features on riscv.
13554
13555The tracking issue for this feature is: [#150257]
13556
13557[#150257]: https://github.com/rust-lang/rust/issues/150257
13558
13559------------------------
13560"##,
13561 default_severity: Severity::Allow,
13562 warn_since: None,
13563 deny_since: None,
13564 },
13565 Lint {
13566 label: "rt",
13567 description: r##"# `rt`
13568
13569This feature is internal to the Rust compiler and is not intended for general use.
13570
13571------------------------
13572"##,
13573 default_severity: Severity::Allow,
13574 warn_since: None,
13575 deny_since: None,
13576 },
13577 Lint {
13578 label: "rtm_target_feature",
13579 description: r##"# `rtm_target_feature`
13580
13581The rtm target feature on x86.
13582
13583The tracking issue for this feature is: [#150258]
13584
13585[#150258]: https://github.com/rust-lang/rust/issues/150258
13586
13587------------------------
13588"##,
13589 default_severity: Severity::Allow,
13590 warn_since: None,
13591 deny_since: None,
13592 },
13593 Lint {
13594 label: "rust_cold_cc",
13595 description: r##"# `rust_cold_cc`
13596
13597Allows `extern "rust-cold"`.
13598
13599The tracking issue for this feature is: [#97544]
13600
13601[#97544]: https://github.com/rust-lang/rust/issues/97544
13602
13603------------------------
13604"##,
13605 default_severity: Severity::Allow,
13606 warn_since: None,
13607 deny_since: None,
13608 },
13609 Lint {
13610 label: "rust_preserve_none_cc",
13611 description: r##"# `rust_preserve_none_cc`
13612
13613Allows `extern "rust-preserve-none"`.
13614
13615The tracking issue for this feature is: [#151401]
13616
13617[#151401]: https://github.com/rust-lang/rust/issues/151401
13618
13619------------------------
13620"##,
13621 default_severity: Severity::Allow,
13622 warn_since: None,
13623 deny_since: None,
13624 },
13625 Lint {
13626 label: "rustc_attrs",
13627 description: r##"# `rustc_attrs`
13628
13629This feature has no tracking issue, and is therefore internal to
13630the compiler, not being intended for general use.
13631
13632Note: `rustc_attrs` enables many rustc-internal attributes and this page
13633only discuss a few of them.
13634
13635------------------------
13636
13637The `rustc_attrs` feature allows debugging rustc type layouts by using
13638`#[rustc_dump_layout(...)]` to debug layout at compile time (it even works
13639with `cargo check`) as an alternative to `rustc -Z print-type-sizes`
13640that is way more verbose.
13641
13642Options provided by `#[rustc_dump_layout(...)]` are `backend_repr`, `align`,
13643`debug`, `homogeneous_aggregate` and `size`.
13644Note that it only works on sized types without generics.
13645
13646## Examples
13647
13648```rust,compile_fail
13649#![feature(rustc_attrs)]
13650
13651#[rustc_dump_layout(backend_repr, size)]
13652pub enum X {
13653 Y(u8, u8, u8),
13654 Z(isize),
13655}
13656```
13657
13658When that is compiled, the compiler will error with something like
13659
13660```text
13661error: backend_repr: Aggregate { sized: true }
13662 --> src/lib.rs:4:1
13663 |
136644 | / pub enum T {
136655 | | Y(u8, u8, u8),
136666 | | Z(isize),
136677 | | }
13668 | |_^
13669
13670error: size: Size { raw: 16 }
13671 --> src/lib.rs:4:1
13672 |
136734 | / pub enum T {
136745 | | Y(u8, u8, u8),
136756 | | Z(isize),
136767 | | }
13677 | |_^
13678
13679error: aborting due to 2 previous errors
13680```
13681"##,
13682 default_severity: Severity::Allow,
13683 warn_since: None,
13684 deny_since: None,
13685 },
13686 Lint {
13687 label: "rustc_private",
13688 description: r##"# `rustc_private`
13689
13690The tracking issue for this feature is: [#27812]
13691
13692[#27812]: https://github.com/rust-lang/rust/issues/27812
13693
13694------------------------
13695
13696This feature allows access to unstable internal compiler crates such as `rustc_driver`.
13697
13698The presence of this feature changes the way the linkage format for dylibs is calculated in a way
13699that is necessary for linking against dylibs that statically link `std` (such as `rustc_driver`).
13700This makes this feature "viral" in linkage; its use in a given crate makes its use required in
13701dependent crates which link to it (including integration tests, which are built as separate crates).
13702
13703## Common linker failures related to missing LLVM libraries
13704
13705### When using `rustc-private` with Official Toolchains
13706
13707When using the `rustc_private` feature with official toolchains distributed via rustup, you'll need to install:
13708
137091. The `rustc-dev` component (provides compiler libraries)
137102. The `llvm-tools` component (provides LLVM libraries needed for linking)
13711
13712You can install these components using `rustup`:
13713
13714```text
13715rustup component add rustc-dev llvm-tools
13716```
13717
13718Without the `llvm-tools` component, you may encounter linking errors like:
13719
13720```text
13721error: linking with `cc` failed: exit status: 1
13722 |
13723 = note: rust-lld: error: unable to find library -lLLVM-{version}
13724```
13725
13726### When using `rustc-private` with Custom Toolchains
13727
13728For custom-built toolchains or environments not using rustup, different configuration may be required:
13729
13730- Ensure LLVM libraries are available in your library search paths
13731- You might need to configure library paths explicitly depending on your LLVM installation
13732"##,
13733 default_severity: Severity::Allow,
13734 warn_since: None,
13735 deny_since: None,
13736 },
13737 Lint {
13738 label: "rustdoc_internals",
13739 description: r##"# `rustdoc_internals`
13740
13741Allows using internal rustdoc features like `doc(keyword)`.
13742
13743The tracking issue for this feature is: [#90418]
13744
13745[#90418]: https://github.com/rust-lang/rust/issues/90418
13746
13747------------------------
13748"##,
13749 default_severity: Severity::Allow,
13750 warn_since: None,
13751 deny_since: None,
13752 },
13753 Lint {
13754 label: "rustdoc_missing_doc_code_examples",
13755 description: r##"# `rustdoc_missing_doc_code_examples`
13756
13757Allows using the `rustdoc::missing_doc_code_examples` lint
13758
13759The tracking issue for this feature is: [#101730]
13760
13761[#101730]: https://github.com/rust-lang/rust/issues/101730
13762
13763------------------------
13764"##,
13765 default_severity: Severity::Allow,
13766 warn_since: None,
13767 deny_since: None,
13768 },
13769 Lint {
13770 label: "rwlock_data_ptr",
13771 description: r##"# `rwlock_data_ptr`
13772
13773
13774
13775The tracking issue for this feature is: [#140368]
13776
13777[#140368]: https://github.com/rust-lang/rust/issues/140368
13778
13779------------------------
13780"##,
13781 default_severity: Severity::Allow,
13782 warn_since: None,
13783 deny_since: None,
13784 },
13785 Lint {
13786 label: "s390x_target_feature",
13787 description: r##"# `s390x_target_feature`
13788
13789Target features on s390x.
13790
13791The tracking issue for this feature is: [#150259]
13792
13793[#150259]: https://github.com/rust-lang/rust/issues/150259
13794
13795------------------------
13796"##,
13797 default_severity: Severity::Allow,
13798 warn_since: None,
13799 deny_since: None,
13800 },
13801 Lint {
13802 label: "sanitize",
13803 description: r##"# `sanitize`
13804
13805The tracking issue for this feature is: [#39699]
13806
13807[#39699]: https://github.com/rust-lang/rust/issues/39699
13808
13809------------------------
13810
13811The `sanitize` attribute can be used to selectively disable or enable sanitizer
13812instrumentation in an annotated function. This might be useful to: avoid
13813instrumentation overhead in a performance critical function, or avoid
13814instrumenting code that contains constructs unsupported by given sanitizer.
13815
13816The precise effect of this annotation depends on particular sanitizer in use.
13817For example, with `sanitize(thread = "off")`, the thread sanitizer will no
13818longer instrument non-atomic store / load operations, but it will instrument
13819atomic operations to avoid reporting false positives and provide meaning full
13820stack traces.
13821
13822This attribute was previously named `no_sanitize`.
13823
13824## Examples
13825
13826``` rust
13827#![feature(sanitize)]
13828
13829#[sanitize(address = "off")]
13830fn foo() {
13831 // ...
13832}
13833```
13834
13835It is also possible to disable sanitizers for entire modules and enable them
13836for single items or functions.
13837
13838```rust
13839#![feature(sanitize)]
13840
13841#[sanitize(address = "off")]
13842mod foo {
13843 fn unsanitized() {
13844 // ...
13845 }
13846
13847 #[sanitize(address = "on")]
13848 fn sanitized() {
13849 // ...
13850 }
13851}
13852```
13853
13854It's also applicable to impl blocks.
13855
13856```rust
13857#![feature(sanitize)]
13858
13859trait MyTrait {
13860 fn foo(&self);
13861 fn bar(&self);
13862}
13863
13864#[sanitize(address = "off")]
13865impl MyTrait for () {
13866 fn foo(&self) {
13867 // ...
13868 }
13869
13870 #[sanitize(address = "on")]
13871 fn bar(&self) {
13872 // ...
13873 }
13874}
13875```
13876"##,
13877 default_severity: Severity::Allow,
13878 warn_since: None,
13879 deny_since: None,
13880 },
13881 Lint {
13882 label: "sealed",
13883 description: r##"# `sealed`
13884
13885
13886
13887This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
13888
13889------------------------
13890"##,
13891 default_severity: Severity::Allow,
13892 warn_since: None,
13893 deny_since: None,
13894 },
13895 Lint {
13896 label: "seek_io_take_position",
13897 description: r##"# `seek_io_take_position`
13898
13899
13900
13901The tracking issue for this feature is: [#97227]
13902
13903[#97227]: https://github.com/rust-lang/rust/issues/97227
13904
13905------------------------
13906"##,
13907 default_severity: Severity::Allow,
13908 warn_since: None,
13909 deny_since: None,
13910 },
13911 Lint {
13912 label: "seek_stream_len",
13913 description: r##"# `seek_stream_len`
13914
13915
13916
13917The tracking issue for this feature is: [#59359]
13918
13919[#59359]: https://github.com/rust-lang/rust/issues/59359
13920
13921------------------------
13922"##,
13923 default_severity: Severity::Allow,
13924 warn_since: None,
13925 deny_since: None,
13926 },
13927 Lint {
13928 label: "set_permissions_nofollow",
13929 description: r##"# `set_permissions_nofollow`
13930
13931
13932
13933The tracking issue for this feature is: [#141607]
13934
13935[#141607]: https://github.com/rust-lang/rust/issues/141607
13936
13937------------------------
13938"##,
13939 default_severity: Severity::Allow,
13940 warn_since: None,
13941 deny_since: None,
13942 },
13943 Lint {
13944 label: "set_ptr_value",
13945 description: r##"# `set_ptr_value`
13946
13947
13948
13949The tracking issue for this feature is: [#75091]
13950
13951[#75091]: https://github.com/rust-lang/rust/issues/75091
13952
13953------------------------
13954"##,
13955 default_severity: Severity::Allow,
13956 warn_since: None,
13957 deny_since: None,
13958 },
13959 Lint {
13960 label: "setgroups",
13961 description: r##"# `setgroups`
13962
13963
13964
13965The tracking issue for this feature is: [#90747]
13966
13967[#90747]: https://github.com/rust-lang/rust/issues/90747
13968
13969------------------------
13970"##,
13971 default_severity: Severity::Allow,
13972 warn_since: None,
13973 deny_since: None,
13974 },
13975 Lint {
13976 label: "sgx_platform",
13977 description: r##"# `sgx_platform`
13978
13979
13980
13981The tracking issue for this feature is: [#56975]
13982
13983[#56975]: https://github.com/rust-lang/rust/issues/56975
13984
13985------------------------
13986"##,
13987 default_severity: Severity::Allow,
13988 warn_since: None,
13989 deny_since: None,
13990 },
13991 Lint {
13992 label: "signed_bigint_helpers",
13993 description: r##"# `signed_bigint_helpers`
13994
13995
13996
13997The tracking issue for this feature is: [#151989]
13998
13999[#151989]: https://github.com/rust-lang/rust/issues/151989
14000
14001------------------------
14002"##,
14003 default_severity: Severity::Allow,
14004 warn_since: None,
14005 deny_since: None,
14006 },
14007 Lint {
14008 label: "simd_ffi",
14009 description: r##"# `simd_ffi`
14010
14011Allows the use of SIMD types in functions declared in `extern` blocks.
14012
14013The tracking issue for this feature is: [#27731]
14014
14015[#27731]: https://github.com/rust-lang/rust/issues/27731
14016
14017------------------------
14018"##,
14019 default_severity: Severity::Allow,
14020 warn_since: None,
14021 deny_since: None,
14022 },
14023 Lint {
14024 label: "sized_hierarchy",
14025 description: r##"# `sized_hierarchy`
14026
14027Introduces a hierarchy of `Sized` traits (RFC 3729).
14028
14029The tracking issue for this feature is: [#144404]
14030
14031[#144404]: https://github.com/rust-lang/rust/issues/144404
14032
14033------------------------
14034"##,
14035 default_severity: Severity::Allow,
14036 warn_since: None,
14037 deny_since: None,
14038 },
14039 Lint {
14040 label: "sized_type_properties",
14041 description: r##"# `sized_type_properties`
14042
14043
14044
14045This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
14046
14047------------------------
14048"##,
14049 default_severity: Severity::Allow,
14050 warn_since: None,
14051 deny_since: None,
14052 },
14053 Lint {
14054 label: "slice_concat_ext",
14055 description: r##"# `slice_concat_ext`
14056
14057
14058
14059The tracking issue for this feature is: [#27747]
14060
14061[#27747]: https://github.com/rust-lang/rust/issues/27747
14062
14063------------------------
14064"##,
14065 default_severity: Severity::Allow,
14066 warn_since: None,
14067 deny_since: None,
14068 },
14069 Lint {
14070 label: "slice_concat_trait",
14071 description: r##"# `slice_concat_trait`
14072
14073
14074
14075The tracking issue for this feature is: [#27747]
14076
14077[#27747]: https://github.com/rust-lang/rust/issues/27747
14078
14079------------------------
14080"##,
14081 default_severity: Severity::Allow,
14082 warn_since: None,
14083 deny_since: None,
14084 },
14085 Lint {
14086 label: "slice_from_ptr_range",
14087 description: r##"# `slice_from_ptr_range`
14088
14089
14090
14091The tracking issue for this feature is: [#89792]
14092
14093[#89792]: https://github.com/rust-lang/rust/issues/89792
14094
14095------------------------
14096"##,
14097 default_severity: Severity::Allow,
14098 warn_since: None,
14099 deny_since: None,
14100 },
14101 Lint {
14102 label: "slice_index_methods",
14103 description: r##"# `slice_index_methods`
14104
14105
14106
14107This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
14108
14109------------------------
14110"##,
14111 default_severity: Severity::Allow,
14112 warn_since: None,
14113 deny_since: None,
14114 },
14115 Lint {
14116 label: "slice_internals",
14117 description: r##"# `slice_internals`
14118
14119
14120
14121This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
14122
14123------------------------
14124"##,
14125 default_severity: Severity::Allow,
14126 warn_since: None,
14127 deny_since: None,
14128 },
14129 Lint {
14130 label: "slice_iter_mut_as_mut_slice",
14131 description: r##"# `slice_iter_mut_as_mut_slice`
14132
14133
14134
14135The tracking issue for this feature is: [#93079]
14136
14137[#93079]: https://github.com/rust-lang/rust/issues/93079
14138
14139------------------------
14140"##,
14141 default_severity: Severity::Allow,
14142 warn_since: None,
14143 deny_since: None,
14144 },
14145 Lint {
14146 label: "slice_partial_sort_unstable",
14147 description: r##"# `slice_partial_sort_unstable`
14148
14149
14150
14151The tracking issue for this feature is: [#149046]
14152
14153[#149046]: https://github.com/rust-lang/rust/issues/149046
14154
14155------------------------
14156"##,
14157 default_severity: Severity::Allow,
14158 warn_since: None,
14159 deny_since: None,
14160 },
14161 Lint {
14162 label: "slice_partition_dedup",
14163 description: r##"# `slice_partition_dedup`
14164
14165
14166
14167The tracking issue for this feature is: [#54279]
14168
14169[#54279]: https://github.com/rust-lang/rust/issues/54279
14170
14171------------------------
14172"##,
14173 default_severity: Severity::Allow,
14174 warn_since: None,
14175 deny_since: None,
14176 },
14177 Lint {
14178 label: "slice_pattern",
14179 description: r##"# `slice_pattern`
14180
14181
14182
14183The tracking issue for this feature is: [#56345]
14184
14185[#56345]: https://github.com/rust-lang/rust/issues/56345
14186
14187------------------------
14188"##,
14189 default_severity: Severity::Allow,
14190 warn_since: None,
14191 deny_since: None,
14192 },
14193 Lint {
14194 label: "slice_ptr_get",
14195 description: r##"# `slice_ptr_get`
14196
14197
14198
14199The tracking issue for this feature is: [#74265]
14200
14201[#74265]: https://github.com/rust-lang/rust/issues/74265
14202
14203------------------------
14204"##,
14205 default_severity: Severity::Allow,
14206 warn_since: None,
14207 deny_since: None,
14208 },
14209 Lint {
14210 label: "slice_range",
14211 description: r##"# `slice_range`
14212
14213
14214
14215The tracking issue for this feature is: [#76393]
14216
14217[#76393]: https://github.com/rust-lang/rust/issues/76393
14218
14219------------------------
14220"##,
14221 default_severity: Severity::Allow,
14222 warn_since: None,
14223 deny_since: None,
14224 },
14225 Lint {
14226 label: "slice_shift",
14227 description: r##"# `slice_shift`
14228
14229
14230
14231The tracking issue for this feature is: [#151772]
14232
14233[#151772]: https://github.com/rust-lang/rust/issues/151772
14234
14235------------------------
14236"##,
14237 default_severity: Severity::Allow,
14238 warn_since: None,
14239 deny_since: None,
14240 },
14241 Lint {
14242 label: "slice_split_once",
14243 description: r##"# `slice_split_once`
14244
14245
14246
14247The tracking issue for this feature is: [#112811]
14248
14249[#112811]: https://github.com/rust-lang/rust/issues/112811
14250
14251------------------------
14252"##,
14253 default_severity: Severity::Allow,
14254 warn_since: None,
14255 deny_since: None,
14256 },
14257 Lint {
14258 label: "slice_swap_unchecked",
14259 description: r##"# `slice_swap_unchecked`
14260
14261
14262
14263The tracking issue for this feature is: [#88539]
14264
14265[#88539]: https://github.com/rust-lang/rust/issues/88539
14266
14267------------------------
14268"##,
14269 default_severity: Severity::Allow,
14270 warn_since: None,
14271 deny_since: None,
14272 },
14273 Lint {
14274 label: "sliceindex_wrappers",
14275 description: r##"# `sliceindex_wrappers`
14276
14277
14278
14279The tracking issue for this feature is: [#146179]
14280
14281[#146179]: https://github.com/rust-lang/rust/issues/146179
14282
14283------------------------
14284"##,
14285 default_severity: Severity::Allow,
14286 warn_since: None,
14287 deny_since: None,
14288 },
14289 Lint {
14290 label: "smart_pointer_try_map",
14291 description: r##"# `smart_pointer_try_map`
14292
14293
14294
14295The tracking issue for this feature is: [#144419]
14296
14297[#144419]: https://github.com/rust-lang/rust/issues/144419
14298
14299------------------------
14300"##,
14301 default_severity: Severity::Allow,
14302 warn_since: None,
14303 deny_since: None,
14304 },
14305 Lint {
14306 label: "solid_ext",
14307 description: r##"# `solid_ext`
14308
14309
14310
14311This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
14312
14313------------------------
14314"##,
14315 default_severity: Severity::Allow,
14316 warn_since: None,
14317 deny_since: None,
14318 },
14319 Lint {
14320 label: "sort_floats",
14321 description: r##"# `sort_floats`
14322
14323
14324
14325The tracking issue for this feature is: [#93396]
14326
14327[#93396]: https://github.com/rust-lang/rust/issues/93396
14328
14329------------------------
14330"##,
14331 default_severity: Severity::Allow,
14332 warn_since: None,
14333 deny_since: None,
14334 },
14335 Lint {
14336 label: "sparc_target_feature",
14337 description: r##"# `sparc_target_feature`
14338
14339Target features on sparc.
14340
14341The tracking issue for this feature is: [#132783]
14342
14343[#132783]: https://github.com/rust-lang/rust/issues/132783
14344
14345------------------------
14346"##,
14347 default_severity: Severity::Allow,
14348 warn_since: None,
14349 deny_since: None,
14350 },
14351 Lint {
14352 label: "specialization",
14353 description: r##"# `specialization`
14354
14355Allows specialization of implementations (RFC 1210).
14356
14357The tracking issue for this feature is: [#31844]
14358
14359[#31844]: https://github.com/rust-lang/rust/issues/31844
14360
14361------------------------
14362"##,
14363 default_severity: Severity::Allow,
14364 warn_since: None,
14365 deny_since: None,
14366 },
14367 Lint {
14368 label: "split_array",
14369 description: r##"# `split_array`
14370
14371
14372
14373The tracking issue for this feature is: [#90091]
14374
14375[#90091]: https://github.com/rust-lang/rust/issues/90091
14376
14377------------------------
14378"##,
14379 default_severity: Severity::Allow,
14380 warn_since: None,
14381 deny_since: None,
14382 },
14383 Lint {
14384 label: "split_as_slice",
14385 description: r##"# `split_as_slice`
14386
14387
14388
14389The tracking issue for this feature is: [#96137]
14390
14391[#96137]: https://github.com/rust-lang/rust/issues/96137
14392
14393------------------------
14394"##,
14395 default_severity: Severity::Allow,
14396 warn_since: None,
14397 deny_since: None,
14398 },
14399 Lint {
14400 label: "staged_api",
14401 description: r##"# `staged_api`
14402
14403Allows using the `#[stable]` and `#[unstable]` attributes.
14404
14405This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
14406
14407------------------------
14408"##,
14409 default_severity: Severity::Allow,
14410 warn_since: None,
14411 deny_since: None,
14412 },
14413 Lint {
14414 label: "static_align",
14415 description: r##"# `static_align`
14416
14417Allows using `#[rustc_align_static(...)]` on static items.
14418
14419The tracking issue for this feature is: [#146177]
14420
14421[#146177]: https://github.com/rust-lang/rust/issues/146177
14422
14423------------------------
14424"##,
14425 default_severity: Severity::Allow,
14426 warn_since: None,
14427 deny_since: None,
14428 },
14429 Lint {
14430 label: "std_internals",
14431 description: r##"# `std_internals`
14432
14433
14434
14435This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
14436
14437------------------------
14438"##,
14439 default_severity: Severity::Allow,
14440 warn_since: None,
14441 deny_since: None,
14442 },
14443 Lint {
14444 label: "stdarch_aarch64_feature_detection",
14445 description: r##"# `stdarch_aarch64_feature_detection`
14446
14447
14448
14449The tracking issue for this feature is: [#127764]
14450
14451[#127764]: https://github.com/rust-lang/rust/issues/127764
14452
14453------------------------
14454"##,
14455 default_severity: Severity::Allow,
14456 warn_since: None,
14457 deny_since: None,
14458 },
14459 Lint {
14460 label: "stdarch_arm_feature_detection",
14461 description: r##"# `stdarch_arm_feature_detection`
14462
14463
14464
14465The tracking issue for this feature is: [#111190]
14466
14467[#111190]: https://github.com/rust-lang/rust/issues/111190
14468
14469------------------------
14470"##,
14471 default_severity: Severity::Allow,
14472 warn_since: None,
14473 deny_since: None,
14474 },
14475 Lint {
14476 label: "stdarch_internal",
14477 description: r##"# `stdarch_internal`
14478
14479
14480
14481This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
14482
14483------------------------
14484"##,
14485 default_severity: Severity::Allow,
14486 warn_since: None,
14487 deny_since: None,
14488 },
14489 Lint {
14490 label: "stdarch_loongarch_feature_detection",
14491 description: r##"# `stdarch_loongarch_feature_detection`
14492
14493
14494
14495The tracking issue for this feature is: [#117425]
14496
14497[#117425]: https://github.com/rust-lang/rust/issues/117425
14498
14499------------------------
14500"##,
14501 default_severity: Severity::Allow,
14502 warn_since: None,
14503 deny_since: None,
14504 },
14505 Lint {
14506 label: "stdarch_mips_feature_detection",
14507 description: r##"# `stdarch_mips_feature_detection`
14508
14509
14510
14511The tracking issue for this feature is: [#111188]
14512
14513[#111188]: https://github.com/rust-lang/rust/issues/111188
14514
14515------------------------
14516"##,
14517 default_severity: Severity::Allow,
14518 warn_since: None,
14519 deny_since: None,
14520 },
14521 Lint {
14522 label: "stdarch_powerpc_feature_detection",
14523 description: r##"# `stdarch_powerpc_feature_detection`
14524
14525
14526
14527The tracking issue for this feature is: [#111191]
14528
14529[#111191]: https://github.com/rust-lang/rust/issues/111191
14530
14531------------------------
14532"##,
14533 default_severity: Severity::Allow,
14534 warn_since: None,
14535 deny_since: None,
14536 },
14537 Lint {
14538 label: "stdarch_riscv_feature_detection",
14539 description: r##"# `stdarch_riscv_feature_detection`
14540
14541
14542
14543The tracking issue for this feature is: [#111192]
14544
14545[#111192]: https://github.com/rust-lang/rust/issues/111192
14546
14547------------------------
14548"##,
14549 default_severity: Severity::Allow,
14550 warn_since: None,
14551 deny_since: None,
14552 },
14553 Lint {
14554 label: "stdio_fd_consts",
14555 description: r##"# `stdio_fd_consts`
14556
14557
14558
14559The tracking issue for this feature is: [#150836]
14560
14561[#150836]: https://github.com/rust-lang/rust/issues/150836
14562
14563------------------------
14564"##,
14565 default_severity: Severity::Allow,
14566 warn_since: None,
14567 deny_since: None,
14568 },
14569 Lint {
14570 label: "stdio_makes_pipe",
14571 description: r##"# `stdio_makes_pipe`
14572
14573
14574
14575The tracking issue for this feature is: [#98288]
14576
14577[#98288]: https://github.com/rust-lang/rust/issues/98288
14578
14579------------------------
14580"##,
14581 default_severity: Severity::Allow,
14582 warn_since: None,
14583 deny_since: None,
14584 },
14585 Lint {
14586 label: "stdio_swap",
14587 description: r##"# `stdio_swap`
14588
14589
14590
14591The tracking issue for this feature is: [#150667]
14592
14593[#150667]: https://github.com/rust-lang/rust/issues/150667
14594
14595------------------------
14596"##,
14597 default_severity: Severity::Allow,
14598 warn_since: None,
14599 deny_since: None,
14600 },
14601 Lint {
14602 label: "step_trait",
14603 description: r##"# `step_trait`
14604
14605
14606
14607The tracking issue for this feature is: [#42168]
14608
14609[#42168]: https://github.com/rust-lang/rust/issues/42168
14610
14611------------------------
14612"##,
14613 default_severity: Severity::Allow,
14614 warn_since: None,
14615 deny_since: None,
14616 },
14617 Lint {
14618 label: "stmt_expr_attributes",
14619 description: r##"# `stmt_expr_attributes`
14620
14621Allows attributes on expressions and non-item statements.
14622
14623The tracking issue for this feature is: [#15701]
14624
14625[#15701]: https://github.com/rust-lang/rust/issues/15701
14626
14627------------------------
14628"##,
14629 default_severity: Severity::Allow,
14630 warn_since: None,
14631 deny_since: None,
14632 },
14633 Lint {
14634 label: "str_as_str",
14635 description: r##"# `str_as_str`
14636
14637
14638
14639The tracking issue for this feature is: [#130366]
14640
14641[#130366]: https://github.com/rust-lang/rust/issues/130366
14642
14643------------------------
14644"##,
14645 default_severity: Severity::Allow,
14646 warn_since: None,
14647 deny_since: None,
14648 },
14649 Lint {
14650 label: "str_from_raw_parts",
14651 description: r##"# `str_from_raw_parts`
14652
14653
14654
14655The tracking issue for this feature is: [#119206]
14656
14657[#119206]: https://github.com/rust-lang/rust/issues/119206
14658
14659------------------------
14660"##,
14661 default_severity: Severity::Allow,
14662 warn_since: None,
14663 deny_since: None,
14664 },
14665 Lint {
14666 label: "str_from_utf16_endian",
14667 description: r##"# `str_from_utf16_endian`
14668
14669
14670
14671The tracking issue for this feature is: [#116258]
14672
14673[#116258]: https://github.com/rust-lang/rust/issues/116258
14674
14675------------------------
14676"##,
14677 default_severity: Severity::Allow,
14678 warn_since: None,
14679 deny_since: None,
14680 },
14681 Lint {
14682 label: "str_internals",
14683 description: r##"# `str_internals`
14684
14685This feature is internal to the Rust compiler and is not intended for general use.
14686
14687------------------------
14688"##,
14689 default_severity: Severity::Allow,
14690 warn_since: None,
14691 deny_since: None,
14692 },
14693 Lint {
14694 label: "str_lines_remainder",
14695 description: r##"# `str_lines_remainder`
14696
14697
14698
14699The tracking issue for this feature is: [#77998]
14700
14701[#77998]: https://github.com/rust-lang/rust/issues/77998
14702
14703------------------------
14704"##,
14705 default_severity: Severity::Allow,
14706 warn_since: None,
14707 deny_since: None,
14708 },
14709 Lint {
14710 label: "str_split_inclusive_remainder",
14711 description: r##"# `str_split_inclusive_remainder`
14712
14713
14714
14715The tracking issue for this feature is: [#77998]
14716
14717[#77998]: https://github.com/rust-lang/rust/issues/77998
14718
14719------------------------
14720"##,
14721 default_severity: Severity::Allow,
14722 warn_since: None,
14723 deny_since: None,
14724 },
14725 Lint {
14726 label: "str_split_remainder",
14727 description: r##"# `str_split_remainder`
14728
14729
14730
14731The tracking issue for this feature is: [#77998]
14732
14733[#77998]: https://github.com/rust-lang/rust/issues/77998
14734
14735------------------------
14736"##,
14737 default_severity: Severity::Allow,
14738 warn_since: None,
14739 deny_since: None,
14740 },
14741 Lint {
14742 label: "str_split_whitespace_remainder",
14743 description: r##"# `str_split_whitespace_remainder`
14744
14745
14746
14747The tracking issue for this feature is: [#77998]
14748
14749[#77998]: https://github.com/rust-lang/rust/issues/77998
14750
14751------------------------
14752"##,
14753 default_severity: Severity::Allow,
14754 warn_since: None,
14755 deny_since: None,
14756 },
14757 Lint {
14758 label: "strict_provenance_lints",
14759 description: r##"# `strict_provenance_lints`
14760
14761The tracking issue for this feature is: [#130351]
14762
14763[#130351]: https://github.com/rust-lang/rust/issues/130351
14764-----
14765
14766The `strict_provenance_lints` feature allows to enable the `fuzzy_provenance_casts` and `lossy_provenance_casts` lints.
14767These lint on casts between integers and pointers, that are recommended against or invalid in the strict provenance model.
14768
14769## Example
14770
14771```rust
14772#![feature(strict_provenance_lints)]
14773#![warn(fuzzy_provenance_casts)]
14774
14775fn main() {
14776 let _dangling = 16_usize as *const u8;
14777 //~^ WARNING: strict provenance disallows casting integer `usize` to pointer `*const u8`
14778}
14779```
14780"##,
14781 default_severity: Severity::Allow,
14782 warn_since: None,
14783 deny_since: None,
14784 },
14785 Lint {
14786 label: "string_from_utf8_lossy_owned",
14787 description: r##"# `string_from_utf8_lossy_owned`
14788
14789
14790
14791The tracking issue for this feature is: [#129436]
14792
14793[#129436]: https://github.com/rust-lang/rust/issues/129436
14794
14795------------------------
14796"##,
14797 default_severity: Severity::Allow,
14798 warn_since: None,
14799 deny_since: None,
14800 },
14801 Lint {
14802 label: "string_into_chars",
14803 description: r##"# `string_into_chars`
14804
14805
14806
14807The tracking issue for this feature is: [#133125]
14808
14809[#133125]: https://github.com/rust-lang/rust/issues/133125
14810
14811------------------------
14812"##,
14813 default_severity: Severity::Allow,
14814 warn_since: None,
14815 deny_since: None,
14816 },
14817 Lint {
14818 label: "string_remove_matches",
14819 description: r##"# `string_remove_matches`
14820
14821
14822
14823The tracking issue for this feature is: [#72826]
14824
14825[#72826]: https://github.com/rust-lang/rust/issues/72826
14826
14827------------------------
14828"##,
14829 default_severity: Severity::Allow,
14830 warn_since: None,
14831 deny_since: None,
14832 },
14833 Lint {
14834 label: "string_replace_in_place",
14835 description: r##"# `string_replace_in_place`
14836
14837
14838
14839The tracking issue for this feature is: [#147949]
14840
14841[#147949]: https://github.com/rust-lang/rust/issues/147949
14842
14843------------------------
14844"##,
14845 default_severity: Severity::Allow,
14846 warn_since: None,
14847 deny_since: None,
14848 },
14849 Lint {
14850 label: "strip_circumfix",
14851 description: r##"# `strip_circumfix`
14852
14853
14854
14855The tracking issue for this feature is: [#147946]
14856
14857[#147946]: https://github.com/rust-lang/rust/issues/147946
14858
14859------------------------
14860"##,
14861 default_severity: Severity::Allow,
14862 warn_since: None,
14863 deny_since: None,
14864 },
14865 Lint {
14866 label: "structural_match",
14867 description: r##"# `structural_match`
14868
14869Allows 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.
14870
14871The tracking issue for this feature is: [#31434]
14872
14873[#31434]: https://github.com/rust-lang/rust/issues/31434
14874
14875------------------------
14876"##,
14877 default_severity: Severity::Allow,
14878 warn_since: None,
14879 deny_since: None,
14880 },
14881 Lint {
14882 label: "substr_range",
14883 description: r##"# `substr_range`
14884
14885
14886
14887The tracking issue for this feature is: [#126769]
14888
14889[#126769]: https://github.com/rust-lang/rust/issues/126769
14890
14891------------------------
14892"##,
14893 default_severity: Severity::Allow,
14894 warn_since: None,
14895 deny_since: None,
14896 },
14897 Lint {
14898 label: "super_let",
14899 description: r##"# `super_let`
14900
14901Allows `super let` statements.
14902
14903The tracking issue for this feature is: [#139076]
14904
14905[#139076]: https://github.com/rust-lang/rust/issues/139076
14906
14907------------------------
14908"##,
14909 default_severity: Severity::Allow,
14910 warn_since: None,
14911 deny_since: None,
14912 },
14913 Lint {
14914 label: "supertrait_item_shadowing",
14915 description: r##"# `supertrait_item_shadowing`
14916
14917Allows subtrait items to shadow supertrait items.
14918
14919The tracking issue for this feature is: [#89151]
14920
14921[#89151]: https://github.com/rust-lang/rust/issues/89151
14922
14923------------------------
14924"##,
14925 default_severity: Severity::Allow,
14926 warn_since: None,
14927 deny_since: None,
14928 },
14929 Lint {
14930 label: "sync_nonpoison",
14931 description: r##"# `sync_nonpoison`
14932
14933
14934
14935The tracking issue for this feature is: [#134645]
14936
14937[#134645]: https://github.com/rust-lang/rust/issues/134645
14938
14939------------------------
14940"##,
14941 default_severity: Severity::Allow,
14942 warn_since: None,
14943 deny_since: None,
14944 },
14945 Lint {
14946 label: "sync_poison_mod",
14947 description: r##"# `sync_poison_mod`
14948
14949
14950
14951The tracking issue for this feature is: [#134646]
14952
14953[#134646]: https://github.com/rust-lang/rust/issues/134646
14954
14955------------------------
14956"##,
14957 default_severity: Severity::Allow,
14958 warn_since: None,
14959 deny_since: None,
14960 },
14961 Lint {
14962 label: "sync_unsafe_cell",
14963 description: r##"# `sync_unsafe_cell`
14964
14965
14966
14967The tracking issue for this feature is: [#95439]
14968
14969[#95439]: https://github.com/rust-lang/rust/issues/95439
14970
14971------------------------
14972"##,
14973 default_severity: Severity::Allow,
14974 warn_since: None,
14975 deny_since: None,
14976 },
14977 Lint {
14978 label: "target_feature_inline_always",
14979 description: r##"# `target_feature_inline_always`
14980
14981Allows the use of target_feature when a function is marked inline(always).
14982
14983The tracking issue for this feature is: [#145574]
14984
14985[#145574]: https://github.com/rust-lang/rust/issues/145574
14986
14987------------------------
14988"##,
14989 default_severity: Severity::Allow,
14990 warn_since: None,
14991 deny_since: None,
14992 },
14993 Lint {
14994 label: "tcp_deferaccept",
14995 description: r##"# `tcp_deferaccept`
14996
14997
14998
14999The tracking issue for this feature is: [#119639]
15000
15001[#119639]: https://github.com/rust-lang/rust/issues/119639
15002
15003------------------------
15004"##,
15005 default_severity: Severity::Allow,
15006 warn_since: None,
15007 deny_since: None,
15008 },
15009 Lint {
15010 label: "tcp_keepalive",
15011 description: r##"# `tcp_keepalive`
15012
15013
15014
15015The tracking issue for this feature is: [#155889]
15016
15017[#155889]: https://github.com/rust-lang/rust/issues/155889
15018
15019------------------------
15020"##,
15021 default_severity: Severity::Allow,
15022 warn_since: None,
15023 deny_since: None,
15024 },
15025 Lint {
15026 label: "tcp_linger",
15027 description: r##"# `tcp_linger`
15028
15029
15030
15031The tracking issue for this feature is: [#88494]
15032
15033[#88494]: https://github.com/rust-lang/rust/issues/88494
15034
15035------------------------
15036"##,
15037 default_severity: Severity::Allow,
15038 warn_since: None,
15039 deny_since: None,
15040 },
15041 Lint {
15042 label: "tcplistener_into_incoming",
15043 description: r##"# `tcplistener_into_incoming`
15044
15045
15046
15047The tracking issue for this feature is: [#88373]
15048
15049[#88373]: https://github.com/rust-lang/rust/issues/88373
15050
15051------------------------
15052"##,
15053 default_severity: Severity::Allow,
15054 warn_since: None,
15055 deny_since: None,
15056 },
15057 Lint {
15058 label: "temporary_niche_types",
15059 description: r##"# `temporary_niche_types`
15060
15061
15062
15063This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
15064
15065------------------------
15066"##,
15067 default_severity: Severity::Allow,
15068 warn_since: None,
15069 deny_since: None,
15070 },
15071 Lint {
15072 label: "test",
15073 description: r##"# `test`
15074
15075The tracking issue for this feature is: None.
15076
15077------------------------
15078
15079The internals of the `test` crate are unstable, behind the `test` flag. The
15080most widely used part of the `test` crate are benchmark tests, which can test
15081the performance of your code. Let's make our `src/lib.rs` look like this
15082(comments elided):
15083
15084```rust,no_run
15085#![feature(test)]
15086
15087extern crate test;
15088
15089pub fn add_two(a: i32) -> i32 {
15090 a + 2
15091}
15092
15093#[cfg(test)]
15094mod tests {
15095 use super::*;
15096 use test::Bencher;
15097
15098 #[test]
15099 fn it_works() {
15100 assert_eq!(4, add_two(2));
15101 }
15102
15103 #[bench]
15104 fn bench_add_two(b: &mut Bencher) {
15105 b.iter(|| add_two(2));
15106 }
15107}
15108```
15109
15110Note the `test` feature gate, which enables this unstable feature.
15111
15112We've imported the `test` crate, which contains our benchmarking support.
15113We have a new function as well, with the `bench` attribute. Unlike regular
15114tests, which take no arguments, benchmark tests take a `&mut Bencher`. This
15115`Bencher` provides an `iter` method, which takes a closure. This closure
15116contains the code we'd like to benchmark.
15117
15118We can run benchmark tests with `cargo bench`:
15119
15120```bash
15121$ cargo bench
15122 Compiling adder v0.0.1 (file:///home/steve/tmp/adder)
15123 Running target/release/adder-91b3e234d4ed382a
15124
15125running 2 tests
15126test tests::it_works ... ignored
15127test tests::bench_add_two ... bench: 1 ns/iter (+/- 0)
15128
15129test result: ok. 0 passed; 0 failed; 1 ignored; 1 measured
15130```
15131
15132Our non-benchmark test was ignored. You may have noticed that `cargo bench`
15133takes a bit longer than `cargo test`. This is because Rust runs our benchmark
15134a number of times, and then takes the average. Because we're doing so little
15135work in this example, we have a `1 ns/iter (+/- 0)`, but this would show
15136the variance if there was one.
15137
15138Advice on writing benchmarks:
15139
15140
15141* Move setup code outside the `iter` loop; only put the part you want to measure inside
15142* Make the code do "the same thing" on each iteration; do not accumulate or change state
15143* Make the outer function idempotent too; the benchmark runner is likely to run
15144 it many times
15145* Make the inner `iter` loop short and fast so benchmark runs are fast and the
15146 calibrator can adjust the run-length at fine resolution
15147* Make the code in the `iter` loop do something simple, to assist in pinpointing
15148 performance improvements (or regressions)
15149
15150## Gotcha: optimizations
15151
15152There's another tricky part to writing benchmarks: benchmarks compiled with
15153optimizations activated can be dramatically changed by the optimizer so that
15154the benchmark is no longer benchmarking what one expects. For example, the
15155compiler might recognize that some calculation has no external effects and
15156remove it entirely.
15157
15158```rust,no_run
15159#![feature(test)]
15160
15161extern crate test;
15162use test::Bencher;
15163
15164#[bench]
15165fn bench_xor_1000_ints(b: &mut Bencher) {
15166 b.iter(|| {
15167 (0..1000).fold(0, |old, new| old ^ new);
15168 });
15169}
15170```
15171
15172gives the following results
15173
15174```text
15175running 1 test
15176test bench_xor_1000_ints ... bench: 0 ns/iter (+/- 0)
15177
15178test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured
15179```
15180
15181The benchmarking runner offers two ways to avoid this. Either, the closure that
15182the `iter` method receives can return an arbitrary value which forces the
15183optimizer to consider the result used and ensures it cannot remove the
15184computation entirely. This could be done for the example above by adjusting the
15185`b.iter` call to
15186
15187```rust
15188# struct X;
15189# impl X { fn iter<T, F>(&self, _: F) where F: FnMut() -> T {} } let b = X;
15190b.iter(|| {
15191 // Note lack of `;` (could also use an explicit `return`).
15192 (0..1000).fold(0, |old, new| old ^ new)
15193});
15194```
15195
15196Or, the other option is to call the generic `test::black_box` function, which
15197is an opaque "black box" to the optimizer and so forces it to consider any
15198argument as used.
15199
15200```rust
15201#![feature(test)]
15202
15203extern crate test;
15204
15205# fn main() {
15206# struct X;
15207# impl X { fn iter<T, F>(&self, _: F) where F: FnMut() -> T {} } let b = X;
15208b.iter(|| {
15209 let n = test::black_box(1000);
15210
15211 (0..n).fold(0, |a, b| a ^ b)
15212})
15213# }
15214```
15215
15216Neither of these read or modify the value, and are very cheap for small values.
15217Larger values can be passed indirectly to reduce overhead (e.g.
15218`black_box(&huge_struct)`).
15219
15220Performing either of the above changes gives the following benchmarking results
15221
15222```text
15223running 1 test
15224test bench_xor_1000_ints ... bench: 131 ns/iter (+/- 3)
15225
15226test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured
15227```
15228
15229However, the optimizer can still modify a testcase in an undesirable manner
15230even when using either of the above.
15231"##,
15232 default_severity: Severity::Allow,
15233 warn_since: None,
15234 deny_since: None,
15235 },
15236 Lint {
15237 label: "test_incomplete_feature",
15238 description: r##"# `test_incomplete_feature`
15239
15240Perma-unstable, only used to test the `incomplete_features` lint.
15241
15242This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
15243
15244------------------------
15245"##,
15246 default_severity: Severity::Allow,
15247 warn_since: None,
15248 deny_since: None,
15249 },
15250 Lint {
15251 label: "test_unstable_lint",
15252 description: r##"# `test_unstable_lint`
15253
15254Added for testing unstable lints; perma-unstable.
15255
15256This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
15257
15258------------------------
15259"##,
15260 default_severity: Severity::Allow,
15261 warn_since: None,
15262 deny_since: None,
15263 },
15264 Lint {
15265 label: "thin_box",
15266 description: r##"# `thin_box`
15267
15268
15269
15270The tracking issue for this feature is: [#92791]
15271
15272[#92791]: https://github.com/rust-lang/rust/issues/92791
15273
15274------------------------
15275"##,
15276 default_severity: Severity::Allow,
15277 warn_since: None,
15278 deny_since: None,
15279 },
15280 Lint {
15281 label: "thread_id_value",
15282 description: r##"# `thread_id_value`
15283
15284
15285
15286The tracking issue for this feature is: [#67939]
15287
15288[#67939]: https://github.com/rust-lang/rust/issues/67939
15289
15290------------------------
15291"##,
15292 default_severity: Severity::Allow,
15293 warn_since: None,
15294 deny_since: None,
15295 },
15296 Lint {
15297 label: "thread_local",
15298 description: r##"# `thread_local`
15299
15300Allows using `#[thread_local]` on `static` items.
15301
15302The tracking issue for this feature is: [#29594]
15303
15304[#29594]: https://github.com/rust-lang/rust/issues/29594
15305
15306------------------------
15307"##,
15308 default_severity: Severity::Allow,
15309 warn_since: None,
15310 deny_since: None,
15311 },
15312 Lint {
15313 label: "thread_local_internals",
15314 description: r##"# `thread_local_internals`
15315
15316This feature is internal to the Rust compiler and is not intended for general use.
15317
15318------------------------
15319"##,
15320 default_severity: Severity::Allow,
15321 warn_since: None,
15322 deny_since: None,
15323 },
15324 Lint {
15325 label: "thread_raw",
15326 description: r##"# `thread_raw`
15327
15328
15329
15330The tracking issue for this feature is: [#97523]
15331
15332[#97523]: https://github.com/rust-lang/rust/issues/97523
15333
15334------------------------
15335"##,
15336 default_severity: Severity::Allow,
15337 warn_since: None,
15338 deny_since: None,
15339 },
15340 Lint {
15341 label: "thread_sleep_until",
15342 description: r##"# `thread_sleep_until`
15343
15344
15345
15346The tracking issue for this feature is: [#113752]
15347
15348[#113752]: https://github.com/rust-lang/rust/issues/113752
15349
15350------------------------
15351"##,
15352 default_severity: Severity::Allow,
15353 warn_since: None,
15354 deny_since: None,
15355 },
15356 Lint {
15357 label: "thread_spawn_hook",
15358 description: r##"# `thread_spawn_hook`
15359
15360
15361
15362The tracking issue for this feature is: [#132951]
15363
15364[#132951]: https://github.com/rust-lang/rust/issues/132951
15365
15366------------------------
15367"##,
15368 default_severity: Severity::Allow,
15369 warn_since: None,
15370 deny_since: None,
15371 },
15372 Lint {
15373 label: "time_saturating_systemtime",
15374 description: r##"# `time_saturating_systemtime`
15375
15376
15377
15378The tracking issue for this feature is: [#151199]
15379
15380[#151199]: https://github.com/rust-lang/rust/issues/151199
15381
15382------------------------
15383"##,
15384 default_severity: Severity::Allow,
15385 warn_since: None,
15386 deny_since: None,
15387 },
15388 Lint {
15389 label: "time_systemtime_limits",
15390 description: r##"# `time_systemtime_limits`
15391
15392
15393
15394The tracking issue for this feature is: [#149067]
15395
15396[#149067]: https://github.com/rust-lang/rust/issues/149067
15397
15398------------------------
15399"##,
15400 default_severity: Severity::Allow,
15401 warn_since: None,
15402 deny_since: None,
15403 },
15404 Lint {
15405 label: "titlecase",
15406 description: r##"# `titlecase`
15407
15408
15409
15410The tracking issue for this feature is: [#153892]
15411
15412[#153892]: https://github.com/rust-lang/rust/issues/153892
15413
15414------------------------
15415"##,
15416 default_severity: Severity::Allow,
15417 warn_since: None,
15418 deny_since: None,
15419 },
15420 Lint {
15421 label: "trace_macros",
15422 description: r##"# `trace_macros`
15423
15424The tracking issue for this feature is [#29598].
15425
15426[#29598]: https://github.com/rust-lang/rust/issues/29598
15427
15428------------------------
15429
15430With `trace_macros` you can trace the expansion of macros in your code.
15431
15432## Examples
15433
15434```rust
15435#![feature(trace_macros)]
15436
15437fn main() {
15438 trace_macros!(true);
15439 println!("Hello, Rust!");
15440 trace_macros!(false);
15441}
15442```
15443
15444The `cargo build` output:
15445
15446```txt
15447note: trace_macro
15448 --> src/main.rs:5:5
15449 |
154505 | println!("Hello, Rust!");
15451 | ^^^^^^^^^^^^^^^^^^^^^^^^^
15452 |
15453 = note: expanding `println! { "Hello, Rust!" }`
15454 = note: to `print ! ( concat ! ( "Hello, Rust!" , "\n" ) )`
15455 = note: expanding `print! { concat ! ( "Hello, Rust!" , "\n" ) }`
15456 = note: to `$crate :: io :: _print ( format_args ! ( concat ! ( "Hello, Rust!" , "\n" ) )
15457 )`
15458
15459 Finished dev [unoptimized + debuginfo] target(s) in 0.60 secs
15460```
15461"##,
15462 default_severity: Severity::Allow,
15463 warn_since: None,
15464 deny_since: None,
15465 },
15466 Lint {
15467 label: "trait_alias",
15468 description: r##"# `trait_alias`
15469
15470The tracking issue for this feature is: [#41517]
15471
15472[#41517]: https://github.com/rust-lang/rust/issues/41517
15473
15474------------------------
15475
15476The `trait_alias` feature adds support for trait aliases. These allow aliases
15477to be created for one or more traits (currently just a single regular trait plus
15478any number of auto-traits), and used wherever traits would normally be used as
15479either bounds or trait objects.
15480
15481```rust
15482#![feature(trait_alias)]
15483
15484trait Foo = std::fmt::Debug + Send;
15485trait Bar = Foo + Sync;
15486
15487// Use trait alias as bound on type parameter.
15488fn foo<T: Foo>(v: &T) {
15489 println!("{:?}", v);
15490}
15491
15492pub fn main() {
15493 foo(&1);
15494
15495 // Use trait alias for trait objects.
15496 let a: &dyn Bar = &123;
15497 println!("{:?}", a);
15498 let b = Box::new(456) as Box<dyn Foo>;
15499 println!("{:?}", b);
15500}
15501```
15502"##,
15503 default_severity: Severity::Allow,
15504 warn_since: None,
15505 deny_since: None,
15506 },
15507 Lint {
15508 label: "transmutability",
15509 description: r##"# `transmutability`
15510
15511
15512
15513The tracking issue for this feature is: [#99571]
15514
15515[#99571]: https://github.com/rust-lang/rust/issues/99571
15516
15517------------------------
15518"##,
15519 default_severity: Severity::Allow,
15520 warn_since: None,
15521 deny_since: None,
15522 },
15523 Lint {
15524 label: "transmute_generic_consts",
15525 description: r##"# `transmute_generic_consts`
15526
15527Allows for transmuting between arrays with sizes that contain generic consts.
15528
15529The tracking issue for this feature is: [#109929]
15530
15531[#109929]: https://github.com/rust-lang/rust/issues/109929
15532
15533------------------------
15534"##,
15535 default_severity: Severity::Allow,
15536 warn_since: None,
15537 deny_since: None,
15538 },
15539 Lint {
15540 label: "transmute_neo",
15541 description: r##"# `transmute_neo`
15542
15543
15544
15545The tracking issue for this feature is: [#155079]
15546
15547[#155079]: https://github.com/rust-lang/rust/issues/155079
15548
15549------------------------
15550"##,
15551 default_severity: Severity::Allow,
15552 warn_since: None,
15553 deny_since: None,
15554 },
15555 Lint {
15556 label: "transmute_prefix",
15557 description: r##"# `transmute_prefix`
15558
15559
15560
15561The tracking issue for this feature is: [#155079]
15562
15563[#155079]: https://github.com/rust-lang/rust/issues/155079
15564
15565------------------------
15566"##,
15567 default_severity: Severity::Allow,
15568 warn_since: None,
15569 deny_since: None,
15570 },
15571 Lint {
15572 label: "transparent_unions",
15573 description: r##"# `transparent_unions`
15574
15575The tracking issue for this feature is [#60405]
15576
15577[#60405]: https://github.com/rust-lang/rust/issues/60405
15578
15579----
15580
15581The `transparent_unions` feature allows you mark `union`s as
15582`#[repr(transparent)]`. A `union` may be `#[repr(transparent)]` in exactly the
15583same conditions in which a `struct` may be `#[repr(transparent)]` (generally,
15584this means the `union` must have exactly one non-zero-sized field). Some
15585concrete illustrations follow.
15586
15587```rust
15588#![feature(transparent_unions)]
15589
15590// This union has the same representation as `f32`.
15591#[repr(transparent)]
15592union SingleFieldUnion {
15593 field: f32,
15594}
15595
15596// This union has the same representation as `usize`.
15597#[repr(transparent)]
15598union MultiFieldUnion {
15599 field: usize,
15600 nothing: (),
15601}
15602```
15603
15604For consistency with transparent `struct`s, `union`s must have exactly one
15605non-zero-sized field. If all fields are zero-sized, the `union` must not be
15606`#[repr(transparent)]`:
15607
15608```rust
15609#![feature(transparent_unions)]
15610
15611// This (non-transparent) union is already valid in stable Rust:
15612pub union GoodUnion {
15613 pub nothing: (),
15614}
15615
15616// Error: transparent union needs exactly one non-zero-sized field, but has 0
15617// #[repr(transparent)]
15618// pub union BadUnion {
15619// pub nothing: (),
15620// }
15621```
15622
15623The one exception is if the `union` is generic over `T` and has a field of type
15624`T`, it may be `#[repr(transparent)]` even if `T` is a zero-sized type:
15625
15626```rust
15627#![feature(transparent_unions)]
15628
15629// This union has the same representation as `T`.
15630#[repr(transparent)]
15631pub union GenericUnion<T: Copy> { // Unions with non-`Copy` fields are unstable.
15632 pub field: T,
15633 pub nothing: (),
15634}
15635
15636// This is okay even though `()` is a zero-sized type.
15637pub const THIS_IS_OKAY: GenericUnion<()> = GenericUnion { field: () };
15638```
15639
15640Like transparent `struct`s, a transparent `union` of type `U` has the same
15641layout, size, and ABI as its single non-ZST field. If it is generic over a type
15642`T`, and all its fields are ZSTs except for exactly one field of type `T`, then
15643it has the same layout and ABI as `T` (even if `T` is a ZST when monomorphized).
15644
15645Like transparent `struct`s, transparent `union`s are FFI-safe if and only if
15646their underlying representation type is also FFI-safe.
15647
15648A `union` may not be eligible for the same nonnull-style optimizations that a
15649`struct` or `enum` (with the same fields) are eligible for. Adding
15650`#[repr(transparent)]` to `union` does not change this. To give a more concrete
15651example, it is unspecified whether `size_of::<T>()` is equal to
15652`size_of::<Option<T>>()`, where `T` is a `union` (regardless of whether or not
15653it is transparent). The Rust compiler is free to perform this optimization if
15654possible, but is not required to, and different compiler versions may differ in
15655their application of these optimizations.
15656"##,
15657 default_severity: Severity::Allow,
15658 warn_since: None,
15659 deny_since: None,
15660 },
15661 Lint {
15662 label: "trim_prefix_suffix",
15663 description: r##"# `trim_prefix_suffix`
15664
15665
15666
15667The tracking issue for this feature is: [#142312]
15668
15669[#142312]: https://github.com/rust-lang/rust/issues/142312
15670
15671------------------------
15672"##,
15673 default_severity: Severity::Allow,
15674 warn_since: None,
15675 deny_since: None,
15676 },
15677 Lint {
15678 label: "trivial_bounds",
15679 description: r##"# `trivial_bounds`
15680
15681Allows inconsistent bounds in where clauses.
15682
15683The tracking issue for this feature is: [#48214]
15684
15685[#48214]: https://github.com/rust-lang/rust/issues/48214
15686
15687------------------------
15688"##,
15689 default_severity: Severity::Allow,
15690 warn_since: None,
15691 deny_since: None,
15692 },
15693 Lint {
15694 label: "trivial_clone",
15695 description: r##"# `trivial_clone`
15696
15697
15698
15699This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
15700
15701------------------------
15702"##,
15703 default_severity: Severity::Allow,
15704 warn_since: None,
15705 deny_since: None,
15706 },
15707 Lint {
15708 label: "trusted_fused",
15709 description: r##"# `trusted_fused`
15710
15711
15712
15713This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
15714
15715------------------------
15716"##,
15717 default_severity: Severity::Allow,
15718 warn_since: None,
15719 deny_since: None,
15720 },
15721 Lint {
15722 label: "trusted_len",
15723 description: r##"# `trusted_len`
15724
15725
15726
15727The tracking issue for this feature is: [#37572]
15728
15729[#37572]: https://github.com/rust-lang/rust/issues/37572
15730
15731------------------------
15732"##,
15733 default_severity: Severity::Allow,
15734 warn_since: None,
15735 deny_since: None,
15736 },
15737 Lint {
15738 label: "trusted_len_next_unchecked",
15739 description: r##"# `trusted_len_next_unchecked`
15740
15741
15742
15743The tracking issue for this feature is: [#37572]
15744
15745[#37572]: https://github.com/rust-lang/rust/issues/37572
15746
15747------------------------
15748"##,
15749 default_severity: Severity::Allow,
15750 warn_since: None,
15751 deny_since: None,
15752 },
15753 Lint {
15754 label: "trusted_random_access",
15755 description: r##"# `trusted_random_access`
15756
15757
15758
15759This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
15760
15761------------------------
15762"##,
15763 default_severity: Severity::Allow,
15764 warn_since: None,
15765 deny_since: None,
15766 },
15767 Lint {
15768 label: "trusted_step",
15769 description: r##"# `trusted_step`
15770
15771
15772
15773The tracking issue for this feature is: [#85731]
15774
15775[#85731]: https://github.com/rust-lang/rust/issues/85731
15776
15777------------------------
15778"##,
15779 default_severity: Severity::Allow,
15780 warn_since: None,
15781 deny_since: None,
15782 },
15783 Lint {
15784 label: "try_as_dyn",
15785 description: r##"# `try_as_dyn`
15786
15787
15788
15789The tracking issue for this feature is: [#144361]
15790
15791[#144361]: https://github.com/rust-lang/rust/issues/144361
15792
15793------------------------
15794"##,
15795 default_severity: Severity::Allow,
15796 warn_since: None,
15797 deny_since: None,
15798 },
15799 Lint {
15800 label: "try_blocks",
15801 description: r##"# `try_blocks`
15802
15803The tracking issue for this feature is: [#154391]
15804
15805[#154391]: https://github.com/rust-lang/rust/issues/154391
15806
15807------------------------
15808
15809The `try_blocks` feature adds support for `try` blocks. A `try`
15810block creates a new scope one can use the `?` operator in.
15811
15812```rust,edition2018
15813#![feature(try_blocks)]
15814
15815use std::num::ParseIntError;
15816
15817let result = try {
15818 "1".parse::<i32>()?
15819 + "2".parse::<i32>()?
15820 + "3".parse::<i32>()?
15821};
15822assert_eq!(result, Ok(6));
15823
15824let result = try {
15825 "1".parse::<i32>()?
15826 + "foo".parse::<i32>()?
15827 + "3".parse::<i32>()?
15828};
15829assert!(result.is_err());
15830```
15831"##,
15832 default_severity: Severity::Allow,
15833 warn_since: None,
15834 deny_since: None,
15835 },
15836 Lint {
15837 label: "try_blocks_heterogeneous",
15838 description: r##"# `try_blocks_heterogeneous`
15839
15840Allows using `try bikeshed TargetType {...}` expressions.
15841
15842The tracking issue for this feature is: [#149488]
15843
15844[#149488]: https://github.com/rust-lang/rust/issues/149488
15845
15846------------------------
15847"##,
15848 default_severity: Severity::Allow,
15849 warn_since: None,
15850 deny_since: None,
15851 },
15852 Lint {
15853 label: "try_find",
15854 description: r##"# `try_find`
15855
15856
15857
15858The tracking issue for this feature is: [#63178]
15859
15860[#63178]: https://github.com/rust-lang/rust/issues/63178
15861
15862------------------------
15863"##,
15864 default_severity: Severity::Allow,
15865 warn_since: None,
15866 deny_since: None,
15867 },
15868 Lint {
15869 label: "try_from_int_error_kind",
15870 description: r##"# `try_from_int_error_kind`
15871
15872
15873
15874The tracking issue for this feature is: [#153978]
15875
15876[#153978]: https://github.com/rust-lang/rust/issues/153978
15877
15878------------------------
15879"##,
15880 default_severity: Severity::Allow,
15881 warn_since: None,
15882 deny_since: None,
15883 },
15884 Lint {
15885 label: "try_reserve_kind",
15886 description: r##"# `try_reserve_kind`
15887
15888
15889
15890The tracking issue for this feature is: [#48043]
15891
15892[#48043]: https://github.com/rust-lang/rust/issues/48043
15893
15894------------------------
15895"##,
15896 default_severity: Severity::Allow,
15897 warn_since: None,
15898 deny_since: None,
15899 },
15900 Lint {
15901 label: "try_trait_v2",
15902 description: r##"# `try_trait_v2`
15903
15904
15905
15906The tracking issue for this feature is: [#84277]
15907
15908[#84277]: https://github.com/rust-lang/rust/issues/84277
15909
15910------------------------
15911"##,
15912 default_severity: Severity::Allow,
15913 warn_since: None,
15914 deny_since: None,
15915 },
15916 Lint {
15917 label: "try_trait_v2_residual",
15918 description: r##"# `try_trait_v2_residual`
15919
15920
15921
15922The tracking issue for this feature is: [#91285]
15923
15924[#91285]: https://github.com/rust-lang/rust/issues/91285
15925
15926------------------------
15927"##,
15928 default_severity: Severity::Allow,
15929 warn_since: None,
15930 deny_since: None,
15931 },
15932 Lint {
15933 label: "try_trait_v2_yeet",
15934 description: r##"# `try_trait_v2_yeet`
15935
15936
15937
15938The tracking issue for this feature is: [#96374]
15939
15940[#96374]: https://github.com/rust-lang/rust/issues/96374
15941
15942------------------------
15943"##,
15944 default_severity: Severity::Allow,
15945 warn_since: None,
15946 deny_since: None,
15947 },
15948 Lint {
15949 label: "try_with_capacity",
15950 description: r##"# `try_with_capacity`
15951
15952
15953
15954The tracking issue for this feature is: [#91913]
15955
15956[#91913]: https://github.com/rust-lang/rust/issues/91913
15957
15958------------------------
15959"##,
15960 default_severity: Severity::Allow,
15961 warn_since: None,
15962 deny_since: None,
15963 },
15964 Lint {
15965 label: "tuple_trait",
15966 description: r##"# `tuple_trait`
15967
15968
15969
15970This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
15971
15972------------------------
15973"##,
15974 default_severity: Severity::Allow,
15975 warn_since: None,
15976 deny_since: None,
15977 },
15978 Lint {
15979 label: "type_alias_impl_trait",
15980 description: r##"# `type_alias_impl_trait`
15981
15982The tracking issue for this feature is: [#63063]
15983
15984------------------------
15985
15986> This feature is not to be confused with [`trait_alias`] or [`impl_trait_in_assoc_type`].
15987
15988### What is `impl Trait`?
15989
15990`impl Trait` in return position is useful for declaring types that are constrained by traits, but whose concrete type should be hidden:
15991
15992```rust
15993use std::fmt::Debug;
15994
15995fn new() -> impl Debug {
15996 42
15997}
15998
15999fn main() {
16000 let thing = new();
16001 // What actually is a `thing`?
16002 // No idea but we know it implements `Debug`, so we can debug print it
16003 println!("{thing:?}");
16004}
16005```
16006
16007See the [reference] for more information about `impl Trait` in return position.
16008
16009### `type_alias_impl_trait`
16010
16011However, we might want to use an `impl Trait` in multiple locations but actually use the same concrete type everywhere while keeping it hidden.
16012This can be useful in libraries where you want to hide implementation details.
16013
16014The `#[define_opaque]` attribute must be used to explicitly list opaque items constrained by the item it's on.
16015
16016```rust
16017#![feature(type_alias_impl_trait)]
16018# #![allow(unused_variables, dead_code)]
16019trait Trait {}
16020
16021struct MyType;
16022
16023impl Trait for MyType {}
16024
16025type Alias = impl Trait;
16026
16027#[define_opaque(Alias)] // To constrain the type alias to `MyType`
16028fn new() -> Alias {
16029 MyType
16030}
16031
16032#[define_opaque(Alias)] // So we can name the concrete type inside this item
16033fn main() {
16034 let thing: MyType = new();
16035}
16036
16037// It can be a part of a struct too
16038struct HaveAlias {
16039 stuff: String,
16040 thing: Alias,
16041}
16042```
16043
16044In this example, the concrete type referred to by `Alias` is guaranteed to be the same wherever `Alias` occurs.
16045
16046> 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`].
16047
16048### `type_alias_impl_trait` in argument position.
16049
16050Note 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.
16051
16052```rust
16053# #![feature(type_alias_impl_trait)]
16054# #![allow(unused_variables)]
16055# pub mod x {
16056# pub trait Trait {}
16057#
16058# struct MyType;
16059#
16060# impl Trait for MyType {}
16061#
16062# pub type Alias = impl Trait;
16063#
16064# #[define_opaque(Alias)]
16065# pub fn new() -> Alias {
16066# MyType
16067# }
16068# }
16069# use x::*;
16070// this...
16071pub fn take_alias(x: Alias) {
16072 // ...
16073}
16074
16075// ...is *not* the same as
16076pub fn take_impl(x: impl Trait) {
16077 // ...
16078}
16079# fn main(){}
16080```
16081
16082```rust,compile_fail,E0308
16083# #![feature(type_alias_impl_trait)]
16084# #![allow(unused_variables)]
16085# pub mod x {
16086# pub trait Trait {}
16087#
16088# struct MyType;
16089#
16090# impl Trait for MyType {}
16091#
16092# pub type Alias = impl Trait;
16093#
16094# #[define_opaque(Alias)]
16095# pub fn new() -> Alias {
16096# MyType
16097# }
16098# }
16099# use x::*;
16100# pub fn take_alias(x: Alias) {
16101# // ...
16102# }
16103#
16104# pub fn take_impl(x: impl Trait) {
16105# // ...
16106# }
16107#
16108// a user's crate using the trait and type alias
16109struct UserType;
16110impl Trait for UserType {}
16111
16112# fn main(){
16113let x = UserType;
16114take_alias(x);
16115// ERROR expected opaque type, found `UserType`
16116// this function *actually* takes a `MyType` as is constrained in `new`
16117
16118let x = UserType;
16119take_impl(x);
16120// OK
16121
16122let x = new();
16123take_alias(x);
16124// OK
16125
16126let x = new();
16127take_impl(x);
16128// OK
16129# }
16130```
16131
16132Note 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`".
16133
16134[#63063]: https://github.com/rust-lang/rust/issues/63063
16135[#110237]: https://github.com/rust-lang/rust/pull/110237
16136[reference]: https://doc.rust-lang.org/stable/reference/types/impl-trait.html#abstract-return-types
16137[`trait_alias`]: ./trait-alias.md
16138[`impl_trait_in_assoc_type`]: ./impl-trait-in-assoc-type.md
16139"##,
16140 default_severity: Severity::Allow,
16141 warn_since: None,
16142 deny_since: None,
16143 },
16144 Lint {
16145 label: "type_ascription",
16146 description: r##"# `type_ascription`
16147
16148
16149
16150The tracking issue for this feature is: [#23416]
16151
16152[#23416]: https://github.com/rust-lang/rust/issues/23416
16153
16154------------------------
16155"##,
16156 default_severity: Severity::Allow,
16157 warn_since: None,
16158 deny_since: None,
16159 },
16160 Lint {
16161 label: "type_changing_struct_update",
16162 description: r##"# `type_changing_struct_update`
16163
16164The tracking issue for this feature is: [#86555]
16165
16166[#86555]: https://github.com/rust-lang/rust/issues/86555
16167
16168------------------------
16169
16170This implements [RFC2528]. When turned on, you can create instances of the same struct
16171that have different generic type or lifetime parameters.
16172
16173[RFC2528]: https://github.com/rust-lang/rfcs/blob/master/text/2528-type-changing-struct-update-syntax.md
16174
16175```rust
16176#![allow(unused_variables, dead_code)]
16177#![feature(type_changing_struct_update)]
16178
16179fn main () {
16180 struct Foo<T, U> {
16181 field1: T,
16182 field2: U,
16183 }
16184
16185 let base: Foo<String, i32> = Foo {
16186 field1: String::from("hello"),
16187 field2: 1234,
16188 };
16189 let updated: Foo<f64, i32> = Foo {
16190 field1: 3.14,
16191 ..base
16192 };
16193}
16194```
16195"##,
16196 default_severity: Severity::Allow,
16197 warn_since: None,
16198 deny_since: None,
16199 },
16200 Lint {
16201 label: "type_info",
16202 description: r##"# `type_info`
16203
16204
16205
16206The tracking issue for this feature is: [#146922]
16207
16208[#146922]: https://github.com/rust-lang/rust/issues/146922
16209
16210------------------------
16211"##,
16212 default_severity: Severity::Allow,
16213 warn_since: None,
16214 deny_since: None,
16215 },
16216 Lint {
16217 label: "ub_checks",
16218 description: r##"# `ub_checks`
16219
16220
16221
16222This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
16223
16224------------------------
16225"##,
16226 default_severity: Severity::Allow,
16227 warn_since: None,
16228 deny_since: None,
16229 },
16230 Lint {
16231 label: "uefi_std",
16232 description: r##"# `uefi_std`
16233
16234
16235
16236The tracking issue for this feature is: [#100499]
16237
16238[#100499]: https://github.com/rust-lang/rust/issues/100499
16239
16240------------------------
16241"##,
16242 default_severity: Severity::Allow,
16243 warn_since: None,
16244 deny_since: None,
16245 },
16246 Lint {
16247 label: "uint_carryless_mul",
16248 description: r##"# `uint_carryless_mul`
16249
16250
16251
16252The tracking issue for this feature is: [#152080]
16253
16254[#152080]: https://github.com/rust-lang/rust/issues/152080
16255
16256------------------------
16257"##,
16258 default_severity: Severity::Allow,
16259 warn_since: None,
16260 deny_since: None,
16261 },
16262 Lint {
16263 label: "uint_gather_scatter_bits",
16264 description: r##"# `uint_gather_scatter_bits`
16265
16266
16267
16268The tracking issue for this feature is: [#149069]
16269
16270[#149069]: https://github.com/rust-lang/rust/issues/149069
16271
16272------------------------
16273"##,
16274 default_severity: Severity::Allow,
16275 warn_since: None,
16276 deny_since: None,
16277 },
16278 Lint {
16279 label: "unboxed_closures",
16280 description: r##"# `unboxed_closures`
16281
16282The tracking issue for this feature is [#29625]
16283
16284See Also: [`fn_traits`](../library-features/fn-traits.md)
16285
16286[#29625]: https://github.com/rust-lang/rust/issues/29625
16287
16288----
16289
16290The `unboxed_closures` feature allows you to write functions using the `"rust-call"` ABI,
16291required for implementing the [`Fn*`] family of traits. `"rust-call"` functions must have
16292exactly one (non self) argument, a tuple representing the argument list.
16293
16294[`Fn*`]: ../../std/ops/trait.Fn.html
16295
16296```rust
16297#![feature(unboxed_closures)]
16298
16299extern "rust-call" fn add_args(args: (u32, u32)) -> u32 {
16300 args.0 + args.1
16301}
16302
16303fn main() {}
16304```
16305"##,
16306 default_severity: Severity::Allow,
16307 warn_since: None,
16308 deny_since: None,
16309 },
16310 Lint {
16311 label: "unicode_internals",
16312 description: r##"# `unicode_internals`
16313
16314
16315
16316This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
16317
16318------------------------
16319"##,
16320 default_severity: Severity::Allow,
16321 warn_since: None,
16322 deny_since: None,
16323 },
16324 Lint {
16325 label: "unique_rc_arc",
16326 description: r##"# `unique_rc_arc`
16327
16328
16329
16330The tracking issue for this feature is: [#112566]
16331
16332[#112566]: https://github.com/rust-lang/rust/issues/112566
16333
16334------------------------
16335"##,
16336 default_severity: Severity::Allow,
16337 warn_since: None,
16338 deny_since: None,
16339 },
16340 Lint {
16341 label: "unix_file_vectored_at",
16342 description: r##"# `unix_file_vectored_at`
16343
16344
16345
16346The tracking issue for this feature is: [#89517]
16347
16348[#89517]: https://github.com/rust-lang/rust/issues/89517
16349
16350------------------------
16351"##,
16352 default_severity: Severity::Allow,
16353 warn_since: None,
16354 deny_since: None,
16355 },
16356 Lint {
16357 label: "unix_kill_process_group",
16358 description: r##"# `unix_kill_process_group`
16359
16360
16361
16362The tracking issue for this feature is: [#156537]
16363
16364[#156537]: https://github.com/rust-lang/rust/issues/156537
16365
16366------------------------
16367"##,
16368 default_severity: Severity::Allow,
16369 warn_since: None,
16370 deny_since: None,
16371 },
16372 Lint {
16373 label: "unix_mkfifo",
16374 description: r##"# `unix_mkfifo`
16375
16376
16377
16378The tracking issue for this feature is: [#139324]
16379
16380[#139324]: https://github.com/rust-lang/rust/issues/139324
16381
16382------------------------
16383"##,
16384 default_severity: Severity::Allow,
16385 warn_since: None,
16386 deny_since: None,
16387 },
16388 Lint {
16389 label: "unix_send_signal",
16390 description: r##"# `unix_send_signal`
16391
16392
16393
16394The tracking issue for this feature is: [#141975]
16395
16396[#141975]: https://github.com/rust-lang/rust/issues/141975
16397
16398------------------------
16399"##,
16400 default_severity: Severity::Allow,
16401 warn_since: None,
16402 deny_since: None,
16403 },
16404 Lint {
16405 label: "unix_set_mark",
16406 description: r##"# `unix_set_mark`
16407
16408
16409
16410The tracking issue for this feature is: [#96467]
16411
16412[#96467]: https://github.com/rust-lang/rust/issues/96467
16413
16414------------------------
16415"##,
16416 default_severity: Severity::Allow,
16417 warn_since: None,
16418 deny_since: None,
16419 },
16420 Lint {
16421 label: "unix_socket_ancillary_data",
16422 description: r##"# `unix_socket_ancillary_data`
16423
16424
16425
16426The tracking issue for this feature is: [#76915]
16427
16428[#76915]: https://github.com/rust-lang/rust/issues/76915
16429
16430------------------------
16431"##,
16432 default_severity: Severity::Allow,
16433 warn_since: None,
16434 deny_since: None,
16435 },
16436 Lint {
16437 label: "unix_socket_exclbind",
16438 description: r##"# `unix_socket_exclbind`
16439
16440
16441
16442The tracking issue for this feature is: [#123481]
16443
16444[#123481]: https://github.com/rust-lang/rust/issues/123481
16445
16446------------------------
16447"##,
16448 default_severity: Severity::Allow,
16449 warn_since: None,
16450 deny_since: None,
16451 },
16452 Lint {
16453 label: "unix_socket_peek",
16454 description: r##"# `unix_socket_peek`
16455
16456
16457
16458The tracking issue for this feature is: [#76923]
16459
16460[#76923]: https://github.com/rust-lang/rust/issues/76923
16461
16462------------------------
16463"##,
16464 default_severity: Severity::Allow,
16465 warn_since: None,
16466 deny_since: None,
16467 },
16468 Lint {
16469 label: "unqualified_local_imports",
16470 description: r##"# `unqualified_local_imports`
16471
16472Helps with formatting for `group_imports = "StdExternalCrate"`.
16473
16474The tracking issue for this feature is: [#138299]
16475
16476[#138299]: https://github.com/rust-lang/rust/issues/138299
16477
16478------------------------
16479"##,
16480 default_severity: Severity::Allow,
16481 warn_since: None,
16482 deny_since: None,
16483 },
16484 Lint {
16485 label: "unsafe_binders",
16486 description: r##"# `unsafe_binders`
16487
16488Allows using `unsafe<'a> &'a T` unsafe binder types.
16489
16490The tracking issue for this feature is: [#130516]
16491
16492[#130516]: https://github.com/rust-lang/rust/issues/130516
16493
16494------------------------
16495"##,
16496 default_severity: Severity::Allow,
16497 warn_since: None,
16498 deny_since: None,
16499 },
16500 Lint {
16501 label: "unsafe_cell_access",
16502 description: r##"# `unsafe_cell_access`
16503
16504
16505
16506The tracking issue for this feature is: [#136327]
16507
16508[#136327]: https://github.com/rust-lang/rust/issues/136327
16509
16510------------------------
16511"##,
16512 default_severity: Severity::Allow,
16513 warn_since: None,
16514 deny_since: None,
16515 },
16516 Lint {
16517 label: "unsafe_fields",
16518 description: r##"# `unsafe_fields`
16519
16520Allows declaring fields `unsafe`.
16521
16522The tracking issue for this feature is: [#132922]
16523
16524[#132922]: https://github.com/rust-lang/rust/issues/132922
16525
16526------------------------
16527"##,
16528 default_severity: Severity::Allow,
16529 warn_since: None,
16530 deny_since: None,
16531 },
16532 Lint {
16533 label: "unsafe_pinned",
16534 description: r##"# `unsafe_pinned`
16535
16536
16537
16538The tracking issue for this feature is: [#125735]
16539
16540[#125735]: https://github.com/rust-lang/rust/issues/125735
16541
16542------------------------
16543"##,
16544 default_severity: Severity::Allow,
16545 warn_since: None,
16546 deny_since: None,
16547 },
16548 Lint {
16549 label: "unsafe_unpin",
16550 description: r##"# `unsafe_unpin`
16551
16552
16553
16554The tracking issue for this feature is: [#125735]
16555
16556[#125735]: https://github.com/rust-lang/rust/issues/125735
16557
16558------------------------
16559"##,
16560 default_severity: Severity::Allow,
16561 warn_since: None,
16562 deny_since: None,
16563 },
16564 Lint {
16565 label: "unsize",
16566 description: r##"# `unsize`
16567
16568
16569
16570The tracking issue for this feature is: [#18598]
16571
16572[#18598]: https://github.com/rust-lang/rust/issues/18598
16573
16574------------------------
16575"##,
16576 default_severity: Severity::Allow,
16577 warn_since: None,
16578 deny_since: None,
16579 },
16580 Lint {
16581 label: "unsized_const_params",
16582 description: r##"# `unsized_const_params`
16583
16584Allows const generic parameters to be defined with types that are not `Sized`, e.g. `fn foo<const N: [u8]>() {`.
16585
16586The tracking issue for this feature is: [#95174]
16587
16588[#95174]: https://github.com/rust-lang/rust/issues/95174
16589
16590------------------------
16591"##,
16592 default_severity: Severity::Allow,
16593 warn_since: None,
16594 deny_since: None,
16595 },
16596 Lint {
16597 label: "unsized_fn_params",
16598 description: r##"# `unsized_fn_params`
16599
16600Allows unsized fn parameters.
16601
16602The tracking issue for this feature is: [#48055]
16603
16604[#48055]: https://github.com/rust-lang/rust/issues/48055
16605
16606------------------------
16607"##,
16608 default_severity: Severity::Allow,
16609 warn_since: None,
16610 deny_since: None,
16611 },
16612 Lint {
16613 label: "unwrap_infallible",
16614 description: r##"# `unwrap_infallible`
16615
16616
16617
16618The tracking issue for this feature is: [#61695]
16619
16620[#61695]: https://github.com/rust-lang/rust/issues/61695
16621
16622------------------------
16623"##,
16624 default_severity: Severity::Allow,
16625 warn_since: None,
16626 deny_since: None,
16627 },
16628 Lint {
16629 label: "update_panic_count",
16630 description: r##"# `update_panic_count`
16631
16632This feature is internal to the Rust compiler and is not intended for general use.
16633
16634------------------------
16635"##,
16636 default_severity: Severity::Allow,
16637 warn_since: None,
16638 deny_since: None,
16639 },
16640 Lint {
16641 label: "used_with_arg",
16642 description: r##"# `used_with_arg`
16643
16644Allows using the `#[used(linker)]` (or `#[used(compiler)]`) attribute.
16645
16646The tracking issue for this feature is: [#93798]
16647
16648[#93798]: https://github.com/rust-lang/rust/issues/93798
16649
16650------------------------
16651"##,
16652 default_severity: Severity::Allow,
16653 warn_since: None,
16654 deny_since: None,
16655 },
16656 Lint {
16657 label: "utf16_extra",
16658 description: r##"# `utf16_extra`
16659
16660
16661
16662The tracking issue for this feature is: [#94919]
16663
16664[#94919]: https://github.com/rust-lang/rust/issues/94919
16665
16666------------------------
16667"##,
16668 default_severity: Severity::Allow,
16669 warn_since: None,
16670 deny_since: None,
16671 },
16672 Lint {
16673 label: "variant_count",
16674 description: r##"# `variant_count`
16675
16676
16677
16678The tracking issue for this feature is: [#73662]
16679
16680[#73662]: https://github.com/rust-lang/rust/issues/73662
16681
16682------------------------
16683"##,
16684 default_severity: Severity::Allow,
16685 warn_since: None,
16686 deny_since: None,
16687 },
16688 Lint {
16689 label: "vec_deque_extract_if",
16690 description: r##"# `vec_deque_extract_if`
16691
16692
16693
16694The tracking issue for this feature is: [#147750]
16695
16696[#147750]: https://github.com/rust-lang/rust/issues/147750
16697
16698------------------------
16699"##,
16700 default_severity: Severity::Allow,
16701 warn_since: None,
16702 deny_since: None,
16703 },
16704 Lint {
16705 label: "vec_deque_iter_as_slices",
16706 description: r##"# `vec_deque_iter_as_slices`
16707
16708
16709
16710The tracking issue for this feature is: [#123947]
16711
16712[#123947]: https://github.com/rust-lang/rust/issues/123947
16713
16714------------------------
16715"##,
16716 default_severity: Severity::Allow,
16717 warn_since: None,
16718 deny_since: None,
16719 },
16720 Lint {
16721 label: "vec_deque_truncate_front",
16722 description: r##"# `vec_deque_truncate_front`
16723
16724
16725
16726The tracking issue for this feature is: [#140667]
16727
16728[#140667]: https://github.com/rust-lang/rust/issues/140667
16729
16730------------------------
16731"##,
16732 default_severity: Severity::Allow,
16733 warn_since: None,
16734 deny_since: None,
16735 },
16736 Lint {
16737 label: "vec_fallible_shrink",
16738 description: r##"# `vec_fallible_shrink`
16739
16740
16741
16742The tracking issue for this feature is: [#152350]
16743
16744[#152350]: https://github.com/rust-lang/rust/issues/152350
16745
16746------------------------
16747"##,
16748 default_severity: Severity::Allow,
16749 warn_since: None,
16750 deny_since: None,
16751 },
16752 Lint {
16753 label: "vec_from_fn",
16754 description: r##"# `vec_from_fn`
16755
16756
16757
16758The tracking issue for this feature is: [#149698]
16759
16760[#149698]: https://github.com/rust-lang/rust/issues/149698
16761
16762------------------------
16763"##,
16764 default_severity: Severity::Allow,
16765 warn_since: None,
16766 deny_since: None,
16767 },
16768 Lint {
16769 label: "vec_into_chunks",
16770 description: r##"# `vec_into_chunks`
16771
16772
16773
16774The tracking issue for this feature is: [#142137]
16775
16776[#142137]: https://github.com/rust-lang/rust/issues/142137
16777
16778------------------------
16779"##,
16780 default_severity: Severity::Allow,
16781 warn_since: None,
16782 deny_since: None,
16783 },
16784 Lint {
16785 label: "vec_peek_mut",
16786 description: r##"# `vec_peek_mut`
16787
16788
16789
16790The tracking issue for this feature is: [#122742]
16791
16792[#122742]: https://github.com/rust-lang/rust/issues/122742
16793
16794------------------------
16795"##,
16796 default_severity: Severity::Allow,
16797 warn_since: None,
16798 deny_since: None,
16799 },
16800 Lint {
16801 label: "vec_push_within_capacity",
16802 description: r##"# `vec_push_within_capacity`
16803
16804
16805
16806The tracking issue for this feature is: [#100486]
16807
16808[#100486]: https://github.com/rust-lang/rust/issues/100486
16809
16810------------------------
16811"##,
16812 default_severity: Severity::Allow,
16813 warn_since: None,
16814 deny_since: None,
16815 },
16816 Lint {
16817 label: "vec_recycle",
16818 description: r##"# `vec_recycle`
16819
16820
16821
16822The tracking issue for this feature is: [#148227]
16823
16824[#148227]: https://github.com/rust-lang/rust/issues/148227
16825
16826------------------------
16827"##,
16828 default_severity: Severity::Allow,
16829 warn_since: None,
16830 deny_since: None,
16831 },
16832 Lint {
16833 label: "vec_split_at_spare",
16834 description: r##"# `vec_split_at_spare`
16835
16836
16837
16838The tracking issue for this feature is: [#81944]
16839
16840[#81944]: https://github.com/rust-lang/rust/issues/81944
16841
16842------------------------
16843"##,
16844 default_severity: Severity::Allow,
16845 warn_since: None,
16846 deny_since: None,
16847 },
16848 Lint {
16849 label: "vec_try_remove",
16850 description: r##"# `vec_try_remove`
16851
16852
16853
16854The tracking issue for this feature is: [#146954]
16855
16856[#146954]: https://github.com/rust-lang/rust/issues/146954
16857
16858------------------------
16859"##,
16860 default_severity: Severity::Allow,
16861 warn_since: None,
16862 deny_since: None,
16863 },
16864 Lint {
16865 label: "view_types",
16866 description: r##"# `view_types`
16867
16868Allows view types.
16869
16870The tracking issue for this feature is: [#155938]
16871
16872[#155938]: https://github.com/rust-lang/rust/issues/155938
16873
16874------------------------
16875"##,
16876 default_severity: Severity::Allow,
16877 warn_since: None,
16878 deny_since: None,
16879 },
16880 Lint {
16881 label: "waker_fn",
16882 description: r##"# `waker_fn`
16883
16884
16885
16886The tracking issue for this feature is: [#149580]
16887
16888[#149580]: https://github.com/rust-lang/rust/issues/149580
16889
16890------------------------
16891"##,
16892 default_severity: Severity::Allow,
16893 warn_since: None,
16894 deny_since: None,
16895 },
16896 Lint {
16897 label: "waker_from_fn_ptr",
16898 description: r##"# `waker_from_fn_ptr`
16899
16900
16901
16902The tracking issue for this feature is: [#148457]
16903
16904[#148457]: https://github.com/rust-lang/rust/issues/148457
16905
16906------------------------
16907"##,
16908 default_severity: Severity::Allow,
16909 warn_since: None,
16910 deny_since: None,
16911 },
16912 Lint {
16913 label: "wasi_ext",
16914 description: r##"# `wasi_ext`
16915
16916
16917
16918The tracking issue for this feature is: [#71213]
16919
16920[#71213]: https://github.com/rust-lang/rust/issues/71213
16921
16922------------------------
16923"##,
16924 default_severity: Severity::Allow,
16925 warn_since: None,
16926 deny_since: None,
16927 },
16928 Lint {
16929 label: "wasm_target_feature",
16930 description: r##"# `wasm_target_feature`
16931
16932Target features on wasm.
16933
16934The tracking issue for this feature is: [#150260]
16935
16936[#150260]: https://github.com/rust-lang/rust/issues/150260
16937
16938------------------------
16939"##,
16940 default_severity: Severity::Allow,
16941 warn_since: None,
16942 deny_since: None,
16943 },
16944 Lint {
16945 label: "where_clause_attrs",
16946 description: r##"# `where_clause_attrs`
16947
16948Allows use of attributes in `where` clauses.
16949
16950The tracking issue for this feature is: [#115590]
16951
16952[#115590]: https://github.com/rust-lang/rust/issues/115590
16953
16954------------------------
16955"##,
16956 default_severity: Severity::Allow,
16957 warn_since: None,
16958 deny_since: None,
16959 },
16960 Lint {
16961 label: "widening_mul",
16962 description: r##"# `widening_mul`
16963
16964
16965
16966The tracking issue for this feature is: [#152016]
16967
16968[#152016]: https://github.com/rust-lang/rust/issues/152016
16969
16970------------------------
16971"##,
16972 default_severity: Severity::Allow,
16973 warn_since: None,
16974 deny_since: None,
16975 },
16976 Lint {
16977 label: "windows_by_handle",
16978 description: r##"# `windows_by_handle`
16979
16980
16981
16982The tracking issue for this feature is: [#63010]
16983
16984[#63010]: https://github.com/rust-lang/rust/issues/63010
16985
16986------------------------
16987"##,
16988 default_severity: Severity::Allow,
16989 warn_since: None,
16990 deny_since: None,
16991 },
16992 Lint {
16993 label: "windows_c",
16994 description: r##"# `windows_c`
16995
16996This feature is internal to the Rust compiler and is not intended for general use.
16997
16998------------------------
16999"##,
17000 default_severity: Severity::Allow,
17001 warn_since: None,
17002 deny_since: None,
17003 },
17004 Lint {
17005 label: "windows_change_time",
17006 description: r##"# `windows_change_time`
17007
17008
17009
17010The tracking issue for this feature is: [#121478]
17011
17012[#121478]: https://github.com/rust-lang/rust/issues/121478
17013
17014------------------------
17015"##,
17016 default_severity: Severity::Allow,
17017 warn_since: None,
17018 deny_since: None,
17019 },
17020 Lint {
17021 label: "windows_freeze_file_times",
17022 description: r##"# `windows_freeze_file_times`
17023
17024
17025
17026The tracking issue for this feature is: [#149715]
17027
17028[#149715]: https://github.com/rust-lang/rust/issues/149715
17029
17030------------------------
17031"##,
17032 default_severity: Severity::Allow,
17033 warn_since: None,
17034 deny_since: None,
17035 },
17036 Lint {
17037 label: "windows_handle",
17038 description: r##"# `windows_handle`
17039
17040This feature is internal to the Rust compiler and is not intended for general use.
17041
17042------------------------
17043"##,
17044 default_severity: Severity::Allow,
17045 warn_since: None,
17046 deny_since: None,
17047 },
17048 Lint {
17049 label: "windows_net",
17050 description: r##"# `windows_net`
17051
17052This feature is internal to the Rust compiler and is not intended for general use.
17053
17054------------------------
17055"##,
17056 default_severity: Severity::Allow,
17057 warn_since: None,
17058 deny_since: None,
17059 },
17060 Lint {
17061 label: "windows_permissions_ext",
17062 description: r##"# `windows_permissions_ext`
17063
17064
17065
17066The tracking issue for this feature is: [#152956]
17067
17068[#152956]: https://github.com/rust-lang/rust/issues/152956
17069
17070------------------------
17071"##,
17072 default_severity: Severity::Allow,
17073 warn_since: None,
17074 deny_since: None,
17075 },
17076 Lint {
17077 label: "windows_process_exit_code_from",
17078 description: r##"# `windows_process_exit_code_from`
17079
17080
17081
17082The tracking issue for this feature is: [#111688]
17083
17084[#111688]: https://github.com/rust-lang/rust/issues/111688
17085
17086------------------------
17087"##,
17088 default_severity: Severity::Allow,
17089 warn_since: None,
17090 deny_since: None,
17091 },
17092 Lint {
17093 label: "windows_process_extensions_async_pipes",
17094 description: r##"# `windows_process_extensions_async_pipes`
17095
17096
17097
17098The tracking issue for this feature is: [#98289]
17099
17100[#98289]: https://github.com/rust-lang/rust/issues/98289
17101
17102------------------------
17103"##,
17104 default_severity: Severity::Allow,
17105 warn_since: None,
17106 deny_since: None,
17107 },
17108 Lint {
17109 label: "windows_process_extensions_force_quotes",
17110 description: r##"# `windows_process_extensions_force_quotes`
17111
17112
17113
17114The tracking issue for this feature is: [#82227]
17115
17116[#82227]: https://github.com/rust-lang/rust/issues/82227
17117
17118------------------------
17119"##,
17120 default_severity: Severity::Allow,
17121 warn_since: None,
17122 deny_since: None,
17123 },
17124 Lint {
17125 label: "windows_process_extensions_inherit_handles",
17126 description: r##"# `windows_process_extensions_inherit_handles`
17127
17128
17129
17130The tracking issue for this feature is: [#146407]
17131
17132[#146407]: https://github.com/rust-lang/rust/issues/146407
17133
17134------------------------
17135"##,
17136 default_severity: Severity::Allow,
17137 warn_since: None,
17138 deny_since: None,
17139 },
17140 Lint {
17141 label: "windows_process_extensions_main_thread_handle",
17142 description: r##"# `windows_process_extensions_main_thread_handle`
17143
17144
17145
17146The tracking issue for this feature is: [#96723]
17147
17148[#96723]: https://github.com/rust-lang/rust/issues/96723
17149
17150------------------------
17151"##,
17152 default_severity: Severity::Allow,
17153 warn_since: None,
17154 deny_since: None,
17155 },
17156 Lint {
17157 label: "windows_process_extensions_raw_attribute",
17158 description: r##"# `windows_process_extensions_raw_attribute`
17159
17160
17161
17162The tracking issue for this feature is: [#114854]
17163
17164[#114854]: https://github.com/rust-lang/rust/issues/114854
17165
17166------------------------
17167"##,
17168 default_severity: Severity::Allow,
17169 warn_since: None,
17170 deny_since: None,
17171 },
17172 Lint {
17173 label: "windows_process_extensions_show_window",
17174 description: r##"# `windows_process_extensions_show_window`
17175
17176
17177
17178The tracking issue for this feature is: [#127544]
17179
17180[#127544]: https://github.com/rust-lang/rust/issues/127544
17181
17182------------------------
17183"##,
17184 default_severity: Severity::Allow,
17185 warn_since: None,
17186 deny_since: None,
17187 },
17188 Lint {
17189 label: "windows_process_extensions_startupinfo",
17190 description: r##"# `windows_process_extensions_startupinfo`
17191
17192
17193
17194The tracking issue for this feature is: [#141010]
17195
17196[#141010]: https://github.com/rust-lang/rust/issues/141010
17197
17198------------------------
17199"##,
17200 default_severity: Severity::Allow,
17201 warn_since: None,
17202 deny_since: None,
17203 },
17204 Lint {
17205 label: "windows_stdio",
17206 description: r##"# `windows_stdio`
17207
17208This feature is internal to the Rust compiler and is not intended for general use.
17209
17210------------------------
17211"##,
17212 default_severity: Severity::Allow,
17213 warn_since: None,
17214 deny_since: None,
17215 },
17216 Lint {
17217 label: "windows_unix_domain_sockets",
17218 description: r##"# `windows_unix_domain_sockets`
17219
17220
17221
17222The tracking issue for this feature is: [#150487]
17223
17224[#150487]: https://github.com/rust-lang/rust/issues/150487
17225
17226------------------------
17227"##,
17228 default_severity: Severity::Allow,
17229 warn_since: None,
17230 deny_since: None,
17231 },
17232 Lint {
17233 label: "with_negative_coherence",
17234 description: r##"# `with_negative_coherence`
17235
17236Use for stable + negative coherence and strict coherence depending on trait's rustc_strict_coherence value.
17237
17238This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
17239
17240------------------------
17241"##,
17242 default_severity: Severity::Allow,
17243 warn_since: None,
17244 deny_since: None,
17245 },
17246 Lint {
17247 label: "wrapping_int_impl",
17248 description: r##"# `wrapping_int_impl`
17249
17250
17251
17252The tracking issue for this feature is: [#32463]
17253
17254[#32463]: https://github.com/rust-lang/rust/issues/32463
17255
17256------------------------
17257"##,
17258 default_severity: Severity::Allow,
17259 warn_since: None,
17260 deny_since: None,
17261 },
17262 Lint {
17263 label: "wrapping_next_power_of_two",
17264 description: r##"# `wrapping_next_power_of_two`
17265
17266
17267
17268The tracking issue for this feature is: [#32463]
17269
17270[#32463]: https://github.com/rust-lang/rust/issues/32463
17271
17272------------------------
17273"##,
17274 default_severity: Severity::Allow,
17275 warn_since: None,
17276 deny_since: None,
17277 },
17278 Lint {
17279 label: "write_all_vectored",
17280 description: r##"# `write_all_vectored`
17281
17282
17283
17284The tracking issue for this feature is: [#70436]
17285
17286[#70436]: https://github.com/rust-lang/rust/issues/70436
17287
17288------------------------
17289"##,
17290 default_severity: Severity::Allow,
17291 warn_since: None,
17292 deny_since: None,
17293 },
17294 Lint {
17295 label: "wtf8_internals",
17296 description: r##"# `wtf8_internals`
17297
17298
17299
17300This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
17301
17302------------------------
17303"##,
17304 default_severity: Severity::Allow,
17305 warn_since: None,
17306 deny_since: None,
17307 },
17308 Lint {
17309 label: "x86_amx_intrinsics",
17310 description: r##"# `x86_amx_intrinsics`
17311
17312Allows use of x86 `AMX` target-feature attributes and intrinsics
17313
17314The tracking issue for this feature is: [#126622]
17315
17316[#126622]: https://github.com/rust-lang/rust/issues/126622
17317
17318------------------------
17319"##,
17320 default_severity: Severity::Allow,
17321 warn_since: None,
17322 deny_since: None,
17323 },
17324 Lint {
17325 label: "x87_target_feature",
17326 description: r##"# `x87_target_feature`
17327
17328The x87 target feature on x86.
17329
17330The tracking issue for this feature is: [#150261]
17331
17332[#150261]: https://github.com/rust-lang/rust/issues/150261
17333
17334------------------------
17335"##,
17336 default_severity: Severity::Allow,
17337 warn_since: None,
17338 deny_since: None,
17339 },
17340 Lint {
17341 label: "xop_target_feature",
17342 description: r##"# `xop_target_feature`
17343
17344Allows use of the `xop` target-feature
17345
17346The tracking issue for this feature is: [#127208]
17347
17348[#127208]: https://github.com/rust-lang/rust/issues/127208
17349
17350------------------------
17351"##,
17352 default_severity: Severity::Allow,
17353 warn_since: None,
17354 deny_since: None,
17355 },
17356 Lint {
17357 label: "yeet_desugar_details",
17358 description: r##"# `yeet_desugar_details`
17359
17360
17361
17362This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
17363
17364------------------------
17365"##,
17366 default_severity: Severity::Allow,
17367 warn_since: None,
17368 deny_since: None,
17369 },
17370 Lint {
17371 label: "yeet_expr",
17372 description: r##"# `yeet_expr`
17373
17374The tracking issue for this feature is: [#96373]
17375
17376[#96373]: https://github.com/rust-lang/rust/issues/96373
17377
17378------------------------
17379
17380The `yeet_expr` feature adds support for `do yeet` expressions,
17381which can be used to early-exit from a function or `try` block.
17382
17383These are highly experimental, thus the placeholder syntax.
17384
17385```rust,edition2021
17386#![feature(yeet_expr)]
17387
17388fn foo() -> Result<String, i32> {
17389 do yeet 4;
17390}
17391assert_eq!(foo(), Err(4));
17392
17393fn bar() -> Option<String> {
17394 do yeet;
17395}
17396assert_eq!(bar(), None);
17397```
17398"##,
17399 default_severity: Severity::Allow,
17400 warn_since: None,
17401 deny_since: None,
17402 },
17403 Lint {
17404 label: "yield_expr",
17405 description: r##"# `yield_expr`
17406
17407
17408
17409The tracking issue for this feature is: [#43122]
17410
17411[#43122]: https://github.com/rust-lang/rust/issues/43122
17412
17413------------------------
17414"##,
17415 default_severity: Severity::Allow,
17416 warn_since: None,
17417 deny_since: None,
17418 },
17419];
17420
17421pub const CLIPPY_LINTS: &[Lint] = &[
17422 Lint {
17423 label: "clippy::absolute_paths",
17424 description: r##"Checks for usage of items through absolute paths, like `std::env::current_dir`."##,
17425 default_severity: Severity::Allow,
17426 warn_since: None,
17427 deny_since: None,
17428 },
17429 Lint {
17430 label: "clippy::absurd_extreme_comparisons",
17431 description: r##"Checks for comparisons where one side of the relation is
17432either the minimum or maximum value for its type and warns if it involves a
17433case that is always true or always false. Only integer and boolean types are
17434checked."##,
17435 default_severity: Severity::Allow,
17436 warn_since: None,
17437 deny_since: None,
17438 },
17439 Lint {
17440 label: "clippy::alloc_instead_of_core",
17441 description: r##"Finds items imported through `alloc` when available through `core`."##,
17442 default_severity: Severity::Allow,
17443 warn_since: None,
17444 deny_since: None,
17445 },
17446 Lint {
17447 label: "clippy::allow_attributes",
17448 description: r##"Checks for usage of the `#[allow]` attribute and suggests replacing it with
17449the `#[expect]` (See [RFC 2383](https://rust-lang.github.io/rfcs/2383-lint-reasons.html))
17450
17451This lint only warns outer attributes (`#[allow]`), as inner attributes
17452(`#![allow]`) are usually used to enable or disable lints on a global scale."##,
17453 default_severity: Severity::Allow,
17454 warn_since: None,
17455 deny_since: None,
17456 },
17457 Lint {
17458 label: "clippy::allow_attributes_without_reason",
17459 description: r##"Checks for attributes that allow lints without a reason."##,
17460 default_severity: Severity::Allow,
17461 warn_since: None,
17462 deny_since: None,
17463 },
17464 Lint {
17465 label: "clippy::almost_complete_range",
17466 description: r##"Checks for ranges which almost include the entire range of letters from 'a' to 'z'
17467or digits from '0' to '9', but don't because they're a half open range."##,
17468 default_severity: Severity::Allow,
17469 warn_since: None,
17470 deny_since: None,
17471 },
17472 Lint {
17473 label: "clippy::almost_swapped",
17474 description: r##"Checks for `foo = bar; bar = foo` sequences."##,
17475 default_severity: Severity::Allow,
17476 warn_since: None,
17477 deny_since: None,
17478 },
17479 Lint {
17480 label: "clippy::approx_constant",
17481 description: r##"Checks for floating point literals that approximate
17482constants which are defined in
17483[`std::f32::consts`](https://doc.rust-lang.org/stable/std/f32/consts/#constants)
17484or
17485[`std::f64::consts`](https://doc.rust-lang.org/stable/std/f64/consts/#constants),
17486respectively, suggesting to use the predefined constant."##,
17487 default_severity: Severity::Allow,
17488 warn_since: None,
17489 deny_since: None,
17490 },
17491 Lint {
17492 label: "clippy::arc_with_non_send_sync",
17493 description: r##".
17494This lint warns when you use `Arc` with a type that does not implement `Send` or `Sync`."##,
17495 default_severity: Severity::Allow,
17496 warn_since: None,
17497 deny_since: None,
17498 },
17499 Lint {
17500 label: "clippy::arithmetic_side_effects",
17501 description: r##"Checks any kind of arithmetic operation of any type.
17502
17503Operators like `+`, `-`, `*` or `<<` are usually capable of overflowing according to the [Rust
17504Reference](https://doc.rust-lang.org/reference/expressions/operator-expr.html#overflow),
17505or can panic (`/`, `%`).
17506
17507Known safe built-in types like `Wrapping` or `Saturating`, floats, operations in constant
17508environments, allowed types and non-constant operations that won't overflow are ignored."##,
17509 default_severity: Severity::Allow,
17510 warn_since: None,
17511 deny_since: None,
17512 },
17513 Lint {
17514 label: "clippy::as_conversions",
17515 description: r##"Checks for usage of `as` conversions.
17516
17517Note that this lint is specialized in linting *every single* use of `as`
17518regardless of whether good alternatives exist or not.
17519If you want more precise lints for `as`, please consider using these separate lints:
17520`unnecessary_cast`, `cast_lossless/cast_possible_truncation/cast_possible_wrap/cast_precision_loss/cast_sign_loss`,
17521`fn_to_numeric_cast(_with_truncation)`, `char_lit_as_u8`, `ref_to_mut` and `ptr_as_ptr`.
17522There is a good explanation the reason why this lint should work in this way and how it is useful
17523[in this issue](https://github.com/rust-lang/rust-clippy/issues/5122)."##,
17524 default_severity: Severity::Allow,
17525 warn_since: None,
17526 deny_since: None,
17527 },
17528 Lint {
17529 label: "clippy::as_ptr_cast_mut",
17530 description: r##"Checks for the result of a `&self`-taking `as_ptr` being cast to a mutable pointer."##,
17531 default_severity: Severity::Allow,
17532 warn_since: None,
17533 deny_since: None,
17534 },
17535 Lint {
17536 label: "clippy::as_underscore",
17537 description: r##"Checks for the usage of `as _` conversion using inferred type."##,
17538 default_severity: Severity::Allow,
17539 warn_since: None,
17540 deny_since: None,
17541 },
17542 Lint {
17543 label: "clippy::assertions_on_constants",
17544 description: r##"Checks for `assert!(true)` and `assert!(false)` calls."##,
17545 default_severity: Severity::Allow,
17546 warn_since: None,
17547 deny_since: None,
17548 },
17549 Lint {
17550 label: "clippy::assertions_on_result_states",
17551 description: r##"Checks for `assert!(r.is_ok())` or `assert!(r.is_err())` calls."##,
17552 default_severity: Severity::Allow,
17553 warn_since: None,
17554 deny_since: None,
17555 },
17556 Lint {
17557 label: "clippy::assign_op_pattern",
17558 description: r##"Checks for `a = a op b` or `a = b commutative_op a`
17559patterns."##,
17560 default_severity: Severity::Allow,
17561 warn_since: None,
17562 deny_since: None,
17563 },
17564 Lint {
17565 label: "clippy::assign_ops",
17566 description: r##"Nothing. This lint has been deprecated"##,
17567 default_severity: Severity::Allow,
17568 warn_since: None,
17569 deny_since: None,
17570 },
17571 Lint {
17572 label: "clippy::assigning_clones",
17573 description: r##"Checks for code like `foo = bar.clone();`"##,
17574 default_severity: Severity::Allow,
17575 warn_since: None,
17576 deny_since: None,
17577 },
17578 Lint {
17579 label: "clippy::async_yields_async",
17580 description: r##"Checks for async blocks that yield values of types
17581that can themselves be awaited."##,
17582 default_severity: Severity::Allow,
17583 warn_since: None,
17584 deny_since: None,
17585 },
17586 Lint {
17587 label: "clippy::await_holding_invalid_type",
17588 description: r##"Allows users to configure types which should not be held across await
17589suspension points."##,
17590 default_severity: Severity::Allow,
17591 warn_since: None,
17592 deny_since: None,
17593 },
17594 Lint {
17595 label: "clippy::await_holding_lock",
17596 description: r##"Checks for calls to `await` while holding a non-async-aware
17597`MutexGuard`."##,
17598 default_severity: Severity::Allow,
17599 warn_since: None,
17600 deny_since: None,
17601 },
17602 Lint {
17603 label: "clippy::await_holding_refcell_ref",
17604 description: r##"Checks for calls to `await` while holding a `RefCell`, `Ref`, or `RefMut`."##,
17605 default_severity: Severity::Allow,
17606 warn_since: None,
17607 deny_since: None,
17608 },
17609 Lint {
17610 label: "clippy::bad_bit_mask",
17611 description: r##"Checks for incompatible bit masks in comparisons.
17612
17613The formula for detecting if an expression of the type `_ <bit_op> m
17614<cmp_op> c` (where `<bit_op>` is one of {`&`, `|`} and `<cmp_op>` is one of
17615{`!=`, `>=`, `>`, `!=`, `>=`, `>`}) can be determined from the following
17616table:
17617
17618|Comparison |Bit Op|Example |is always|Formula |
17619|------------|------|-------------|---------|----------------------|
17620|`==` or `!=`| `&` |`x & 2 == 3` |`false` |`c & m != c` |
17621|`<` or `>=`| `&` |`x & 2 < 3` |`true` |`m < c` |
17622|`>` or `<=`| `&` |`x & 1 > 1` |`false` |`m <= c` |
17623|`==` or `!=`| `\\|` |`x \\| 1 == 0`|`false` |`c \\| m != c` |
17624|`<` or `>=`| `\\|` |`x \\| 1 < 1` |`false` |`m >= c` |
17625|`<=` or `>` | `\\|` |`x \\| 1 > 0` |`true` |`m > c` |"##,
17626 default_severity: Severity::Allow,
17627 warn_since: None,
17628 deny_since: None,
17629 },
17630 Lint {
17631 label: "clippy::big_endian_bytes",
17632 description: r##"Checks for the usage of the `to_be_bytes` method and/or the function `from_be_bytes`."##,
17633 default_severity: Severity::Allow,
17634 warn_since: None,
17635 deny_since: None,
17636 },
17637 Lint {
17638 label: "clippy::bind_instead_of_map",
17639 description: r##"Checks for usage of `_.and_then(|x| Some(y))`, `_.and_then(|x| Ok(y))`
17640or `_.or_else(|x| Err(y))`."##,
17641 default_severity: Severity::Allow,
17642 warn_since: None,
17643 deny_since: None,
17644 },
17645 Lint {
17646 label: "clippy::blanket_clippy_restriction_lints",
17647 description: r##"Checks for `warn`/`deny`/`forbid` attributes targeting the whole clippy::restriction category."##,
17648 default_severity: Severity::Allow,
17649 warn_since: None,
17650 deny_since: None,
17651 },
17652 Lint {
17653 label: "clippy::blocks_in_conditions",
17654 description: r##"Checks for `if` and `match` conditions that use blocks containing an
17655expression, statements or conditions that use closures with blocks."##,
17656 default_severity: Severity::Allow,
17657 warn_since: None,
17658 deny_since: None,
17659 },
17660 Lint {
17661 label: "clippy::bool_assert_comparison",
17662 description: r##"This lint warns about boolean comparisons in assert-like macros."##,
17663 default_severity: Severity::Allow,
17664 warn_since: None,
17665 deny_since: None,
17666 },
17667 Lint {
17668 label: "clippy::bool_comparison",
17669 description: r##"Checks for expressions of the form `x == true`,
17670`x != true` and order comparisons such as `x < true` (or vice versa) and
17671suggest using the variable directly."##,
17672 default_severity: Severity::Allow,
17673 warn_since: None,
17674 deny_since: None,
17675 },
17676 Lint {
17677 label: "clippy::bool_to_int_with_if",
17678 description: r##"Instead of using an if statement to convert a bool to an int,
17679this lint suggests using a `from()` function or an `as` coercion."##,
17680 default_severity: Severity::Allow,
17681 warn_since: None,
17682 deny_since: None,
17683 },
17684 Lint {
17685 label: "clippy::borrow_as_ptr",
17686 description: r##"Checks for the usage of `&expr as *const T` or
17687`&mut expr as *mut T`, and suggest using `ptr::addr_of` or
17688`ptr::addr_of_mut` instead."##,
17689 default_severity: Severity::Allow,
17690 warn_since: None,
17691 deny_since: None,
17692 },
17693 Lint {
17694 label: "clippy::borrow_deref_ref",
17695 description: r##"Checks for `&*(&T)`."##,
17696 default_severity: Severity::Allow,
17697 warn_since: None,
17698 deny_since: None,
17699 },
17700 Lint {
17701 label: "clippy::borrow_interior_mutable_const",
17702 description: r##"Checks if `const` items which is interior mutable (e.g.,
17703contains a `Cell`, `Mutex`, `AtomicXxxx`, etc.) has been borrowed directly."##,
17704 default_severity: Severity::Allow,
17705 warn_since: None,
17706 deny_since: None,
17707 },
17708 Lint {
17709 label: "clippy::borrowed_box",
17710 description: r##"Checks for usage of `&Box<T>` 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_collection",
17718 description: r##"Checks for usage of `Box<T>` where T is a collection such as Vec anywhere in the code.
17719Check the [Box documentation](https://doc.rust-lang.org/std/boxed/index.html) for more information."##,
17720 default_severity: Severity::Allow,
17721 warn_since: None,
17722 deny_since: None,
17723 },
17724 Lint {
17725 label: "clippy::box_default",
17726 description: r##"checks for `Box::new(Default::default())`, which can be written as
17727`Box::default()`."##,
17728 default_severity: Severity::Allow,
17729 warn_since: None,
17730 deny_since: None,
17731 },
17732 Lint {
17733 label: "clippy::boxed_local",
17734 description: r##"Checks for usage of `Box<T>` where an unboxed `T` would
17735work fine."##,
17736 default_severity: Severity::Allow,
17737 warn_since: None,
17738 deny_since: None,
17739 },
17740 Lint {
17741 label: "clippy::branches_sharing_code",
17742 description: r##"Checks if the `if` and `else` block contain shared code that can be
17743moved out of the blocks."##,
17744 default_severity: Severity::Allow,
17745 warn_since: None,
17746 deny_since: None,
17747 },
17748 Lint {
17749 label: "clippy::builtin_type_shadow",
17750 description: r##"Warns if a generic shadows a built-in type."##,
17751 default_severity: Severity::Allow,
17752 warn_since: None,
17753 deny_since: None,
17754 },
17755 Lint {
17756 label: "clippy::byte_char_slices",
17757 description: r##"Checks for hard to read slices of byte characters, that could be more easily expressed as a
17758byte string."##,
17759 default_severity: Severity::Allow,
17760 warn_since: None,
17761 deny_since: None,
17762 },
17763 Lint {
17764 label: "clippy::bytes_count_to_len",
17765 description: r##"It checks for `str::bytes().count()` and suggests replacing it with
17766`str::len()`."##,
17767 default_severity: Severity::Allow,
17768 warn_since: None,
17769 deny_since: None,
17770 },
17771 Lint {
17772 label: "clippy::bytes_nth",
17773 description: r##"Checks for the use of `.bytes().nth()`."##,
17774 default_severity: Severity::Allow,
17775 warn_since: None,
17776 deny_since: None,
17777 },
17778 Lint {
17779 label: "clippy::cargo_common_metadata",
17780 description: r##"Checks to see if all common metadata is defined in
17781`Cargo.toml`. See: https://rust-lang-nursery.github.io/api-guidelines/documentation.html#cargotoml-includes-all-common-metadata-c-metadata"##,
17782 default_severity: Severity::Allow,
17783 warn_since: None,
17784 deny_since: None,
17785 },
17786 Lint {
17787 label: "clippy::case_sensitive_file_extension_comparisons",
17788 description: r##"Checks for calls to `ends_with` with possible file extensions
17789and suggests to use a case-insensitive approach instead."##,
17790 default_severity: Severity::Allow,
17791 warn_since: None,
17792 deny_since: None,
17793 },
17794 Lint {
17795 label: "clippy::cast_abs_to_unsigned",
17796 description: r##"Checks for usage of the `abs()` method that cast the result to unsigned."##,
17797 default_severity: Severity::Allow,
17798 warn_since: None,
17799 deny_since: None,
17800 },
17801 Lint {
17802 label: "clippy::cast_enum_constructor",
17803 description: r##"Checks for casts from an enum tuple constructor to an integer."##,
17804 default_severity: Severity::Allow,
17805 warn_since: None,
17806 deny_since: None,
17807 },
17808 Lint {
17809 label: "clippy::cast_enum_truncation",
17810 description: r##"Checks for casts from an enum type to an integral type that will definitely truncate the
17811value."##,
17812 default_severity: Severity::Allow,
17813 warn_since: None,
17814 deny_since: None,
17815 },
17816 Lint {
17817 label: "clippy::cast_lossless",
17818 description: r##"Checks for casts between numeric types that can be replaced by safe
17819conversion functions."##,
17820 default_severity: Severity::Allow,
17821 warn_since: None,
17822 deny_since: None,
17823 },
17824 Lint {
17825 label: "clippy::cast_nan_to_int",
17826 description: r##"Checks for a known NaN float being cast to an integer"##,
17827 default_severity: Severity::Allow,
17828 warn_since: None,
17829 deny_since: None,
17830 },
17831 Lint {
17832 label: "clippy::cast_possible_truncation",
17833 description: r##"Checks for casts between numeric types that may
17834truncate large values. This is expected behavior, so the cast is `Allow` by
17835default. It suggests user either explicitly ignore the lint,
17836or use `try_from()` and handle the truncation, default, or panic explicitly."##,
17837 default_severity: Severity::Allow,
17838 warn_since: None,
17839 deny_since: None,
17840 },
17841 Lint {
17842 label: "clippy::cast_possible_wrap",
17843 description: r##"Checks for casts from an unsigned type to a signed type of
17844the same size, or possibly smaller due to target-dependent integers.
17845Performing such a cast is a no-op for the compiler (that is, nothing is
17846changed at the bit level), and the binary representation of the value is
17847reinterpreted. This can cause wrapping if the value is too big
17848for the target signed type. However, the cast works as defined, so this lint
17849is `Allow` by default."##,
17850 default_severity: Severity::Allow,
17851 warn_since: None,
17852 deny_since: None,
17853 },
17854 Lint {
17855 label: "clippy::cast_precision_loss",
17856 description: r##"Checks for casts from any numeric type to a float type where
17857the receiving type cannot store all values from the original type without
17858rounding errors. This possible rounding is to be expected, so this lint is
17859`Allow` by default.
17860
17861Basically, this warns on casting any integer with 32 or more bits to `f32`
17862or any 64-bit integer to `f64`."##,
17863 default_severity: Severity::Allow,
17864 warn_since: None,
17865 deny_since: None,
17866 },
17867 Lint {
17868 label: "clippy::cast_ptr_alignment",
17869 description: r##"Checks for casts, using `as` or `pointer::cast`, from a
17870less strictly aligned pointer to a more strictly aligned pointer."##,
17871 default_severity: Severity::Allow,
17872 warn_since: None,
17873 deny_since: None,
17874 },
17875 Lint {
17876 label: "clippy::cast_sign_loss",
17877 description: r##"Checks for casts from a signed to an unsigned numeric
17878type. In this case, negative values wrap around to large positive values,
17879which can be quite surprising in practice. However, since the cast works as
17880defined, this lint is `Allow` by default."##,
17881 default_severity: Severity::Allow,
17882 warn_since: None,
17883 deny_since: None,
17884 },
17885 Lint {
17886 label: "clippy::cast_slice_different_sizes",
17887 description: r##"Checks for `as` casts between raw pointers to slices with differently sized elements."##,
17888 default_severity: Severity::Allow,
17889 warn_since: None,
17890 deny_since: None,
17891 },
17892 Lint {
17893 label: "clippy::cast_slice_from_raw_parts",
17894 description: r##"Checks for a raw slice being cast to a slice pointer"##,
17895 default_severity: Severity::Allow,
17896 warn_since: None,
17897 deny_since: None,
17898 },
17899 Lint {
17900 label: "clippy::cfg_not_test",
17901 description: r##"Checks for usage of `cfg` that excludes code from `test` builds. (i.e., `#[cfg(not(test))]`)"##,
17902 default_severity: Severity::Allow,
17903 warn_since: None,
17904 deny_since: None,
17905 },
17906 Lint {
17907 label: "clippy::char_lit_as_u8",
17908 description: r##"Checks for expressions where a character literal is cast
17909to `u8` and suggests using a byte literal instead."##,
17910 default_severity: Severity::Allow,
17911 warn_since: None,
17912 deny_since: None,
17913 },
17914 Lint {
17915 label: "clippy::chars_last_cmp",
17916 description: r##"Checks for usage of `_.chars().last()` or
17917`_.chars().next_back()` on a `str` to check if it ends with a given char."##,
17918 default_severity: Severity::Allow,
17919 warn_since: None,
17920 deny_since: None,
17921 },
17922 Lint {
17923 label: "clippy::chars_next_cmp",
17924 description: r##"Checks for usage of `.chars().next()` on a `str` to check
17925if it starts with a given char."##,
17926 default_severity: Severity::Allow,
17927 warn_since: None,
17928 deny_since: None,
17929 },
17930 Lint {
17931 label: "clippy::checked_conversions",
17932 description: r##"Checks for explicit bounds checking when casting."##,
17933 default_severity: Severity::Allow,
17934 warn_since: None,
17935 deny_since: None,
17936 },
17937 Lint {
17938 label: "clippy::clear_with_drain",
17939 description: r##"Checks for usage of `.drain(..)` for the sole purpose of clearing a container."##,
17940 default_severity: Severity::Allow,
17941 warn_since: None,
17942 deny_since: None,
17943 },
17944 Lint {
17945 label: "clippy::clone_on_copy",
17946 description: r##"Checks for usage of `.clone()` on a `Copy` type."##,
17947 default_severity: Severity::Allow,
17948 warn_since: None,
17949 deny_since: None,
17950 },
17951 Lint {
17952 label: "clippy::clone_on_ref_ptr",
17953 description: r##"Checks for usage of `.clone()` on a ref-counted pointer,
17954(`Rc`, `Arc`, `rc::Weak`, or `sync::Weak`), and suggests calling Clone via unified
17955function syntax instead (e.g., `Rc::clone(foo)`)."##,
17956 default_severity: Severity::Allow,
17957 warn_since: None,
17958 deny_since: None,
17959 },
17960 Lint {
17961 label: "clippy::cloned_instead_of_copied",
17962 description: r##"Checks for usage of `cloned()` on an `Iterator` or `Option` where
17963`copied()` could be used instead."##,
17964 default_severity: Severity::Allow,
17965 warn_since: None,
17966 deny_since: None,
17967 },
17968 Lint {
17969 label: "clippy::cmp_null",
17970 description: r##"This lint checks for equality comparisons with `ptr::null`"##,
17971 default_severity: Severity::Allow,
17972 warn_since: None,
17973 deny_since: None,
17974 },
17975 Lint {
17976 label: "clippy::cmp_owned",
17977 description: r##"Checks for conversions to owned values just for the sake
17978of a comparison."##,
17979 default_severity: Severity::Allow,
17980 warn_since: None,
17981 deny_since: None,
17982 },
17983 Lint {
17984 label: "clippy::cognitive_complexity",
17985 description: r##"Checks for methods with high cognitive complexity."##,
17986 default_severity: Severity::Allow,
17987 warn_since: None,
17988 deny_since: None,
17989 },
17990 Lint {
17991 label: "clippy::collapsible_else_if",
17992 description: r##"Checks for collapsible `else { if ... }` expressions
17993that can be collapsed to `else if ...`."##,
17994 default_severity: Severity::Allow,
17995 warn_since: None,
17996 deny_since: None,
17997 },
17998 Lint {
17999 label: "clippy::collapsible_if",
18000 description: r##"Checks for nested `if` statements which can be collapsed
18001by `&&`-combining their conditions."##,
18002 default_severity: Severity::Allow,
18003 warn_since: None,
18004 deny_since: None,
18005 },
18006 Lint {
18007 label: "clippy::collapsible_match",
18008 description: r##"Finds nested `match` or `if let` expressions where the patterns may be collapsed together
18009without adding any branches.
18010
18011Note that this lint is not intended to find _all_ cases where nested match patterns can be merged, but only
18012cases where merging would most likely make the code more readable."##,
18013 default_severity: Severity::Allow,
18014 warn_since: None,
18015 deny_since: None,
18016 },
18017 Lint {
18018 label: "clippy::collapsible_str_replace",
18019 description: r##"Checks for consecutive calls to `str::replace` (2 or more)
18020that can be collapsed into a single call."##,
18021 default_severity: Severity::Allow,
18022 warn_since: None,
18023 deny_since: None,
18024 },
18025 Lint {
18026 label: "clippy::collection_is_never_read",
18027 description: r##"Checks for collections that are never queried."##,
18028 default_severity: Severity::Allow,
18029 warn_since: None,
18030 deny_since: None,
18031 },
18032 Lint {
18033 label: "clippy::comparison_chain",
18034 description: r##"Checks comparison chains written with `if` that can be
18035rewritten with `match` and `cmp`."##,
18036 default_severity: Severity::Allow,
18037 warn_since: None,
18038 deny_since: None,
18039 },
18040 Lint {
18041 label: "clippy::comparison_to_empty",
18042 description: r##"Checks for comparing to an empty slice such as `` or `[]`,
18043and suggests using `.is_empty()` where applicable."##,
18044 default_severity: Severity::Allow,
18045 warn_since: None,
18046 deny_since: None,
18047 },
18048 Lint {
18049 label: "clippy::const_is_empty",
18050 description: r##"It identifies calls to `.is_empty()` on constant values."##,
18051 default_severity: Severity::Allow,
18052 warn_since: None,
18053 deny_since: None,
18054 },
18055 Lint {
18056 label: "clippy::copy_iterator",
18057 description: r##"Checks for types that implement `Copy` as well as
18058`Iterator`."##,
18059 default_severity: Severity::Allow,
18060 warn_since: None,
18061 deny_since: None,
18062 },
18063 Lint {
18064 label: "clippy::crate_in_macro_def",
18065 description: r##"Checks for usage of `crate` as opposed to `$crate` in a macro definition."##,
18066 default_severity: Severity::Allow,
18067 warn_since: None,
18068 deny_since: None,
18069 },
18070 Lint {
18071 label: "clippy::create_dir",
18072 description: r##"Checks usage of `std::fs::create_dir` and suggest using `std::fs::create_dir_all` instead."##,
18073 default_severity: Severity::Allow,
18074 warn_since: None,
18075 deny_since: None,
18076 },
18077 Lint {
18078 label: "clippy::crosspointer_transmute",
18079 description: r##"Checks for transmutes between a type `T` and `*T`."##,
18080 default_severity: Severity::Allow,
18081 warn_since: None,
18082 deny_since: None,
18083 },
18084 Lint {
18085 label: "clippy::dbg_macro",
18086 description: r##"Checks for usage of the [`dbg!`](https://doc.rust-lang.org/std/macro.dbg.html) macro."##,
18087 default_severity: Severity::Allow,
18088 warn_since: None,
18089 deny_since: None,
18090 },
18091 Lint {
18092 label: "clippy::debug_assert_with_mut_call",
18093 description: r##"Checks for function/method calls with a mutable
18094parameter in `debug_assert!`, `debug_assert_eq!` and `debug_assert_ne!` macros."##,
18095 default_severity: Severity::Allow,
18096 warn_since: None,
18097 deny_since: None,
18098 },
18099 Lint {
18100 label: "clippy::decimal_literal_representation",
18101 description: r##"Warns if there is a better representation for a numeric literal."##,
18102 default_severity: Severity::Allow,
18103 warn_since: None,
18104 deny_since: None,
18105 },
18106 Lint {
18107 label: "clippy::declare_interior_mutable_const",
18108 description: r##"Checks for declaration of `const` items which is interior
18109mutable (e.g., contains a `Cell`, `Mutex`, `AtomicXxxx`, etc.)."##,
18110 default_severity: Severity::Allow,
18111 warn_since: None,
18112 deny_since: None,
18113 },
18114 Lint {
18115 label: "clippy::default_constructed_unit_structs",
18116 description: r##"Checks for construction on unit struct using `default`."##,
18117 default_severity: Severity::Allow,
18118 warn_since: None,
18119 deny_since: None,
18120 },
18121 Lint {
18122 label: "clippy::default_instead_of_iter_empty",
18123 description: r##"It checks for `std::iter::Empty::default()` and suggests replacing it with
18124`std::iter::empty()`."##,
18125 default_severity: Severity::Allow,
18126 warn_since: None,
18127 deny_since: None,
18128 },
18129 Lint {
18130 label: "clippy::default_numeric_fallback",
18131 description: r##"Checks for usage of unconstrained numeric literals which may cause default numeric fallback in type
18132inference.
18133
18134Default numeric fallback means that if numeric types have not yet been bound to concrete
18135types at the end of type inference, then integer type is bound to `i32`, and similarly
18136floating type is bound to `f64`.
18137
18138See [RFC0212](https://github.com/rust-lang/rfcs/blob/master/text/0212-restore-int-fallback.md) for more information about the fallback."##,
18139 default_severity: Severity::Allow,
18140 warn_since: None,
18141 deny_since: None,
18142 },
18143 Lint {
18144 label: "clippy::default_trait_access",
18145 description: r##"Checks for literal calls to `Default::default()`."##,
18146 default_severity: Severity::Allow,
18147 warn_since: None,
18148 deny_since: None,
18149 },
18150 Lint {
18151 label: "clippy::default_union_representation",
18152 description: r##"Displays a warning when a union is declared with the default representation (without a `#[repr(C)]` attribute)."##,
18153 default_severity: Severity::Allow,
18154 warn_since: None,
18155 deny_since: None,
18156 },
18157 Lint {
18158 label: "clippy::deprecated_cfg_attr",
18159 description: r##"Checks for `#[cfg_attr(rustfmt, rustfmt_skip)]` and suggests to replace it
18160with `#[rustfmt::skip]`."##,
18161 default_severity: Severity::Allow,
18162 warn_since: None,
18163 deny_since: None,
18164 },
18165 Lint {
18166 label: "clippy::deprecated_clippy_cfg_attr",
18167 description: r##"Checks for `#[cfg_attr(feature = cargo-clippy, ...)]` and for
18168`#[cfg(feature = cargo-clippy)]` and suggests to replace it with
18169`#[cfg_attr(clippy, ...)]` or `#[cfg(clippy)]`."##,
18170 default_severity: Severity::Allow,
18171 warn_since: None,
18172 deny_since: None,
18173 },
18174 Lint {
18175 label: "clippy::deprecated_semver",
18176 description: r##"Checks for `#[deprecated]` annotations with a `since`
18177field that is not a valid semantic version. Also allows TBD to signal
18178future deprecation."##,
18179 default_severity: Severity::Allow,
18180 warn_since: None,
18181 deny_since: None,
18182 },
18183 Lint {
18184 label: "clippy::deref_addrof",
18185 description: r##"Checks for usage of `*&` and `*&mut` in expressions."##,
18186 default_severity: Severity::Allow,
18187 warn_since: None,
18188 deny_since: None,
18189 },
18190 Lint {
18191 label: "clippy::deref_by_slicing",
18192 description: r##"Checks for slicing expressions which are equivalent to dereferencing the
18193value."##,
18194 default_severity: Severity::Allow,
18195 warn_since: None,
18196 deny_since: None,
18197 },
18198 Lint {
18199 label: "clippy::derivable_impls",
18200 description: r##"Detects manual `std::default::Default` implementations that are identical to a derived implementation."##,
18201 default_severity: Severity::Allow,
18202 warn_since: None,
18203 deny_since: None,
18204 },
18205 Lint {
18206 label: "clippy::derive_ord_xor_partial_ord",
18207 description: r##"Lints against manual `PartialOrd` and `Ord` implementations for types with a derived `Ord`
18208or `PartialOrd` implementation."##,
18209 default_severity: Severity::Allow,
18210 warn_since: None,
18211 deny_since: None,
18212 },
18213 Lint {
18214 label: "clippy::derive_partial_eq_without_eq",
18215 description: r##"Checks for types that derive `PartialEq` and could implement `Eq`."##,
18216 default_severity: Severity::Allow,
18217 warn_since: None,
18218 deny_since: None,
18219 },
18220 Lint {
18221 label: "clippy::derived_hash_with_manual_eq",
18222 description: r##"Lints against manual `PartialEq` implementations for types with a derived `Hash`
18223implementation."##,
18224 default_severity: Severity::Allow,
18225 warn_since: None,
18226 deny_since: None,
18227 },
18228 Lint {
18229 label: "clippy::disallowed_macros",
18230 description: r##"Denies the configured macros in clippy.toml
18231
18232Note: Even though this lint is warn-by-default, it will only trigger if
18233macros are defined in the clippy.toml file."##,
18234 default_severity: Severity::Allow,
18235 warn_since: None,
18236 deny_since: None,
18237 },
18238 Lint {
18239 label: "clippy::disallowed_methods",
18240 description: r##"Denies the configured methods and functions in clippy.toml
18241
18242Note: Even though this lint is warn-by-default, it will only trigger if
18243methods are defined in the clippy.toml file."##,
18244 default_severity: Severity::Allow,
18245 warn_since: None,
18246 deny_since: None,
18247 },
18248 Lint {
18249 label: "clippy::disallowed_names",
18250 description: r##"Checks for usage of disallowed names for variables, such
18251as `foo`."##,
18252 default_severity: Severity::Allow,
18253 warn_since: None,
18254 deny_since: None,
18255 },
18256 Lint {
18257 label: "clippy::disallowed_script_idents",
18258 description: r##"Checks for usage of unicode scripts other than those explicitly allowed
18259by the lint config.
18260
18261This lint doesn't take into account non-text scripts such as `Unknown` and `Linear_A`.
18262It also ignores the `Common` script type.
18263While configuring, be sure to use official script name [aliases] from
18264[the list of supported scripts][supported_scripts].
18265
18266See also: [`non_ascii_idents`].
18267
18268[aliases]: http://www.unicode.org/reports/tr24/tr24-31.html#Script_Value_Aliases
18269[supported_scripts]: https://www.unicode.org/iso15924/iso15924-codes.html"##,
18270 default_severity: Severity::Allow,
18271 warn_since: None,
18272 deny_since: None,
18273 },
18274 Lint {
18275 label: "clippy::disallowed_types",
18276 description: r##"Denies the configured types in clippy.toml.
18277
18278Note: Even though this lint is warn-by-default, it will only trigger if
18279types are defined in the clippy.toml file."##,
18280 default_severity: Severity::Allow,
18281 warn_since: None,
18282 deny_since: None,
18283 },
18284 Lint {
18285 label: "clippy::diverging_sub_expression",
18286 description: r##"Checks for diverging calls that are not match arms or
18287statements."##,
18288 default_severity: Severity::Allow,
18289 warn_since: None,
18290 deny_since: None,
18291 },
18292 Lint {
18293 label: "clippy::doc_lazy_continuation",
18294 description: r##"In CommonMark Markdown, the language used to write doc comments, a
18295paragraph nested within a list or block quote does not need any line
18296after the first one to be indented or marked. The specification calls
18297this a lazy paragraph continuation."##,
18298 default_severity: Severity::Allow,
18299 warn_since: None,
18300 deny_since: None,
18301 },
18302 Lint {
18303 label: "clippy::doc_link_with_quotes",
18304 description: r##"Detects the syntax `['foo']` in documentation comments (notice quotes instead of backticks)
18305outside of code blocks"##,
18306 default_severity: Severity::Allow,
18307 warn_since: None,
18308 deny_since: None,
18309 },
18310 Lint {
18311 label: "clippy::doc_markdown",
18312 description: r##"Checks for the presence of `_`, `::` or camel-case words
18313outside ticks in documentation."##,
18314 default_severity: Severity::Allow,
18315 warn_since: None,
18316 deny_since: None,
18317 },
18318 Lint {
18319 label: "clippy::double_comparisons",
18320 description: r##"Checks for double comparisons that could be simplified to a single expression."##,
18321 default_severity: Severity::Allow,
18322 warn_since: None,
18323 deny_since: None,
18324 },
18325 Lint {
18326 label: "clippy::double_must_use",
18327 description: r##"Checks for a `#[must_use]` attribute without
18328further information on functions and methods that return a type already
18329marked as `#[must_use]`."##,
18330 default_severity: Severity::Allow,
18331 warn_since: None,
18332 deny_since: None,
18333 },
18334 Lint {
18335 label: "clippy::double_neg",
18336 description: r##"Detects expressions of the form `--x`."##,
18337 default_severity: Severity::Allow,
18338 warn_since: None,
18339 deny_since: None,
18340 },
18341 Lint {
18342 label: "clippy::double_parens",
18343 description: r##"Checks for unnecessary double parentheses."##,
18344 default_severity: Severity::Allow,
18345 warn_since: None,
18346 deny_since: None,
18347 },
18348 Lint {
18349 label: "clippy::drain_collect",
18350 description: r##"Checks for calls to `.drain()` that clear the collection, immediately followed by a call to `.collect()`.
18351
18352> Collection in this context refers to any type with a `drain` method:
18353> `Vec`, `VecDeque`, `BinaryHeap`, `HashSet`,`HashMap`, `String`"##,
18354 default_severity: Severity::Allow,
18355 warn_since: None,
18356 deny_since: None,
18357 },
18358 Lint {
18359 label: "clippy::drop_non_drop",
18360 description: r##"Checks for calls to `std::mem::drop` with a value that does not implement `Drop`."##,
18361 default_severity: Severity::Allow,
18362 warn_since: None,
18363 deny_since: None,
18364 },
18365 Lint {
18366 label: "clippy::duplicate_mod",
18367 description: r##"Checks for files that are included as modules multiple times."##,
18368 default_severity: Severity::Allow,
18369 warn_since: None,
18370 deny_since: None,
18371 },
18372 Lint {
18373 label: "clippy::duplicate_underscore_argument",
18374 description: r##"Checks for function arguments having the similar names
18375differing by an underscore."##,
18376 default_severity: Severity::Allow,
18377 warn_since: None,
18378 deny_since: None,
18379 },
18380 Lint {
18381 label: "clippy::duplicated_attributes",
18382 description: r##"Checks for attributes that appear two or more times."##,
18383 default_severity: Severity::Allow,
18384 warn_since: None,
18385 deny_since: None,
18386 },
18387 Lint {
18388 label: "clippy::duration_subsec",
18389 description: r##"Checks for calculation of subsecond microseconds or milliseconds
18390from other `Duration` methods."##,
18391 default_severity: Severity::Allow,
18392 warn_since: None,
18393 deny_since: None,
18394 },
18395 Lint {
18396 label: "clippy::eager_transmute",
18397 description: r##"Checks for integer validity checks, followed by a transmute that is (incorrectly) evaluated
18398eagerly (e.g. using `bool::then_some`)."##,
18399 default_severity: Severity::Allow,
18400 warn_since: None,
18401 deny_since: None,
18402 },
18403 Lint {
18404 label: "clippy::else_if_without_else",
18405 description: r##"Checks for usage of if expressions with an `else if` branch,
18406but without a final `else` branch."##,
18407 default_severity: Severity::Allow,
18408 warn_since: None,
18409 deny_since: None,
18410 },
18411 Lint {
18412 label: "clippy::empty_docs",
18413 description: r##"Detects documentation that is empty."##,
18414 default_severity: Severity::Allow,
18415 warn_since: None,
18416 deny_since: None,
18417 },
18418 Lint {
18419 label: "clippy::empty_drop",
18420 description: r##"Checks for empty `Drop` implementations."##,
18421 default_severity: Severity::Allow,
18422 warn_since: None,
18423 deny_since: None,
18424 },
18425 Lint {
18426 label: "clippy::empty_enum",
18427 description: r##"Checks for `enum`s with no variants, which therefore are uninhabited types
18428(cannot be instantiated).
18429
18430As of this writing, the `never_type` is still a nightly-only experimental API.
18431Therefore, this lint is only triggered if `#![feature(never_type)]` is enabled."##,
18432 default_severity: Severity::Allow,
18433 warn_since: None,
18434 deny_since: None,
18435 },
18436 Lint {
18437 label: "clippy::empty_enum_variants_with_brackets",
18438 description: r##"Finds enum variants without fields that are declared with empty brackets."##,
18439 default_severity: Severity::Allow,
18440 warn_since: None,
18441 deny_since: None,
18442 },
18443 Lint {
18444 label: "clippy::empty_line_after_doc_comments",
18445 description: r##"Checks for empty lines after doc comments."##,
18446 default_severity: Severity::Allow,
18447 warn_since: None,
18448 deny_since: None,
18449 },
18450 Lint {
18451 label: "clippy::empty_line_after_outer_attr",
18452 description: r##"Checks for empty lines after outer attributes"##,
18453 default_severity: Severity::Allow,
18454 warn_since: None,
18455 deny_since: None,
18456 },
18457 Lint {
18458 label: "clippy::empty_loop",
18459 description: r##"Checks for empty `loop` expressions."##,
18460 default_severity: Severity::Allow,
18461 warn_since: None,
18462 deny_since: None,
18463 },
18464 Lint {
18465 label: "clippy::empty_structs_with_brackets",
18466 description: r##"Finds structs without fields (a so-called empty struct) that are declared with brackets."##,
18467 default_severity: Severity::Allow,
18468 warn_since: None,
18469 deny_since: None,
18470 },
18471 Lint {
18472 label: "clippy::enum_clike_unportable_variant",
18473 description: r##"Checks for C-like enumerations that are
18474`repr(isize/usize)` and have values that don't fit into an `i32`."##,
18475 default_severity: Severity::Allow,
18476 warn_since: None,
18477 deny_since: None,
18478 },
18479 Lint {
18480 label: "clippy::enum_glob_use",
18481 description: r##"Checks for `use Enum::*`."##,
18482 default_severity: Severity::Allow,
18483 warn_since: None,
18484 deny_since: None,
18485 },
18486 Lint {
18487 label: "clippy::enum_variant_names",
18488 description: r##"Detects enumeration variants that are prefixed or suffixed
18489by the same characters."##,
18490 default_severity: Severity::Allow,
18491 warn_since: None,
18492 deny_since: None,
18493 },
18494 Lint {
18495 label: "clippy::eq_op",
18496 description: r##"Checks for equal operands to comparison, logical and
18497bitwise, difference and division binary operators (`==`, `>`, etc., `&&`,
18498`||`, `&`, `|`, `^`, `-` and `/`)."##,
18499 default_severity: Severity::Allow,
18500 warn_since: None,
18501 deny_since: None,
18502 },
18503 Lint {
18504 label: "clippy::equatable_if_let",
18505 description: r##"Checks for pattern matchings that can be expressed using equality."##,
18506 default_severity: Severity::Allow,
18507 warn_since: None,
18508 deny_since: None,
18509 },
18510 Lint {
18511 label: "clippy::erasing_op",
18512 description: r##"Checks for erasing operations, e.g., `x * 0`."##,
18513 default_severity: Severity::Allow,
18514 warn_since: None,
18515 deny_since: None,
18516 },
18517 Lint {
18518 label: "clippy::err_expect",
18519 description: r##"Checks for `.err().expect()` calls on the `Result` type."##,
18520 default_severity: Severity::Allow,
18521 warn_since: None,
18522 deny_since: None,
18523 },
18524 Lint {
18525 label: "clippy::error_impl_error",
18526 description: r##"Checks for types named `Error` that implement `Error`."##,
18527 default_severity: Severity::Allow,
18528 warn_since: None,
18529 deny_since: None,
18530 },
18531 Lint {
18532 label: "clippy::excessive_nesting",
18533 description: r##"Checks for blocks which are nested beyond a certain threshold.
18534
18535Note: Even though this lint is warn-by-default, it will only trigger if a maximum nesting level is defined in the clippy.toml file."##,
18536 default_severity: Severity::Allow,
18537 warn_since: None,
18538 deny_since: None,
18539 },
18540 Lint {
18541 label: "clippy::excessive_precision",
18542 description: r##"Checks for float literals with a precision greater
18543than that supported by the underlying type."##,
18544 default_severity: Severity::Allow,
18545 warn_since: None,
18546 deny_since: None,
18547 },
18548 Lint {
18549 label: "clippy::exhaustive_enums",
18550 description: r##"Warns on any exported `enum`s that are not tagged `#[non_exhaustive]`"##,
18551 default_severity: Severity::Allow,
18552 warn_since: None,
18553 deny_since: None,
18554 },
18555 Lint {
18556 label: "clippy::exhaustive_structs",
18557 description: r##"Warns on any exported `struct`s that are not tagged `#[non_exhaustive]`"##,
18558 default_severity: Severity::Allow,
18559 warn_since: None,
18560 deny_since: None,
18561 },
18562 Lint {
18563 label: "clippy::exit",
18564 description: r##"Detects calls to the `exit()` function which terminates the program."##,
18565 default_severity: Severity::Allow,
18566 warn_since: None,
18567 deny_since: None,
18568 },
18569 Lint {
18570 label: "clippy::expect_fun_call",
18571 description: r##"Checks for calls to `.expect(&format!(...))`, `.expect(foo(..))`,
18572etc., and suggests to use `unwrap_or_else` instead"##,
18573 default_severity: Severity::Allow,
18574 warn_since: None,
18575 deny_since: None,
18576 },
18577 Lint {
18578 label: "clippy::expect_used",
18579 description: r##"Checks for `.expect()` or `.expect_err()` calls on `Result`s and `.expect()` call on `Option`s."##,
18580 default_severity: Severity::Allow,
18581 warn_since: None,
18582 deny_since: None,
18583 },
18584 Lint {
18585 label: "clippy::expl_impl_clone_on_copy",
18586 description: r##"Checks for explicit `Clone` implementations for `Copy`
18587types."##,
18588 default_severity: Severity::Allow,
18589 warn_since: None,
18590 deny_since: None,
18591 },
18592 Lint {
18593 label: "clippy::explicit_auto_deref",
18594 description: r##"Checks for dereferencing expressions which would be covered by auto-deref."##,
18595 default_severity: Severity::Allow,
18596 warn_since: None,
18597 deny_since: None,
18598 },
18599 Lint {
18600 label: "clippy::explicit_counter_loop",
18601 description: r##"Checks `for` loops over slices with an explicit counter
18602and suggests the use of `.enumerate()`."##,
18603 default_severity: Severity::Allow,
18604 warn_since: None,
18605 deny_since: None,
18606 },
18607 Lint {
18608 label: "clippy::explicit_deref_methods",
18609 description: r##"Checks for explicit `deref()` or `deref_mut()` method calls."##,
18610 default_severity: Severity::Allow,
18611 warn_since: None,
18612 deny_since: None,
18613 },
18614 Lint {
18615 label: "clippy::explicit_into_iter_loop",
18616 description: r##"Checks for loops on `y.into_iter()` where `y` 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_iter_loop",
18624 description: r##"Checks for loops on `x.iter()` where `&x` will do, and
18625suggests the latter."##,
18626 default_severity: Severity::Allow,
18627 warn_since: None,
18628 deny_since: None,
18629 },
18630 Lint {
18631 label: "clippy::explicit_write",
18632 description: r##"Checks for usage of `write!()` / `writeln()!` which can be
18633replaced with `(e)print!()` / `(e)println!()`"##,
18634 default_severity: Severity::Allow,
18635 warn_since: None,
18636 deny_since: None,
18637 },
18638 Lint {
18639 label: "clippy::extend_from_slice",
18640 description: r##"Nothing. This lint has been deprecated"##,
18641 default_severity: Severity::Allow,
18642 warn_since: None,
18643 deny_since: None,
18644 },
18645 Lint {
18646 label: "clippy::extend_with_drain",
18647 description: r##"Checks for occurrences where one vector gets extended instead of append"##,
18648 default_severity: Severity::Allow,
18649 warn_since: None,
18650 deny_since: None,
18651 },
18652 Lint {
18653 label: "clippy::extra_unused_lifetimes",
18654 description: r##"Checks for lifetimes in generics that are never used
18655anywhere else."##,
18656 default_severity: Severity::Allow,
18657 warn_since: None,
18658 deny_since: None,
18659 },
18660 Lint {
18661 label: "clippy::extra_unused_type_parameters",
18662 description: r##"Checks for type parameters in generics that are never used anywhere else."##,
18663 default_severity: Severity::Allow,
18664 warn_since: None,
18665 deny_since: None,
18666 },
18667 Lint {
18668 label: "clippy::fallible_impl_from",
18669 description: r##"Checks for impls of `From<..>` that contain `panic!()` or `unwrap()`"##,
18670 default_severity: Severity::Allow,
18671 warn_since: None,
18672 deny_since: None,
18673 },
18674 Lint {
18675 label: "clippy::field_reassign_with_default",
18676 description: r##"Checks for immediate reassignment of fields initialized
18677with Default::default()."##,
18678 default_severity: Severity::Allow,
18679 warn_since: None,
18680 deny_since: None,
18681 },
18682 Lint {
18683 label: "clippy::field_scoped_visibility_modifiers",
18684 description: r##"Checks for usage of scoped visibility modifiers, like `pub(crate)`, on fields. These
18685make a field visible within a scope between public and private."##,
18686 default_severity: Severity::Allow,
18687 warn_since: None,
18688 deny_since: None,
18689 },
18690 Lint {
18691 label: "clippy::filetype_is_file",
18692 description: r##"Checks for `FileType::is_file()`."##,
18693 default_severity: Severity::Allow,
18694 warn_since: None,
18695 deny_since: None,
18696 },
18697 Lint {
18698 label: "clippy::filter_map_bool_then",
18699 description: r##"Checks for usage of `bool::then` in `Iterator::filter_map`."##,
18700 default_severity: Severity::Allow,
18701 warn_since: None,
18702 deny_since: None,
18703 },
18704 Lint {
18705 label: "clippy::filter_map_identity",
18706 description: r##"Checks for usage of `filter_map(|x| x)`."##,
18707 default_severity: Severity::Allow,
18708 warn_since: None,
18709 deny_since: None,
18710 },
18711 Lint {
18712 label: "clippy::filter_map_next",
18713 description: r##"Checks for usage of `_.filter_map(_).next()`."##,
18714 default_severity: Severity::Allow,
18715 warn_since: None,
18716 deny_since: None,
18717 },
18718 Lint {
18719 label: "clippy::filter_next",
18720 description: r##"Checks for usage of `_.filter(_).next()`."##,
18721 default_severity: Severity::Allow,
18722 warn_since: None,
18723 deny_since: None,
18724 },
18725 Lint {
18726 label: "clippy::flat_map_identity",
18727 description: r##"Checks for usage of `flat_map(|x| x)`."##,
18728 default_severity: Severity::Allow,
18729 warn_since: None,
18730 deny_since: None,
18731 },
18732 Lint {
18733 label: "clippy::flat_map_option",
18734 description: r##"Checks for usage of `Iterator::flat_map()` where `filter_map()` could be
18735used instead."##,
18736 default_severity: Severity::Allow,
18737 warn_since: None,
18738 deny_since: None,
18739 },
18740 Lint {
18741 label: "clippy::float_arithmetic",
18742 description: r##"Checks for float arithmetic."##,
18743 default_severity: Severity::Allow,
18744 warn_since: None,
18745 deny_since: None,
18746 },
18747 Lint {
18748 label: "clippy::float_cmp",
18749 description: r##"Checks for (in-)equality comparisons on floating-point
18750values (apart from zero), except in functions called `*eq*` (which probably
18751implement equality for a type involving floats)."##,
18752 default_severity: Severity::Allow,
18753 warn_since: None,
18754 deny_since: None,
18755 },
18756 Lint {
18757 label: "clippy::float_cmp_const",
18758 description: r##"Checks for (in-)equality comparisons on constant floating-point
18759values (apart from zero), except in functions called `*eq*` (which probably
18760implement equality for a type involving floats)."##,
18761 default_severity: Severity::Allow,
18762 warn_since: None,
18763 deny_since: None,
18764 },
18765 Lint {
18766 label: "clippy::float_equality_without_abs",
18767 description: r##"Checks for statements of the form `(a - b) < f32::EPSILON` or
18768`(a - b) < f64::EPSILON`. Notes the missing `.abs()`."##,
18769 default_severity: Severity::Allow,
18770 warn_since: None,
18771 deny_since: None,
18772 },
18773 Lint {
18774 label: "clippy::fn_address_comparisons",
18775 description: r##"Checks for comparisons with an address of a function item."##,
18776 default_severity: Severity::Allow,
18777 warn_since: None,
18778 deny_since: None,
18779 },
18780 Lint {
18781 label: "clippy::fn_params_excessive_bools",
18782 description: r##"Checks for excessive use of
18783bools in function definitions."##,
18784 default_severity: Severity::Allow,
18785 warn_since: None,
18786 deny_since: None,
18787 },
18788 Lint {
18789 label: "clippy::fn_to_numeric_cast",
18790 description: r##"Checks for casts of function pointers to something other than `usize`."##,
18791 default_severity: Severity::Allow,
18792 warn_since: None,
18793 deny_since: None,
18794 },
18795 Lint {
18796 label: "clippy::fn_to_numeric_cast_any",
18797 description: r##"Checks for casts of a function pointer to any integer type."##,
18798 default_severity: Severity::Allow,
18799 warn_since: None,
18800 deny_since: None,
18801 },
18802 Lint {
18803 label: "clippy::fn_to_numeric_cast_with_truncation",
18804 description: r##"Checks for casts of a function pointer to a numeric type not wide enough to
18805store an address."##,
18806 default_severity: Severity::Allow,
18807 warn_since: None,
18808 deny_since: None,
18809 },
18810 Lint {
18811 label: "clippy::for_kv_map",
18812 description: r##"Checks for iterating a map (`HashMap` or `BTreeMap`) and
18813ignoring either the keys or values."##,
18814 default_severity: Severity::Allow,
18815 warn_since: None,
18816 deny_since: None,
18817 },
18818 Lint {
18819 label: "clippy::forget_non_drop",
18820 description: r##"Checks for calls to `std::mem::forget` with a value that does not implement `Drop`."##,
18821 default_severity: Severity::Allow,
18822 warn_since: None,
18823 deny_since: None,
18824 },
18825 Lint {
18826 label: "clippy::format_collect",
18827 description: r##"Checks for usage of `.map(|_| format!(..)).collect::<String>()`."##,
18828 default_severity: Severity::Allow,
18829 warn_since: None,
18830 deny_since: None,
18831 },
18832 Lint {
18833 label: "clippy::format_in_format_args",
18834 description: r##"Detects `format!` within the arguments of another macro that does
18835formatting such as `format!` itself, `write!` or `println!`. Suggests
18836inlining the `format!` call."##,
18837 default_severity: Severity::Allow,
18838 warn_since: None,
18839 deny_since: None,
18840 },
18841 Lint {
18842 label: "clippy::format_push_string",
18843 description: r##"Detects cases where the result of a `format!` call is
18844appended to an existing `String`."##,
18845 default_severity: Severity::Allow,
18846 warn_since: None,
18847 deny_since: None,
18848 },
18849 Lint {
18850 label: "clippy::four_forward_slashes",
18851 description: r##"Checks for outer doc comments written with 4 forward slashes (`////`)."##,
18852 default_severity: Severity::Allow,
18853 warn_since: None,
18854 deny_since: None,
18855 },
18856 Lint {
18857 label: "clippy::from_iter_instead_of_collect",
18858 description: r##"Checks for `from_iter()` function calls on types that implement the `FromIterator`
18859trait."##,
18860 default_severity: Severity::Allow,
18861 warn_since: None,
18862 deny_since: None,
18863 },
18864 Lint {
18865 label: "clippy::from_over_into",
18866 description: r##"Searches for implementations of the `Into<..>` trait and suggests to implement `From<..>` instead."##,
18867 default_severity: Severity::Allow,
18868 warn_since: None,
18869 deny_since: None,
18870 },
18871 Lint {
18872 label: "clippy::from_raw_with_void_ptr",
18873 description: r##"Checks if we're passing a `c_void` raw pointer to `{Box,Rc,Arc,Weak}::from_raw(_)`"##,
18874 default_severity: Severity::Allow,
18875 warn_since: None,
18876 deny_since: None,
18877 },
18878 Lint {
18879 label: "clippy::from_str_radix_10",
18880 description: r##"Checks for function invocations of the form `primitive::from_str_radix(s, 10)`"##,
18881 default_severity: Severity::Allow,
18882 warn_since: None,
18883 deny_since: None,
18884 },
18885 Lint {
18886 label: "clippy::future_not_send",
18887 description: r##"This lint requires Future implementations returned from
18888functions and methods to implement the `Send` marker trait. It is mostly
18889used by library authors (public and internal) that target an audience where
18890multithreaded executors are likely to be used for running these Futures."##,
18891 default_severity: Severity::Allow,
18892 warn_since: None,
18893 deny_since: None,
18894 },
18895 Lint {
18896 label: "clippy::get_first",
18897 description: r##"Checks for usage of `x.get(0)` instead of
18898`x.first()` or `x.front()`."##,
18899 default_severity: Severity::Allow,
18900 warn_since: None,
18901 deny_since: None,
18902 },
18903 Lint {
18904 label: "clippy::get_last_with_len",
18905 description: r##"Checks for usage of `x.get(x.len() - 1)` instead of
18906`x.last()`."##,
18907 default_severity: Severity::Allow,
18908 warn_since: None,
18909 deny_since: None,
18910 },
18911 Lint {
18912 label: "clippy::get_unwrap",
18913 description: r##"Checks for usage of `.get().unwrap()` (or
18914`.get_mut().unwrap`) on a standard library type which implements `Index`"##,
18915 default_severity: Severity::Allow,
18916 warn_since: None,
18917 deny_since: None,
18918 },
18919 Lint {
18920 label: "clippy::host_endian_bytes",
18921 description: r##"Checks for the usage of the `to_ne_bytes` method and/or the function `from_ne_bytes`."##,
18922 default_severity: Severity::Allow,
18923 warn_since: None,
18924 deny_since: None,
18925 },
18926 Lint {
18927 label: "clippy::identity_op",
18928 description: r##"Checks for identity operations, e.g., `x + 0`."##,
18929 default_severity: Severity::Allow,
18930 warn_since: None,
18931 deny_since: None,
18932 },
18933 Lint {
18934 label: "clippy::if_let_mutex",
18935 description: r##"Checks for `Mutex::lock` calls in `if let` expression
18936with lock calls in any of the else blocks."##,
18937 default_severity: Severity::Allow,
18938 warn_since: None,
18939 deny_since: None,
18940 },
18941 Lint {
18942 label: "clippy::if_not_else",
18943 description: r##"Checks for usage of `!` or `!=` in an if condition with an
18944else branch."##,
18945 default_severity: Severity::Allow,
18946 warn_since: None,
18947 deny_since: None,
18948 },
18949 Lint {
18950 label: "clippy::if_same_then_else",
18951 description: r##"Checks for `if/else` with the same body as the *then* part
18952and the *else* part."##,
18953 default_severity: Severity::Allow,
18954 warn_since: None,
18955 deny_since: None,
18956 },
18957 Lint {
18958 label: "clippy::if_then_some_else_none",
18959 description: r##"Checks for if-else that could be written using either `bool::then` or `bool::then_some`."##,
18960 default_severity: Severity::Allow,
18961 warn_since: None,
18962 deny_since: None,
18963 },
18964 Lint {
18965 label: "clippy::ifs_same_cond",
18966 description: r##"Checks for consecutive `if`s with the same condition."##,
18967 default_severity: Severity::Allow,
18968 warn_since: None,
18969 deny_since: None,
18970 },
18971 Lint {
18972 label: "clippy::ignored_unit_patterns",
18973 description: r##"Checks for usage of `_` in patterns of type `()`."##,
18974 default_severity: Severity::Allow,
18975 warn_since: None,
18976 deny_since: None,
18977 },
18978 Lint {
18979 label: "clippy::impl_hash_borrow_with_str_and_bytes",
18980 description: r##"This lint is concerned with the semantics of `Borrow` and `Hash` for a
18981type that implements all three of `Hash`, `Borrow<str>` and `Borrow<[u8]>`
18982as it is impossible to satisfy the semantics of Borrow and `Hash` for
18983both `Borrow<str>` and `Borrow<[u8]>`."##,
18984 default_severity: Severity::Allow,
18985 warn_since: None,
18986 deny_since: None,
18987 },
18988 Lint {
18989 label: "clippy::impl_trait_in_params",
18990 description: r##"Lints when `impl Trait` is being used in a function's parameters."##,
18991 default_severity: Severity::Allow,
18992 warn_since: None,
18993 deny_since: None,
18994 },
18995 Lint {
18996 label: "clippy::implicit_clone",
18997 description: r##"Checks for the usage of `_.to_owned()`, `vec.to_vec()`, or similar when calling `_.clone()` would be clearer."##,
18998 default_severity: Severity::Allow,
18999 warn_since: None,
19000 deny_since: None,
19001 },
19002 Lint {
19003 label: "clippy::implicit_hasher",
19004 description: r##"Checks for public `impl` or `fn` missing generalization
19005over different hashers and implicitly defaulting to the default hashing
19006algorithm (`SipHash`)."##,
19007 default_severity: Severity::Allow,
19008 warn_since: None,
19009 deny_since: None,
19010 },
19011 Lint {
19012 label: "clippy::implicit_return",
19013 description: r##"Checks for missing return statements at the end of a block."##,
19014 default_severity: Severity::Allow,
19015 warn_since: None,
19016 deny_since: None,
19017 },
19018 Lint {
19019 label: "clippy::implicit_saturating_add",
19020 description: r##"Checks for implicit saturating addition."##,
19021 default_severity: Severity::Allow,
19022 warn_since: None,
19023 deny_since: None,
19024 },
19025 Lint {
19026 label: "clippy::implicit_saturating_sub",
19027 description: r##"Checks for implicit saturating subtraction."##,
19028 default_severity: Severity::Allow,
19029 warn_since: None,
19030 deny_since: None,
19031 },
19032 Lint {
19033 label: "clippy::implied_bounds_in_impls",
19034 description: r##"Looks for bounds in `impl Trait` in return position that are implied by other bounds.
19035This can happen when a trait is specified that another trait already has as a supertrait
19036(e.g. `fn() -> impl Deref + DerefMut<Target = i32>` has an unnecessary `Deref` bound,
19037because `Deref` is a supertrait of `DerefMut`)"##,
19038 default_severity: Severity::Allow,
19039 warn_since: None,
19040 deny_since: None,
19041 },
19042 Lint {
19043 label: "clippy::impossible_comparisons",
19044 description: r##"Checks for double comparisons that can never succeed"##,
19045 default_severity: Severity::Allow,
19046 warn_since: None,
19047 deny_since: None,
19048 },
19049 Lint {
19050 label: "clippy::imprecise_flops",
19051 description: r##"Looks for floating-point expressions that
19052can be expressed using built-in methods to improve accuracy
19053at the cost of performance."##,
19054 default_severity: Severity::Allow,
19055 warn_since: None,
19056 deny_since: None,
19057 },
19058 Lint {
19059 label: "clippy::incompatible_msrv",
19060 description: r##"This lint checks that no function newer than the defined MSRV (minimum
19061supported rust version) is used in the crate."##,
19062 default_severity: Severity::Allow,
19063 warn_since: None,
19064 deny_since: None,
19065 },
19066 Lint {
19067 label: "clippy::inconsistent_digit_grouping",
19068 description: r##"Warns if an integral or floating-point constant is
19069grouped inconsistently with underscores."##,
19070 default_severity: Severity::Allow,
19071 warn_since: None,
19072 deny_since: None,
19073 },
19074 Lint {
19075 label: "clippy::inconsistent_struct_constructor",
19076 description: r##"Checks for struct constructors where all fields are shorthand and
19077the order of the field init shorthand in the constructor is inconsistent
19078with the order in the struct definition."##,
19079 default_severity: Severity::Allow,
19080 warn_since: None,
19081 deny_since: None,
19082 },
19083 Lint {
19084 label: "clippy::index_refutable_slice",
19085 description: r##"The lint checks for slice bindings in patterns that are only used to
19086access individual slice values."##,
19087 default_severity: Severity::Allow,
19088 warn_since: None,
19089 deny_since: None,
19090 },
19091 Lint {
19092 label: "clippy::indexing_slicing",
19093 description: r##"Checks for usage of indexing or slicing. Arrays are special cases, this lint
19094does report on arrays if we can tell that slicing operations are in bounds and does not
19095lint on constant `usize` indexing on arrays because that is handled by rustc's `const_err` lint."##,
19096 default_severity: Severity::Allow,
19097 warn_since: None,
19098 deny_since: None,
19099 },
19100 Lint {
19101 label: "clippy::ineffective_bit_mask",
19102 description: r##"Checks for bit masks in comparisons which can be removed
19103without changing the outcome. The basic structure can be seen in the
19104following table:
19105
19106|Comparison| Bit Op |Example |equals |
19107|----------|----------|------------|-------|
19108|`>` / `<=`|`\\|` / `^`|`x \\| 2 > 3`|`x > 3`|
19109|`<` / `>=`|`\\|` / `^`|`x ^ 1 < 4` |`x < 4`|"##,
19110 default_severity: Severity::Allow,
19111 warn_since: None,
19112 deny_since: None,
19113 },
19114 Lint {
19115 label: "clippy::ineffective_open_options",
19116 description: r##"Checks if both `.write(true)` and `.append(true)` methods are called
19117on a same `OpenOptions`."##,
19118 default_severity: Severity::Allow,
19119 warn_since: None,
19120 deny_since: None,
19121 },
19122 Lint {
19123 label: "clippy::inefficient_to_string",
19124 description: r##"Checks for usage of `.to_string()` on an `&&T` where
19125`T` implements `ToString` directly (like `&&str` or `&&String`)."##,
19126 default_severity: Severity::Allow,
19127 warn_since: None,
19128 deny_since: None,
19129 },
19130 Lint {
19131 label: "clippy::infallible_destructuring_match",
19132 description: r##"Checks for matches being used to destructure a single-variant enum
19133or tuple struct where a `let` will suffice."##,
19134 default_severity: Severity::Allow,
19135 warn_since: None,
19136 deny_since: None,
19137 },
19138 Lint {
19139 label: "clippy::infinite_iter",
19140 description: r##"Checks for iteration that is guaranteed to be infinite."##,
19141 default_severity: Severity::Allow,
19142 warn_since: None,
19143 deny_since: None,
19144 },
19145 Lint {
19146 label: "clippy::infinite_loop",
19147 description: r##"Checks for infinite loops in a function where the return type is not `!`
19148and lint accordingly."##,
19149 default_severity: Severity::Allow,
19150 warn_since: None,
19151 deny_since: None,
19152 },
19153 Lint {
19154 label: "clippy::inherent_to_string",
19155 description: r##"Checks for the definition of inherent methods with a signature of `to_string(&self) -> String`."##,
19156 default_severity: Severity::Allow,
19157 warn_since: None,
19158 deny_since: None,
19159 },
19160 Lint {
19161 label: "clippy::inherent_to_string_shadow_display",
19162 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."##,
19163 default_severity: Severity::Allow,
19164 warn_since: None,
19165 deny_since: None,
19166 },
19167 Lint {
19168 label: "clippy::init_numbered_fields",
19169 description: r##"Checks for tuple structs initialized with field syntax.
19170It will however not lint if a base initializer is present.
19171The lint will also ignore code in macros."##,
19172 default_severity: Severity::Allow,
19173 warn_since: None,
19174 deny_since: None,
19175 },
19176 Lint {
19177 label: "clippy::inline_always",
19178 description: r##"Checks for items annotated with `#[inline(always)]`,
19179unless the annotated function is empty or simply panics."##,
19180 default_severity: Severity::Allow,
19181 warn_since: None,
19182 deny_since: None,
19183 },
19184 Lint {
19185 label: "clippy::inline_asm_x86_att_syntax",
19186 description: r##"Checks for usage of AT&T x86 assembly syntax."##,
19187 default_severity: Severity::Allow,
19188 warn_since: None,
19189 deny_since: None,
19190 },
19191 Lint {
19192 label: "clippy::inline_asm_x86_intel_syntax",
19193 description: r##"Checks for usage of Intel x86 assembly syntax."##,
19194 default_severity: Severity::Allow,
19195 warn_since: None,
19196 deny_since: None,
19197 },
19198 Lint {
19199 label: "clippy::inline_fn_without_body",
19200 description: r##"Checks for `#[inline]` on trait methods without bodies"##,
19201 default_severity: Severity::Allow,
19202 warn_since: None,
19203 deny_since: None,
19204 },
19205 Lint {
19206 label: "clippy::inspect_for_each",
19207 description: r##"Checks for usage of `inspect().for_each()`."##,
19208 default_severity: Severity::Allow,
19209 warn_since: None,
19210 deny_since: None,
19211 },
19212 Lint {
19213 label: "clippy::int_plus_one",
19214 description: r##"Checks for usage of `x >= y + 1` or `x - 1 >= y` (and `<=`) in a block"##,
19215 default_severity: Severity::Allow,
19216 warn_since: None,
19217 deny_since: None,
19218 },
19219 Lint {
19220 label: "clippy::integer_division",
19221 description: r##"Checks for division of integers"##,
19222 default_severity: Severity::Allow,
19223 warn_since: None,
19224 deny_since: None,
19225 },
19226 Lint {
19227 label: "clippy::integer_division_remainder_used",
19228 description: r##"Checks for the usage of division (`/`) and remainder (`%`) operations
19229when performed on any integer types using the default `Div` and `Rem` trait implementations."##,
19230 default_severity: Severity::Allow,
19231 warn_since: None,
19232 deny_since: None,
19233 },
19234 Lint {
19235 label: "clippy::into_iter_on_ref",
19236 description: r##"Checks for `into_iter` calls on references which should be replaced by `iter`
19237or `iter_mut`."##,
19238 default_severity: Severity::Allow,
19239 warn_since: None,
19240 deny_since: None,
19241 },
19242 Lint {
19243 label: "clippy::into_iter_without_iter",
19244 description: r##"This is the opposite of the `iter_without_into_iter` lint.
19245It looks for `IntoIterator for (&|&mut) Type` implementations without an inherent `iter` or `iter_mut` method
19246on the type or on any of the types in its `Deref` chain."##,
19247 default_severity: Severity::Allow,
19248 warn_since: None,
19249 deny_since: None,
19250 },
19251 Lint {
19252 label: "clippy::invalid_null_ptr_usage",
19253 description: r##"This lint checks for invalid usages of `ptr::null`."##,
19254 default_severity: Severity::Allow,
19255 warn_since: None,
19256 deny_since: None,
19257 },
19258 Lint {
19259 label: "clippy::invalid_regex",
19260 description: r##"Checks [regex](https://crates.io/crates/regex) creation
19261(with `Regex::new`, `RegexBuilder::new`, or `RegexSet::new`) for correct
19262regex syntax."##,
19263 default_severity: Severity::Allow,
19264 warn_since: None,
19265 deny_since: None,
19266 },
19267 Lint {
19268 label: "clippy::invalid_upcast_comparisons",
19269 description: r##"Checks for comparisons where the relation is always either
19270true or false, but where one side has been upcast so that the comparison is
19271necessary. Only integer types are checked."##,
19272 default_severity: Severity::Allow,
19273 warn_since: None,
19274 deny_since: None,
19275 },
19276 Lint {
19277 label: "clippy::inverted_saturating_sub",
19278 description: r##"Checks for comparisons between integers, followed by subtracting the greater value from the
19279lower one."##,
19280 default_severity: Severity::Allow,
19281 warn_since: None,
19282 deny_since: None,
19283 },
19284 Lint {
19285 label: "clippy::invisible_characters",
19286 description: r##"Checks for invisible Unicode characters in the code."##,
19287 default_severity: Severity::Allow,
19288 warn_since: None,
19289 deny_since: None,
19290 },
19291 Lint {
19292 label: "clippy::is_digit_ascii_radix",
19293 description: r##"Finds usages of [`char::is_digit`](https://doc.rust-lang.org/stable/std/primitive.char.html#method.is_digit) that
19294can be replaced with [`is_ascii_digit`](https://doc.rust-lang.org/stable/std/primitive.char.html#method.is_ascii_digit) or
19295[`is_ascii_hexdigit`](https://doc.rust-lang.org/stable/std/primitive.char.html#method.is_ascii_hexdigit)."##,
19296 default_severity: Severity::Allow,
19297 warn_since: None,
19298 deny_since: None,
19299 },
19300 Lint {
19301 label: "clippy::items_after_statements",
19302 description: r##"Checks for items declared after some statement in a block."##,
19303 default_severity: Severity::Allow,
19304 warn_since: None,
19305 deny_since: None,
19306 },
19307 Lint {
19308 label: "clippy::items_after_test_module",
19309 description: r##"Triggers if an item is declared after the testing module marked with `#[cfg(test)]`."##,
19310 default_severity: Severity::Allow,
19311 warn_since: None,
19312 deny_since: None,
19313 },
19314 Lint {
19315 label: "clippy::iter_cloned_collect",
19316 description: r##"Checks for the use of `.cloned().collect()` on slice to
19317create a `Vec`."##,
19318 default_severity: Severity::Allow,
19319 warn_since: None,
19320 deny_since: None,
19321 },
19322 Lint {
19323 label: "clippy::iter_count",
19324 description: r##"Checks for the use of `.iter().count()`."##,
19325 default_severity: Severity::Allow,
19326 warn_since: None,
19327 deny_since: None,
19328 },
19329 Lint {
19330 label: "clippy::iter_filter_is_ok",
19331 description: r##"Checks for usage of `.filter(Result::is_ok)` 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_filter_is_some",
19339 description: r##"Checks for usage of `.filter(Option::is_some)` that may be replaced with a `.flatten()` call.
19340This lint will require additional changes to the follow-up calls as it affects the type."##,
19341 default_severity: Severity::Allow,
19342 warn_since: None,
19343 deny_since: None,
19344 },
19345 Lint {
19346 label: "clippy::iter_kv_map",
19347 description: r##"Checks for iterating a map (`HashMap` or `BTreeMap`) and
19348ignoring either the keys or values."##,
19349 default_severity: Severity::Allow,
19350 warn_since: None,
19351 deny_since: None,
19352 },
19353 Lint {
19354 label: "clippy::iter_next_loop",
19355 description: r##"Checks for loops on `x.next()`."##,
19356 default_severity: Severity::Allow,
19357 warn_since: None,
19358 deny_since: None,
19359 },
19360 Lint {
19361 label: "clippy::iter_next_slice",
19362 description: r##"Checks for usage of `iter().next()` on a Slice or an Array"##,
19363 default_severity: Severity::Allow,
19364 warn_since: None,
19365 deny_since: None,
19366 },
19367 Lint {
19368 label: "clippy::iter_not_returning_iterator",
19369 description: r##"Detects methods named `iter` or `iter_mut` that do not have a return type that implements `Iterator`."##,
19370 default_severity: Severity::Allow,
19371 warn_since: None,
19372 deny_since: None,
19373 },
19374 Lint {
19375 label: "clippy::iter_nth",
19376 description: r##"Checks for usage of `.iter().nth()`/`.iter_mut().nth()` on standard library types that have
19377equivalent `.get()`/`.get_mut()` methods."##,
19378 default_severity: Severity::Allow,
19379 warn_since: None,
19380 deny_since: None,
19381 },
19382 Lint {
19383 label: "clippy::iter_nth_zero",
19384 description: r##"Checks for the use of `iter.nth(0)`."##,
19385 default_severity: Severity::Allow,
19386 warn_since: None,
19387 deny_since: None,
19388 },
19389 Lint {
19390 label: "clippy::iter_on_empty_collections",
19391 description: r##"Checks for calls to `iter`, `iter_mut` or `into_iter` on empty collections"##,
19392 default_severity: Severity::Allow,
19393 warn_since: None,
19394 deny_since: None,
19395 },
19396 Lint {
19397 label: "clippy::iter_on_single_items",
19398 description: r##"Checks for calls to `iter`, `iter_mut` or `into_iter` on collections containing a single item"##,
19399 default_severity: Severity::Allow,
19400 warn_since: None,
19401 deny_since: None,
19402 },
19403 Lint {
19404 label: "clippy::iter_out_of_bounds",
19405 description: r##"Looks for iterator combinator calls such as `.take(x)` or `.skip(x)`
19406where `x` is greater than the amount of items that an iterator will produce."##,
19407 default_severity: Severity::Allow,
19408 warn_since: None,
19409 deny_since: None,
19410 },
19411 Lint {
19412 label: "clippy::iter_over_hash_type",
19413 description: r##"This is a restriction lint which prevents the use of hash types (i.e., `HashSet` and `HashMap`) in for loops."##,
19414 default_severity: Severity::Allow,
19415 warn_since: None,
19416 deny_since: None,
19417 },
19418 Lint {
19419 label: "clippy::iter_overeager_cloned",
19420 description: r##"Checks for usage of `_.cloned().<func>()` where call to `.cloned()` can be postponed."##,
19421 default_severity: Severity::Allow,
19422 warn_since: None,
19423 deny_since: None,
19424 },
19425 Lint {
19426 label: "clippy::iter_skip_next",
19427 description: r##"Checks for usage of `.skip(x).next()` on iterators."##,
19428 default_severity: Severity::Allow,
19429 warn_since: None,
19430 deny_since: None,
19431 },
19432 Lint {
19433 label: "clippy::iter_skip_zero",
19434 description: r##"Checks for usage of `.skip(0)` on iterators."##,
19435 default_severity: Severity::Allow,
19436 warn_since: None,
19437 deny_since: None,
19438 },
19439 Lint {
19440 label: "clippy::iter_with_drain",
19441 description: r##"Checks for usage of `.drain(..)` on `Vec` and `VecDeque` for iteration."##,
19442 default_severity: Severity::Allow,
19443 warn_since: None,
19444 deny_since: None,
19445 },
19446 Lint {
19447 label: "clippy::iter_without_into_iter",
19448 description: r##"Looks for `iter` and `iter_mut` methods without an associated `IntoIterator for (&|&mut) Type` implementation."##,
19449 default_severity: Severity::Allow,
19450 warn_since: None,
19451 deny_since: None,
19452 },
19453 Lint {
19454 label: "clippy::iterator_step_by_zero",
19455 description: r##"Checks for calling `.step_by(0)` on iterators which panics."##,
19456 default_severity: Severity::Allow,
19457 warn_since: None,
19458 deny_since: None,
19459 },
19460 Lint {
19461 label: "clippy::join_absolute_paths",
19462 description: r##"Checks for calls to `Path::join` that start with a path separator (`\\\\` or `/`)."##,
19463 default_severity: Severity::Allow,
19464 warn_since: None,
19465 deny_since: None,
19466 },
19467 Lint {
19468 label: "clippy::just_underscores_and_digits",
19469 description: r##"Checks if you have variables whose name consists of just
19470underscores and digits."##,
19471 default_severity: Severity::Allow,
19472 warn_since: None,
19473 deny_since: None,
19474 },
19475 Lint {
19476 label: "clippy::large_const_arrays",
19477 description: r##"Checks for large `const` arrays that should
19478be defined as `static` instead."##,
19479 default_severity: Severity::Allow,
19480 warn_since: None,
19481 deny_since: None,
19482 },
19483 Lint {
19484 label: "clippy::large_digit_groups",
19485 description: r##"Warns if the digits of an integral or floating-point
19486constant are grouped into groups that
19487are too large."##,
19488 default_severity: Severity::Allow,
19489 warn_since: None,
19490 deny_since: None,
19491 },
19492 Lint {
19493 label: "clippy::large_enum_variant",
19494 description: r##"Checks for large size differences between variants on
19495`enum`s."##,
19496 default_severity: Severity::Allow,
19497 warn_since: None,
19498 deny_since: None,
19499 },
19500 Lint {
19501 label: "clippy::large_futures",
19502 description: r##"It checks for the size of a `Future` created by `async fn` or `async {}`."##,
19503 default_severity: Severity::Allow,
19504 warn_since: None,
19505 deny_since: None,
19506 },
19507 Lint {
19508 label: "clippy::large_include_file",
19509 description: r##"Checks for the inclusion of large files via `include_bytes!()`
19510or `include_str!()`."##,
19511 default_severity: Severity::Allow,
19512 warn_since: None,
19513 deny_since: None,
19514 },
19515 Lint {
19516 label: "clippy::large_stack_arrays",
19517 description: r##"Checks for local arrays that may be too large."##,
19518 default_severity: Severity::Allow,
19519 warn_since: None,
19520 deny_since: None,
19521 },
19522 Lint {
19523 label: "clippy::large_stack_frames",
19524 description: r##"Checks for functions that use a lot of stack space.
19525
19526This often happens when constructing a large type, such as an array with a lot of elements,
19527or constructing *many* smaller-but-still-large structs, or copying around a lot of large types.
19528
19529This lint is a more general version of [`large_stack_arrays`](https://rust-lang.github.io/rust-clippy/master/#large_stack_arrays)
19530that is intended to look at functions as a whole instead of only individual array expressions inside of a function."##,
19531 default_severity: Severity::Allow,
19532 warn_since: None,
19533 deny_since: None,
19534 },
19535 Lint {
19536 label: "clippy::large_types_passed_by_value",
19537 description: r##"Checks for functions taking arguments by value, where
19538the argument type is `Copy` and large enough to be worth considering
19539passing by reference. Does not trigger if the function is being exported,
19540because that might induce API breakage, if the parameter is declared as mutable,
19541or if the argument is a `self`."##,
19542 default_severity: Severity::Allow,
19543 warn_since: None,
19544 deny_since: None,
19545 },
19546 Lint {
19547 label: "clippy::legacy_numeric_constants",
19548 description: r##"Checks for usage of `<integer>::max_value()`, `std::<integer>::MAX`,
19549`std::<float>::EPSILON`, etc."##,
19550 default_severity: Severity::Allow,
19551 warn_since: None,
19552 deny_since: None,
19553 },
19554 Lint {
19555 label: "clippy::len_without_is_empty",
19556 description: r##"Checks for items that implement `.len()` but not
19557`.is_empty()`."##,
19558 default_severity: Severity::Allow,
19559 warn_since: None,
19560 deny_since: None,
19561 },
19562 Lint {
19563 label: "clippy::len_zero",
19564 description: r##"Checks for getting the length of something via `.len()`
19565just to compare to zero, and suggests using `.is_empty()` where applicable."##,
19566 default_severity: Severity::Allow,
19567 warn_since: None,
19568 deny_since: None,
19569 },
19570 Lint {
19571 label: "clippy::let_and_return",
19572 description: r##"Checks for `let`-bindings, which are subsequently
19573returned."##,
19574 default_severity: Severity::Allow,
19575 warn_since: None,
19576 deny_since: None,
19577 },
19578 Lint {
19579 label: "clippy::let_underscore_future",
19580 description: r##"Checks for `let _ = <expr>` where the resulting type of expr implements `Future`"##,
19581 default_severity: Severity::Allow,
19582 warn_since: None,
19583 deny_since: None,
19584 },
19585 Lint {
19586 label: "clippy::let_underscore_lock",
19587 description: r##"Checks for `let _ = sync_lock`. This supports `mutex` and `rwlock` in
19588`parking_lot`. For `std` locks see the `rustc` lint
19589[`let_underscore_lock`](https://doc.rust-lang.org/nightly/rustc/lints/listing/deny-by-default.html#let-underscore-lock)"##,
19590 default_severity: Severity::Allow,
19591 warn_since: None,
19592 deny_since: None,
19593 },
19594 Lint {
19595 label: "clippy::let_underscore_must_use",
19596 description: r##"Checks for `let _ = <expr>` where expr is `#[must_use]`"##,
19597 default_severity: Severity::Allow,
19598 warn_since: None,
19599 deny_since: None,
19600 },
19601 Lint {
19602 label: "clippy::let_underscore_untyped",
19603 description: r##"Checks for `let _ = <expr>` without a type annotation, and suggests to either provide one,
19604or remove the `let` keyword altogether."##,
19605 default_severity: Severity::Allow,
19606 warn_since: None,
19607 deny_since: None,
19608 },
19609 Lint {
19610 label: "clippy::let_unit_value",
19611 description: r##"Checks for binding a unit value."##,
19612 default_severity: Severity::Allow,
19613 warn_since: None,
19614 deny_since: None,
19615 },
19616 Lint {
19617 label: "clippy::let_with_type_underscore",
19618 description: r##"Detects when a variable is declared with an explicit type of `_`."##,
19619 default_severity: Severity::Allow,
19620 warn_since: None,
19621 deny_since: None,
19622 },
19623 Lint {
19624 label: "clippy::lines_filter_map_ok",
19625 description: r##"Checks for usage of `lines.filter_map(Result::ok)` or `lines.flat_map(Result::ok)`
19626when `lines` has type `std::io::Lines`."##,
19627 default_severity: Severity::Allow,
19628 warn_since: None,
19629 deny_since: None,
19630 },
19631 Lint {
19632 label: "clippy::linkedlist",
19633 description: r##"Checks for usage of any `LinkedList`, suggesting to use a
19634`Vec` or a `VecDeque` (formerly called `RingBuf`)."##,
19635 default_severity: Severity::Allow,
19636 warn_since: None,
19637 deny_since: None,
19638 },
19639 Lint {
19640 label: "clippy::lint_groups_priority",
19641 description: r##"Checks for lint groups with the same priority as lints in the `Cargo.toml`
19642[`[lints]` table](https://doc.rust-lang.org/cargo/reference/manifest.html#the-lints-section).
19643
19644This lint will be removed once [cargo#12918](https://github.com/rust-lang/cargo/issues/12918)
19645is resolved."##,
19646 default_severity: Severity::Allow,
19647 warn_since: None,
19648 deny_since: None,
19649 },
19650 Lint {
19651 label: "clippy::little_endian_bytes",
19652 description: r##"Checks for the usage of the `to_le_bytes` method and/or the function `from_le_bytes`."##,
19653 default_severity: Severity::Allow,
19654 warn_since: None,
19655 deny_since: None,
19656 },
19657 Lint {
19658 label: "clippy::lossy_float_literal",
19659 description: r##"Checks for whole number float literals that
19660cannot be represented as the underlying type without loss."##,
19661 default_severity: Severity::Allow,
19662 warn_since: None,
19663 deny_since: None,
19664 },
19665 Lint {
19666 label: "clippy::macro_metavars_in_unsafe",
19667 description: r##"Looks for macros that expand metavariables in an unsafe block."##,
19668 default_severity: Severity::Allow,
19669 warn_since: None,
19670 deny_since: None,
19671 },
19672 Lint {
19673 label: "clippy::macro_use_imports",
19674 description: r##"Checks for `#[macro_use] use...`."##,
19675 default_severity: Severity::Allow,
19676 warn_since: None,
19677 deny_since: None,
19678 },
19679 Lint {
19680 label: "clippy::main_recursion",
19681 description: r##"Checks for recursion using the entrypoint."##,
19682 default_severity: Severity::Allow,
19683 warn_since: None,
19684 deny_since: None,
19685 },
19686 Lint {
19687 label: "clippy::manual_assert",
19688 description: r##"Detects `if`-then-`panic!` that can be replaced with `assert!`."##,
19689 default_severity: Severity::Allow,
19690 warn_since: None,
19691 deny_since: None,
19692 },
19693 Lint {
19694 label: "clippy::manual_async_fn",
19695 description: r##"It checks for manual implementations of `async` functions."##,
19696 default_severity: Severity::Allow,
19697 warn_since: None,
19698 deny_since: None,
19699 },
19700 Lint {
19701 label: "clippy::manual_bits",
19702 description: r##"Checks for usage of `std::mem::size_of::<T>() * 8` when
19703`T::BITS` is available."##,
19704 default_severity: Severity::Allow,
19705 warn_since: None,
19706 deny_since: None,
19707 },
19708 Lint {
19709 label: "clippy::manual_c_str_literals",
19710 description: r##"Checks for the manual creation of C strings (a string with a `NUL` byte at the end), either
19711through one of the `CStr` constructor functions, or more plainly by calling `.as_ptr()`
19712on a (byte) string literal with a hardcoded `\\0` byte at the end."##,
19713 default_severity: Severity::Allow,
19714 warn_since: None,
19715 deny_since: None,
19716 },
19717 Lint {
19718 label: "clippy::manual_clamp",
19719 description: r##"Identifies good opportunities for a clamp function from std or core, and suggests using it."##,
19720 default_severity: Severity::Allow,
19721 warn_since: None,
19722 deny_since: None,
19723 },
19724 Lint {
19725 label: "clippy::manual_div_ceil",
19726 description: r##"Checks for an expression like `(x + (y - 1)) / y` which is a common manual reimplementation
19727of `x.div_ceil(y)`."##,
19728 default_severity: Severity::Allow,
19729 warn_since: None,
19730 deny_since: None,
19731 },
19732 Lint {
19733 label: "clippy::manual_filter",
19734 description: r##"Checks for usage of `match` which could be implemented using `filter`"##,
19735 default_severity: Severity::Allow,
19736 warn_since: None,
19737 deny_since: None,
19738 },
19739 Lint {
19740 label: "clippy::manual_filter_map",
19741 description: r##"Checks for usage of `_.filter(_).map(_)` that can be written more simply
19742as `filter_map(_)`."##,
19743 default_severity: Severity::Allow,
19744 warn_since: None,
19745 deny_since: None,
19746 },
19747 Lint {
19748 label: "clippy::manual_find",
19749 description: r##"Checks for manual implementations of Iterator::find"##,
19750 default_severity: Severity::Allow,
19751 warn_since: None,
19752 deny_since: None,
19753 },
19754 Lint {
19755 label: "clippy::manual_find_map",
19756 description: r##"Checks for usage of `_.find(_).map(_)` that can be written more simply
19757as `find_map(_)`."##,
19758 default_severity: Severity::Allow,
19759 warn_since: None,
19760 deny_since: None,
19761 },
19762 Lint {
19763 label: "clippy::manual_flatten",
19764 description: r##"Checks for unnecessary `if let` usage in a for loop
19765where only the `Some` or `Ok` variant of the iterator element is used."##,
19766 default_severity: Severity::Allow,
19767 warn_since: None,
19768 deny_since: None,
19769 },
19770 Lint {
19771 label: "clippy::manual_hash_one",
19772 description: r##"Checks for cases where [`BuildHasher::hash_one`] can be used.
19773
19774[`BuildHasher::hash_one`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html#method.hash_one"##,
19775 default_severity: Severity::Allow,
19776 warn_since: None,
19777 deny_since: None,
19778 },
19779 Lint {
19780 label: "clippy::manual_inspect",
19781 description: r##"Checks for uses of `map` which return the original item."##,
19782 default_severity: Severity::Allow,
19783 warn_since: None,
19784 deny_since: None,
19785 },
19786 Lint {
19787 label: "clippy::manual_instant_elapsed",
19788 description: r##"Lints subtraction between `Instant::now()` and another `Instant`."##,
19789 default_severity: Severity::Allow,
19790 warn_since: None,
19791 deny_since: None,
19792 },
19793 Lint {
19794 label: "clippy::manual_is_ascii_check",
19795 description: r##"Suggests to use dedicated built-in methods,
19796`is_ascii_(lowercase|uppercase|digit|hexdigit)` for checking on corresponding
19797ascii range"##,
19798 default_severity: Severity::Allow,
19799 warn_since: None,
19800 deny_since: None,
19801 },
19802 Lint {
19803 label: "clippy::manual_is_finite",
19804 description: r##"Checks for manual `is_finite` 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_infinite",
19812 description: r##"Checks for manual `is_infinite` reimplementations
19813(i.e., `x == <float>::INFINITY || x == <float>::NEG_INFINITY`)."##,
19814 default_severity: Severity::Allow,
19815 warn_since: None,
19816 deny_since: None,
19817 },
19818 Lint {
19819 label: "clippy::manual_is_power_of_two",
19820 description: r##"Checks for expressions like `x.count_ones() == 1` or `x & (x - 1) == 0`, with x and unsigned integer, which are manual
19821reimplementations of `x.is_power_of_two()`."##,
19822 default_severity: Severity::Allow,
19823 warn_since: None,
19824 deny_since: None,
19825 },
19826 Lint {
19827 label: "clippy::manual_is_variant_and",
19828 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."##,
19829 default_severity: Severity::Allow,
19830 warn_since: None,
19831 deny_since: None,
19832 },
19833 Lint {
19834 label: "clippy::manual_let_else",
19835 description: r##"Warn of cases where `let...else` could be used"##,
19836 default_severity: Severity::Allow,
19837 warn_since: None,
19838 deny_since: None,
19839 },
19840 Lint {
19841 label: "clippy::manual_main_separator_str",
19842 description: r##"Checks for references on `std::path::MAIN_SEPARATOR.to_string()` used
19843to build a `&str`."##,
19844 default_severity: Severity::Allow,
19845 warn_since: None,
19846 deny_since: None,
19847 },
19848 Lint {
19849 label: "clippy::manual_map",
19850 description: r##"Checks for usage of `match` which could be implemented using `map`"##,
19851 default_severity: Severity::Allow,
19852 warn_since: None,
19853 deny_since: None,
19854 },
19855 Lint {
19856 label: "clippy::manual_memcpy",
19857 description: r##"Checks for for-loops that manually copy items between
19858slices that could be optimized by having a memcpy."##,
19859 default_severity: Severity::Allow,
19860 warn_since: None,
19861 deny_since: None,
19862 },
19863 Lint {
19864 label: "clippy::manual_next_back",
19865 description: r##"Checks for `.rev().next()` on a `DoubleEndedIterator`"##,
19866 default_severity: Severity::Allow,
19867 warn_since: None,
19868 deny_since: None,
19869 },
19870 Lint {
19871 label: "clippy::manual_non_exhaustive",
19872 description: r##"Checks for manual implementations of the non-exhaustive pattern."##,
19873 default_severity: Severity::Allow,
19874 warn_since: None,
19875 deny_since: None,
19876 },
19877 Lint {
19878 label: "clippy::manual_ok_or",
19879 description: r##"Finds patterns that reimplement `Option::ok_or`."##,
19880 default_severity: Severity::Allow,
19881 warn_since: None,
19882 deny_since: None,
19883 },
19884 Lint {
19885 label: "clippy::manual_pattern_char_comparison",
19886 description: r##"Checks for manual `char` comparison in string patterns"##,
19887 default_severity: Severity::Allow,
19888 warn_since: None,
19889 deny_since: None,
19890 },
19891 Lint {
19892 label: "clippy::manual_range_contains",
19893 description: r##"Checks for expressions like `x >= 3 && x < 8` that could
19894be more readably expressed as `(3..8).contains(x)`."##,
19895 default_severity: Severity::Allow,
19896 warn_since: None,
19897 deny_since: None,
19898 },
19899 Lint {
19900 label: "clippy::manual_range_patterns",
19901 description: r##"Looks for combined OR patterns that are all contained in a specific range,
19902e.g. `6 | 4 | 5 | 9 | 7 | 8` can be rewritten as `4..=9`."##,
19903 default_severity: Severity::Allow,
19904 warn_since: None,
19905 deny_since: None,
19906 },
19907 Lint {
19908 label: "clippy::manual_rem_euclid",
19909 description: r##"Checks for an expression like `((x % 4) + 4) % 4` which is a common manual reimplementation
19910of `x.rem_euclid(4)`."##,
19911 default_severity: Severity::Allow,
19912 warn_since: None,
19913 deny_since: None,
19914 },
19915 Lint {
19916 label: "clippy::manual_retain",
19917 description: r##"Checks for code to be replaced by `.retain()`."##,
19918 default_severity: Severity::Allow,
19919 warn_since: None,
19920 deny_since: None,
19921 },
19922 Lint {
19923 label: "clippy::manual_rotate",
19924 description: r##"It detects manual bit rotations that could be rewritten using standard
19925functions `rotate_left` or `rotate_right`."##,
19926 default_severity: Severity::Allow,
19927 warn_since: None,
19928 deny_since: None,
19929 },
19930 Lint {
19931 label: "clippy::manual_saturating_arithmetic",
19932 description: r##"Checks for `.checked_add/sub(x).unwrap_or(MAX/MIN)`."##,
19933 default_severity: Severity::Allow,
19934 warn_since: None,
19935 deny_since: None,
19936 },
19937 Lint {
19938 label: "clippy::manual_slice_size_calculation",
19939 description: r##"When `a` is `&[T]`, detect `a.len() * size_of::<T>()` and suggest `size_of_val(a)`
19940instead."##,
19941 default_severity: Severity::Allow,
19942 warn_since: None,
19943 deny_since: None,
19944 },
19945 Lint {
19946 label: "clippy::manual_split_once",
19947 description: r##"Checks for usage of `str::splitn(2, _)`"##,
19948 default_severity: Severity::Allow,
19949 warn_since: None,
19950 deny_since: None,
19951 },
19952 Lint {
19953 label: "clippy::manual_str_repeat",
19954 description: r##"Checks for manual implementations of `str::repeat`"##,
19955 default_severity: Severity::Allow,
19956 warn_since: None,
19957 deny_since: None,
19958 },
19959 Lint {
19960 label: "clippy::manual_string_new",
19961 description: r##"Checks for usage of `` to create a `String`, such as `.to_string()`, `.to_owned()`,
19962`String::from()` and others."##,
19963 default_severity: Severity::Allow,
19964 warn_since: None,
19965 deny_since: None,
19966 },
19967 Lint {
19968 label: "clippy::manual_strip",
19969 description: r##"Suggests using `strip_{prefix,suffix}` over `str::{starts,ends}_with` and slicing using
19970the pattern's length."##,
19971 default_severity: Severity::Allow,
19972 warn_since: None,
19973 deny_since: None,
19974 },
19975 Lint {
19976 label: "clippy::manual_swap",
19977 description: r##"Checks for manual swapping.
19978
19979Note that the lint will not be emitted in const blocks, as the suggestion would not be applicable."##,
19980 default_severity: Severity::Allow,
19981 warn_since: None,
19982 deny_since: None,
19983 },
19984 Lint {
19985 label: "clippy::manual_try_fold",
19986 description: r##"Checks for usage of `Iterator::fold` with a type that implements `Try`."##,
19987 default_severity: Severity::Allow,
19988 warn_since: None,
19989 deny_since: None,
19990 },
19991 Lint {
19992 label: "clippy::manual_unwrap_or",
19993 description: r##"Finds patterns that reimplement `Option::unwrap_or` or `Result::unwrap_or`."##,
19994 default_severity: Severity::Allow,
19995 warn_since: None,
19996 deny_since: None,
19997 },
19998 Lint {
19999 label: "clippy::manual_unwrap_or_default",
20000 description: r##"Checks if a `match` or `if let` expression can be simplified using
20001`.unwrap_or_default()`."##,
20002 default_severity: Severity::Allow,
20003 warn_since: None,
20004 deny_since: None,
20005 },
20006 Lint {
20007 label: "clippy::manual_while_let_some",
20008 description: r##"Looks for loops that check for emptiness of a `Vec` in the condition and pop an element
20009in the body as a separate operation."##,
20010 default_severity: Severity::Allow,
20011 warn_since: None,
20012 deny_since: None,
20013 },
20014 Lint {
20015 label: "clippy::many_single_char_names",
20016 description: r##"Checks for too many variables whose name consists of a
20017single character."##,
20018 default_severity: Severity::Allow,
20019 warn_since: None,
20020 deny_since: None,
20021 },
20022 Lint {
20023 label: "clippy::map_clone",
20024 description: r##"Checks for usage of `map(|x| x.clone())` or
20025dereferencing closures for `Copy` types, on `Iterator` or `Option`,
20026and suggests `cloned()` or `copied()` instead"##,
20027 default_severity: Severity::Allow,
20028 warn_since: None,
20029 deny_since: None,
20030 },
20031 Lint {
20032 label: "clippy::map_collect_result_unit",
20033 description: r##"Checks for usage of `_.map(_).collect::<Result<(), _>()`."##,
20034 default_severity: Severity::Allow,
20035 warn_since: None,
20036 deny_since: None,
20037 },
20038 Lint {
20039 label: "clippy::map_entry",
20040 description: r##"Checks for usage of `contains_key` + `insert` on `HashMap`
20041or `BTreeMap`."##,
20042 default_severity: Severity::Allow,
20043 warn_since: None,
20044 deny_since: None,
20045 },
20046 Lint {
20047 label: "clippy::map_err_ignore",
20048 description: r##"Checks for instances of `map_err(|_| Some::Enum)`"##,
20049 default_severity: Severity::Allow,
20050 warn_since: None,
20051 deny_since: None,
20052 },
20053 Lint {
20054 label: "clippy::map_flatten",
20055 description: r##"Checks for usage of `_.map(_).flatten(_)` on `Iterator` and `Option`"##,
20056 default_severity: Severity::Allow,
20057 warn_since: None,
20058 deny_since: None,
20059 },
20060 Lint {
20061 label: "clippy::map_identity",
20062 description: r##"Checks for instances of `map(f)` where `f` is the identity function."##,
20063 default_severity: Severity::Allow,
20064 warn_since: None,
20065 deny_since: None,
20066 },
20067 Lint {
20068 label: "clippy::map_unwrap_or",
20069 description: r##"Checks for usage of `option.map(_).unwrap_or(_)` or `option.map(_).unwrap_or_else(_)` or
20070`result.map(_).unwrap_or_else(_)`."##,
20071 default_severity: Severity::Allow,
20072 warn_since: None,
20073 deny_since: None,
20074 },
20075 Lint {
20076 label: "clippy::match_as_ref",
20077 description: r##"Checks for match which is used to add a reference to an
20078`Option` value."##,
20079 default_severity: Severity::Allow,
20080 warn_since: None,
20081 deny_since: None,
20082 },
20083 Lint {
20084 label: "clippy::match_bool",
20085 description: r##"Checks for matches where match expression is a `bool`. It
20086suggests to replace the expression with an `if...else` block."##,
20087 default_severity: Severity::Allow,
20088 warn_since: None,
20089 deny_since: None,
20090 },
20091 Lint {
20092 label: "clippy::match_like_matches_macro",
20093 description: r##"Checks for `match` or `if let` expressions producing a
20094`bool` that could be written using `matches!`"##,
20095 default_severity: Severity::Allow,
20096 warn_since: None,
20097 deny_since: None,
20098 },
20099 Lint {
20100 label: "clippy::match_on_vec_items",
20101 description: r##"Checks for `match vec[idx]` or `match vec[n..m]`."##,
20102 default_severity: Severity::Allow,
20103 warn_since: None,
20104 deny_since: None,
20105 },
20106 Lint {
20107 label: "clippy::match_overlapping_arm",
20108 description: r##"Checks for overlapping match arms."##,
20109 default_severity: Severity::Allow,
20110 warn_since: None,
20111 deny_since: None,
20112 },
20113 Lint {
20114 label: "clippy::match_ref_pats",
20115 description: r##"Checks for matches where all arms match a reference,
20116suggesting to remove the reference and deref the matched expression
20117instead. It also checks for `if let &foo = bar` blocks."##,
20118 default_severity: Severity::Allow,
20119 warn_since: None,
20120 deny_since: None,
20121 },
20122 Lint {
20123 label: "clippy::match_result_ok",
20124 description: r##"Checks for unnecessary `ok()` in `while let`."##,
20125 default_severity: Severity::Allow,
20126 warn_since: None,
20127 deny_since: None,
20128 },
20129 Lint {
20130 label: "clippy::match_same_arms",
20131 description: r##"Checks for `match` with identical arm bodies.
20132
20133Note: Does not lint on wildcards if the `non_exhaustive_omitted_patterns_lint` feature is
20134enabled and disallowed."##,
20135 default_severity: Severity::Allow,
20136 warn_since: None,
20137 deny_since: None,
20138 },
20139 Lint {
20140 label: "clippy::match_single_binding",
20141 description: r##"Checks for useless match that binds to only one value."##,
20142 default_severity: Severity::Allow,
20143 warn_since: None,
20144 deny_since: None,
20145 },
20146 Lint {
20147 label: "clippy::match_str_case_mismatch",
20148 description: r##"Checks for `match` expressions modifying the case of a string with non-compliant arms"##,
20149 default_severity: Severity::Allow,
20150 warn_since: None,
20151 deny_since: None,
20152 },
20153 Lint {
20154 label: "clippy::match_wild_err_arm",
20155 description: r##"Checks for arm which matches all errors with `Err(_)`
20156and take drastic actions like `panic!`."##,
20157 default_severity: Severity::Allow,
20158 warn_since: None,
20159 deny_since: None,
20160 },
20161 Lint {
20162 label: "clippy::match_wildcard_for_single_variants",
20163 description: r##"Checks for wildcard enum matches for a single variant."##,
20164 default_severity: Severity::Allow,
20165 warn_since: None,
20166 deny_since: None,
20167 },
20168 Lint {
20169 label: "clippy::maybe_infinite_iter",
20170 description: r##"Checks for iteration that may be infinite."##,
20171 default_severity: Severity::Allow,
20172 warn_since: None,
20173 deny_since: None,
20174 },
20175 Lint {
20176 label: "clippy::mem_forget",
20177 description: r##"Checks for usage of `std::mem::forget(t)` where `t` is
20178`Drop` or has a field that implements `Drop`."##,
20179 default_severity: Severity::Allow,
20180 warn_since: None,
20181 deny_since: None,
20182 },
20183 Lint {
20184 label: "clippy::mem_replace_option_with_none",
20185 description: r##"Checks for `mem::replace()` on an `Option` with
20186`None`."##,
20187 default_severity: Severity::Allow,
20188 warn_since: None,
20189 deny_since: None,
20190 },
20191 Lint {
20192 label: "clippy::mem_replace_with_default",
20193 description: r##"Checks for `std::mem::replace` on a value of type
20194`T` with `T::default()`."##,
20195 default_severity: Severity::Allow,
20196 warn_since: None,
20197 deny_since: None,
20198 },
20199 Lint {
20200 label: "clippy::mem_replace_with_uninit",
20201 description: r##"Checks for `mem::replace(&mut _, mem::uninitialized())`
20202and `mem::replace(&mut _, mem::zeroed())`."##,
20203 default_severity: Severity::Allow,
20204 warn_since: None,
20205 deny_since: None,
20206 },
20207 Lint {
20208 label: "clippy::min_ident_chars",
20209 description: r##"Checks for identifiers which consist of a single character (or fewer than the configured threshold).
20210
20211Note: This lint can be very noisy when enabled; it may be desirable to only enable it
20212temporarily."##,
20213 default_severity: Severity::Allow,
20214 warn_since: None,
20215 deny_since: None,
20216 },
20217 Lint {
20218 label: "clippy::min_max",
20219 description: r##"Checks for expressions where `std::cmp::min` and `max` are
20220used to clamp values, but switched so that the result is constant."##,
20221 default_severity: Severity::Allow,
20222 warn_since: None,
20223 deny_since: None,
20224 },
20225 Lint {
20226 label: "clippy::misaligned_transmute",
20227 description: r##"Nothing. This lint has been deprecated"##,
20228 default_severity: Severity::Allow,
20229 warn_since: None,
20230 deny_since: None,
20231 },
20232 Lint {
20233 label: "clippy::mismatching_type_param_order",
20234 description: r##"Checks for type parameters which are positioned inconsistently between
20235a type definition and impl block. Specifically, a parameter in an impl
20236block which has the same name as a parameter in the type def, but is in
20237a different place."##,
20238 default_severity: Severity::Allow,
20239 warn_since: None,
20240 deny_since: None,
20241 },
20242 Lint {
20243 label: "clippy::misnamed_getters",
20244 description: r##"Checks for getter methods that return a field that doesn't correspond
20245to the name of the method, when there is a field's whose name matches that of the method."##,
20246 default_severity: Severity::Allow,
20247 warn_since: None,
20248 deny_since: None,
20249 },
20250 Lint {
20251 label: "clippy::misrefactored_assign_op",
20252 description: r##"Checks for `a op= a op b` or `a op= b op a` patterns."##,
20253 default_severity: Severity::Allow,
20254 warn_since: None,
20255 deny_since: None,
20256 },
20257 Lint {
20258 label: "clippy::missing_assert_message",
20259 description: r##"Checks assertions without a custom panic message."##,
20260 default_severity: Severity::Allow,
20261 warn_since: None,
20262 deny_since: None,
20263 },
20264 Lint {
20265 label: "clippy::missing_asserts_for_indexing",
20266 description: r##"Checks for repeated slice indexing without asserting beforehand that the length
20267is greater than the largest index used to index into the slice."##,
20268 default_severity: Severity::Allow,
20269 warn_since: None,
20270 deny_since: None,
20271 },
20272 Lint {
20273 label: "clippy::missing_const_for_fn",
20274 description: r##"Suggests the use of `const` in functions and methods where possible."##,
20275 default_severity: Severity::Allow,
20276 warn_since: None,
20277 deny_since: None,
20278 },
20279 Lint {
20280 label: "clippy::missing_const_for_thread_local",
20281 description: r##"Suggests to use `const` in `thread_local!` macro if possible."##,
20282 default_severity: Severity::Allow,
20283 warn_since: None,
20284 deny_since: None,
20285 },
20286 Lint {
20287 label: "clippy::missing_docs_in_private_items",
20288 description: r##"Warns if there is missing documentation for any private documentable item."##,
20289 default_severity: Severity::Allow,
20290 warn_since: None,
20291 deny_since: None,
20292 },
20293 Lint {
20294 label: "clippy::missing_enforced_import_renames",
20295 description: r##"Checks for imports that do not rename the item as specified
20296in the `enforced-import-renames` config option.
20297
20298Note: Even though this lint is warn-by-default, it will only trigger if
20299import renames are defined in the `clippy.toml` file."##,
20300 default_severity: Severity::Allow,
20301 warn_since: None,
20302 deny_since: None,
20303 },
20304 Lint {
20305 label: "clippy::missing_errors_doc",
20306 description: r##"Checks the doc comments of publicly visible functions that
20307return a `Result` type and warns if there is no `# Errors` section."##,
20308 default_severity: Severity::Allow,
20309 warn_since: None,
20310 deny_since: None,
20311 },
20312 Lint {
20313 label: "clippy::missing_fields_in_debug",
20314 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."##,
20315 default_severity: Severity::Allow,
20316 warn_since: None,
20317 deny_since: None,
20318 },
20319 Lint {
20320 label: "clippy::missing_inline_in_public_items",
20321 description: r##"It lints if an exported function, method, trait method with default impl,
20322or trait method impl is not `#[inline]`."##,
20323 default_severity: Severity::Allow,
20324 warn_since: None,
20325 deny_since: None,
20326 },
20327 Lint {
20328 label: "clippy::missing_panics_doc",
20329 description: r##"Checks the doc comments of publicly visible functions that
20330may panic and warns if there is no `# Panics` section."##,
20331 default_severity: Severity::Allow,
20332 warn_since: None,
20333 deny_since: None,
20334 },
20335 Lint {
20336 label: "clippy::missing_safety_doc",
20337 description: r##"Checks for the doc comments of publicly visible
20338unsafe functions and warns if there is no `# Safety` section."##,
20339 default_severity: Severity::Allow,
20340 warn_since: None,
20341 deny_since: None,
20342 },
20343 Lint {
20344 label: "clippy::missing_spin_loop",
20345 description: r##"Checks for empty spin loops"##,
20346 default_severity: Severity::Allow,
20347 warn_since: None,
20348 deny_since: None,
20349 },
20350 Lint {
20351 label: "clippy::missing_trait_methods",
20352 description: r##"Checks if a provided method is used implicitly by a trait
20353implementation."##,
20354 default_severity: Severity::Allow,
20355 warn_since: None,
20356 deny_since: None,
20357 },
20358 Lint {
20359 label: "clippy::missing_transmute_annotations",
20360 description: r##"Checks if transmute calls have all generics specified."##,
20361 default_severity: Severity::Allow,
20362 warn_since: None,
20363 deny_since: None,
20364 },
20365 Lint {
20366 label: "clippy::mistyped_literal_suffixes",
20367 description: r##"Warns for mistyped suffix in literals"##,
20368 default_severity: Severity::Allow,
20369 warn_since: None,
20370 deny_since: None,
20371 },
20372 Lint {
20373 label: "clippy::mixed_attributes_style",
20374 description: r##"Checks for items that have the same kind of attributes with mixed styles (inner/outer)."##,
20375 default_severity: Severity::Allow,
20376 warn_since: None,
20377 deny_since: None,
20378 },
20379 Lint {
20380 label: "clippy::mixed_case_hex_literals",
20381 description: r##"Warns on hexadecimal literals with mixed-case letter
20382digits."##,
20383 default_severity: Severity::Allow,
20384 warn_since: None,
20385 deny_since: None,
20386 },
20387 Lint {
20388 label: "clippy::mixed_read_write_in_expression",
20389 description: r##"Checks for a read and a write to the same variable where
20390whether the read occurs before or after the write depends on the evaluation
20391order of sub-expressions."##,
20392 default_severity: Severity::Allow,
20393 warn_since: None,
20394 deny_since: None,
20395 },
20396 Lint {
20397 label: "clippy::mod_module_files",
20398 description: r##"Checks that module layout uses only self named module files; bans `mod.rs` files."##,
20399 default_severity: Severity::Allow,
20400 warn_since: None,
20401 deny_since: None,
20402 },
20403 Lint {
20404 label: "clippy::module_inception",
20405 description: r##"Checks for modules that have the same name as their
20406parent module"##,
20407 default_severity: Severity::Allow,
20408 warn_since: None,
20409 deny_since: None,
20410 },
20411 Lint {
20412 label: "clippy::module_name_repetitions",
20413 description: r##"Detects type names that are prefixed or suffixed by the
20414containing module's name."##,
20415 default_severity: Severity::Allow,
20416 warn_since: None,
20417 deny_since: None,
20418 },
20419 Lint {
20420 label: "clippy::modulo_arithmetic",
20421 description: r##"Checks for modulo arithmetic."##,
20422 default_severity: Severity::Allow,
20423 warn_since: None,
20424 deny_since: None,
20425 },
20426 Lint {
20427 label: "clippy::modulo_one",
20428 description: r##"Checks for getting the remainder of integer division by one or minus
20429one."##,
20430 default_severity: Severity::Allow,
20431 warn_since: None,
20432 deny_since: None,
20433 },
20434 Lint {
20435 label: "clippy::multi_assignments",
20436 description: r##"Checks for nested assignments."##,
20437 default_severity: Severity::Allow,
20438 warn_since: None,
20439 deny_since: None,
20440 },
20441 Lint {
20442 label: "clippy::multiple_bound_locations",
20443 description: r##"Check if a generic is defined both in the bound predicate and in the `where` clause."##,
20444 default_severity: Severity::Allow,
20445 warn_since: None,
20446 deny_since: None,
20447 },
20448 Lint {
20449 label: "clippy::multiple_crate_versions",
20450 description: r##"Checks to see if multiple versions of a crate are being
20451used."##,
20452 default_severity: Severity::Allow,
20453 warn_since: None,
20454 deny_since: None,
20455 },
20456 Lint {
20457 label: "clippy::multiple_inherent_impl",
20458 description: r##"Checks for multiple inherent implementations of a struct"##,
20459 default_severity: Severity::Allow,
20460 warn_since: None,
20461 deny_since: None,
20462 },
20463 Lint {
20464 label: "clippy::multiple_unsafe_ops_per_block",
20465 description: r##"Checks for `unsafe` blocks that contain more than one unsafe operation."##,
20466 default_severity: Severity::Allow,
20467 warn_since: None,
20468 deny_since: None,
20469 },
20470 Lint {
20471 label: "clippy::must_use_candidate",
20472 description: r##"Checks for public functions that have no
20473`#[must_use]` attribute, but return something not already marked
20474must-use, have no mutable arg and mutate no statics."##,
20475 default_severity: Severity::Allow,
20476 warn_since: None,
20477 deny_since: None,
20478 },
20479 Lint {
20480 label: "clippy::must_use_unit",
20481 description: r##"Checks for a `#[must_use]` attribute on
20482unit-returning functions and methods."##,
20483 default_severity: Severity::Allow,
20484 warn_since: None,
20485 deny_since: None,
20486 },
20487 Lint {
20488 label: "clippy::mut_from_ref",
20489 description: r##"This lint checks for functions that take immutable references and return
20490mutable ones. This will not trigger if no unsafe code exists as there
20491are multiple safe functions which will do this transformation
20492
20493To be on the conservative side, if there's at least one mutable
20494reference with the output lifetime, this lint will not trigger."##,
20495 default_severity: Severity::Allow,
20496 warn_since: None,
20497 deny_since: None,
20498 },
20499 Lint {
20500 label: "clippy::mut_mut",
20501 description: r##"Checks for instances of `mut mut` references."##,
20502 default_severity: Severity::Allow,
20503 warn_since: None,
20504 deny_since: None,
20505 },
20506 Lint {
20507 label: "clippy::mut_mutex_lock",
20508 description: r##"Checks for `&mut Mutex::lock` calls"##,
20509 default_severity: Severity::Allow,
20510 warn_since: None,
20511 deny_since: None,
20512 },
20513 Lint {
20514 label: "clippy::mut_range_bound",
20515 description: r##"Checks for loops with a range bound that is a mutable variable."##,
20516 default_severity: Severity::Allow,
20517 warn_since: None,
20518 deny_since: None,
20519 },
20520 Lint {
20521 label: "clippy::mutable_key_type",
20522 description: r##"Checks for sets/maps with mutable key types."##,
20523 default_severity: Severity::Allow,
20524 warn_since: None,
20525 deny_since: None,
20526 },
20527 Lint {
20528 label: "clippy::mutex_atomic",
20529 description: r##"Checks for usage of `Mutex<X>` where an atomic will do."##,
20530 default_severity: Severity::Allow,
20531 warn_since: None,
20532 deny_since: None,
20533 },
20534 Lint {
20535 label: "clippy::mutex_integer",
20536 description: r##"Checks for usage of `Mutex<X>` where `X` is an integral
20537type."##,
20538 default_severity: Severity::Allow,
20539 warn_since: None,
20540 deny_since: None,
20541 },
20542 Lint {
20543 label: "clippy::naive_bytecount",
20544 description: r##"Checks for naive byte counts"##,
20545 default_severity: Severity::Allow,
20546 warn_since: None,
20547 deny_since: None,
20548 },
20549 Lint {
20550 label: "clippy::needless_arbitrary_self_type",
20551 description: r##"The lint checks for `self` in fn parameters that
20552specify the `Self`-type explicitly"##,
20553 default_severity: Severity::Allow,
20554 warn_since: None,
20555 deny_since: None,
20556 },
20557 Lint {
20558 label: "clippy::needless_bitwise_bool",
20559 description: r##"Checks for usage of bitwise and/or operators between booleans, where performance may be improved by using
20560a lazy and."##,
20561 default_severity: Severity::Allow,
20562 warn_since: None,
20563 deny_since: None,
20564 },
20565 Lint {
20566 label: "clippy::needless_bool",
20567 description: r##"Checks for expressions of the form `if c { true } else {
20568false }` (or vice versa) and suggests using the condition directly."##,
20569 default_severity: Severity::Allow,
20570 warn_since: None,
20571 deny_since: None,
20572 },
20573 Lint {
20574 label: "clippy::needless_bool_assign",
20575 description: r##"Checks for expressions of the form `if c { x = true } else { x = false }`
20576(or vice versa) and suggest assigning the variable directly from the
20577condition."##,
20578 default_severity: Severity::Allow,
20579 warn_since: None,
20580 deny_since: None,
20581 },
20582 Lint {
20583 label: "clippy::needless_borrow",
20584 description: r##"Checks for address of operations (`&`) that are going to
20585be dereferenced immediately by the compiler."##,
20586 default_severity: Severity::Allow,
20587 warn_since: None,
20588 deny_since: None,
20589 },
20590 Lint {
20591 label: "clippy::needless_borrowed_reference",
20592 description: r##"Checks for bindings that needlessly destructure a reference and borrow the inner
20593value with `&ref`."##,
20594 default_severity: Severity::Allow,
20595 warn_since: None,
20596 deny_since: None,
20597 },
20598 Lint {
20599 label: "clippy::needless_borrows_for_generic_args",
20600 description: r##"Checks for borrow operations (`&`) that are used as a generic argument to a
20601function when the borrowed value could be used."##,
20602 default_severity: Severity::Allow,
20603 warn_since: None,
20604 deny_since: None,
20605 },
20606 Lint {
20607 label: "clippy::needless_character_iteration",
20608 description: r##"Checks if an iterator is used to check if a string is ascii."##,
20609 default_severity: Severity::Allow,
20610 warn_since: None,
20611 deny_since: None,
20612 },
20613 Lint {
20614 label: "clippy::needless_collect",
20615 description: r##"Checks for functions collecting an iterator when collect
20616is not needed."##,
20617 default_severity: Severity::Allow,
20618 warn_since: None,
20619 deny_since: None,
20620 },
20621 Lint {
20622 label: "clippy::needless_continue",
20623 description: r##"The lint checks for `if`-statements appearing in loops
20624that contain a `continue` statement in either their main blocks or their
20625`else`-blocks, when omitting the `else`-block possibly with some
20626rearrangement of code can make the code easier to understand."##,
20627 default_severity: Severity::Allow,
20628 warn_since: None,
20629 deny_since: None,
20630 },
20631 Lint {
20632 label: "clippy::needless_doctest_main",
20633 description: r##"Checks for `fn main() { .. }` in doctests"##,
20634 default_severity: Severity::Allow,
20635 warn_since: None,
20636 deny_since: None,
20637 },
20638 Lint {
20639 label: "clippy::needless_else",
20640 description: r##"Checks for empty `else` branches."##,
20641 default_severity: Severity::Allow,
20642 warn_since: None,
20643 deny_since: None,
20644 },
20645 Lint {
20646 label: "clippy::needless_for_each",
20647 description: r##"Checks for usage of `for_each` that would be more simply written as a
20648`for` loop."##,
20649 default_severity: Severity::Allow,
20650 warn_since: None,
20651 deny_since: None,
20652 },
20653 Lint {
20654 label: "clippy::needless_if",
20655 description: r##"Checks for empty `if` branches with no else branch."##,
20656 default_severity: Severity::Allow,
20657 warn_since: None,
20658 deny_since: None,
20659 },
20660 Lint {
20661 label: "clippy::needless_late_init",
20662 description: r##"Checks for late initializations that can be replaced by a `let` statement
20663with an initializer."##,
20664 default_severity: Severity::Allow,
20665 warn_since: None,
20666 deny_since: None,
20667 },
20668 Lint {
20669 label: "clippy::needless_lifetimes",
20670 description: r##"Checks for lifetime annotations which can be removed by
20671relying on lifetime elision."##,
20672 default_severity: Severity::Allow,
20673 warn_since: None,
20674 deny_since: None,
20675 },
20676 Lint {
20677 label: "clippy::needless_match",
20678 description: r##"Checks for unnecessary `match` or match-like `if let` returns for `Option` and `Result`
20679when function signatures are the same."##,
20680 default_severity: Severity::Allow,
20681 warn_since: None,
20682 deny_since: None,
20683 },
20684 Lint {
20685 label: "clippy::needless_maybe_sized",
20686 description: r##"Lints `?Sized` bounds applied to type parameters that cannot be unsized"##,
20687 default_severity: Severity::Allow,
20688 warn_since: None,
20689 deny_since: None,
20690 },
20691 Lint {
20692 label: "clippy::needless_option_as_deref",
20693 description: r##"Checks for no-op uses of `Option::{as_deref, as_deref_mut}`,
20694for example, `Option<&T>::as_deref()` returns the same type."##,
20695 default_severity: Severity::Allow,
20696 warn_since: None,
20697 deny_since: None,
20698 },
20699 Lint {
20700 label: "clippy::needless_option_take",
20701 description: r##"Checks for calling `take` function after `as_ref`."##,
20702 default_severity: Severity::Allow,
20703 warn_since: None,
20704 deny_since: None,
20705 },
20706 Lint {
20707 label: "clippy::needless_parens_on_range_literals",
20708 description: r##"The lint checks for parenthesis on literals in range statements that are
20709superfluous."##,
20710 default_severity: Severity::Allow,
20711 warn_since: None,
20712 deny_since: None,
20713 },
20714 Lint {
20715 label: "clippy::needless_pass_by_ref_mut",
20716 description: r##"Check if a `&mut` function argument is actually used mutably.
20717
20718Be careful if the function is publicly reexported as it would break compatibility with
20719users of this function, when the users pass this function as an argument."##,
20720 default_severity: Severity::Allow,
20721 warn_since: None,
20722 deny_since: None,
20723 },
20724 Lint {
20725 label: "clippy::needless_pass_by_value",
20726 description: r##"Checks for functions taking arguments by value, but not
20727consuming them in its
20728body."##,
20729 default_severity: Severity::Allow,
20730 warn_since: None,
20731 deny_since: None,
20732 },
20733 Lint {
20734 label: "clippy::needless_pub_self",
20735 description: r##"Checks for usage of `pub(self)` and `pub(in self)`."##,
20736 default_severity: Severity::Allow,
20737 warn_since: None,
20738 deny_since: None,
20739 },
20740 Lint {
20741 label: "clippy::needless_question_mark",
20742 description: r##"Suggests alternatives for useless applications of `?` in terminating expressions"##,
20743 default_severity: Severity::Allow,
20744 warn_since: None,
20745 deny_since: None,
20746 },
20747 Lint {
20748 label: "clippy::needless_range_loop",
20749 description: r##"Checks for looping over the range of `0..len` of some
20750collection just to get the values by index."##,
20751 default_severity: Severity::Allow,
20752 warn_since: None,
20753 deny_since: None,
20754 },
20755 Lint {
20756 label: "clippy::needless_raw_string_hashes",
20757 description: r##"Checks for raw string literals with an unnecessary amount of hashes around them."##,
20758 default_severity: Severity::Allow,
20759 warn_since: None,
20760 deny_since: None,
20761 },
20762 Lint {
20763 label: "clippy::needless_raw_strings",
20764 description: r##"Checks for raw string literals where a string literal can be used instead."##,
20765 default_severity: Severity::Allow,
20766 warn_since: None,
20767 deny_since: None,
20768 },
20769 Lint {
20770 label: "clippy::needless_return",
20771 description: r##"Checks for return statements at the end of a block."##,
20772 default_severity: Severity::Allow,
20773 warn_since: None,
20774 deny_since: None,
20775 },
20776 Lint {
20777 label: "clippy::needless_return_with_question_mark",
20778 description: r##"Checks for return statements on `Err` paired with the `?` operator."##,
20779 default_severity: Severity::Allow,
20780 warn_since: None,
20781 deny_since: None,
20782 },
20783 Lint {
20784 label: "clippy::needless_splitn",
20785 description: r##"Checks for usage of `str::splitn` (or `str::rsplitn`) where using `str::split` would be the same."##,
20786 default_severity: Severity::Allow,
20787 warn_since: None,
20788 deny_since: None,
20789 },
20790 Lint {
20791 label: "clippy::needless_update",
20792 description: r##"Checks for needlessly including a base struct on update
20793when all fields are changed anyway.
20794
20795This lint is not applied to structs marked with
20796[non_exhaustive](https://doc.rust-lang.org/reference/attributes/type_system.html)."##,
20797 default_severity: Severity::Allow,
20798 warn_since: None,
20799 deny_since: None,
20800 },
20801 Lint {
20802 label: "clippy::neg_cmp_op_on_partial_ord",
20803 description: r##"Checks for the usage of negated comparison operators on types which only implement
20804`PartialOrd` (e.g., `f64`)."##,
20805 default_severity: Severity::Allow,
20806 warn_since: None,
20807 deny_since: None,
20808 },
20809 Lint {
20810 label: "clippy::neg_multiply",
20811 description: r##"Checks for multiplication by -1 as a form of negation."##,
20812 default_severity: Severity::Allow,
20813 warn_since: None,
20814 deny_since: None,
20815 },
20816 Lint {
20817 label: "clippy::negative_feature_names",
20818 description: r##"Checks for negative feature names with prefix `no-` or `not-`"##,
20819 default_severity: Severity::Allow,
20820 warn_since: None,
20821 deny_since: None,
20822 },
20823 Lint {
20824 label: "clippy::never_loop",
20825 description: r##"Checks for loops that will always `break`, `return` or
20826`continue` an outer loop."##,
20827 default_severity: Severity::Allow,
20828 warn_since: None,
20829 deny_since: None,
20830 },
20831 Lint {
20832 label: "clippy::new_ret_no_self",
20833 description: r##"Checks for `new` not returning a type that contains `Self`."##,
20834 default_severity: Severity::Allow,
20835 warn_since: None,
20836 deny_since: None,
20837 },
20838 Lint {
20839 label: "clippy::new_without_default",
20840 description: r##"Checks for public types with a `pub fn new() -> Self` method and no
20841implementation of
20842[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html)."##,
20843 default_severity: Severity::Allow,
20844 warn_since: None,
20845 deny_since: None,
20846 },
20847 Lint {
20848 label: "clippy::no_effect",
20849 description: r##"Checks for statements which have no effect."##,
20850 default_severity: Severity::Allow,
20851 warn_since: None,
20852 deny_since: None,
20853 },
20854 Lint {
20855 label: "clippy::no_effect_replace",
20856 description: r##"Checks for `replace` statements which have no effect."##,
20857 default_severity: Severity::Allow,
20858 warn_since: None,
20859 deny_since: None,
20860 },
20861 Lint {
20862 label: "clippy::no_effect_underscore_binding",
20863 description: r##"Checks for binding to underscore prefixed variable without side-effects."##,
20864 default_severity: Severity::Allow,
20865 warn_since: None,
20866 deny_since: None,
20867 },
20868 Lint {
20869 label: "clippy::no_mangle_with_rust_abi",
20870 description: r##"Checks for Rust ABI functions with the `#[no_mangle]` attribute."##,
20871 default_severity: Severity::Allow,
20872 warn_since: None,
20873 deny_since: None,
20874 },
20875 Lint {
20876 label: "clippy::non_ascii_literal",
20877 description: r##"Checks for non-ASCII characters in string and char literals."##,
20878 default_severity: Severity::Allow,
20879 warn_since: None,
20880 deny_since: None,
20881 },
20882 Lint {
20883 label: "clippy::non_canonical_clone_impl",
20884 description: r##"Checks for non-canonical implementations of `Clone` when `Copy` is already implemented."##,
20885 default_severity: Severity::Allow,
20886 warn_since: None,
20887 deny_since: None,
20888 },
20889 Lint {
20890 label: "clippy::non_canonical_partial_ord_impl",
20891 description: r##"Checks for non-canonical implementations of `PartialOrd` when `Ord` is already implemented."##,
20892 default_severity: Severity::Allow,
20893 warn_since: None,
20894 deny_since: None,
20895 },
20896 Lint {
20897 label: "clippy::non_minimal_cfg",
20898 description: r##"Checks for `any` and `all` combinators in `cfg` with only one condition."##,
20899 default_severity: Severity::Allow,
20900 warn_since: None,
20901 deny_since: None,
20902 },
20903 Lint {
20904 label: "clippy::non_octal_unix_permissions",
20905 description: r##"Checks for non-octal values used to set Unix file permissions."##,
20906 default_severity: Severity::Allow,
20907 warn_since: None,
20908 deny_since: None,
20909 },
20910 Lint {
20911 label: "clippy::non_send_fields_in_send_ty",
20912 description: r##"This lint warns about a `Send` implementation for a type that
20913contains fields that are not safe to be sent across threads.
20914It tries to detect fields that can cause a soundness issue
20915when sent to another thread (e.g., `Rc`) while allowing `!Send` fields
20916that are expected to exist in a `Send` type, such as raw pointers."##,
20917 default_severity: Severity::Allow,
20918 warn_since: None,
20919 deny_since: None,
20920 },
20921 Lint {
20922 label: "clippy::non_zero_suggestions",
20923 description: r##"Checks for conversions from `NonZero` types to regular integer types,
20924and suggests using `NonZero` types for the target as well."##,
20925 default_severity: Severity::Allow,
20926 warn_since: None,
20927 deny_since: None,
20928 },
20929 Lint {
20930 label: "clippy::nonminimal_bool",
20931 description: r##"Checks for boolean expressions that can be written more
20932concisely."##,
20933 default_severity: Severity::Allow,
20934 warn_since: None,
20935 deny_since: None,
20936 },
20937 Lint {
20938 label: "clippy::nonsensical_open_options",
20939 description: r##"Checks for duplicate open options as well as combinations
20940that make no sense."##,
20941 default_severity: Severity::Allow,
20942 warn_since: None,
20943 deny_since: None,
20944 },
20945 Lint {
20946 label: "clippy::nonstandard_macro_braces",
20947 description: r##"Checks that common macros are used with consistent bracing."##,
20948 default_severity: Severity::Allow,
20949 warn_since: None,
20950 deny_since: None,
20951 },
20952 Lint {
20953 label: "clippy::not_unsafe_ptr_arg_deref",
20954 description: r##"Checks for public functions that dereference raw pointer
20955arguments but are not marked `unsafe`."##,
20956 default_severity: Severity::Allow,
20957 warn_since: None,
20958 deny_since: None,
20959 },
20960 Lint {
20961 label: "clippy::obfuscated_if_else",
20962 description: r##"Checks for usage of `.then_some(..).unwrap_or(..)`"##,
20963 default_severity: Severity::Allow,
20964 warn_since: None,
20965 deny_since: None,
20966 },
20967 Lint {
20968 label: "clippy::octal_escapes",
20969 description: r##"Checks for `\\0` escapes in string and byte literals that look like octal
20970character escapes in C."##,
20971 default_severity: Severity::Allow,
20972 warn_since: None,
20973 deny_since: None,
20974 },
20975 Lint {
20976 label: "clippy::ok_expect",
20977 description: r##"Checks for usage of `ok().expect(..)`."##,
20978 default_severity: Severity::Allow,
20979 warn_since: None,
20980 deny_since: None,
20981 },
20982 Lint {
20983 label: "clippy::only_used_in_recursion",
20984 description: r##"Checks for arguments that are only used in recursion with no side-effects."##,
20985 default_severity: Severity::Allow,
20986 warn_since: None,
20987 deny_since: None,
20988 },
20989 Lint {
20990 label: "clippy::op_ref",
20991 description: r##"Checks for arguments to `==` which have their address
20992taken to satisfy a bound
20993and suggests to dereference the other argument instead"##,
20994 default_severity: Severity::Allow,
20995 warn_since: None,
20996 deny_since: None,
20997 },
20998 Lint {
20999 label: "clippy::option_as_ref_cloned",
21000 description: r##"Checks for usage of `.as_ref().cloned()` and `.as_mut().cloned()` on `Option`s"##,
21001 default_severity: Severity::Allow,
21002 warn_since: None,
21003 deny_since: None,
21004 },
21005 Lint {
21006 label: "clippy::option_as_ref_deref",
21007 description: r##"Checks for usage of `_.as_ref().map(Deref::deref)` or its aliases (such as String::as_str)."##,
21008 default_severity: Severity::Allow,
21009 warn_since: None,
21010 deny_since: None,
21011 },
21012 Lint {
21013 label: "clippy::option_env_unwrap",
21014 description: r##"Checks for usage of `option_env!(...).unwrap()` and
21015suggests usage of the `env!` macro."##,
21016 default_severity: Severity::Allow,
21017 warn_since: None,
21018 deny_since: None,
21019 },
21020 Lint {
21021 label: "clippy::option_filter_map",
21022 description: r##"Checks for iterators of `Option`s using `.filter(Option::is_some).map(Option::unwrap)` that may
21023be replaced with a `.flatten()` call."##,
21024 default_severity: Severity::Allow,
21025 warn_since: None,
21026 deny_since: None,
21027 },
21028 Lint {
21029 label: "clippy::option_if_let_else",
21030 description: r##"Lints usage of `if let Some(v) = ... { y } else { x }` and
21031`match .. { Some(v) => y, None/_ => x }` which are more
21032idiomatically done with `Option::map_or` (if the else bit is a pure
21033expression) or `Option::map_or_else` (if the else bit is an impure
21034expression)."##,
21035 default_severity: Severity::Allow,
21036 warn_since: None,
21037 deny_since: None,
21038 },
21039 Lint {
21040 label: "clippy::option_map_or_err_ok",
21041 description: r##"Checks for usage of `_.map_or(Err(_), Ok)`."##,
21042 default_severity: Severity::Allow,
21043 warn_since: None,
21044 deny_since: None,
21045 },
21046 Lint {
21047 label: "clippy::option_map_or_none",
21048 description: r##"Checks for usage of `_.map_or(None, _)`."##,
21049 default_severity: Severity::Allow,
21050 warn_since: None,
21051 deny_since: None,
21052 },
21053 Lint {
21054 label: "clippy::option_map_unit_fn",
21055 description: r##"Checks for usage of `option.map(f)` where f is a function
21056or closure that returns the unit type `()`."##,
21057 default_severity: Severity::Allow,
21058 warn_since: None,
21059 deny_since: None,
21060 },
21061 Lint {
21062 label: "clippy::option_option",
21063 description: r##"Checks for usage of `Option<Option<_>>` in function signatures and type
21064definitions"##,
21065 default_severity: Severity::Allow,
21066 warn_since: None,
21067 deny_since: None,
21068 },
21069 Lint {
21070 label: "clippy::or_fun_call",
21071 description: r##"Checks for calls to `.or(foo(..))`, `.unwrap_or(foo(..))`,
21072`.or_insert(foo(..))` etc., and suggests to use `.or_else(|| foo(..))`,
21073`.unwrap_or_else(|| foo(..))`, `.unwrap_or_default()` or `.or_default()`
21074etc. instead."##,
21075 default_severity: Severity::Allow,
21076 warn_since: None,
21077 deny_since: None,
21078 },
21079 Lint {
21080 label: "clippy::or_then_unwrap",
21081 description: r##"Checks for `.or(…).unwrap()` calls to Options and Results."##,
21082 default_severity: Severity::Allow,
21083 warn_since: None,
21084 deny_since: None,
21085 },
21086 Lint {
21087 label: "clippy::out_of_bounds_indexing",
21088 description: r##"Checks for out of bounds array indexing with a constant
21089index."##,
21090 default_severity: Severity::Allow,
21091 warn_since: None,
21092 deny_since: None,
21093 },
21094 Lint {
21095 label: "clippy::overly_complex_bool_expr",
21096 description: r##"Checks for boolean expressions that contain terminals that
21097can be eliminated."##,
21098 default_severity: Severity::Allow,
21099 warn_since: None,
21100 deny_since: None,
21101 },
21102 Lint {
21103 label: "clippy::panic",
21104 description: r##"Checks for usage of `panic!`."##,
21105 default_severity: Severity::Allow,
21106 warn_since: None,
21107 deny_since: None,
21108 },
21109 Lint {
21110 label: "clippy::panic_in_result_fn",
21111 description: r##"Checks for usage of `panic!` or assertions in a function whose return type is `Result`."##,
21112 default_severity: Severity::Allow,
21113 warn_since: None,
21114 deny_since: None,
21115 },
21116 Lint {
21117 label: "clippy::panicking_overflow_checks",
21118 description: r##"Detects C-style underflow/overflow checks."##,
21119 default_severity: Severity::Allow,
21120 warn_since: None,
21121 deny_since: None,
21122 },
21123 Lint {
21124 label: "clippy::panicking_unwrap",
21125 description: r##"Checks for calls of `unwrap[_err]()` that will always fail."##,
21126 default_severity: Severity::Allow,
21127 warn_since: None,
21128 deny_since: None,
21129 },
21130 Lint {
21131 label: "clippy::partial_pub_fields",
21132 description: r##"Checks whether some but not all fields of a `struct` are public.
21133
21134Either make all fields of a type public, or make none of them public"##,
21135 default_severity: Severity::Allow,
21136 warn_since: None,
21137 deny_since: None,
21138 },
21139 Lint {
21140 label: "clippy::partialeq_ne_impl",
21141 description: r##"Checks for manual re-implementations of `PartialEq::ne`."##,
21142 default_severity: Severity::Allow,
21143 warn_since: None,
21144 deny_since: None,
21145 },
21146 Lint {
21147 label: "clippy::partialeq_to_none",
21148 description: r##"Checks for binary comparisons to a literal `Option::None`."##,
21149 default_severity: Severity::Allow,
21150 warn_since: None,
21151 deny_since: None,
21152 },
21153 Lint {
21154 label: "clippy::path_buf_push_overwrite",
21155 description: r##"* Checks for [push](https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.push)
21156calls on `PathBuf` that can cause overwrites."##,
21157 default_severity: Severity::Allow,
21158 warn_since: None,
21159 deny_since: None,
21160 },
21161 Lint {
21162 label: "clippy::path_ends_with_ext",
21163 description: r##"Looks for calls to `Path::ends_with` calls where the argument looks like a file extension.
21164
21165By default, Clippy has a short list of known filenames that start with a dot
21166but aren't necessarily file extensions (e.g. the `.git` folder), which are allowed by default.
21167The `allowed-dotfiles` configuration can be used to allow additional
21168file extensions that Clippy should not lint."##,
21169 default_severity: Severity::Allow,
21170 warn_since: None,
21171 deny_since: None,
21172 },
21173 Lint {
21174 label: "clippy::pathbuf_init_then_push",
21175 description: r##"Checks for calls to `push` immediately after creating a new `PathBuf`."##,
21176 default_severity: Severity::Allow,
21177 warn_since: None,
21178 deny_since: None,
21179 },
21180 Lint {
21181 label: "clippy::pattern_type_mismatch",
21182 description: r##"Checks for patterns that aren't exact representations of the types
21183they are applied to.
21184
21185To satisfy this lint, you will have to adjust either the expression that is matched
21186against or the pattern itself, as well as the bindings that are introduced by the
21187adjusted patterns. For matching you will have to either dereference the expression
21188with the `*` operator, or amend the patterns to explicitly match against `&<pattern>`
21189or `&mut <pattern>` depending on the reference mutability. For the bindings you need
21190to use the inverse. You can leave them as plain bindings if you wish for the value
21191to be copied, but you must use `ref mut <variable>` or `ref <variable>` to construct
21192a reference into the matched structure.
21193
21194If you are looking for a way to learn about ownership semantics in more detail, it
21195is recommended to look at IDE options available to you to highlight types, lifetimes
21196and reference semantics in your code. The available tooling would expose these things
21197in a general way even outside of the various pattern matching mechanics. Of course
21198this lint can still be used to highlight areas of interest and ensure a good understanding
21199of ownership semantics."##,
21200 default_severity: Severity::Allow,
21201 warn_since: None,
21202 deny_since: None,
21203 },
21204 Lint {
21205 label: "clippy::permissions_set_readonly_false",
21206 description: r##"Checks for calls to `std::fs::Permissions.set_readonly` with argument `false`."##,
21207 default_severity: Severity::Allow,
21208 warn_since: None,
21209 deny_since: None,
21210 },
21211 Lint {
21212 label: "clippy::pointers_in_nomem_asm_block",
21213 description: r##"Checks if any pointer is being passed to an asm! block with `nomem` option."##,
21214 default_severity: Severity::Allow,
21215 warn_since: None,
21216 deny_since: None,
21217 },
21218 Lint {
21219 label: "clippy::possible_missing_comma",
21220 description: r##"Checks for possible missing comma in an array. It lints if
21221an array element is a binary operator expression and it lies on two lines."##,
21222 default_severity: Severity::Allow,
21223 warn_since: None,
21224 deny_since: None,
21225 },
21226 Lint {
21227 label: "clippy::precedence",
21228 description: r##"Checks for operations where precedence may be unclear
21229and suggests to add parentheses. Currently it catches the following:
21230* mixed usage of arithmetic and bit shifting/combining operators without
21231parentheses"##,
21232 default_severity: Severity::Allow,
21233 warn_since: None,
21234 deny_since: None,
21235 },
21236 Lint {
21237 label: "clippy::print_in_format_impl",
21238 description: r##"Checks for usage of `println`, `print`, `eprintln` or `eprint` in an
21239implementation of a formatting trait."##,
21240 default_severity: Severity::Allow,
21241 warn_since: None,
21242 deny_since: None,
21243 },
21244 Lint {
21245 label: "clippy::print_literal",
21246 description: r##"This lint warns about the use of literals as `print!`/`println!` args."##,
21247 default_severity: Severity::Allow,
21248 warn_since: None,
21249 deny_since: None,
21250 },
21251 Lint {
21252 label: "clippy::print_stderr",
21253 description: r##"Checks for printing on *stderr*. 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_stdout",
21261 description: r##"Checks for printing on *stdout*. The purpose of this lint
21262is to catch debugging remnants."##,
21263 default_severity: Severity::Allow,
21264 warn_since: None,
21265 deny_since: None,
21266 },
21267 Lint {
21268 label: "clippy::print_with_newline",
21269 description: r##"This lint warns when you use `print!()` with a format
21270string that ends in a newline."##,
21271 default_severity: Severity::Allow,
21272 warn_since: None,
21273 deny_since: None,
21274 },
21275 Lint {
21276 label: "clippy::println_empty_string",
21277 description: r##"This lint warns when you use `println!()` to
21278print a newline."##,
21279 default_severity: Severity::Allow,
21280 warn_since: None,
21281 deny_since: None,
21282 },
21283 Lint {
21284 label: "clippy::ptr_arg",
21285 description: r##"This lint checks for function arguments of type `&String`, `&Vec`,
21286`&PathBuf`, and `Cow<_>`. It will also suggest you replace `.clone()` calls
21287with the appropriate `.to_owned()`/`to_string()` calls."##,
21288 default_severity: Severity::Allow,
21289 warn_since: None,
21290 deny_since: None,
21291 },
21292 Lint {
21293 label: "clippy::ptr_as_ptr",
21294 description: r##"Checks for `as` casts between raw pointers that don't change their
21295constness, namely `*const T` to `*const U` and `*mut T` to `*mut U`."##,
21296 default_severity: Severity::Allow,
21297 warn_since: None,
21298 deny_since: None,
21299 },
21300 Lint {
21301 label: "clippy::ptr_cast_constness",
21302 description: r##"Checks for `as` casts between raw pointers that change their constness, namely `*const T` to
21303`*mut T` and `*mut T` to `*const T`."##,
21304 default_severity: Severity::Allow,
21305 warn_since: None,
21306 deny_since: None,
21307 },
21308 Lint {
21309 label: "clippy::ptr_eq",
21310 description: r##"Use `std::ptr::eq` when applicable"##,
21311 default_severity: Severity::Allow,
21312 warn_since: None,
21313 deny_since: None,
21314 },
21315 Lint {
21316 label: "clippy::ptr_offset_with_cast",
21317 description: r##"Checks for usage of the `offset` pointer method with a `usize` casted to an
21318`isize`."##,
21319 default_severity: Severity::Allow,
21320 warn_since: None,
21321 deny_since: None,
21322 },
21323 Lint {
21324 label: "clippy::pub_enum_variant_names",
21325 description: r##"Nothing. This lint has been deprecated"##,
21326 default_severity: Severity::Allow,
21327 warn_since: None,
21328 deny_since: None,
21329 },
21330 Lint {
21331 label: "clippy::pub_underscore_fields",
21332 description: r##"Checks whether any field of the struct is prefixed with an `_` (underscore) and also marked
21333`pub` (public)"##,
21334 default_severity: Severity::Allow,
21335 warn_since: None,
21336 deny_since: None,
21337 },
21338 Lint {
21339 label: "clippy::pub_use",
21340 description: r##"Restricts the usage of `pub use ...`"##,
21341 default_severity: Severity::Allow,
21342 warn_since: None,
21343 deny_since: None,
21344 },
21345 Lint {
21346 label: "clippy::pub_with_shorthand",
21347 description: r##"Checks for usage of `pub(<loc>)` with `in`."##,
21348 default_severity: Severity::Allow,
21349 warn_since: None,
21350 deny_since: None,
21351 },
21352 Lint {
21353 label: "clippy::pub_without_shorthand",
21354 description: r##"Checks for usage of `pub(<loc>)` without `in`.
21355
21356Note: As you cannot write a module's path in `pub(<loc>)`, this will only trigger on
21357`pub(super)` and the like."##,
21358 default_severity: Severity::Allow,
21359 warn_since: None,
21360 deny_since: None,
21361 },
21362 Lint {
21363 label: "clippy::question_mark",
21364 description: r##"Checks for expressions that could be replaced by the question mark operator."##,
21365 default_severity: Severity::Allow,
21366 warn_since: None,
21367 deny_since: None,
21368 },
21369 Lint {
21370 label: "clippy::question_mark_used",
21371 description: r##"Checks for expressions that use the question mark operator and rejects them."##,
21372 default_severity: Severity::Allow,
21373 warn_since: None,
21374 deny_since: None,
21375 },
21376 Lint {
21377 label: "clippy::range_minus_one",
21378 description: r##"Checks for inclusive ranges where 1 is subtracted from
21379the upper 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_plus_one",
21386 description: r##"Checks for exclusive ranges where 1 is added to the
21387upper bound, e.g., `x..(y+1)`."##,
21388 default_severity: Severity::Allow,
21389 warn_since: None,
21390 deny_since: None,
21391 },
21392 Lint {
21393 label: "clippy::range_step_by_zero",
21394 description: r##"Nothing. This lint has been deprecated"##,
21395 default_severity: Severity::Allow,
21396 warn_since: None,
21397 deny_since: None,
21398 },
21399 Lint {
21400 label: "clippy::range_zip_with_len",
21401 description: r##"Checks for zipping a collection with the range of
21402`0.._.len()`."##,
21403 default_severity: Severity::Allow,
21404 warn_since: None,
21405 deny_since: None,
21406 },
21407 Lint {
21408 label: "clippy::rc_buffer",
21409 description: r##"Checks for `Rc<T>` and `Arc<T>` when `T` is a mutable buffer type such as `String` or `Vec`."##,
21410 default_severity: Severity::Allow,
21411 warn_since: None,
21412 deny_since: None,
21413 },
21414 Lint {
21415 label: "clippy::rc_clone_in_vec_init",
21416 description: r##"Checks for reference-counted pointers (`Arc`, `Rc`, `rc::Weak`, and `sync::Weak`)
21417in `vec![elem; len]`"##,
21418 default_severity: Severity::Allow,
21419 warn_since: None,
21420 deny_since: None,
21421 },
21422 Lint {
21423 label: "clippy::rc_mutex",
21424 description: r##"Checks for `Rc<Mutex<T>>`."##,
21425 default_severity: Severity::Allow,
21426 warn_since: None,
21427 deny_since: None,
21428 },
21429 Lint {
21430 label: "clippy::read_line_without_trim",
21431 description: r##"Looks for calls to [`Stdin::read_line`] to read a line from the standard input
21432into a string, then later attempting to use that string for an operation that will never
21433work for strings with a trailing newline character in it (e.g. parsing into a `i32`)."##,
21434 default_severity: Severity::Allow,
21435 warn_since: None,
21436 deny_since: None,
21437 },
21438 Lint {
21439 label: "clippy::read_zero_byte_vec",
21440 description: r##"This lint catches reads into a zero-length `Vec`.
21441Especially in the case of a call to `with_capacity`, this lint warns that read
21442gets the number of bytes from the `Vec`'s length, not its capacity."##,
21443 default_severity: Severity::Allow,
21444 warn_since: None,
21445 deny_since: None,
21446 },
21447 Lint {
21448 label: "clippy::readonly_write_lock",
21449 description: r##"Looks for calls to `RwLock::write` where the lock is only used for reading."##,
21450 default_severity: Severity::Allow,
21451 warn_since: None,
21452 deny_since: None,
21453 },
21454 Lint {
21455 label: "clippy::recursive_format_impl",
21456 description: r##"Checks for format trait implementations (e.g. `Display`) with a recursive call to itself
21457which uses `self` as a parameter.
21458This is typically done indirectly with the `write!` macro or with `to_string()`."##,
21459 default_severity: Severity::Allow,
21460 warn_since: None,
21461 deny_since: None,
21462 },
21463 Lint {
21464 label: "clippy::redundant_allocation",
21465 description: r##"Checks for usage of redundant allocations anywhere in the code."##,
21466 default_severity: Severity::Allow,
21467 warn_since: None,
21468 deny_since: None,
21469 },
21470 Lint {
21471 label: "clippy::redundant_as_str",
21472 description: r##"Checks for usage of `as_str()` on a `String` chained with a method available on the `String` itself."##,
21473 default_severity: Severity::Allow,
21474 warn_since: None,
21475 deny_since: None,
21476 },
21477 Lint {
21478 label: "clippy::redundant_async_block",
21479 description: r##"Checks for `async` block that only returns `await` on a future."##,
21480 default_severity: Severity::Allow,
21481 warn_since: None,
21482 deny_since: None,
21483 },
21484 Lint {
21485 label: "clippy::redundant_at_rest_pattern",
21486 description: r##"Checks for `[all @ ..]` patterns."##,
21487 default_severity: Severity::Allow,
21488 warn_since: None,
21489 deny_since: None,
21490 },
21491 Lint {
21492 label: "clippy::redundant_clone",
21493 description: r##"Checks for a redundant `clone()` (and its relatives) which clones an owned
21494value that is going to be dropped without further use."##,
21495 default_severity: Severity::Allow,
21496 warn_since: None,
21497 deny_since: None,
21498 },
21499 Lint {
21500 label: "clippy::redundant_closure",
21501 description: r##"Checks for closures which just call another function where
21502the function can be called directly. `unsafe` functions, calls where types
21503get adjusted or where the callee is marked `#[track_caller]` are ignored."##,
21504 default_severity: Severity::Allow,
21505 warn_since: None,
21506 deny_since: None,
21507 },
21508 Lint {
21509 label: "clippy::redundant_closure_call",
21510 description: r##"Detects closures called in the same expression where they
21511are defined."##,
21512 default_severity: Severity::Allow,
21513 warn_since: None,
21514 deny_since: None,
21515 },
21516 Lint {
21517 label: "clippy::redundant_closure_for_method_calls",
21518 description: r##"Checks for closures which only invoke a method on the closure
21519argument and can be replaced by referencing the method directly."##,
21520 default_severity: Severity::Allow,
21521 warn_since: None,
21522 deny_since: None,
21523 },
21524 Lint {
21525 label: "clippy::redundant_comparisons",
21526 description: r##"Checks for ineffective double comparisons against constants."##,
21527 default_severity: Severity::Allow,
21528 warn_since: None,
21529 deny_since: None,
21530 },
21531 Lint {
21532 label: "clippy::redundant_else",
21533 description: r##"Checks for `else` blocks that can be removed without changing semantics."##,
21534 default_severity: Severity::Allow,
21535 warn_since: None,
21536 deny_since: None,
21537 },
21538 Lint {
21539 label: "clippy::redundant_feature_names",
21540 description: r##"Checks for feature names with prefix `use-`, `with-` or suffix `-support`"##,
21541 default_severity: Severity::Allow,
21542 warn_since: None,
21543 deny_since: None,
21544 },
21545 Lint {
21546 label: "clippy::redundant_field_names",
21547 description: r##"Checks for fields in struct literals where shorthands
21548could be used."##,
21549 default_severity: Severity::Allow,
21550 warn_since: None,
21551 deny_since: None,
21552 },
21553 Lint {
21554 label: "clippy::redundant_guards",
21555 description: r##"Checks for unnecessary guards in match expressions."##,
21556 default_severity: Severity::Allow,
21557 warn_since: None,
21558 deny_since: None,
21559 },
21560 Lint {
21561 label: "clippy::redundant_locals",
21562 description: r##"Checks for redundant redefinitions of local bindings."##,
21563 default_severity: Severity::Allow,
21564 warn_since: None,
21565 deny_since: None,
21566 },
21567 Lint {
21568 label: "clippy::redundant_pattern",
21569 description: r##"Checks for patterns in the form `name @ _`."##,
21570 default_severity: Severity::Allow,
21571 warn_since: None,
21572 deny_since: None,
21573 },
21574 Lint {
21575 label: "clippy::redundant_pattern_matching",
21576 description: r##"Lint for redundant pattern matching over `Result`, `Option`,
21577`std::task::Poll`, `std::net::IpAddr` or `bool`s"##,
21578 default_severity: Severity::Allow,
21579 warn_since: None,
21580 deny_since: None,
21581 },
21582 Lint {
21583 label: "clippy::redundant_pub_crate",
21584 description: r##"Checks for items declared `pub(crate)` that are not crate visible because they
21585are inside a private module."##,
21586 default_severity: Severity::Allow,
21587 warn_since: None,
21588 deny_since: None,
21589 },
21590 Lint {
21591 label: "clippy::redundant_slicing",
21592 description: r##"Checks for redundant slicing expressions which use the full range, and
21593do not change the type."##,
21594 default_severity: Severity::Allow,
21595 warn_since: None,
21596 deny_since: None,
21597 },
21598 Lint {
21599 label: "clippy::redundant_static_lifetimes",
21600 description: r##"Checks for constants and statics with an explicit `'static` lifetime."##,
21601 default_severity: Severity::Allow,
21602 warn_since: None,
21603 deny_since: None,
21604 },
21605 Lint {
21606 label: "clippy::redundant_type_annotations",
21607 description: r##"Warns about needless / redundant type annotations."##,
21608 default_severity: Severity::Allow,
21609 warn_since: None,
21610 deny_since: None,
21611 },
21612 Lint {
21613 label: "clippy::ref_as_ptr",
21614 description: r##"Checks for casts of references to pointer using `as`
21615and suggests `std::ptr::from_ref` and `std::ptr::from_mut` instead."##,
21616 default_severity: Severity::Allow,
21617 warn_since: None,
21618 deny_since: None,
21619 },
21620 Lint {
21621 label: "clippy::ref_binding_to_reference",
21622 description: r##"Checks for `ref` bindings which create a reference to a reference."##,
21623 default_severity: Severity::Allow,
21624 warn_since: None,
21625 deny_since: None,
21626 },
21627 Lint {
21628 label: "clippy::ref_option",
21629 description: r##"Warns when a function signature uses `&Option<T>` instead of `Option<&T>`."##,
21630 default_severity: Severity::Allow,
21631 warn_since: None,
21632 deny_since: None,
21633 },
21634 Lint {
21635 label: "clippy::ref_option_ref",
21636 description: r##"Checks for usage of `&Option<&T>`."##,
21637 default_severity: Severity::Allow,
21638 warn_since: None,
21639 deny_since: None,
21640 },
21641 Lint {
21642 label: "clippy::ref_patterns",
21643 description: r##"Checks for usages of the `ref` keyword."##,
21644 default_severity: Severity::Allow,
21645 warn_since: None,
21646 deny_since: None,
21647 },
21648 Lint {
21649 label: "clippy::regex_macro",
21650 description: r##"Nothing. This lint has been deprecated"##,
21651 default_severity: Severity::Allow,
21652 warn_since: None,
21653 deny_since: None,
21654 },
21655 Lint {
21656 label: "clippy::renamed_function_params",
21657 description: r##"Lints when the name of function parameters from trait impl is
21658different than its default implementation."##,
21659 default_severity: Severity::Allow,
21660 warn_since: None,
21661 deny_since: None,
21662 },
21663 Lint {
21664 label: "clippy::repeat_once",
21665 description: r##"Checks for usage of `.repeat(1)` and suggest the following method for each types.
21666- `.to_string()` for `str`
21667- `.clone()` for `String`
21668- `.to_vec()` for `slice`
21669
21670The lint will evaluate constant expressions and values as arguments of `.repeat(..)` and emit a message if
21671they are equivalent to `1`. (Related discussion in [rust-clippy#7306](https://github.com/rust-lang/rust-clippy/issues/7306))"##,
21672 default_severity: Severity::Allow,
21673 warn_since: None,
21674 deny_since: None,
21675 },
21676 Lint {
21677 label: "clippy::repeat_vec_with_capacity",
21678 description: r##"Looks for patterns such as `vec![Vec::with_capacity(x); n]` or `iter::repeat(Vec::with_capacity(x))`."##,
21679 default_severity: Severity::Allow,
21680 warn_since: None,
21681 deny_since: None,
21682 },
21683 Lint {
21684 label: "clippy::replace_consts",
21685 description: r##"Nothing. This lint has been deprecated"##,
21686 default_severity: Severity::Allow,
21687 warn_since: None,
21688 deny_since: None,
21689 },
21690 Lint {
21691 label: "clippy::reserve_after_initialization",
21692 description: r##"Informs the user about a more concise way to create a vector with a known capacity."##,
21693 default_severity: Severity::Allow,
21694 warn_since: None,
21695 deny_since: None,
21696 },
21697 Lint {
21698 label: "clippy::rest_pat_in_fully_bound_structs",
21699 description: r##"Checks for unnecessary '..' pattern binding on struct when all fields are explicitly matched."##,
21700 default_severity: Severity::Allow,
21701 warn_since: None,
21702 deny_since: None,
21703 },
21704 Lint {
21705 label: "clippy::result_filter_map",
21706 description: r##"Checks for iterators of `Result`s using `.filter(Result::is_ok).map(Result::unwrap)` that may
21707be replaced with a `.flatten()` call."##,
21708 default_severity: Severity::Allow,
21709 warn_since: None,
21710 deny_since: None,
21711 },
21712 Lint {
21713 label: "clippy::result_large_err",
21714 description: r##"Checks for functions that return `Result` with an unusually large
21715`Err`-variant."##,
21716 default_severity: Severity::Allow,
21717 warn_since: None,
21718 deny_since: None,
21719 },
21720 Lint {
21721 label: "clippy::result_map_or_into_option",
21722 description: r##"Checks for usage of `_.map_or(None, Some)`."##,
21723 default_severity: Severity::Allow,
21724 warn_since: None,
21725 deny_since: None,
21726 },
21727 Lint {
21728 label: "clippy::result_map_unit_fn",
21729 description: r##"Checks for usage of `result.map(f)` where f is a function
21730or closure that returns the unit type `()`."##,
21731 default_severity: Severity::Allow,
21732 warn_since: None,
21733 deny_since: None,
21734 },
21735 Lint {
21736 label: "clippy::result_unit_err",
21737 description: r##"Checks for public functions that return a `Result`
21738with an `Err` type of `()`. It suggests using a custom type that
21739implements `std::error::Error`."##,
21740 default_severity: Severity::Allow,
21741 warn_since: None,
21742 deny_since: None,
21743 },
21744 Lint {
21745 label: "clippy::return_self_not_must_use",
21746 description: r##"This lint warns when a method returning `Self` doesn't have the `#[must_use]` attribute."##,
21747 default_severity: Severity::Allow,
21748 warn_since: None,
21749 deny_since: None,
21750 },
21751 Lint {
21752 label: "clippy::reversed_empty_ranges",
21753 description: r##"Checks for range expressions `x..y` where both `x` and `y`
21754are constant and `x` is greater to `y`. Also triggers if `x` is equal to `y` when they are conditions to a `for` loop."##,
21755 default_severity: Severity::Allow,
21756 warn_since: None,
21757 deny_since: None,
21758 },
21759 Lint {
21760 label: "clippy::same_functions_in_if_condition",
21761 description: r##"Checks for consecutive `if`s with the same function call."##,
21762 default_severity: Severity::Allow,
21763 warn_since: None,
21764 deny_since: None,
21765 },
21766 Lint {
21767 label: "clippy::same_item_push",
21768 description: r##"Checks whether a for loop is being used to push a constant
21769value into a Vec."##,
21770 default_severity: Severity::Allow,
21771 warn_since: None,
21772 deny_since: None,
21773 },
21774 Lint {
21775 label: "clippy::same_name_method",
21776 description: r##"It lints if a struct has two methods with the same name:
21777one from a trait, another not from a trait."##,
21778 default_severity: Severity::Allow,
21779 warn_since: None,
21780 deny_since: None,
21781 },
21782 Lint {
21783 label: "clippy::search_is_some",
21784 description: r##"Checks for an iterator or string search (such as `find()`,
21785`position()`, or `rposition()`) followed by a call to `is_some()` or `is_none()`."##,
21786 default_severity: Severity::Allow,
21787 warn_since: None,
21788 deny_since: None,
21789 },
21790 Lint {
21791 label: "clippy::seek_from_current",
21792 description: r##"Checks if the `seek` method of the `Seek` trait is called with `SeekFrom::Current(0)`,
21793and if it is, suggests using `stream_position` instead."##,
21794 default_severity: Severity::Allow,
21795 warn_since: None,
21796 deny_since: None,
21797 },
21798 Lint {
21799 label: "clippy::seek_to_start_instead_of_rewind",
21800 description: r##"Checks for jumps to the start of a stream that implements `Seek`
21801and uses the `seek` method providing `Start` as parameter."##,
21802 default_severity: Severity::Allow,
21803 warn_since: None,
21804 deny_since: None,
21805 },
21806 Lint {
21807 label: "clippy::self_assignment",
21808 description: r##"Checks for explicit self-assignments."##,
21809 default_severity: Severity::Allow,
21810 warn_since: None,
21811 deny_since: None,
21812 },
21813 Lint {
21814 label: "clippy::self_named_constructors",
21815 description: r##"Warns when constructors have the same name as their types."##,
21816 default_severity: Severity::Allow,
21817 warn_since: None,
21818 deny_since: None,
21819 },
21820 Lint {
21821 label: "clippy::self_named_module_files",
21822 description: r##"Checks that module layout uses only `mod.rs` files."##,
21823 default_severity: Severity::Allow,
21824 warn_since: None,
21825 deny_since: None,
21826 },
21827 Lint {
21828 label: "clippy::semicolon_if_nothing_returned",
21829 description: r##"Looks for blocks of expressions and fires if the last expression returns
21830`()` but is not followed by a semicolon."##,
21831 default_severity: Severity::Allow,
21832 warn_since: None,
21833 deny_since: None,
21834 },
21835 Lint {
21836 label: "clippy::semicolon_inside_block",
21837 description: r##"Suggests moving the semicolon after a block to the inside of the block, after its last
21838expression."##,
21839 default_severity: Severity::Allow,
21840 warn_since: None,
21841 deny_since: None,
21842 },
21843 Lint {
21844 label: "clippy::semicolon_outside_block",
21845 description: r##"Suggests moving the semicolon from a block's final expression outside of the block."##,
21846 default_severity: Severity::Allow,
21847 warn_since: None,
21848 deny_since: None,
21849 },
21850 Lint {
21851 label: "clippy::separated_literal_suffix",
21852 description: r##"Warns if literal suffixes are separated by an underscore.
21853To enforce separated literal suffix style,
21854see the `unseparated_literal_suffix` lint."##,
21855 default_severity: Severity::Allow,
21856 warn_since: None,
21857 deny_since: None,
21858 },
21859 Lint {
21860 label: "clippy::serde_api_misuse",
21861 description: r##"Checks for misuses of the serde API."##,
21862 default_severity: Severity::Allow,
21863 warn_since: None,
21864 deny_since: None,
21865 },
21866 Lint {
21867 label: "clippy::set_contains_or_insert",
21868 description: r##"Checks for usage of `contains` to see if a value is not present
21869in a set like `HashSet` or `BTreeSet`, followed by an `insert`."##,
21870 default_severity: Severity::Allow,
21871 warn_since: None,
21872 deny_since: None,
21873 },
21874 Lint {
21875 label: "clippy::shadow_reuse",
21876 description: r##"Checks for bindings that shadow other bindings already in
21877scope, while reusing the original value."##,
21878 default_severity: Severity::Allow,
21879 warn_since: None,
21880 deny_since: None,
21881 },
21882 Lint {
21883 label: "clippy::shadow_same",
21884 description: r##"Checks for bindings that shadow other bindings already in
21885scope, while just changing reference level or mutability."##,
21886 default_severity: Severity::Allow,
21887 warn_since: None,
21888 deny_since: None,
21889 },
21890 Lint {
21891 label: "clippy::shadow_unrelated",
21892 description: r##"Checks for bindings that shadow other bindings already in
21893scope, either without an initialization or with one that does not even use
21894the original value."##,
21895 default_severity: Severity::Allow,
21896 warn_since: None,
21897 deny_since: None,
21898 },
21899 Lint {
21900 label: "clippy::short_circuit_statement",
21901 description: r##"Checks for the use of short circuit boolean conditions as
21902a
21903statement."##,
21904 default_severity: Severity::Allow,
21905 warn_since: None,
21906 deny_since: None,
21907 },
21908 Lint {
21909 label: "clippy::should_assert_eq",
21910 description: r##"Nothing. This lint has been deprecated"##,
21911 default_severity: Severity::Allow,
21912 warn_since: None,
21913 deny_since: None,
21914 },
21915 Lint {
21916 label: "clippy::should_implement_trait",
21917 description: r##"Checks for methods that should live in a trait
21918implementation of a `std` trait (see [llogiq's blog
21919post](http://llogiq.github.io/2015/07/30/traits.html) for further
21920information) instead of an inherent implementation."##,
21921 default_severity: Severity::Allow,
21922 warn_since: None,
21923 deny_since: None,
21924 },
21925 Lint {
21926 label: "clippy::should_panic_without_expect",
21927 description: r##"Checks for `#[should_panic]` attributes without specifying the expected panic message."##,
21928 default_severity: Severity::Allow,
21929 warn_since: None,
21930 deny_since: None,
21931 },
21932 Lint {
21933 label: "clippy::significant_drop_in_scrutinee",
21934 description: r##"Checks for temporaries returned from function calls in a match scrutinee that have the
21935`clippy::has_significant_drop` attribute."##,
21936 default_severity: Severity::Allow,
21937 warn_since: None,
21938 deny_since: None,
21939 },
21940 Lint {
21941 label: "clippy::significant_drop_tightening",
21942 description: r##"Searches for elements marked with `#[clippy::has_significant_drop]` that could be early
21943dropped but are in fact dropped at the end of their scopes. In other words, enforces the
21944tightening of their possible lifetimes."##,
21945 default_severity: Severity::Allow,
21946 warn_since: None,
21947 deny_since: None,
21948 },
21949 Lint {
21950 label: "clippy::similar_names",
21951 description: r##"Checks for names that are very similar and thus confusing.
21952
21953Note: this lint looks for similar names throughout each
21954scope. To allow it, you need to allow it on the scope
21955level, not on the name that is reported."##,
21956 default_severity: Severity::Allow,
21957 warn_since: None,
21958 deny_since: None,
21959 },
21960 Lint {
21961 label: "clippy::single_call_fn",
21962 description: r##"Checks for functions that are only used once. Does not lint tests."##,
21963 default_severity: Severity::Allow,
21964 warn_since: None,
21965 deny_since: None,
21966 },
21967 Lint {
21968 label: "clippy::single_char_add_str",
21969 description: r##"Warns when using `push_str`/`insert_str` with a single-character string literal
21970where `push`/`insert` with a `char` would work fine."##,
21971 default_severity: Severity::Allow,
21972 warn_since: None,
21973 deny_since: None,
21974 },
21975 Lint {
21976 label: "clippy::single_char_lifetime_names",
21977 description: r##"Checks for lifetimes with names which are one character
21978long."##,
21979 default_severity: Severity::Allow,
21980 warn_since: None,
21981 deny_since: None,
21982 },
21983 Lint {
21984 label: "clippy::single_char_pattern",
21985 description: r##"Checks for string methods that receive a single-character
21986`str` as an argument, e.g., `_.split(x)`."##,
21987 default_severity: Severity::Allow,
21988 warn_since: None,
21989 deny_since: None,
21990 },
21991 Lint {
21992 label: "clippy::single_component_path_imports",
21993 description: r##"Checking for imports with single component use path."##,
21994 default_severity: Severity::Allow,
21995 warn_since: None,
21996 deny_since: None,
21997 },
21998 Lint {
21999 label: "clippy::single_element_loop",
22000 description: r##"Checks whether a for loop has a single element."##,
22001 default_severity: Severity::Allow,
22002 warn_since: None,
22003 deny_since: None,
22004 },
22005 Lint {
22006 label: "clippy::single_match",
22007 description: r##"Checks for matches with a single arm where an `if let`
22008will usually suffice.
22009
22010This intentionally does not lint if there are comments
22011inside of the other arm, so as to allow the user to document
22012why having another explicit pattern with an empty body is necessary,
22013or because the comments need to be preserved for other reasons."##,
22014 default_severity: Severity::Allow,
22015 warn_since: None,
22016 deny_since: None,
22017 },
22018 Lint {
22019 label: "clippy::single_match_else",
22020 description: r##"Checks for matches with two arms where an `if let else` will
22021usually suffice."##,
22022 default_severity: Severity::Allow,
22023 warn_since: None,
22024 deny_since: None,
22025 },
22026 Lint {
22027 label: "clippy::single_range_in_vec_init",
22028 description: r##"Checks for `Vec` or array initializations that contain only one range."##,
22029 default_severity: Severity::Allow,
22030 warn_since: None,
22031 deny_since: None,
22032 },
22033 Lint {
22034 label: "clippy::size_of_in_element_count",
22035 description: r##"Detects expressions where
22036`size_of::<T>` or `size_of_val::<T>` is used as a
22037count of elements of type `T`"##,
22038 default_severity: Severity::Allow,
22039 warn_since: None,
22040 deny_since: None,
22041 },
22042 Lint {
22043 label: "clippy::size_of_ref",
22044 description: r##"Checks for calls to `std::mem::size_of_val()` where the argument is
22045a reference to a reference."##,
22046 default_severity: Severity::Allow,
22047 warn_since: None,
22048 deny_since: None,
22049 },
22050 Lint {
22051 label: "clippy::skip_while_next",
22052 description: r##"Checks for usage of `_.skip_while(condition).next()`."##,
22053 default_severity: Severity::Allow,
22054 warn_since: None,
22055 deny_since: None,
22056 },
22057 Lint {
22058 label: "clippy::slow_vector_initialization",
22059 description: r##"Checks slow zero-filled vector initialization"##,
22060 default_severity: Severity::Allow,
22061 warn_since: None,
22062 deny_since: None,
22063 },
22064 Lint {
22065 label: "clippy::stable_sort_primitive",
22066 description: r##"When sorting primitive values (integers, bools, chars, as well
22067as arrays, slices, and tuples of such items), it is typically better to
22068use an unstable sort than a stable sort."##,
22069 default_severity: Severity::Allow,
22070 warn_since: None,
22071 deny_since: None,
22072 },
22073 Lint {
22074 label: "clippy::std_instead_of_alloc",
22075 description: r##"Finds items imported through `std` when available through `alloc`."##,
22076 default_severity: Severity::Allow,
22077 warn_since: None,
22078 deny_since: None,
22079 },
22080 Lint {
22081 label: "clippy::std_instead_of_core",
22082 description: r##"Finds items imported through `std` when available through `core`."##,
22083 default_severity: Severity::Allow,
22084 warn_since: None,
22085 deny_since: None,
22086 },
22087 Lint {
22088 label: "clippy::str_split_at_newline",
22089 description: r##"Checks for usages of `str.trim().split(\
22090)` and `str.trim().split(\\
22091)`."##,
22092 default_severity: Severity::Allow,
22093 warn_since: None,
22094 deny_since: None,
22095 },
22096 Lint {
22097 label: "clippy::str_to_string",
22098 description: r##"This lint checks for `.to_string()` method calls on values of type `&str`."##,
22099 default_severity: Severity::Allow,
22100 warn_since: None,
22101 deny_since: None,
22102 },
22103 Lint {
22104 label: "clippy::string_add",
22105 description: r##"Checks for all instances of `x + _` where `x` is of type
22106`String`, but only if [`string_add_assign`](#string_add_assign) does *not*
22107match."##,
22108 default_severity: Severity::Allow,
22109 warn_since: None,
22110 deny_since: None,
22111 },
22112 Lint {
22113 label: "clippy::string_add_assign",
22114 description: r##"Checks for string appends of the form `x = x + y` (without
22115`let`!)."##,
22116 default_severity: Severity::Allow,
22117 warn_since: None,
22118 deny_since: None,
22119 },
22120 Lint {
22121 label: "clippy::string_extend_chars",
22122 description: r##"Checks for the use of `.extend(s.chars())` where s is a
22123`&str` or `String`."##,
22124 default_severity: Severity::Allow,
22125 warn_since: None,
22126 deny_since: None,
22127 },
22128 Lint {
22129 label: "clippy::string_from_utf8_as_bytes",
22130 description: r##"Check if the string is transformed to byte array and casted back to string."##,
22131 default_severity: Severity::Allow,
22132 warn_since: None,
22133 deny_since: None,
22134 },
22135 Lint {
22136 label: "clippy::string_lit_as_bytes",
22137 description: r##"Checks for the `as_bytes` method called on string literals
22138that contain only ASCII characters."##,
22139 default_severity: Severity::Allow,
22140 warn_since: None,
22141 deny_since: None,
22142 },
22143 Lint {
22144 label: "clippy::string_lit_chars_any",
22145 description: r##"Checks for `<string_lit>.chars().any(|i| i == c)`."##,
22146 default_severity: Severity::Allow,
22147 warn_since: None,
22148 deny_since: None,
22149 },
22150 Lint {
22151 label: "clippy::string_slice",
22152 description: r##"Checks for slice operations on strings"##,
22153 default_severity: Severity::Allow,
22154 warn_since: None,
22155 deny_since: None,
22156 },
22157 Lint {
22158 label: "clippy::string_to_string",
22159 description: r##"This lint checks for `.to_string()` method calls on values of type `String`."##,
22160 default_severity: Severity::Allow,
22161 warn_since: None,
22162 deny_since: None,
22163 },
22164 Lint {
22165 label: "clippy::strlen_on_c_strings",
22166 description: r##"Checks for usage of `libc::strlen` on a `CString` or `CStr` value,
22167and suggest calling `as_bytes().len()` or `to_bytes().len()` respectively instead."##,
22168 default_severity: Severity::Allow,
22169 warn_since: None,
22170 deny_since: None,
22171 },
22172 Lint {
22173 label: "clippy::struct_excessive_bools",
22174 description: r##"Checks for excessive
22175use of bools in structs."##,
22176 default_severity: Severity::Allow,
22177 warn_since: None,
22178 deny_since: None,
22179 },
22180 Lint {
22181 label: "clippy::struct_field_names",
22182 description: r##"Detects struct fields that are prefixed or suffixed
22183by the same characters or the name of the struct itself."##,
22184 default_severity: Severity::Allow,
22185 warn_since: None,
22186 deny_since: None,
22187 },
22188 Lint {
22189 label: "clippy::suboptimal_flops",
22190 description: r##"Looks for floating-point expressions that
22191can be expressed using built-in methods to improve both
22192accuracy and performance."##,
22193 default_severity: Severity::Allow,
22194 warn_since: None,
22195 deny_since: None,
22196 },
22197 Lint {
22198 label: "clippy::suspicious_arithmetic_impl",
22199 description: r##"Lints for suspicious operations in impls of arithmetic operators, e.g.
22200subtracting elements in an Add impl."##,
22201 default_severity: Severity::Allow,
22202 warn_since: None,
22203 deny_since: None,
22204 },
22205 Lint {
22206 label: "clippy::suspicious_assignment_formatting",
22207 description: r##"Checks for usage of the non-existent `=*`, `=!` and `=-`
22208operators."##,
22209 default_severity: Severity::Allow,
22210 warn_since: None,
22211 deny_since: None,
22212 },
22213 Lint {
22214 label: "clippy::suspicious_command_arg_space",
22215 description: r##"Checks for `Command::arg()` invocations that look like they
22216should be multiple arguments instead, such as `arg(-t ext2)`."##,
22217 default_severity: Severity::Allow,
22218 warn_since: None,
22219 deny_since: None,
22220 },
22221 Lint {
22222 label: "clippy::suspicious_doc_comments",
22223 description: r##"Detects the use of outer doc comments (`///`, `/**`) followed by a bang (`!`): `///!`"##,
22224 default_severity: Severity::Allow,
22225 warn_since: None,
22226 deny_since: None,
22227 },
22228 Lint {
22229 label: "clippy::suspicious_else_formatting",
22230 description: r##"Checks for formatting of `else`. It lints if the `else`
22231is followed immediately by a newline or the `else` seems to be missing."##,
22232 default_severity: Severity::Allow,
22233 warn_since: None,
22234 deny_since: None,
22235 },
22236 Lint {
22237 label: "clippy::suspicious_map",
22238 description: r##"Checks for calls to `map` followed by a `count`."##,
22239 default_severity: Severity::Allow,
22240 warn_since: None,
22241 deny_since: None,
22242 },
22243 Lint {
22244 label: "clippy::suspicious_op_assign_impl",
22245 description: r##"Lints for suspicious operations in impls of OpAssign, e.g.
22246subtracting elements in an AddAssign impl."##,
22247 default_severity: Severity::Allow,
22248 warn_since: None,
22249 deny_since: None,
22250 },
22251 Lint {
22252 label: "clippy::suspicious_open_options",
22253 description: r##"Checks for the suspicious use of `OpenOptions::create()`
22254without an explicit `OpenOptions::truncate()`."##,
22255 default_severity: Severity::Allow,
22256 warn_since: None,
22257 deny_since: None,
22258 },
22259 Lint {
22260 label: "clippy::suspicious_operation_groupings",
22261 description: r##"Checks for unlikely usages of binary operators that are almost
22262certainly typos and/or copy/paste errors, given the other usages
22263of binary operators nearby."##,
22264 default_severity: Severity::Allow,
22265 warn_since: None,
22266 deny_since: None,
22267 },
22268 Lint {
22269 label: "clippy::suspicious_splitn",
22270 description: r##"Checks for calls to [`splitn`]
22271(https://doc.rust-lang.org/std/primitive.str.html#method.splitn) and
22272related functions with either zero or one splits."##,
22273 default_severity: Severity::Allow,
22274 warn_since: None,
22275 deny_since: None,
22276 },
22277 Lint {
22278 label: "clippy::suspicious_to_owned",
22279 description: r##"Checks for the usage of `_.to_owned()`, on a `Cow<'_, _>`."##,
22280 default_severity: Severity::Allow,
22281 warn_since: None,
22282 deny_since: None,
22283 },
22284 Lint {
22285 label: "clippy::suspicious_unary_op_formatting",
22286 description: r##"Checks the formatting of a unary operator on the right hand side
22287of a binary operator. It lints if there is no space between the binary and unary operators,
22288but there is a space between the unary and its operand."##,
22289 default_severity: Severity::Allow,
22290 warn_since: None,
22291 deny_since: None,
22292 },
22293 Lint {
22294 label: "clippy::suspicious_xor_used_as_pow",
22295 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."##,
22296 default_severity: Severity::Allow,
22297 warn_since: None,
22298 deny_since: None,
22299 },
22300 Lint {
22301 label: "clippy::swap_ptr_to_ref",
22302 description: r##"Checks for calls to `core::mem::swap` where either parameter is derived from a pointer"##,
22303 default_severity: Severity::Allow,
22304 warn_since: None,
22305 deny_since: None,
22306 },
22307 Lint {
22308 label: "clippy::tabs_in_doc_comments",
22309 description: r##"Checks doc comments for usage of tab characters."##,
22310 default_severity: Severity::Allow,
22311 warn_since: None,
22312 deny_since: None,
22313 },
22314 Lint {
22315 label: "clippy::temporary_assignment",
22316 description: r##"Checks for construction of a structure or tuple just to
22317assign a value in it."##,
22318 default_severity: Severity::Allow,
22319 warn_since: None,
22320 deny_since: None,
22321 },
22322 Lint {
22323 label: "clippy::test_attr_in_doctest",
22324 description: r##"Checks for `#[test]` in doctests unless they are marked with
22325either `ignore`, `no_run` or `compile_fail`."##,
22326 default_severity: Severity::Allow,
22327 warn_since: None,
22328 deny_since: None,
22329 },
22330 Lint {
22331 label: "clippy::tests_outside_test_module",
22332 description: r##"Triggers when a testing function (marked with the `#[test]` attribute) isn't inside a testing module
22333(marked with `#[cfg(test)]`)."##,
22334 default_severity: Severity::Allow,
22335 warn_since: None,
22336 deny_since: None,
22337 },
22338 Lint {
22339 label: "clippy::to_digit_is_some",
22340 description: r##"Checks for `.to_digit(..).is_some()` on `char`s."##,
22341 default_severity: Severity::Allow,
22342 warn_since: None,
22343 deny_since: None,
22344 },
22345 Lint {
22346 label: "clippy::to_string_in_format_args",
22347 description: r##"Checks for [`ToString::to_string`](https://doc.rust-lang.org/std/string/trait.ToString.html#tymethod.to_string)
22348applied to a type that implements [`Display`](https://doc.rust-lang.org/std/fmt/trait.Display.html)
22349in a macro that does formatting."##,
22350 default_severity: Severity::Allow,
22351 warn_since: None,
22352 deny_since: None,
22353 },
22354 Lint {
22355 label: "clippy::to_string_trait_impl",
22356 description: r##"Checks for direct implementations of `ToString`."##,
22357 default_severity: Severity::Allow,
22358 warn_since: None,
22359 deny_since: None,
22360 },
22361 Lint {
22362 label: "clippy::todo",
22363 description: r##"Checks for usage of `todo!`."##,
22364 default_severity: Severity::Allow,
22365 warn_since: None,
22366 deny_since: None,
22367 },
22368 Lint {
22369 label: "clippy::too_long_first_doc_paragraph",
22370 description: r##"Checks if the first line in the documentation of items listed in module page is too long."##,
22371 default_severity: Severity::Allow,
22372 warn_since: None,
22373 deny_since: None,
22374 },
22375 Lint {
22376 label: "clippy::too_many_arguments",
22377 description: r##"Checks for functions with too many parameters."##,
22378 default_severity: Severity::Allow,
22379 warn_since: None,
22380 deny_since: None,
22381 },
22382 Lint {
22383 label: "clippy::too_many_lines",
22384 description: r##"Checks for functions with a large amount of lines."##,
22385 default_severity: Severity::Allow,
22386 warn_since: None,
22387 deny_since: None,
22388 },
22389 Lint {
22390 label: "clippy::toplevel_ref_arg",
22391 description: r##"Checks for function arguments and let bindings denoted as
22392`ref`."##,
22393 default_severity: Severity::Allow,
22394 warn_since: None,
22395 deny_since: None,
22396 },
22397 Lint {
22398 label: "clippy::trailing_empty_array",
22399 description: r##"Displays a warning when a struct with a trailing zero-sized array is declared without a `repr` attribute."##,
22400 default_severity: Severity::Allow,
22401 warn_since: None,
22402 deny_since: None,
22403 },
22404 Lint {
22405 label: "clippy::trait_duplication_in_bounds",
22406 description: r##"Checks for cases where generics or trait objects are being used and multiple
22407syntax specifications for trait bounds are used simultaneously."##,
22408 default_severity: Severity::Allow,
22409 warn_since: None,
22410 deny_since: None,
22411 },
22412 Lint {
22413 label: "clippy::transmute_bytes_to_str",
22414 description: r##"Checks for transmutes from a `&[u8]` to a `&str`."##,
22415 default_severity: Severity::Allow,
22416 warn_since: None,
22417 deny_since: None,
22418 },
22419 Lint {
22420 label: "clippy::transmute_float_to_int",
22421 description: r##"Checks for transmutes from a float to an integer."##,
22422 default_severity: Severity::Allow,
22423 warn_since: None,
22424 deny_since: None,
22425 },
22426 Lint {
22427 label: "clippy::transmute_int_to_bool",
22428 description: r##"Checks for transmutes from an integer to a `bool`."##,
22429 default_severity: Severity::Allow,
22430 warn_since: None,
22431 deny_since: None,
22432 },
22433 Lint {
22434 label: "clippy::transmute_int_to_char",
22435 description: r##"Checks for transmutes from an integer to a `char`."##,
22436 default_severity: Severity::Allow,
22437 warn_since: None,
22438 deny_since: None,
22439 },
22440 Lint {
22441 label: "clippy::transmute_int_to_float",
22442 description: r##"Checks for transmutes from an integer to a float."##,
22443 default_severity: Severity::Allow,
22444 warn_since: None,
22445 deny_since: None,
22446 },
22447 Lint {
22448 label: "clippy::transmute_int_to_non_zero",
22449 description: r##"Checks for transmutes from `T` to `NonZero<T>`, and suggests the `new_unchecked`
22450method instead."##,
22451 default_severity: Severity::Allow,
22452 warn_since: None,
22453 deny_since: None,
22454 },
22455 Lint {
22456 label: "clippy::transmute_null_to_fn",
22457 description: r##"Checks for null function pointer creation through transmute."##,
22458 default_severity: Severity::Allow,
22459 warn_since: None,
22460 deny_since: None,
22461 },
22462 Lint {
22463 label: "clippy::transmute_num_to_bytes",
22464 description: r##"Checks for transmutes from a number to an array of `u8`"##,
22465 default_severity: Severity::Allow,
22466 warn_since: None,
22467 deny_since: None,
22468 },
22469 Lint {
22470 label: "clippy::transmute_ptr_to_ptr",
22471 description: r##"Checks for transmutes from a pointer to a pointer, or
22472from a reference to a reference."##,
22473 default_severity: Severity::Allow,
22474 warn_since: None,
22475 deny_since: None,
22476 },
22477 Lint {
22478 label: "clippy::transmute_ptr_to_ref",
22479 description: r##"Checks for transmutes from a pointer to a reference."##,
22480 default_severity: Severity::Allow,
22481 warn_since: None,
22482 deny_since: None,
22483 },
22484 Lint {
22485 label: "clippy::transmute_undefined_repr",
22486 description: r##"Checks for transmutes between types which do not have a representation defined relative to
22487each other."##,
22488 default_severity: Severity::Allow,
22489 warn_since: None,
22490 deny_since: None,
22491 },
22492 Lint {
22493 label: "clippy::transmutes_expressible_as_ptr_casts",
22494 description: r##"Checks for transmutes that could be a pointer cast."##,
22495 default_severity: Severity::Allow,
22496 warn_since: None,
22497 deny_since: None,
22498 },
22499 Lint {
22500 label: "clippy::transmuting_null",
22501 description: r##"Checks for transmute calls which would receive a null pointer."##,
22502 default_severity: Severity::Allow,
22503 warn_since: None,
22504 deny_since: None,
22505 },
22506 Lint {
22507 label: "clippy::trim_split_whitespace",
22508 description: r##"Warns about calling `str::trim` (or variants) before `str::split_whitespace`."##,
22509 default_severity: Severity::Allow,
22510 warn_since: None,
22511 deny_since: None,
22512 },
22513 Lint {
22514 label: "clippy::trivial_regex",
22515 description: r##"Checks for trivial [regex](https://crates.io/crates/regex)
22516creation (with `Regex::new`, `RegexBuilder::new`, or `RegexSet::new`)."##,
22517 default_severity: Severity::Allow,
22518 warn_since: None,
22519 deny_since: None,
22520 },
22521 Lint {
22522 label: "clippy::trivially_copy_pass_by_ref",
22523 description: r##"Checks for functions taking arguments by reference, where
22524the argument type is `Copy` and small enough to be more efficient to always
22525pass by value."##,
22526 default_severity: Severity::Allow,
22527 warn_since: None,
22528 deny_since: None,
22529 },
22530 Lint {
22531 label: "clippy::try_err",
22532 description: r##"Checks for usage of `Err(x)?`."##,
22533 default_severity: Severity::Allow,
22534 warn_since: None,
22535 deny_since: None,
22536 },
22537 Lint {
22538 label: "clippy::tuple_array_conversions",
22539 description: r##"Checks for tuple<=>array conversions that are not done with `.into()`."##,
22540 default_severity: Severity::Allow,
22541 warn_since: None,
22542 deny_since: None,
22543 },
22544 Lint {
22545 label: "clippy::type_complexity",
22546 description: r##"Checks for types used in structs, parameters and `let`
22547declarations above a certain complexity threshold."##,
22548 default_severity: Severity::Allow,
22549 warn_since: None,
22550 deny_since: None,
22551 },
22552 Lint {
22553 label: "clippy::type_id_on_box",
22554 description: r##"Looks for calls to `.type_id()` on a `Box<dyn _>`."##,
22555 default_severity: Severity::Allow,
22556 warn_since: None,
22557 deny_since: None,
22558 },
22559 Lint {
22560 label: "clippy::type_repetition_in_bounds",
22561 description: r##"This lint warns about unnecessary type repetitions in trait bounds"##,
22562 default_severity: Severity::Allow,
22563 warn_since: None,
22564 deny_since: None,
22565 },
22566 Lint {
22567 label: "clippy::unchecked_duration_subtraction",
22568 description: r##"Lints subtraction between an `Instant` and a `Duration`."##,
22569 default_severity: Severity::Allow,
22570 warn_since: None,
22571 deny_since: None,
22572 },
22573 Lint {
22574 label: "clippy::unconditional_recursion",
22575 description: r##"Checks that there isn't an infinite recursion in trait
22576implementations."##,
22577 default_severity: Severity::Allow,
22578 warn_since: None,
22579 deny_since: None,
22580 },
22581 Lint {
22582 label: "clippy::undocumented_unsafe_blocks",
22583 description: r##"Checks for `unsafe` blocks and impls without a `// SAFETY: ` comment
22584explaining why the unsafe operations performed inside
22585the block are safe.
22586
22587Note the comment must appear on the line(s) preceding the unsafe block
22588with nothing appearing in between. The following is ok:
22589```rust
22590foo(
22591 // SAFETY:
22592 // This is a valid safety comment
22593 unsafe { *x }
22594)
22595```
22596But neither of these are:
22597```rust
22598// SAFETY:
22599// This is not a valid safety comment
22600foo(
22601 /* SAFETY: Neither is this */ unsafe { *x },
22602);
22603```"##,
22604 default_severity: Severity::Allow,
22605 warn_since: None,
22606 deny_since: None,
22607 },
22608 Lint {
22609 label: "clippy::unicode_not_nfc",
22610 description: r##"Checks for string literals that contain Unicode in a form
22611that is not equal to its
22612[NFC-recomposition](http://www.unicode.org/reports/tr15/#Norm_Forms)."##,
22613 default_severity: Severity::Allow,
22614 warn_since: None,
22615 deny_since: None,
22616 },
22617 Lint {
22618 label: "clippy::unimplemented",
22619 description: r##"Checks for usage of `unimplemented!`."##,
22620 default_severity: Severity::Allow,
22621 warn_since: None,
22622 deny_since: None,
22623 },
22624 Lint {
22625 label: "clippy::uninhabited_references",
22626 description: r##"It detects references to uninhabited types, such as `!` and
22627warns when those are either dereferenced or returned from a function."##,
22628 default_severity: Severity::Allow,
22629 warn_since: None,
22630 deny_since: None,
22631 },
22632 Lint {
22633 label: "clippy::uninit_assumed_init",
22634 description: r##"Checks for `MaybeUninit::uninit().assume_init()`."##,
22635 default_severity: Severity::Allow,
22636 warn_since: None,
22637 deny_since: None,
22638 },
22639 Lint {
22640 label: "clippy::uninit_vec",
22641 description: r##"Checks for `set_len()` call that creates `Vec` with uninitialized elements.
22642This is commonly caused by calling `set_len()` right after allocating or
22643reserving a buffer with `new()`, `default()`, `with_capacity()`, or `reserve()`."##,
22644 default_severity: Severity::Allow,
22645 warn_since: None,
22646 deny_since: None,
22647 },
22648 Lint {
22649 label: "clippy::uninlined_format_args",
22650 description: r##"Detect when a variable is not inlined in a format string,
22651and suggests to inline it."##,
22652 default_severity: Severity::Allow,
22653 warn_since: None,
22654 deny_since: None,
22655 },
22656 Lint {
22657 label: "clippy::unit_arg",
22658 description: r##"Checks for passing a unit value as an argument to a function without using a
22659unit literal (`()`)."##,
22660 default_severity: Severity::Allow,
22661 warn_since: None,
22662 deny_since: None,
22663 },
22664 Lint {
22665 label: "clippy::unit_cmp",
22666 description: r##"Checks for comparisons to unit. This includes all binary
22667comparisons (like `==` and `<`) and asserts."##,
22668 default_severity: Severity::Allow,
22669 warn_since: None,
22670 deny_since: None,
22671 },
22672 Lint {
22673 label: "clippy::unit_hash",
22674 description: r##"Detects `().hash(_)`."##,
22675 default_severity: Severity::Allow,
22676 warn_since: None,
22677 deny_since: None,
22678 },
22679 Lint {
22680 label: "clippy::unit_return_expecting_ord",
22681 description: r##"Checks for functions that expect closures of type
22682Fn(...) -> Ord where the implemented closure returns the unit type.
22683The lint also suggests to remove the semi-colon at the end of the statement if present."##,
22684 default_severity: Severity::Allow,
22685 warn_since: None,
22686 deny_since: None,
22687 },
22688 Lint {
22689 label: "clippy::unnecessary_box_returns",
22690 description: r##"Checks for a return type containing a `Box<T>` where `T` implements `Sized`
22691
22692The lint ignores `Box<T>` where `T` is larger than `unnecessary_box_size`,
22693as returning a large `T` directly may be detrimental to performance."##,
22694 default_severity: Severity::Allow,
22695 warn_since: None,
22696 deny_since: None,
22697 },
22698 Lint {
22699 label: "clippy::unnecessary_cast",
22700 description: r##"Checks for casts to the same type, casts of int literals to integer
22701types, casts of float literals to float types, and casts between raw
22702pointers that don't change type or constness."##,
22703 default_severity: Severity::Allow,
22704 warn_since: None,
22705 deny_since: None,
22706 },
22707 Lint {
22708 label: "clippy::unnecessary_clippy_cfg",
22709 description: r##"Checks for `#[cfg_attr(clippy, allow(clippy::lint))]`
22710and suggests to replace it with `#[allow(clippy::lint)]`."##,
22711 default_severity: Severity::Allow,
22712 warn_since: None,
22713 deny_since: None,
22714 },
22715 Lint {
22716 label: "clippy::unnecessary_fallible_conversions",
22717 description: r##"Checks for calls to `TryInto::try_into` and `TryFrom::try_from` when their infallible counterparts
22718could be used."##,
22719 default_severity: Severity::Allow,
22720 warn_since: None,
22721 deny_since: None,
22722 },
22723 Lint {
22724 label: "clippy::unnecessary_filter_map",
22725 description: r##"Checks for `filter_map` calls that could be replaced by `filter` or `map`.
22726More specifically it checks if the closure provided is only performing one of the
22727filter or map operations and suggests the appropriate option."##,
22728 default_severity: Severity::Allow,
22729 warn_since: None,
22730 deny_since: None,
22731 },
22732 Lint {
22733 label: "clippy::unnecessary_find_map",
22734 description: r##"Checks for `find_map` calls that could be replaced by `find` or `map`. More
22735specifically it checks if the closure provided is only performing one of the
22736find or map operations and suggests the appropriate option."##,
22737 default_severity: Severity::Allow,
22738 warn_since: None,
22739 deny_since: None,
22740 },
22741 Lint {
22742 label: "clippy::unnecessary_first_then_check",
22743 description: r##"Checks the usage of `.first().is_some()` or `.first().is_none()` to check if a slice is
22744empty."##,
22745 default_severity: Severity::Allow,
22746 warn_since: None,
22747 deny_since: None,
22748 },
22749 Lint {
22750 label: "clippy::unnecessary_fold",
22751 description: r##"Checks for usage of `fold` when a more succinct alternative exists.
22752Specifically, this checks for `fold`s which could be replaced by `any`, `all`,
22753`sum` or `product`."##,
22754 default_severity: Severity::Allow,
22755 warn_since: None,
22756 deny_since: None,
22757 },
22758 Lint {
22759 label: "clippy::unnecessary_get_then_check",
22760 description: r##"Checks the usage of `.get().is_some()` or `.get().is_none()` on std map types."##,
22761 default_severity: Severity::Allow,
22762 warn_since: None,
22763 deny_since: None,
22764 },
22765 Lint {
22766 label: "clippy::unnecessary_join",
22767 description: r##"Checks for usage of `.collect::<Vec<String>>().join()` on iterators."##,
22768 default_severity: Severity::Allow,
22769 warn_since: None,
22770 deny_since: None,
22771 },
22772 Lint {
22773 label: "clippy::unnecessary_lazy_evaluations",
22774 description: r##"As the counterpart to `or_fun_call`, this lint looks for unnecessary
22775lazily evaluated closures on `Option` and `Result`.
22776
22777This lint suggests changing the following functions, when eager evaluation results in
22778simpler code:
22779 - `unwrap_or_else` to `unwrap_or`
22780 - `and_then` to `and`
22781 - `or_else` to `or`
22782 - `get_or_insert_with` to `get_or_insert`
22783 - `ok_or_else` to `ok_or`
22784 - `then` to `then_some` (for msrv >= 1.62.0)"##,
22785 default_severity: Severity::Allow,
22786 warn_since: None,
22787 deny_since: None,
22788 },
22789 Lint {
22790 label: "clippy::unnecessary_literal_unwrap",
22791 description: r##"Checks for `.unwrap()` related calls on `Result`s and `Option`s that are constructed."##,
22792 default_severity: Severity::Allow,
22793 warn_since: None,
22794 deny_since: None,
22795 },
22796 Lint {
22797 label: "clippy::unnecessary_map_on_constructor",
22798 description: r##"Suggests removing the use of a `map()` (or `map_err()`) method when an `Option` or `Result`
22799is being constructed."##,
22800 default_severity: Severity::Allow,
22801 warn_since: None,
22802 deny_since: None,
22803 },
22804 Lint {
22805 label: "clippy::unnecessary_min_or_max",
22806 description: r##"Checks for unnecessary calls to `min()` or `max()` in the following cases
22807- Either both side is constant
22808- One side is clearly larger than the other, like i32::MIN and an i32 variable"##,
22809 default_severity: Severity::Allow,
22810 warn_since: None,
22811 deny_since: None,
22812 },
22813 Lint {
22814 label: "clippy::unnecessary_mut_passed",
22815 description: r##"Detects passing a mutable reference to a function that only
22816requires an immutable reference."##,
22817 default_severity: Severity::Allow,
22818 warn_since: None,
22819 deny_since: None,
22820 },
22821 Lint {
22822 label: "clippy::unnecessary_operation",
22823 description: r##"Checks for expression statements that can be reduced to a
22824sub-expression."##,
22825 default_severity: Severity::Allow,
22826 warn_since: None,
22827 deny_since: None,
22828 },
22829 Lint {
22830 label: "clippy::unnecessary_owned_empty_strings",
22831 description: r##"Detects cases of owned empty strings being passed as an argument to a function expecting `&str`"##,
22832 default_severity: Severity::Allow,
22833 warn_since: None,
22834 deny_since: None,
22835 },
22836 Lint {
22837 label: "clippy::unnecessary_result_map_or_else",
22838 description: r##"Checks for usage of `.map_or_else()` map closure for `Result` type."##,
22839 default_severity: Severity::Allow,
22840 warn_since: None,
22841 deny_since: None,
22842 },
22843 Lint {
22844 label: "clippy::unnecessary_safety_comment",
22845 description: r##"Checks for `// SAFETY: ` comments on safe code."##,
22846 default_severity: Severity::Allow,
22847 warn_since: None,
22848 deny_since: None,
22849 },
22850 Lint {
22851 label: "clippy::unnecessary_safety_doc",
22852 description: r##"Checks for the doc comments of publicly visible
22853safe functions and traits and warns if there is a `# Safety` section."##,
22854 default_severity: Severity::Allow,
22855 warn_since: None,
22856 deny_since: None,
22857 },
22858 Lint {
22859 label: "clippy::unnecessary_self_imports",
22860 description: r##"Checks for imports ending in `::{self}`."##,
22861 default_severity: Severity::Allow,
22862 warn_since: None,
22863 deny_since: None,
22864 },
22865 Lint {
22866 label: "clippy::unnecessary_sort_by",
22867 description: r##"Checks for usage of `Vec::sort_by` passing in a closure
22868which compares the two arguments, either directly or indirectly."##,
22869 default_severity: Severity::Allow,
22870 warn_since: None,
22871 deny_since: None,
22872 },
22873 Lint {
22874 label: "clippy::unnecessary_struct_initialization",
22875 description: r##"Checks for initialization of an identical `struct` from another instance
22876of the type, either by copying a base without setting any field or by
22877moving all fields individually."##,
22878 default_severity: Severity::Allow,
22879 warn_since: None,
22880 deny_since: None,
22881 },
22882 Lint {
22883 label: "clippy::unnecessary_to_owned",
22884 description: r##"Checks for unnecessary calls to [`ToOwned::to_owned`](https://doc.rust-lang.org/std/borrow/trait.ToOwned.html#tymethod.to_owned)
22885and other `to_owned`-like functions."##,
22886 default_severity: Severity::Allow,
22887 warn_since: None,
22888 deny_since: None,
22889 },
22890 Lint {
22891 label: "clippy::unnecessary_unwrap",
22892 description: r##"Checks for calls of `unwrap[_err]()` that cannot fail."##,
22893 default_severity: Severity::Allow,
22894 warn_since: None,
22895 deny_since: None,
22896 },
22897 Lint {
22898 label: "clippy::unnecessary_wraps",
22899 description: r##"Checks for private functions that only return `Ok` or `Some`."##,
22900 default_severity: Severity::Allow,
22901 warn_since: None,
22902 deny_since: None,
22903 },
22904 Lint {
22905 label: "clippy::unneeded_field_pattern",
22906 description: r##"Checks for structure field patterns bound to wildcards."##,
22907 default_severity: Severity::Allow,
22908 warn_since: None,
22909 deny_since: None,
22910 },
22911 Lint {
22912 label: "clippy::unneeded_wildcard_pattern",
22913 description: r##"Checks for tuple patterns with a wildcard
22914pattern (`_`) is next to a rest pattern (`..`).
22915
22916_NOTE_: While `_, ..` means there is at least one element left, `..`
22917means there are 0 or more elements left. This can make a difference
22918when refactoring, but shouldn't result in errors in the refactored code,
22919since the wildcard pattern isn't used anyway."##,
22920 default_severity: Severity::Allow,
22921 warn_since: None,
22922 deny_since: None,
22923 },
22924 Lint {
22925 label: "clippy::unnested_or_patterns",
22926 description: r##"Checks for unnested or-patterns, e.g., `Some(0) | Some(2)` and
22927suggests replacing the pattern with a nested one, `Some(0 | 2)`.
22928
22929Another way to think of this is that it rewrites patterns in
22930*disjunctive normal form (DNF)* into *conjunctive normal form (CNF)*."##,
22931 default_severity: Severity::Allow,
22932 warn_since: None,
22933 deny_since: None,
22934 },
22935 Lint {
22936 label: "clippy::unreachable",
22937 description: r##"Checks for usage of `unreachable!`."##,
22938 default_severity: Severity::Allow,
22939 warn_since: None,
22940 deny_since: None,
22941 },
22942 Lint {
22943 label: "clippy::unreadable_literal",
22944 description: r##"Warns if a long integral or floating-point constant does
22945not contain underscores."##,
22946 default_severity: Severity::Allow,
22947 warn_since: None,
22948 deny_since: None,
22949 },
22950 Lint {
22951 label: "clippy::unsafe_derive_deserialize",
22952 description: r##"Checks for deriving `serde::Deserialize` on a type that
22953has methods using `unsafe`."##,
22954 default_severity: Severity::Allow,
22955 warn_since: None,
22956 deny_since: None,
22957 },
22958 Lint {
22959 label: "clippy::unsafe_removed_from_name",
22960 description: r##"Checks for imports that remove unsafe from an item's
22961name."##,
22962 default_severity: Severity::Allow,
22963 warn_since: None,
22964 deny_since: None,
22965 },
22966 Lint {
22967 label: "clippy::unsafe_vector_initialization",
22968 description: r##"Nothing. This lint has been deprecated"##,
22969 default_severity: Severity::Allow,
22970 warn_since: None,
22971 deny_since: None,
22972 },
22973 Lint {
22974 label: "clippy::unseparated_literal_suffix",
22975 description: r##"Warns if literal suffixes are not separated by an
22976underscore.
22977To enforce unseparated literal suffix style,
22978see the `separated_literal_suffix` lint."##,
22979 default_severity: Severity::Allow,
22980 warn_since: None,
22981 deny_since: None,
22982 },
22983 Lint {
22984 label: "clippy::unsound_collection_transmute",
22985 description: r##"Checks for transmutes between collections whose
22986types have different ABI, size or alignment."##,
22987 default_severity: Severity::Allow,
22988 warn_since: None,
22989 deny_since: None,
22990 },
22991 Lint {
22992 label: "clippy::unstable_as_mut_slice",
22993 description: r##"Nothing. This lint has been deprecated"##,
22994 default_severity: Severity::Allow,
22995 warn_since: None,
22996 deny_since: None,
22997 },
22998 Lint {
22999 label: "clippy::unstable_as_slice",
23000 description: r##"Nothing. This lint has been deprecated"##,
23001 default_severity: Severity::Allow,
23002 warn_since: None,
23003 deny_since: None,
23004 },
23005 Lint {
23006 label: "clippy::unused_async",
23007 description: r##"Checks for functions that are declared `async` but have no `.await`s inside of them."##,
23008 default_severity: Severity::Allow,
23009 warn_since: None,
23010 deny_since: None,
23011 },
23012 Lint {
23013 label: "clippy::unused_collect",
23014 description: r##"Nothing. This lint has been deprecated"##,
23015 default_severity: Severity::Allow,
23016 warn_since: None,
23017 deny_since: None,
23018 },
23019 Lint {
23020 label: "clippy::unused_enumerate_index",
23021 description: r##"Checks for uses of the `enumerate` method where the index is unused (`_`)"##,
23022 default_severity: Severity::Allow,
23023 warn_since: None,
23024 deny_since: None,
23025 },
23026 Lint {
23027 label: "clippy::unused_format_specs",
23028 description: r##"Detects [formatting parameters] that have no effect on the output of
23029`format!()`, `println!()` or similar macros."##,
23030 default_severity: Severity::Allow,
23031 warn_since: None,
23032 deny_since: None,
23033 },
23034 Lint {
23035 label: "clippy::unused_io_amount",
23036 description: r##"Checks for unused written/read amount."##,
23037 default_severity: Severity::Allow,
23038 warn_since: None,
23039 deny_since: None,
23040 },
23041 Lint {
23042 label: "clippy::unused_peekable",
23043 description: r##"Checks for the creation of a `peekable` iterator that is never `.peek()`ed"##,
23044 default_severity: Severity::Allow,
23045 warn_since: None,
23046 deny_since: None,
23047 },
23048 Lint {
23049 label: "clippy::unused_result_ok",
23050 description: r##"Checks for calls to `Result::ok()` without using the returned `Option`."##,
23051 default_severity: Severity::Allow,
23052 warn_since: None,
23053 deny_since: None,
23054 },
23055 Lint {
23056 label: "clippy::unused_rounding",
23057 description: r##"Detects cases where a whole-number literal float is being rounded, using
23058the `floor`, `ceil`, or `round` methods."##,
23059 default_severity: Severity::Allow,
23060 warn_since: None,
23061 deny_since: None,
23062 },
23063 Lint {
23064 label: "clippy::unused_self",
23065 description: r##"Checks methods that contain a `self` argument but don't use it"##,
23066 default_severity: Severity::Allow,
23067 warn_since: None,
23068 deny_since: None,
23069 },
23070 Lint {
23071 label: "clippy::unused_trait_names",
23072 description: r##"Checks for `use Trait` where the Trait is only used for its methods and not referenced by a path directly."##,
23073 default_severity: Severity::Allow,
23074 warn_since: None,
23075 deny_since: None,
23076 },
23077 Lint {
23078 label: "clippy::unused_unit",
23079 description: r##"Checks for unit (`()`) expressions that can be removed."##,
23080 default_severity: Severity::Allow,
23081 warn_since: None,
23082 deny_since: None,
23083 },
23084 Lint {
23085 label: "clippy::unusual_byte_groupings",
23086 description: r##"Warns if hexadecimal or binary literals are not grouped
23087by nibble or byte."##,
23088 default_severity: Severity::Allow,
23089 warn_since: None,
23090 deny_since: None,
23091 },
23092 Lint {
23093 label: "clippy::unwrap_in_result",
23094 description: r##"Checks for functions of type `Result` that contain `expect()` or `unwrap()`"##,
23095 default_severity: Severity::Allow,
23096 warn_since: None,
23097 deny_since: None,
23098 },
23099 Lint {
23100 label: "clippy::unwrap_or_default",
23101 description: r##"Checks for usages of the following functions with an argument that constructs a default value
23102(e.g., `Default::default` or `String::new`):
23103- `unwrap_or`
23104- `unwrap_or_else`
23105- `or_insert`
23106- `or_insert_with`"##,
23107 default_severity: Severity::Allow,
23108 warn_since: None,
23109 deny_since: None,
23110 },
23111 Lint {
23112 label: "clippy::unwrap_used",
23113 description: r##"Checks for `.unwrap()` or `.unwrap_err()` calls on `Result`s and `.unwrap()` call on `Option`s."##,
23114 default_severity: Severity::Allow,
23115 warn_since: None,
23116 deny_since: None,
23117 },
23118 Lint {
23119 label: "clippy::upper_case_acronyms",
23120 description: r##"Checks for fully capitalized names and optionally names containing a capitalized acronym."##,
23121 default_severity: Severity::Allow,
23122 warn_since: None,
23123 deny_since: None,
23124 },
23125 Lint {
23126 label: "clippy::use_debug",
23127 description: r##"Checks for usage of `Debug` formatting. The purpose of this
23128lint is to catch debugging remnants."##,
23129 default_severity: Severity::Allow,
23130 warn_since: None,
23131 deny_since: None,
23132 },
23133 Lint {
23134 label: "clippy::use_self",
23135 description: r##"Checks for unnecessary repetition of structure name when a
23136replacement with `Self` is applicable."##,
23137 default_severity: Severity::Allow,
23138 warn_since: None,
23139 deny_since: None,
23140 },
23141 Lint {
23142 label: "clippy::used_underscore_binding",
23143 description: r##"Checks for the use of bindings with a single leading
23144underscore."##,
23145 default_severity: Severity::Allow,
23146 warn_since: None,
23147 deny_since: None,
23148 },
23149 Lint {
23150 label: "clippy::used_underscore_items",
23151 description: r##"Checks for the use of item with a single leading
23152underscore."##,
23153 default_severity: Severity::Allow,
23154 warn_since: None,
23155 deny_since: None,
23156 },
23157 Lint {
23158 label: "clippy::useless_asref",
23159 description: r##"Checks for usage of `.as_ref()` or `.as_mut()` where the
23160types before and after the call are the same."##,
23161 default_severity: Severity::Allow,
23162 warn_since: None,
23163 deny_since: None,
23164 },
23165 Lint {
23166 label: "clippy::useless_attribute",
23167 description: r##"Checks for `extern crate` and `use` items annotated with
23168lint attributes.
23169
23170This lint permits lint attributes for lints emitted on the items themself.
23171For `use` items these lints are:
23172* ambiguous_glob_reexports
23173* dead_code
23174* deprecated
23175* hidden_glob_reexports
23176* unreachable_pub
23177* unused
23178* unused_braces
23179* unused_import_braces
23180* clippy::disallowed_types
23181* clippy::enum_glob_use
23182* clippy::macro_use_imports
23183* clippy::module_name_repetitions
23184* clippy::redundant_pub_crate
23185* clippy::single_component_path_imports
23186* clippy::unsafe_removed_from_name
23187* clippy::wildcard_imports
23188
23189For `extern crate` items these lints are:
23190* `unused_imports` on items with `#[macro_use]`"##,
23191 default_severity: Severity::Allow,
23192 warn_since: None,
23193 deny_since: None,
23194 },
23195 Lint {
23196 label: "clippy::useless_conversion",
23197 description: r##"Checks for `Into`, `TryInto`, `From`, `TryFrom`, or `IntoIter` calls
23198which uselessly convert to the same type."##,
23199 default_severity: Severity::Allow,
23200 warn_since: None,
23201 deny_since: None,
23202 },
23203 Lint {
23204 label: "clippy::useless_format",
23205 description: r##"Checks for the use of `format!(string literal with no
23206argument)` and `format!({}, foo)` where `foo` is a string."##,
23207 default_severity: Severity::Allow,
23208 warn_since: None,
23209 deny_since: None,
23210 },
23211 Lint {
23212 label: "clippy::useless_let_if_seq",
23213 description: r##"Checks for variable declarations immediately followed by a
23214conditional affectation."##,
23215 default_severity: Severity::Allow,
23216 warn_since: None,
23217 deny_since: None,
23218 },
23219 Lint {
23220 label: "clippy::useless_transmute",
23221 description: r##"Checks for transmutes to the original type of the object
23222and transmutes that could be a cast."##,
23223 default_severity: Severity::Allow,
23224 warn_since: None,
23225 deny_since: None,
23226 },
23227 Lint {
23228 label: "clippy::useless_vec",
23229 description: r##"Checks for usage of `vec![..]` when using `[..]` would
23230be possible."##,
23231 default_severity: Severity::Allow,
23232 warn_since: None,
23233 deny_since: None,
23234 },
23235 Lint {
23236 label: "clippy::vec_box",
23237 description: r##"Checks for usage of `Vec<Box<T>>` where T: Sized anywhere in the code.
23238Check the [Box documentation](https://doc.rust-lang.org/std/boxed/index.html) for more information."##,
23239 default_severity: Severity::Allow,
23240 warn_since: None,
23241 deny_since: None,
23242 },
23243 Lint {
23244 label: "clippy::vec_init_then_push",
23245 description: r##"Checks for calls to `push` immediately after creating a new `Vec`.
23246
23247If the `Vec` is created using `with_capacity` this will only lint if the capacity is a
23248constant and the number of pushes is greater than or equal to the initial capacity.
23249
23250If the `Vec` is extended after the initial sequence of pushes and it was default initialized
23251then this will only lint after there were at least four pushes. This number may change in
23252the future."##,
23253 default_severity: Severity::Allow,
23254 warn_since: None,
23255 deny_since: None,
23256 },
23257 Lint {
23258 label: "clippy::vec_resize_to_zero",
23259 description: r##"Finds occurrences of `Vec::resize(0, an_int)`"##,
23260 default_severity: Severity::Allow,
23261 warn_since: None,
23262 deny_since: None,
23263 },
23264 Lint {
23265 label: "clippy::verbose_bit_mask",
23266 description: r##"Checks for bit masks that can be replaced by a call
23267to `trailing_zeros`"##,
23268 default_severity: Severity::Allow,
23269 warn_since: None,
23270 deny_since: None,
23271 },
23272 Lint {
23273 label: "clippy::verbose_file_reads",
23274 description: r##"Checks for usage of File::read_to_end and File::read_to_string."##,
23275 default_severity: Severity::Allow,
23276 warn_since: None,
23277 deny_since: None,
23278 },
23279 Lint {
23280 label: "clippy::waker_clone_wake",
23281 description: r##"Checks for usage of `waker.clone().wake()`"##,
23282 default_severity: Severity::Allow,
23283 warn_since: None,
23284 deny_since: None,
23285 },
23286 Lint {
23287 label: "clippy::while_float",
23288 description: r##"Checks for while loops comparing floating point values."##,
23289 default_severity: Severity::Allow,
23290 warn_since: None,
23291 deny_since: None,
23292 },
23293 Lint {
23294 label: "clippy::while_immutable_condition",
23295 description: r##"Checks whether variables used within while loop condition
23296can be (and are) mutated in the body."##,
23297 default_severity: Severity::Allow,
23298 warn_since: None,
23299 deny_since: None,
23300 },
23301 Lint {
23302 label: "clippy::while_let_loop",
23303 description: r##"Detects `loop + match` combinations that are easier
23304written as a `while let` loop."##,
23305 default_severity: Severity::Allow,
23306 warn_since: None,
23307 deny_since: None,
23308 },
23309 Lint {
23310 label: "clippy::while_let_on_iterator",
23311 description: r##"Checks for `while let` expressions on iterators."##,
23312 default_severity: Severity::Allow,
23313 warn_since: None,
23314 deny_since: None,
23315 },
23316 Lint {
23317 label: "clippy::wildcard_dependencies",
23318 description: r##"Checks for wildcard dependencies in the `Cargo.toml`."##,
23319 default_severity: Severity::Allow,
23320 warn_since: None,
23321 deny_since: None,
23322 },
23323 Lint {
23324 label: "clippy::wildcard_enum_match_arm",
23325 description: r##"Checks for wildcard enum matches using `_`."##,
23326 default_severity: Severity::Allow,
23327 warn_since: None,
23328 deny_since: None,
23329 },
23330 Lint {
23331 label: "clippy::wildcard_imports",
23332 description: r##"Checks for wildcard imports `use _::*`."##,
23333 default_severity: Severity::Allow,
23334 warn_since: None,
23335 deny_since: None,
23336 },
23337 Lint {
23338 label: "clippy::wildcard_in_or_patterns",
23339 description: r##"Checks for wildcard pattern used with others patterns in same match arm."##,
23340 default_severity: Severity::Allow,
23341 warn_since: None,
23342 deny_since: None,
23343 },
23344 Lint {
23345 label: "clippy::write_literal",
23346 description: r##"This lint warns about the use of literals as `write!`/`writeln!` args."##,
23347 default_severity: Severity::Allow,
23348 warn_since: None,
23349 deny_since: None,
23350 },
23351 Lint {
23352 label: "clippy::write_with_newline",
23353 description: r##"This lint warns when you use `write!()` with a format
23354string that
23355ends in a newline."##,
23356 default_severity: Severity::Allow,
23357 warn_since: None,
23358 deny_since: None,
23359 },
23360 Lint {
23361 label: "clippy::writeln_empty_string",
23362 description: r##"This lint warns when you use `writeln!(buf, )` to
23363print a newline."##,
23364 default_severity: Severity::Allow,
23365 warn_since: None,
23366 deny_since: None,
23367 },
23368 Lint {
23369 label: "clippy::wrong_pub_self_convention",
23370 description: r##"Nothing. This lint has been deprecated"##,
23371 default_severity: Severity::Allow,
23372 warn_since: None,
23373 deny_since: None,
23374 },
23375 Lint {
23376 label: "clippy::wrong_self_convention",
23377 description: r##"Checks for methods with certain name prefixes or suffixes, and which
23378do not adhere to standard conventions regarding how `self` is taken.
23379The actual rules are:
23380
23381|Prefix |Postfix |`self` taken | `self` type |
23382|-------|------------|-------------------------------|--------------|
23383|`as_` | none |`&self` or `&mut self` | any |
23384|`from_`| none | none | any |
23385|`into_`| none |`self` | any |
23386|`is_` | none |`&mut self` or `&self` or none | any |
23387|`to_` | `_mut` |`&mut self` | any |
23388|`to_` | not `_mut` |`self` | `Copy` |
23389|`to_` | not `_mut` |`&self` | not `Copy` |
23390
23391Note: Clippy doesn't trigger methods with `to_` prefix in:
23392- Traits definition.
23393Clippy can not tell if a type that implements a trait is `Copy` or not.
23394- Traits implementation, when `&self` is taken.
23395The method signature is controlled by the trait and often `&self` is required for all types that implement the trait
23396(see e.g. the `std::string::ToString` trait).
23397
23398Clippy allows `Pin<&Self>` and `Pin<&mut Self>` if `&self` and `&mut self` is required.
23399
23400Please find more info here:
23401https://rust-lang.github.io/api-guidelines/naming.html#ad-hoc-conversions-follow-as_-to_-into_-conventions-c-conv"##,
23402 default_severity: Severity::Allow,
23403 warn_since: None,
23404 deny_since: None,
23405 },
23406 Lint {
23407 label: "clippy::wrong_transmute",
23408 description: r##"Checks for transmutes that can't ever be correct on any
23409architecture."##,
23410 default_severity: Severity::Allow,
23411 warn_since: None,
23412 deny_since: None,
23413 },
23414 Lint {
23415 label: "clippy::zero_divided_by_zero",
23416 description: r##"Checks for `0.0 / 0.0`."##,
23417 default_severity: Severity::Allow,
23418 warn_since: None,
23419 deny_since: None,
23420 },
23421 Lint {
23422 label: "clippy::zero_prefixed_literal",
23423 description: r##"Warns if an integral constant literal starts with `0`."##,
23424 default_severity: Severity::Allow,
23425 warn_since: None,
23426 deny_since: None,
23427 },
23428 Lint {
23429 label: "clippy::zero_ptr",
23430 description: r##"Catch casts from `0` to some pointer type"##,
23431 default_severity: Severity::Allow,
23432 warn_since: None,
23433 deny_since: None,
23434 },
23435 Lint {
23436 label: "clippy::zero_repeat_side_effects",
23437 description: r##"Checks for array or vec initializations which call a function or method,
23438but which have a repeat count of zero."##,
23439 default_severity: Severity::Allow,
23440 warn_since: None,
23441 deny_since: None,
23442 },
23443 Lint {
23444 label: "clippy::zero_sized_map_values",
23445 description: r##"Checks for maps with zero-sized value types anywhere in the code."##,
23446 default_severity: Severity::Allow,
23447 warn_since: None,
23448 deny_since: None,
23449 },
23450 Lint {
23451 label: "clippy::zombie_processes",
23452 description: r##"Looks for code that spawns a process but never calls `wait()` on the child."##,
23453 default_severity: Severity::Allow,
23454 warn_since: None,
23455 deny_since: None,
23456 },
23457 Lint {
23458 label: "clippy::zst_offset",
23459 description: r##"Checks for `offset(_)`, `wrapping_`{`add`, `sub`}, etc. on raw pointers to
23460zero-sized types"##,
23461 default_severity: Severity::Allow,
23462 warn_since: None,
23463 deny_since: None,
23464 },
23465];
23466pub const CLIPPY_LINT_GROUPS: &[LintGroup] = &[
23467 LintGroup {
23468 lint: Lint {
23469 label: "clippy::cargo",
23470 description: r##"lint group for: clippy::cargo_common_metadata, clippy::multiple_crate_versions, clippy::negative_feature_names, clippy::redundant_feature_names, clippy::wildcard_dependencies"##,
23471 default_severity: Severity::Allow,
23472 warn_since: None,
23473 deny_since: None,
23474 },
23475 children: &[
23476 "clippy::cargo_common_metadata",
23477 "clippy::multiple_crate_versions",
23478 "clippy::negative_feature_names",
23479 "clippy::redundant_feature_names",
23480 "clippy::wildcard_dependencies",
23481 ],
23482 },
23483 LintGroup {
23484 lint: Lint {
23485 label: "clippy::complexity",
23486 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"##,
23487 default_severity: Severity::Allow,
23488 warn_since: None,
23489 deny_since: None,
23490 },
23491 children: &[
23492 "clippy::bind_instead_of_map",
23493 "clippy::bool_comparison",
23494 "clippy::borrow_deref_ref",
23495 "clippy::borrowed_box",
23496 "clippy::bytes_count_to_len",
23497 "clippy::char_lit_as_u8",
23498 "clippy::clone_on_copy",
23499 "clippy::crosspointer_transmute",
23500 "clippy::default_constructed_unit_structs",
23501 "clippy::deprecated_cfg_attr",
23502 "clippy::deref_addrof",
23503 "clippy::derivable_impls",
23504 "clippy::diverging_sub_expression",
23505 "clippy::double_comparisons",
23506 "clippy::double_parens",
23507 "clippy::duration_subsec",
23508 "clippy::excessive_nesting",
23509 "clippy::explicit_auto_deref",
23510 "clippy::explicit_counter_loop",
23511 "clippy::explicit_write",
23512 "clippy::extra_unused_lifetimes",
23513 "clippy::extra_unused_type_parameters",
23514 "clippy::filter_map_identity",
23515 "clippy::filter_next",
23516 "clippy::flat_map_identity",
23517 "clippy::get_last_with_len",
23518 "clippy::identity_op",
23519 "clippy::implied_bounds_in_impls",
23520 "clippy::inspect_for_each",
23521 "clippy::int_plus_one",
23522 "clippy::iter_count",
23523 "clippy::iter_kv_map",
23524 "clippy::let_with_type_underscore",
23525 "clippy::manual_c_str_literals",
23526 "clippy::manual_clamp",
23527 "clippy::manual_div_ceil",
23528 "clippy::manual_filter",
23529 "clippy::manual_filter_map",
23530 "clippy::manual_find",
23531 "clippy::manual_find_map",
23532 "clippy::manual_flatten",
23533 "clippy::manual_hash_one",
23534 "clippy::manual_inspect",
23535 "clippy::manual_is_power_of_two",
23536 "clippy::manual_main_separator_str",
23537 "clippy::manual_range_patterns",
23538 "clippy::manual_rem_euclid",
23539 "clippy::manual_slice_size_calculation",
23540 "clippy::manual_split_once",
23541 "clippy::manual_strip",
23542 "clippy::manual_swap",
23543 "clippy::manual_unwrap_or",
23544 "clippy::map_flatten",
23545 "clippy::map_identity",
23546 "clippy::match_as_ref",
23547 "clippy::match_single_binding",
23548 "clippy::needless_arbitrary_self_type",
23549 "clippy::needless_bool",
23550 "clippy::needless_bool_assign",
23551 "clippy::needless_borrowed_reference",
23552 "clippy::needless_if",
23553 "clippy::needless_lifetimes",
23554 "clippy::needless_match",
23555 "clippy::needless_option_as_deref",
23556 "clippy::needless_option_take",
23557 "clippy::needless_question_mark",
23558 "clippy::needless_splitn",
23559 "clippy::needless_update",
23560 "clippy::neg_cmp_op_on_partial_ord",
23561 "clippy::no_effect",
23562 "clippy::nonminimal_bool",
23563 "clippy::only_used_in_recursion",
23564 "clippy::option_as_ref_deref",
23565 "clippy::option_filter_map",
23566 "clippy::option_map_unit_fn",
23567 "clippy::or_then_unwrap",
23568 "clippy::partialeq_ne_impl",
23569 "clippy::precedence",
23570 "clippy::ptr_offset_with_cast",
23571 "clippy::range_zip_with_len",
23572 "clippy::redundant_as_str",
23573 "clippy::redundant_async_block",
23574 "clippy::redundant_at_rest_pattern",
23575 "clippy::redundant_closure_call",
23576 "clippy::redundant_guards",
23577 "clippy::redundant_slicing",
23578 "clippy::repeat_once",
23579 "clippy::reserve_after_initialization",
23580 "clippy::result_filter_map",
23581 "clippy::result_map_unit_fn",
23582 "clippy::search_is_some",
23583 "clippy::seek_from_current",
23584 "clippy::seek_to_start_instead_of_rewind",
23585 "clippy::short_circuit_statement",
23586 "clippy::single_element_loop",
23587 "clippy::skip_while_next",
23588 "clippy::string_from_utf8_as_bytes",
23589 "clippy::strlen_on_c_strings",
23590 "clippy::temporary_assignment",
23591 "clippy::too_many_arguments",
23592 "clippy::transmute_bytes_to_str",
23593 "clippy::transmute_float_to_int",
23594 "clippy::transmute_int_to_bool",
23595 "clippy::transmute_int_to_char",
23596 "clippy::transmute_int_to_float",
23597 "clippy::transmute_int_to_non_zero",
23598 "clippy::transmute_num_to_bytes",
23599 "clippy::transmute_ptr_to_ref",
23600 "clippy::transmutes_expressible_as_ptr_casts",
23601 "clippy::type_complexity",
23602 "clippy::unit_arg",
23603 "clippy::unnecessary_cast",
23604 "clippy::unnecessary_filter_map",
23605 "clippy::unnecessary_find_map",
23606 "clippy::unnecessary_first_then_check",
23607 "clippy::unnecessary_literal_unwrap",
23608 "clippy::unnecessary_map_on_constructor",
23609 "clippy::unnecessary_min_or_max",
23610 "clippy::unnecessary_operation",
23611 "clippy::unnecessary_sort_by",
23612 "clippy::unnecessary_unwrap",
23613 "clippy::unneeded_wildcard_pattern",
23614 "clippy::unused_format_specs",
23615 "clippy::useless_asref",
23616 "clippy::useless_conversion",
23617 "clippy::useless_format",
23618 "clippy::useless_transmute",
23619 "clippy::vec_box",
23620 "clippy::while_let_loop",
23621 "clippy::wildcard_in_or_patterns",
23622 "clippy::zero_divided_by_zero",
23623 "clippy::zero_prefixed_literal",
23624 ],
23625 },
23626 LintGroup {
23627 lint: Lint {
23628 label: "clippy::correctness",
23629 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"##,
23630 default_severity: Severity::Allow,
23631 warn_since: None,
23632 deny_since: None,
23633 },
23634 children: &[
23635 "clippy::absurd_extreme_comparisons",
23636 "clippy::almost_swapped",
23637 "clippy::approx_constant",
23638 "clippy::async_yields_async",
23639 "clippy::bad_bit_mask",
23640 "clippy::cast_slice_different_sizes",
23641 "clippy::deprecated_semver",
23642 "clippy::derive_ord_xor_partial_ord",
23643 "clippy::derived_hash_with_manual_eq",
23644 "clippy::eager_transmute",
23645 "clippy::enum_clike_unportable_variant",
23646 "clippy::eq_op",
23647 "clippy::erasing_op",
23648 "clippy::fn_address_comparisons",
23649 "clippy::if_let_mutex",
23650 "clippy::ifs_same_cond",
23651 "clippy::impl_hash_borrow_with_str_and_bytes",
23652 "clippy::impossible_comparisons",
23653 "clippy::ineffective_bit_mask",
23654 "clippy::infinite_iter",
23655 "clippy::inherent_to_string_shadow_display",
23656 "clippy::inline_fn_without_body",
23657 "clippy::invalid_null_ptr_usage",
23658 "clippy::invalid_regex",
23659 "clippy::inverted_saturating_sub",
23660 "clippy::invisible_characters",
23661 "clippy::iter_next_loop",
23662 "clippy::iter_skip_zero",
23663 "clippy::iterator_step_by_zero",
23664 "clippy::let_underscore_lock",
23665 "clippy::lint_groups_priority",
23666 "clippy::match_str_case_mismatch",
23667 "clippy::mem_replace_with_uninit",
23668 "clippy::min_max",
23669 "clippy::mistyped_literal_suffixes",
23670 "clippy::modulo_one",
23671 "clippy::mut_from_ref",
23672 "clippy::never_loop",
23673 "clippy::non_octal_unix_permissions",
23674 "clippy::nonsensical_open_options",
23675 "clippy::not_unsafe_ptr_arg_deref",
23676 "clippy::option_env_unwrap",
23677 "clippy::out_of_bounds_indexing",
23678 "clippy::overly_complex_bool_expr",
23679 "clippy::panicking_overflow_checks",
23680 "clippy::panicking_unwrap",
23681 "clippy::possible_missing_comma",
23682 "clippy::read_line_without_trim",
23683 "clippy::recursive_format_impl",
23684 "clippy::redundant_comparisons",
23685 "clippy::redundant_locals",
23686 "clippy::reversed_empty_ranges",
23687 "clippy::self_assignment",
23688 "clippy::serde_api_misuse",
23689 "clippy::size_of_in_element_count",
23690 "clippy::suspicious_splitn",
23691 "clippy::transmute_null_to_fn",
23692 "clippy::transmuting_null",
23693 "clippy::uninit_assumed_init",
23694 "clippy::uninit_vec",
23695 "clippy::unit_cmp",
23696 "clippy::unit_hash",
23697 "clippy::unit_return_expecting_ord",
23698 "clippy::unsound_collection_transmute",
23699 "clippy::unused_io_amount",
23700 "clippy::useless_attribute",
23701 "clippy::vec_resize_to_zero",
23702 "clippy::while_immutable_condition",
23703 "clippy::wrong_transmute",
23704 "clippy::zst_offset",
23705 ],
23706 },
23707 LintGroup {
23708 lint: Lint {
23709 label: "clippy::deprecated",
23710 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"##,
23711 default_severity: Severity::Allow,
23712 warn_since: None,
23713 deny_since: None,
23714 },
23715 children: &[
23716 "clippy::assign_ops",
23717 "clippy::extend_from_slice",
23718 "clippy::misaligned_transmute",
23719 "clippy::pub_enum_variant_names",
23720 "clippy::range_step_by_zero",
23721 "clippy::regex_macro",
23722 "clippy::replace_consts",
23723 "clippy::should_assert_eq",
23724 "clippy::unsafe_vector_initialization",
23725 "clippy::unstable_as_mut_slice",
23726 "clippy::unstable_as_slice",
23727 "clippy::unused_collect",
23728 "clippy::wrong_pub_self_convention",
23729 ],
23730 },
23731 LintGroup {
23732 lint: Lint {
23733 label: "clippy::nursery",
23734 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"##,
23735 default_severity: Severity::Allow,
23736 warn_since: None,
23737 deny_since: None,
23738 },
23739 children: &[
23740 "clippy::as_ptr_cast_mut",
23741 "clippy::branches_sharing_code",
23742 "clippy::clear_with_drain",
23743 "clippy::cognitive_complexity",
23744 "clippy::collection_is_never_read",
23745 "clippy::debug_assert_with_mut_call",
23746 "clippy::derive_partial_eq_without_eq",
23747 "clippy::equatable_if_let",
23748 "clippy::fallible_impl_from",
23749 "clippy::future_not_send",
23750 "clippy::imprecise_flops",
23751 "clippy::iter_on_empty_collections",
23752 "clippy::iter_on_single_items",
23753 "clippy::iter_with_drain",
23754 "clippy::large_stack_frames",
23755 "clippy::missing_const_for_fn",
23756 "clippy::mutex_integer",
23757 "clippy::needless_collect",
23758 "clippy::needless_pass_by_ref_mut",
23759 "clippy::non_send_fields_in_send_ty",
23760 "clippy::nonstandard_macro_braces",
23761 "clippy::option_if_let_else",
23762 "clippy::or_fun_call",
23763 "clippy::path_buf_push_overwrite",
23764 "clippy::read_zero_byte_vec",
23765 "clippy::redundant_clone",
23766 "clippy::redundant_pub_crate",
23767 "clippy::set_contains_or_insert",
23768 "clippy::significant_drop_in_scrutinee",
23769 "clippy::significant_drop_tightening",
23770 "clippy::string_lit_as_bytes",
23771 "clippy::suboptimal_flops",
23772 "clippy::suspicious_operation_groupings",
23773 "clippy::trailing_empty_array",
23774 "clippy::trait_duplication_in_bounds",
23775 "clippy::transmute_undefined_repr",
23776 "clippy::trivial_regex",
23777 "clippy::tuple_array_conversions",
23778 "clippy::type_repetition_in_bounds",
23779 "clippy::uninhabited_references",
23780 "clippy::unnecessary_struct_initialization",
23781 "clippy::unused_peekable",
23782 "clippy::unused_rounding",
23783 "clippy::use_self",
23784 "clippy::useless_let_if_seq",
23785 "clippy::while_float",
23786 ],
23787 },
23788 LintGroup {
23789 lint: Lint {
23790 label: "clippy::pedantic",
23791 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"##,
23792 default_severity: Severity::Allow,
23793 warn_since: None,
23794 deny_since: None,
23795 },
23796 children: &[
23797 "clippy::assigning_clones",
23798 "clippy::bool_to_int_with_if",
23799 "clippy::borrow_as_ptr",
23800 "clippy::case_sensitive_file_extension_comparisons",
23801 "clippy::cast_lossless",
23802 "clippy::cast_possible_truncation",
23803 "clippy::cast_possible_wrap",
23804 "clippy::cast_precision_loss",
23805 "clippy::cast_ptr_alignment",
23806 "clippy::cast_sign_loss",
23807 "clippy::checked_conversions",
23808 "clippy::cloned_instead_of_copied",
23809 "clippy::copy_iterator",
23810 "clippy::default_trait_access",
23811 "clippy::doc_link_with_quotes",
23812 "clippy::doc_markdown",
23813 "clippy::empty_enum",
23814 "clippy::enum_glob_use",
23815 "clippy::expl_impl_clone_on_copy",
23816 "clippy::explicit_deref_methods",
23817 "clippy::explicit_into_iter_loop",
23818 "clippy::explicit_iter_loop",
23819 "clippy::filter_map_next",
23820 "clippy::flat_map_option",
23821 "clippy::float_cmp",
23822 "clippy::fn_params_excessive_bools",
23823 "clippy::from_iter_instead_of_collect",
23824 "clippy::if_not_else",
23825 "clippy::ignored_unit_patterns",
23826 "clippy::implicit_clone",
23827 "clippy::implicit_hasher",
23828 "clippy::inconsistent_struct_constructor",
23829 "clippy::index_refutable_slice",
23830 "clippy::inefficient_to_string",
23831 "clippy::inline_always",
23832 "clippy::into_iter_without_iter",
23833 "clippy::invalid_upcast_comparisons",
23834 "clippy::items_after_statements",
23835 "clippy::iter_filter_is_ok",
23836 "clippy::iter_filter_is_some",
23837 "clippy::iter_not_returning_iterator",
23838 "clippy::iter_without_into_iter",
23839 "clippy::large_digit_groups",
23840 "clippy::large_futures",
23841 "clippy::large_stack_arrays",
23842 "clippy::large_types_passed_by_value",
23843 "clippy::linkedlist",
23844 "clippy::macro_use_imports",
23845 "clippy::manual_assert",
23846 "clippy::manual_instant_elapsed",
23847 "clippy::manual_is_variant_and",
23848 "clippy::manual_let_else",
23849 "clippy::manual_ok_or",
23850 "clippy::manual_string_new",
23851 "clippy::many_single_char_names",
23852 "clippy::map_unwrap_or",
23853 "clippy::match_bool",
23854 "clippy::match_on_vec_items",
23855 "clippy::match_same_arms",
23856 "clippy::match_wild_err_arm",
23857 "clippy::match_wildcard_for_single_variants",
23858 "clippy::maybe_infinite_iter",
23859 "clippy::mismatching_type_param_order",
23860 "clippy::missing_errors_doc",
23861 "clippy::missing_fields_in_debug",
23862 "clippy::missing_panics_doc",
23863 "clippy::module_name_repetitions",
23864 "clippy::must_use_candidate",
23865 "clippy::mut_mut",
23866 "clippy::naive_bytecount",
23867 "clippy::needless_bitwise_bool",
23868 "clippy::needless_continue",
23869 "clippy::needless_for_each",
23870 "clippy::needless_pass_by_value",
23871 "clippy::needless_raw_string_hashes",
23872 "clippy::no_effect_underscore_binding",
23873 "clippy::no_mangle_with_rust_abi",
23874 "clippy::option_as_ref_cloned",
23875 "clippy::option_option",
23876 "clippy::ptr_as_ptr",
23877 "clippy::ptr_cast_constness",
23878 "clippy::pub_underscore_fields",
23879 "clippy::range_minus_one",
23880 "clippy::range_plus_one",
23881 "clippy::redundant_closure_for_method_calls",
23882 "clippy::redundant_else",
23883 "clippy::ref_as_ptr",
23884 "clippy::ref_binding_to_reference",
23885 "clippy::ref_option",
23886 "clippy::ref_option_ref",
23887 "clippy::return_self_not_must_use",
23888 "clippy::same_functions_in_if_condition",
23889 "clippy::semicolon_if_nothing_returned",
23890 "clippy::should_panic_without_expect",
23891 "clippy::similar_names",
23892 "clippy::single_char_pattern",
23893 "clippy::single_match_else",
23894 "clippy::stable_sort_primitive",
23895 "clippy::str_split_at_newline",
23896 "clippy::string_add_assign",
23897 "clippy::struct_excessive_bools",
23898 "clippy::struct_field_names",
23899 "clippy::too_many_lines",
23900 "clippy::transmute_ptr_to_ptr",
23901 "clippy::trivially_copy_pass_by_ref",
23902 "clippy::unchecked_duration_subtraction",
23903 "clippy::unicode_not_nfc",
23904 "clippy::uninlined_format_args",
23905 "clippy::unnecessary_box_returns",
23906 "clippy::unnecessary_join",
23907 "clippy::unnecessary_wraps",
23908 "clippy::unnested_or_patterns",
23909 "clippy::unreadable_literal",
23910 "clippy::unsafe_derive_deserialize",
23911 "clippy::unused_async",
23912 "clippy::unused_self",
23913 "clippy::used_underscore_binding",
23914 "clippy::used_underscore_items",
23915 "clippy::verbose_bit_mask",
23916 "clippy::wildcard_imports",
23917 "clippy::zero_sized_map_values",
23918 ],
23919 },
23920 LintGroup {
23921 lint: Lint {
23922 label: "clippy::perf",
23923 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"##,
23924 default_severity: Severity::Allow,
23925 warn_since: None,
23926 deny_since: None,
23927 },
23928 children: &[
23929 "clippy::box_collection",
23930 "clippy::boxed_local",
23931 "clippy::cmp_owned",
23932 "clippy::collapsible_str_replace",
23933 "clippy::drain_collect",
23934 "clippy::expect_fun_call",
23935 "clippy::extend_with_drain",
23936 "clippy::format_collect",
23937 "clippy::format_in_format_args",
23938 "clippy::iter_overeager_cloned",
23939 "clippy::large_const_arrays",
23940 "clippy::large_enum_variant",
23941 "clippy::manual_memcpy",
23942 "clippy::manual_retain",
23943 "clippy::manual_str_repeat",
23944 "clippy::manual_try_fold",
23945 "clippy::map_entry",
23946 "clippy::missing_const_for_thread_local",
23947 "clippy::missing_spin_loop",
23948 "clippy::readonly_write_lock",
23949 "clippy::redundant_allocation",
23950 "clippy::result_large_err",
23951 "clippy::slow_vector_initialization",
23952 "clippy::to_string_in_format_args",
23953 "clippy::unnecessary_to_owned",
23954 "clippy::useless_vec",
23955 "clippy::vec_init_then_push",
23956 "clippy::waker_clone_wake",
23957 ],
23958 },
23959 LintGroup {
23960 lint: Lint {
23961 label: "clippy::restriction",
23962 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"##,
23963 default_severity: Severity::Allow,
23964 warn_since: None,
23965 deny_since: None,
23966 },
23967 children: &[
23968 "clippy::absolute_paths",
23969 "clippy::alloc_instead_of_core",
23970 "clippy::allow_attributes",
23971 "clippy::allow_attributes_without_reason",
23972 "clippy::arithmetic_side_effects",
23973 "clippy::as_conversions",
23974 "clippy::as_underscore",
23975 "clippy::assertions_on_result_states",
23976 "clippy::big_endian_bytes",
23977 "clippy::cfg_not_test",
23978 "clippy::clone_on_ref_ptr",
23979 "clippy::create_dir",
23980 "clippy::dbg_macro",
23981 "clippy::decimal_literal_representation",
23982 "clippy::default_numeric_fallback",
23983 "clippy::default_union_representation",
23984 "clippy::deref_by_slicing",
23985 "clippy::disallowed_script_idents",
23986 "clippy::else_if_without_else",
23987 "clippy::empty_drop",
23988 "clippy::empty_enum_variants_with_brackets",
23989 "clippy::empty_structs_with_brackets",
23990 "clippy::error_impl_error",
23991 "clippy::exhaustive_enums",
23992 "clippy::exhaustive_structs",
23993 "clippy::exit",
23994 "clippy::expect_used",
23995 "clippy::field_scoped_visibility_modifiers",
23996 "clippy::filetype_is_file",
23997 "clippy::float_arithmetic",
23998 "clippy::float_cmp_const",
23999 "clippy::fn_to_numeric_cast_any",
24000 "clippy::format_push_string",
24001 "clippy::get_unwrap",
24002 "clippy::host_endian_bytes",
24003 "clippy::if_then_some_else_none",
24004 "clippy::impl_trait_in_params",
24005 "clippy::implicit_return",
24006 "clippy::indexing_slicing",
24007 "clippy::infinite_loop",
24008 "clippy::inline_asm_x86_att_syntax",
24009 "clippy::inline_asm_x86_intel_syntax",
24010 "clippy::integer_division",
24011 "clippy::integer_division_remainder_used",
24012 "clippy::iter_over_hash_type",
24013 "clippy::large_include_file",
24014 "clippy::let_underscore_must_use",
24015 "clippy::let_underscore_untyped",
24016 "clippy::little_endian_bytes",
24017 "clippy::lossy_float_literal",
24018 "clippy::map_err_ignore",
24019 "clippy::mem_forget",
24020 "clippy::min_ident_chars",
24021 "clippy::missing_assert_message",
24022 "clippy::missing_asserts_for_indexing",
24023 "clippy::missing_docs_in_private_items",
24024 "clippy::missing_inline_in_public_items",
24025 "clippy::missing_trait_methods",
24026 "clippy::mixed_read_write_in_expression",
24027 "clippy::mod_module_files",
24028 "clippy::modulo_arithmetic",
24029 "clippy::multiple_inherent_impl",
24030 "clippy::multiple_unsafe_ops_per_block",
24031 "clippy::mutex_atomic",
24032 "clippy::needless_raw_strings",
24033 "clippy::non_ascii_literal",
24034 "clippy::non_zero_suggestions",
24035 "clippy::panic",
24036 "clippy::panic_in_result_fn",
24037 "clippy::partial_pub_fields",
24038 "clippy::pathbuf_init_then_push",
24039 "clippy::pattern_type_mismatch",
24040 "clippy::print_stderr",
24041 "clippy::print_stdout",
24042 "clippy::pub_use",
24043 "clippy::pub_with_shorthand",
24044 "clippy::pub_without_shorthand",
24045 "clippy::question_mark_used",
24046 "clippy::rc_buffer",
24047 "clippy::rc_mutex",
24048 "clippy::redundant_type_annotations",
24049 "clippy::ref_patterns",
24050 "clippy::renamed_function_params",
24051 "clippy::rest_pat_in_fully_bound_structs",
24052 "clippy::same_name_method",
24053 "clippy::self_named_module_files",
24054 "clippy::semicolon_inside_block",
24055 "clippy::semicolon_outside_block",
24056 "clippy::separated_literal_suffix",
24057 "clippy::shadow_reuse",
24058 "clippy::shadow_same",
24059 "clippy::shadow_unrelated",
24060 "clippy::single_call_fn",
24061 "clippy::single_char_lifetime_names",
24062 "clippy::std_instead_of_alloc",
24063 "clippy::std_instead_of_core",
24064 "clippy::str_to_string",
24065 "clippy::string_add",
24066 "clippy::string_lit_chars_any",
24067 "clippy::string_slice",
24068 "clippy::string_to_string",
24069 "clippy::suspicious_xor_used_as_pow",
24070 "clippy::tests_outside_test_module",
24071 "clippy::todo",
24072 "clippy::try_err",
24073 "clippy::undocumented_unsafe_blocks",
24074 "clippy::unimplemented",
24075 "clippy::unnecessary_safety_comment",
24076 "clippy::unnecessary_safety_doc",
24077 "clippy::unnecessary_self_imports",
24078 "clippy::unneeded_field_pattern",
24079 "clippy::unreachable",
24080 "clippy::unseparated_literal_suffix",
24081 "clippy::unused_result_ok",
24082 "clippy::unused_trait_names",
24083 "clippy::unwrap_in_result",
24084 "clippy::unwrap_used",
24085 "clippy::use_debug",
24086 "clippy::verbose_file_reads",
24087 "clippy::wildcard_enum_match_arm",
24088 ],
24089 },
24090 LintGroup {
24091 lint: Lint {
24092 label: "clippy::style",
24093 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"##,
24094 default_severity: Severity::Allow,
24095 warn_since: None,
24096 deny_since: None,
24097 },
24098 children: &[
24099 "clippy::assertions_on_constants",
24100 "clippy::assign_op_pattern",
24101 "clippy::blocks_in_conditions",
24102 "clippy::bool_assert_comparison",
24103 "clippy::borrow_interior_mutable_const",
24104 "clippy::box_default",
24105 "clippy::builtin_type_shadow",
24106 "clippy::byte_char_slices",
24107 "clippy::bytes_nth",
24108 "clippy::chars_last_cmp",
24109 "clippy::chars_next_cmp",
24110 "clippy::cmp_null",
24111 "clippy::collapsible_else_if",
24112 "clippy::collapsible_if",
24113 "clippy::collapsible_match",
24114 "clippy::comparison_chain",
24115 "clippy::comparison_to_empty",
24116 "clippy::declare_interior_mutable_const",
24117 "clippy::default_instead_of_iter_empty",
24118 "clippy::disallowed_macros",
24119 "clippy::disallowed_methods",
24120 "clippy::disallowed_names",
24121 "clippy::disallowed_types",
24122 "clippy::doc_lazy_continuation",
24123 "clippy::double_must_use",
24124 "clippy::double_neg",
24125 "clippy::duplicate_underscore_argument",
24126 "clippy::enum_variant_names",
24127 "clippy::err_expect",
24128 "clippy::excessive_precision",
24129 "clippy::field_reassign_with_default",
24130 "clippy::filter_map_bool_then",
24131 "clippy::fn_to_numeric_cast",
24132 "clippy::fn_to_numeric_cast_with_truncation",
24133 "clippy::for_kv_map",
24134 "clippy::from_over_into",
24135 "clippy::from_str_radix_10",
24136 "clippy::get_first",
24137 "clippy::if_same_then_else",
24138 "clippy::implicit_saturating_add",
24139 "clippy::implicit_saturating_sub",
24140 "clippy::inconsistent_digit_grouping",
24141 "clippy::infallible_destructuring_match",
24142 "clippy::inherent_to_string",
24143 "clippy::init_numbered_fields",
24144 "clippy::into_iter_on_ref",
24145 "clippy::is_digit_ascii_radix",
24146 "clippy::items_after_test_module",
24147 "clippy::iter_cloned_collect",
24148 "clippy::iter_next_slice",
24149 "clippy::iter_nth",
24150 "clippy::iter_nth_zero",
24151 "clippy::iter_skip_next",
24152 "clippy::just_underscores_and_digits",
24153 "clippy::legacy_numeric_constants",
24154 "clippy::len_without_is_empty",
24155 "clippy::len_zero",
24156 "clippy::let_and_return",
24157 "clippy::let_unit_value",
24158 "clippy::main_recursion",
24159 "clippy::manual_async_fn",
24160 "clippy::manual_bits",
24161 "clippy::manual_is_ascii_check",
24162 "clippy::manual_is_finite",
24163 "clippy::manual_is_infinite",
24164 "clippy::manual_map",
24165 "clippy::manual_next_back",
24166 "clippy::manual_non_exhaustive",
24167 "clippy::manual_pattern_char_comparison",
24168 "clippy::manual_range_contains",
24169 "clippy::manual_rotate",
24170 "clippy::manual_saturating_arithmetic",
24171 "clippy::manual_while_let_some",
24172 "clippy::map_clone",
24173 "clippy::map_collect_result_unit",
24174 "clippy::match_like_matches_macro",
24175 "clippy::match_overlapping_arm",
24176 "clippy::match_ref_pats",
24177 "clippy::match_result_ok",
24178 "clippy::mem_replace_option_with_none",
24179 "clippy::mem_replace_with_default",
24180 "clippy::missing_enforced_import_renames",
24181 "clippy::missing_safety_doc",
24182 "clippy::mixed_attributes_style",
24183 "clippy::mixed_case_hex_literals",
24184 "clippy::module_inception",
24185 "clippy::must_use_unit",
24186 "clippy::mut_mutex_lock",
24187 "clippy::needless_borrow",
24188 "clippy::needless_borrows_for_generic_args",
24189 "clippy::needless_doctest_main",
24190 "clippy::needless_else",
24191 "clippy::needless_late_init",
24192 "clippy::needless_parens_on_range_literals",
24193 "clippy::needless_pub_self",
24194 "clippy::needless_range_loop",
24195 "clippy::needless_return",
24196 "clippy::needless_return_with_question_mark",
24197 "clippy::neg_multiply",
24198 "clippy::new_ret_no_self",
24199 "clippy::new_without_default",
24200 "clippy::non_minimal_cfg",
24201 "clippy::obfuscated_if_else",
24202 "clippy::ok_expect",
24203 "clippy::op_ref",
24204 "clippy::option_map_or_err_ok",
24205 "clippy::option_map_or_none",
24206 "clippy::partialeq_to_none",
24207 "clippy::print_literal",
24208 "clippy::print_with_newline",
24209 "clippy::println_empty_string",
24210 "clippy::ptr_arg",
24211 "clippy::ptr_eq",
24212 "clippy::question_mark",
24213 "clippy::redundant_closure",
24214 "clippy::redundant_field_names",
24215 "clippy::redundant_pattern",
24216 "clippy::redundant_pattern_matching",
24217 "clippy::redundant_static_lifetimes",
24218 "clippy::result_map_or_into_option",
24219 "clippy::result_unit_err",
24220 "clippy::same_item_push",
24221 "clippy::self_named_constructors",
24222 "clippy::should_implement_trait",
24223 "clippy::single_char_add_str",
24224 "clippy::single_component_path_imports",
24225 "clippy::single_match",
24226 "clippy::string_extend_chars",
24227 "clippy::tabs_in_doc_comments",
24228 "clippy::to_digit_is_some",
24229 "clippy::to_string_trait_impl",
24230 "clippy::too_long_first_doc_paragraph",
24231 "clippy::toplevel_ref_arg",
24232 "clippy::trim_split_whitespace",
24233 "clippy::unnecessary_fallible_conversions",
24234 "clippy::unnecessary_fold",
24235 "clippy::unnecessary_lazy_evaluations",
24236 "clippy::unnecessary_mut_passed",
24237 "clippy::unnecessary_owned_empty_strings",
24238 "clippy::unsafe_removed_from_name",
24239 "clippy::unused_enumerate_index",
24240 "clippy::unused_unit",
24241 "clippy::unusual_byte_groupings",
24242 "clippy::unwrap_or_default",
24243 "clippy::upper_case_acronyms",
24244 "clippy::while_let_on_iterator",
24245 "clippy::write_literal",
24246 "clippy::write_with_newline",
24247 "clippy::writeln_empty_string",
24248 "clippy::wrong_self_convention",
24249 "clippy::zero_ptr",
24250 ],
24251 },
24252 LintGroup {
24253 lint: Lint {
24254 label: "clippy::suspicious",
24255 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"##,
24256 default_severity: Severity::Allow,
24257 warn_since: None,
24258 deny_since: None,
24259 },
24260 children: &[
24261 "clippy::almost_complete_range",
24262 "clippy::arc_with_non_send_sync",
24263 "clippy::await_holding_invalid_type",
24264 "clippy::await_holding_lock",
24265 "clippy::await_holding_refcell_ref",
24266 "clippy::blanket_clippy_restriction_lints",
24267 "clippy::cast_abs_to_unsigned",
24268 "clippy::cast_enum_constructor",
24269 "clippy::cast_enum_truncation",
24270 "clippy::cast_nan_to_int",
24271 "clippy::cast_slice_from_raw_parts",
24272 "clippy::const_is_empty",
24273 "clippy::crate_in_macro_def",
24274 "clippy::deprecated_clippy_cfg_attr",
24275 "clippy::drop_non_drop",
24276 "clippy::duplicate_mod",
24277 "clippy::duplicated_attributes",
24278 "clippy::empty_docs",
24279 "clippy::empty_line_after_doc_comments",
24280 "clippy::empty_line_after_outer_attr",
24281 "clippy::empty_loop",
24282 "clippy::float_equality_without_abs",
24283 "clippy::forget_non_drop",
24284 "clippy::four_forward_slashes",
24285 "clippy::from_raw_with_void_ptr",
24286 "clippy::incompatible_msrv",
24287 "clippy::ineffective_open_options",
24288 "clippy::iter_out_of_bounds",
24289 "clippy::join_absolute_paths",
24290 "clippy::let_underscore_future",
24291 "clippy::lines_filter_map_ok",
24292 "clippy::macro_metavars_in_unsafe",
24293 "clippy::manual_unwrap_or_default",
24294 "clippy::misnamed_getters",
24295 "clippy::misrefactored_assign_op",
24296 "clippy::missing_transmute_annotations",
24297 "clippy::multi_assignments",
24298 "clippy::multiple_bound_locations",
24299 "clippy::mut_range_bound",
24300 "clippy::mutable_key_type",
24301 "clippy::needless_character_iteration",
24302 "clippy::needless_maybe_sized",
24303 "clippy::no_effect_replace",
24304 "clippy::non_canonical_clone_impl",
24305 "clippy::non_canonical_partial_ord_impl",
24306 "clippy::octal_escapes",
24307 "clippy::path_ends_with_ext",
24308 "clippy::permissions_set_readonly_false",
24309 "clippy::pointers_in_nomem_asm_block",
24310 "clippy::print_in_format_impl",
24311 "clippy::rc_clone_in_vec_init",
24312 "clippy::repeat_vec_with_capacity",
24313 "clippy::single_range_in_vec_init",
24314 "clippy::size_of_ref",
24315 "clippy::suspicious_arithmetic_impl",
24316 "clippy::suspicious_assignment_formatting",
24317 "clippy::suspicious_command_arg_space",
24318 "clippy::suspicious_doc_comments",
24319 "clippy::suspicious_else_formatting",
24320 "clippy::suspicious_map",
24321 "clippy::suspicious_op_assign_impl",
24322 "clippy::suspicious_open_options",
24323 "clippy::suspicious_to_owned",
24324 "clippy::suspicious_unary_op_formatting",
24325 "clippy::swap_ptr_to_ref",
24326 "clippy::test_attr_in_doctest",
24327 "clippy::type_id_on_box",
24328 "clippy::unconditional_recursion",
24329 "clippy::unnecessary_clippy_cfg",
24330 "clippy::unnecessary_get_then_check",
24331 "clippy::unnecessary_result_map_or_else",
24332 "clippy::zero_repeat_side_effects",
24333 "clippy::zombie_processes",
24334 ],
24335 },
24336];