forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlints.rs
More file actions
14579 lines (12150 loc) · 463 KB
/
Copy pathlints.rs
File metadata and controls
14579 lines (12150 loc) · 463 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//! Generated by `sourcegen_lints`, do not edit by hand.
#[derive(Clone)]
pub struct Lint {
pub label: &'static str,
pub description: &'static str,
}
pub struct LintGroup {
pub lint: Lint,
pub children: &'static [&'static str],
}
pub const DEFAULT_LINTS: &[Lint] = &[
Lint {
label: "absolute_paths_not_starting_with_crate",
description: r##"fully qualified paths that start with a module name instead of `crate`, `self`, or an extern crate name"##,
},
Lint { label: "ambiguous_associated_items", description: r##"ambiguous associated items"## },
Lint {
label: "ambiguous_glob_imports",
description: r##"detects certain glob imports that require reporting an ambiguity error"##,
},
Lint { label: "ambiguous_glob_reexports", description: r##"ambiguous glob re-exports"## },
Lint {
label: "ambiguous_wide_pointer_comparisons",
description: r##"detects ambiguous wide pointer comparisons"##,
},
Lint { label: "anonymous_parameters", description: r##"detects anonymous parameters"## },
Lint { label: "arithmetic_overflow", description: r##"arithmetic operation overflows"## },
Lint {
label: "array_into_iter",
description: r##"detects calling `into_iter` on arrays in Rust 2015 and 2018"##,
},
Lint {
label: "asm_sub_register",
description: r##"using only a subset of a register for inline asm inputs"##,
},
Lint {
label: "async_fn_in_trait",
description: r##"use of `async fn` in definition of a publicly-reachable trait"##,
},
Lint { label: "bad_asm_style", description: r##"incorrect use of inline assembly"## },
Lint {
label: "bare_trait_objects",
description: r##"suggest using `dyn Trait` for trait objects"##,
},
Lint {
label: "bindings_with_variant_name",
description: r##"detects pattern bindings with the same name as one of the matched variants"##,
},
Lint {
label: "break_with_label_and_loop",
description: r##"`break` expression with label and unlabeled loop as value expression"##,
},
Lint {
label: "byte_slice_in_packed_struct_with_derive",
description: r##"`[u8]` or `str` used in a packed struct with `derive`"##,
},
Lint {
label: "cenum_impl_drop_cast",
description: r##"a C-like enum implementing Drop is cast"##,
},
Lint {
label: "clashing_extern_declarations",
description: r##"detects when an extern fn has been declared with the same name but different types"##,
},
Lint {
label: "coherence_leak_check",
description: r##"distinct impls distinguished only by the leak-check code"##,
},
Lint {
label: "conflicting_repr_hints",
description: r##"conflicts between `#[repr(..)]` hints that were previously accepted and used in practice"##,
},
Lint {
label: "confusable_idents",
description: r##"detects visually confusable pairs between identifiers"##,
},
Lint {
label: "const_evaluatable_unchecked",
description: r##"detects a generic constant is used in a type without a emitting a warning"##,
},
Lint {
label: "const_item_mutation",
description: r##"detects attempts to mutate a `const` item"##,
},
Lint { label: "dead_code", description: r##"detect unused, unexported items"## },
Lint { label: "deprecated", description: r##"detects use of deprecated items"## },
Lint {
label: "deprecated_cfg_attr_crate_type_name",
description: r##"detects usage of `#![cfg_attr(..., crate_type/crate_name = "...")]`"##,
},
Lint {
label: "deprecated_in_future",
description: r##"detects use of items that will be deprecated in a future version"##,
},
Lint {
label: "deprecated_where_clause_location",
description: r##"deprecated where clause location"##,
},
Lint {
label: "deref_into_dyn_supertrait",
description: r##"`Deref` implementation usage with a supertrait trait object for output might be shadowed in the future"##,
},
Lint {
label: "deref_nullptr",
description: r##"detects when an null pointer is dereferenced"##,
},
Lint {
label: "drop_bounds",
description: r##"bounds of the form `T: Drop` are most likely incorrect"##,
},
Lint {
label: "dropping_copy_types",
description: r##"calls to `std::mem::drop` with a value that implements Copy"##,
},
Lint {
label: "dropping_references",
description: r##"calls to `std::mem::drop` with a reference instead of an owned value"##,
},
Lint { label: "duplicate_macro_attributes", description: r##"duplicated attribute"## },
Lint {
label: "dyn_drop",
description: r##"trait objects of the form `dyn Drop` are useless"##,
},
Lint {
label: "elided_lifetimes_in_associated_constant",
description: r##"elided lifetimes cannot be used in associated constants in impls"##,
},
Lint {
label: "elided_lifetimes_in_paths",
description: r##"hidden lifetime parameters in types are deprecated"##,
},
Lint {
label: "ellipsis_inclusive_range_patterns",
description: r##"`...` range patterns are deprecated"##,
},
Lint {
label: "enum_intrinsics_non_enums",
description: r##"detects calls to `core::mem::discriminant` and `core::mem::variant_count` with non-enum types"##,
},
Lint {
label: "explicit_outlives_requirements",
description: r##"outlives requirements can be inferred"##,
},
Lint {
label: "exported_private_dependencies",
description: r##"public interface leaks type from a private dependency"##,
},
Lint {
label: "ffi_unwind_calls",
description: r##"call to foreign functions or function pointers with FFI-unwind ABI"##,
},
Lint {
label: "for_loops_over_fallibles",
description: r##"for-looping over an `Option` or a `Result`, which is more clearly expressed as an `if let`"##,
},
Lint { label: "forbidden_lint_groups", description: r##"applying forbid to lint-groups"## },
Lint {
label: "forgetting_copy_types",
description: r##"calls to `std::mem::forget` with a value that implements Copy"##,
},
Lint {
label: "forgetting_references",
description: r##"calls to `std::mem::forget` with a reference instead of an owned value"##,
},
Lint {
label: "function_item_references",
description: r##"suggest casting to a function pointer when attempting to take references to function items"##,
},
Lint {
label: "future_incompatible",
description: r##"lint group for: deref-into-dyn-supertrait, ambiguous-associated-items, ambiguous-glob-imports, byte-slice-in-packed-struct-with-derive, cenum-impl-drop-cast, coherence-leak-check, conflicting-repr-hints, const-evaluatable-unchecked, deprecated-cfg-attr-crate-type-name, elided-lifetimes-in-associated-constant, forbidden-lint-groups, ill-formed-attribute-input, indirect-structural-match, invalid-doc-attributes, invalid-type-param-default, late-bound-lifetime-arguments, legacy-derive-helpers, macro-expanded-macro-exports-accessed-by-absolute-paths, missing-fragment-specifier, order-dependent-trait-objects, patterns-in-fns-without-body, pointer-structural-match, proc-macro-back-compat, proc-macro-derive-resolution-fallback, pub-use-of-private-extern-crate, repr-transparent-external-private-fields, semicolon-in-expressions-from-macros, soft-unstable, uninhabited-static, unstable-name-collisions, unstable-syntax-pre-expansion, unsupported-calling-conventions, where-clauses-object-safety, writes-through-immutable-pointer"##,
},
Lint {
label: "fuzzy_provenance_casts",
description: r##"a fuzzy integer to pointer cast is used"##,
},
Lint {
label: "hidden_glob_reexports",
description: r##"name introduced by a private item shadows a name introduced by a public glob re-export"##,
},
Lint {
label: "ill_formed_attribute_input",
description: r##"ill-formed attribute inputs that were previously accepted and used in practice"##,
},
Lint {
label: "improper_ctypes",
description: r##"proper use of libc types in foreign modules"##,
},
Lint {
label: "improper_ctypes_definitions",
description: r##"proper use of libc types in foreign item definitions"##,
},
Lint {
label: "incomplete_features",
description: r##"incomplete features that may function improperly in some or all cases"##,
},
Lint { label: "incomplete_include", description: r##"trailing content in included file"## },
Lint {
label: "indirect_structural_match",
description: r##"constant used in pattern contains value of non-structural-match type in a field or a variant"##,
},
Lint {
label: "ineffective_unstable_trait_impl",
description: r##"detects `#[unstable]` on stable trait implementations for stable types"##,
},
Lint {
label: "inline_no_sanitize",
description: r##"detects incompatible use of `#[inline(always)]` and `#[no_sanitize(...)]`"##,
},
Lint {
label: "internal_features",
description: r##"internal features are not supposed to be used"##,
},
Lint {
label: "invalid_atomic_ordering",
description: r##"usage of invalid atomic ordering in atomic operations and memory fences"##,
},
Lint {
label: "invalid_doc_attributes",
description: r##"detects invalid `#[doc(...)]` attributes"##,
},
Lint {
label: "invalid_from_utf8",
description: r##"using a non UTF-8 literal in `std::str::from_utf8`"##,
},
Lint {
label: "invalid_from_utf8_unchecked",
description: r##"using a non UTF-8 literal in `std::str::from_utf8_unchecked`"##,
},
Lint {
label: "invalid_macro_export_arguments",
description: r##""invalid_parameter" isn't a valid argument for `#[macro_export]`"##,
},
Lint {
label: "invalid_nan_comparisons",
description: r##"detects invalid floating point NaN comparisons"##,
},
Lint {
label: "invalid_reference_casting",
description: r##"casts of `&T` to `&mut T` without interior mutability"##,
},
Lint {
label: "invalid_type_param_default",
description: r##"type parameter default erroneously allowed in invalid location"##,
},
Lint {
label: "invalid_value",
description: r##"an invalid value is being created (such as a null reference)"##,
},
Lint {
label: "irrefutable_let_patterns",
description: r##"detects irrefutable patterns in `if let` and `while let` statements"##,
},
Lint {
label: "keyword_idents",
description: r##"detects edition keywords being used as an identifier"##,
},
Lint { label: "large_assignments", description: r##"detects large moves or copies"## },
Lint {
label: "late_bound_lifetime_arguments",
description: r##"detects generic lifetime arguments in path segments with late bound lifetime parameters"##,
},
Lint {
label: "legacy_derive_helpers",
description: r##"detects derive helper attributes that are used before they are introduced"##,
},
Lint {
label: "let_underscore",
description: r##"lint group for: let-underscore-drop, let-underscore-lock"##,
},
Lint {
label: "let_underscore_drop",
description: r##"non-binding let on a type that implements `Drop`"##,
},
Lint {
label: "let_underscore_lock",
description: r##"non-binding let on a synchronization lock"##,
},
Lint {
label: "long_running_const_eval",
description: r##"detects long const eval operations"##,
},
Lint {
label: "lossy_provenance_casts",
description: r##"a lossy pointer to integer cast is used"##,
},
Lint {
label: "macro_expanded_macro_exports_accessed_by_absolute_paths",
description: r##"macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths"##,
},
Lint {
label: "macro_use_extern_crate",
description: r##"the `#[macro_use]` attribute is now deprecated in favor of using macros via the module system"##,
},
Lint {
label: "map_unit_fn",
description: r##"`Iterator::map` call that discard the iterator's values"##,
},
Lint {
label: "meta_variable_misuse",
description: r##"possible meta-variable misuse at macro definition"##,
},
Lint { label: "missing_abi", description: r##"No declared ABI for extern declaration"## },
Lint {
label: "missing_copy_implementations",
description: r##"detects potentially-forgotten implementations of `Copy`"##,
},
Lint {
label: "missing_debug_implementations",
description: r##"detects missing implementations of Debug"##,
},
Lint {
label: "missing_docs",
description: r##"detects missing documentation for public members"##,
},
Lint {
label: "missing_fragment_specifier",
description: r##"detects missing fragment specifiers in unused `macro_rules!` patterns"##,
},
Lint {
label: "mixed_script_confusables",
description: r##"detects Unicode scripts whose mixed script confusables codepoints are solely used"##,
},
Lint {
label: "multiple_supertrait_upcastable",
description: r##"detect when an object-safe trait has multiple supertraits"##,
},
Lint {
label: "must_not_suspend",
description: r##"use of a `#[must_not_suspend]` value across a yield point"##,
},
Lint {
label: "mutable_transmutes",
description: r##"transmuting &T to &mut T is undefined behavior, even if the reference is unused"##,
},
Lint {
label: "named_arguments_used_positionally",
description: r##"named arguments in format used positionally"##,
},
Lint { label: "named_asm_labels", description: r##"named labels in inline assembly"## },
Lint {
label: "no_mangle_const_items",
description: r##"const items will not have their symbols exported"##,
},
Lint { label: "no_mangle_generic_items", description: r##"generic items must be mangled"## },
Lint { label: "non_ascii_idents", description: r##"detects non-ASCII identifiers"## },
Lint {
label: "non_camel_case_types",
description: r##"types, variants, traits and type parameters should have camel case names"##,
},
Lint {
label: "non_exhaustive_omitted_patterns",
description: r##"detect when patterns of types marked `non_exhaustive` are missed"##,
},
Lint {
label: "non_fmt_panics",
description: r##"detect single-argument panic!() invocations in which the argument is not a format string"##,
},
Lint { label: "non_local_definitions", description: r##"checks for non-local definitions"## },
Lint {
label: "non_shorthand_field_patterns",
description: r##"using `Struct { x: x }` instead of `Struct { x }` in a pattern"##,
},
Lint {
label: "non_snake_case",
description: r##"variables, methods, functions, lifetime parameters and modules should have snake case names"##,
},
Lint {
label: "non_upper_case_globals",
description: r##"static constants should have uppercase identifiers"##,
},
Lint {
label: "nonstandard_style",
description: r##"lint group for: non-camel-case-types, non-snake-case, non-upper-case-globals"##,
},
Lint {
label: "noop_method_call",
description: r##"detects the use of well-known noop methods"##,
},
Lint {
label: "opaque_hidden_inferred_bound",
description: r##"detects the use of nested `impl Trait` types in associated type bounds that are not general enough"##,
},
Lint {
label: "order_dependent_trait_objects",
description: r##"trait-object types were treated as different depending on marker-trait order"##,
},
Lint { label: "overflowing_literals", description: r##"literal out of range for its type"## },
Lint {
label: "overlapping_range_endpoints",
description: r##"detects range patterns with overlapping endpoints"##,
},
Lint { label: "path_statements", description: r##"path statements with no effect"## },
Lint {
label: "patterns_in_fns_without_body",
description: r##"patterns in functions without body were erroneously allowed"##,
},
Lint {
label: "pointer_structural_match",
description: r##"pointers are not structural-match"##,
},
Lint {
label: "private_bounds",
description: r##"private type in secondary interface of an item"##,
},
Lint {
label: "private_interfaces",
description: r##"private type in primary interface of an item"##,
},
Lint {
label: "proc_macro_back_compat",
description: r##"detects usage of old versions of certain proc-macro crates"##,
},
Lint {
label: "proc_macro_derive_resolution_fallback",
description: r##"detects proc macro derives using inaccessible names from parent modules"##,
},
Lint {
label: "pub_use_of_private_extern_crate",
description: r##"detect public re-exports of private extern crates"##,
},
Lint {
label: "redundant_semicolons",
description: r##"detects unnecessary trailing semicolons"##,
},
Lint {
label: "refining_impl_trait",
description: r##"impl trait in impl method signature does not match trait method signature"##,
},
Lint {
label: "renamed_and_removed_lints",
description: r##"lints that have been renamed or removed"##,
},
Lint {
label: "repr_transparent_external_private_fields",
description: r##"transparent type contains an external ZST that is marked #[non_exhaustive] or contains private fields"##,
},
Lint {
label: "rust_2018_compatibility",
description: r##"lint group for: keyword-idents, anonymous-parameters, absolute-paths-not-starting-with-crate, tyvar-behind-raw-pointer"##,
},
Lint {
label: "rust_2018_idioms",
description: r##"lint group for: bare-trait-objects, unused-extern-crates, ellipsis-inclusive-range-patterns, elided-lifetimes-in-paths, explicit-outlives-requirements"##,
},
Lint {
label: "rust_2021_compatibility",
description: r##"lint group for: ellipsis-inclusive-range-patterns, bare-trait-objects, rust-2021-incompatible-closure-captures, rust-2021-incompatible-or-patterns, rust-2021-prefixes-incompatible-syntax, rust-2021-prelude-collisions, array-into-iter, non-fmt-panics"##,
},
Lint {
label: "rust_2021_incompatible_closure_captures",
description: r##"detects closures affected by Rust 2021 changes"##,
},
Lint {
label: "rust_2021_incompatible_or_patterns",
description: r##"detects usage of old versions of or-patterns"##,
},
Lint {
label: "rust_2021_prefixes_incompatible_syntax",
description: r##"identifiers that will be parsed as a prefix in Rust 2021"##,
},
Lint {
label: "rust_2021_prelude_collisions",
description: r##"detects the usage of trait methods which are ambiguous with traits added to the prelude in future editions"##,
},
Lint {
label: "rust_2024_compatibility",
description: r##"lint group for: static-mut-refs, unsafe-op-in-unsafe-fn"##,
},
Lint {
label: "semicolon_in_expressions_from_macros",
description: r##"trailing semicolon in macro body used as expression"##,
},
Lint {
label: "single_use_lifetimes",
description: r##"detects lifetime parameters that are only used once"##,
},
Lint {
label: "soft_unstable",
description: r##"a feature gate that doesn't break dependent crates"##,
},
Lint {
label: "special_module_name",
description: r##"module declarations for files with a special meaning"##,
},
Lint {
label: "stable_features",
description: r##"stable features found in `#[feature]` directive"##,
},
Lint {
label: "static_mut_refs",
description: r##"shared references or mutable references of mutable static is discouraged"##,
},
Lint {
label: "suspicious_double_ref_op",
description: r##"suspicious call of trait method on `&&T`"##,
},
Lint {
label: "temporary_cstring_as_ptr",
description: r##"detects getting the inner pointer of a temporary `CString`"##,
},
Lint {
label: "test_unstable_lint",
description: r##"this unstable lint is only for testing"##,
},
Lint {
label: "text_direction_codepoint_in_comment",
description: r##"invisible directionality-changing codepoints in comment"##,
},
Lint {
label: "text_direction_codepoint_in_literal",
description: r##"detect special Unicode codepoints that affect the visual representation of text on screen, changing the direction in which text flows"##,
},
Lint {
label: "trivial_bounds",
description: r##"these bounds don't depend on an type parameters"##,
},
Lint {
label: "trivial_casts",
description: r##"detects trivial casts which could be removed"##,
},
Lint {
label: "trivial_numeric_casts",
description: r##"detects trivial casts of numeric types which could be removed"##,
},
Lint {
label: "type_alias_bounds",
description: r##"bounds in type aliases are not enforced"##,
},
Lint {
label: "tyvar_behind_raw_pointer",
description: r##"raw pointer to an inference variable"##,
},
Lint {
label: "uncommon_codepoints",
description: r##"detects uncommon Unicode codepoints in identifiers"##,
},
Lint {
label: "unconditional_panic",
description: r##"operation will cause a panic at runtime"##,
},
Lint {
label: "unconditional_recursion",
description: r##"functions that cannot return without calling themselves"##,
},
Lint {
label: "undefined_naked_function_abi",
description: r##"undefined naked function ABI"##,
},
Lint {
label: "undropped_manually_drops",
description: r##"calls to `std::mem::drop` with `std::mem::ManuallyDrop` instead of it's inner value"##,
},
Lint {
label: "unexpected_cfgs",
description: r##"detects unexpected names and values in `#[cfg]` conditions"##,
},
Lint {
label: "unfulfilled_lint_expectations",
description: r##"unfulfilled lint expectation"##,
},
Lint {
label: "ungated_async_fn_track_caller",
description: r##"enabling track_caller on an async fn is a no-op unless the async_fn_track_caller feature is enabled"##,
},
Lint { label: "uninhabited_static", description: r##"uninhabited static"## },
Lint {
label: "unit_bindings",
description: r##"binding is useless because it has the unit `()` type"##,
},
Lint {
label: "unknown_crate_types",
description: r##"unknown crate type found in `#[crate_type]` directive"##,
},
Lint { label: "unknown_lints", description: r##"unrecognized lint attribute"## },
Lint {
label: "unknown_or_malformed_diagnostic_attributes",
description: r##"unrecognized or malformed diagnostic attribute"##,
},
Lint {
label: "unnameable_test_items",
description: r##"detects an item that cannot be named being marked as `#[test_case]`"##,
},
Lint {
label: "unnameable_types",
description: r##"effective visibility of a type is larger than the area in which it can be named"##,
},
Lint { label: "unreachable_code", description: r##"detects unreachable code paths"## },
Lint { label: "unreachable_patterns", description: r##"detects unreachable patterns"## },
Lint {
label: "unreachable_pub",
description: r##"`pub` items not reachable from crate root"##,
},
Lint {
label: "unsafe_code",
description: r##"usage of `unsafe` code and other potentially unsound constructs"##,
},
Lint {
label: "unsafe_op_in_unsafe_fn",
description: r##"unsafe operations in unsafe functions without an explicit unsafe block are deprecated"##,
},
Lint { label: "unstable_features", description: r##"enabling unstable features"## },
Lint {
label: "unstable_name_collisions",
description: r##"detects name collision with an existing but unstable method"##,
},
Lint {
label: "unstable_syntax_pre_expansion",
description: r##"unstable syntax can change at any point in the future, causing a hard error!"##,
},
Lint {
label: "unsupported_calling_conventions",
description: r##"use of unsupported calling convention"##,
},
Lint {
label: "unused",
description: r##"lint group for: unused-imports, unused-variables, 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"##,
},
Lint {
label: "unused_allocation",
description: r##"detects unnecessary allocations that can be eliminated"##,
},
Lint {
label: "unused_assignments",
description: r##"detect assignments that will never be read"##,
},
Lint {
label: "unused_associated_type_bounds",
description: r##"detects unused `Foo = Bar` bounds in `dyn Trait<Foo = Bar>`"##,
},
Lint {
label: "unused_attributes",
description: r##"detects attributes that were not used by the compiler"##,
},
Lint { label: "unused_braces", description: r##"unnecessary braces around an expression"## },
Lint {
label: "unused_comparisons",
description: r##"comparisons made useless by limits of the types involved"##,
},
Lint {
label: "unused_crate_dependencies",
description: r##"crate dependencies that are never used"##,
},
Lint {
label: "unused_doc_comments",
description: r##"detects doc comments that aren't used by rustdoc"##,
},
Lint { label: "unused_extern_crates", description: r##"extern crates that are never used"## },
Lint {
label: "unused_features",
description: r##"unused features found in crate-level `#[feature]` directives"##,
},
Lint {
label: "unused_import_braces",
description: r##"unnecessary braces around an imported item"##,
},
Lint { label: "unused_imports", description: r##"imports that are never used"## },
Lint { label: "unused_labels", description: r##"detects labels that are never used"## },
Lint {
label: "unused_lifetimes",
description: r##"detects lifetime parameters that are never used"##,
},
Lint {
label: "unused_macro_rules",
description: r##"detects macro rules that were not used"##,
},
Lint { label: "unused_macros", description: r##"detects macros that were not used"## },
Lint {
label: "unused_must_use",
description: r##"unused result of a type flagged as `#[must_use]`"##,
},
Lint {
label: "unused_mut",
description: r##"detect mut variables which don't need to be mutable"##,
},
Lint {
label: "unused_parens",
description: r##"`if`, `match`, `while` and `return` do not need parentheses"##,
},
Lint {
label: "unused_qualifications",
description: r##"detects unnecessarily qualified names"##,
},
Lint {
label: "unused_results",
description: r##"unused result of an expression in a statement"##,
},
Lint { label: "unused_unsafe", description: r##"unnecessary use of an `unsafe` block"## },
Lint {
label: "unused_variables",
description: r##"detect variables which are not used in any way"##,
},
Lint {
label: "useless_deprecated",
description: r##"detects deprecation attributes with no effect"##,
},
Lint {
label: "useless_ptr_null_checks",
description: r##"useless checking of non-null-typed pointer"##,
},
Lint {
label: "variant_size_differences",
description: r##"detects enums with widely varying variant sizes"##,
},
Lint {
label: "warnings",
description: r##"mass-change the level for lints which produce warnings"##,
},
Lint {
label: "warnings",
description: r##"lint group for: all lints that are set to issue warnings"##,
},
Lint {
label: "where_clauses_object_safety",
description: r##"checks the object safety of where clauses"##,
},
Lint {
label: "while_true",
description: r##"suggest using `loop { }` instead of `while true { }`"##,
},
Lint {
label: "writes_through_immutable_pointer",
description: r##"shared references are immutable, and pointers derived from them must not be written to"##,
},
];
pub const DEFAULT_LINT_GROUPS: &[LintGroup] = &[
LintGroup {
lint: Lint {
label: "future_incompatible",
description: r##"lint group for: deref-into-dyn-supertrait, ambiguous-associated-items, ambiguous-glob-imports, byte-slice-in-packed-struct-with-derive, cenum-impl-drop-cast, coherence-leak-check, conflicting-repr-hints, const-evaluatable-unchecked, deprecated-cfg-attr-crate-type-name, elided-lifetimes-in-associated-constant, forbidden-lint-groups, ill-formed-attribute-input, indirect-structural-match, invalid-doc-attributes, invalid-type-param-default, late-bound-lifetime-arguments, legacy-derive-helpers, macro-expanded-macro-exports-accessed-by-absolute-paths, missing-fragment-specifier, order-dependent-trait-objects, patterns-in-fns-without-body, pointer-structural-match, proc-macro-back-compat, proc-macro-derive-resolution-fallback, pub-use-of-private-extern-crate, repr-transparent-external-private-fields, semicolon-in-expressions-from-macros, soft-unstable, uninhabited-static, unstable-name-collisions, unstable-syntax-pre-expansion, unsupported-calling-conventions, where-clauses-object-safety, writes-through-immutable-pointer"##,
},
children: &[
"deref_into_dyn_supertrait",
"ambiguous_associated_items",
"ambiguous_glob_imports",
"byte_slice_in_packed_struct_with_derive",
"cenum_impl_drop_cast",
"coherence_leak_check",
"conflicting_repr_hints",
"const_evaluatable_unchecked",
"deprecated_cfg_attr_crate_type_name",
"elided_lifetimes_in_associated_constant",
"forbidden_lint_groups",
"ill_formed_attribute_input",
"indirect_structural_match",
"invalid_doc_attributes",
"invalid_type_param_default",
"late_bound_lifetime_arguments",
"legacy_derive_helpers",
"macro_expanded_macro_exports_accessed_by_absolute_paths",
"missing_fragment_specifier",
"order_dependent_trait_objects",
"patterns_in_fns_without_body",
"pointer_structural_match",
"proc_macro_back_compat",
"proc_macro_derive_resolution_fallback",
"pub_use_of_private_extern_crate",
"repr_transparent_external_private_fields",
"semicolon_in_expressions_from_macros",
"soft_unstable",
"uninhabited_static",
"unstable_name_collisions",
"unstable_syntax_pre_expansion",
"unsupported_calling_conventions",
"where_clauses_object_safety",
"writes_through_immutable_pointer",
],
},
LintGroup {
lint: Lint {
label: "let_underscore",
description: r##"lint group for: let-underscore-drop, let-underscore-lock"##,
},
children: &["let_underscore_drop", "let_underscore_lock"],
},
LintGroup {
lint: Lint {
label: "nonstandard_style",
description: r##"lint group for: non-camel-case-types, non-snake-case, non-upper-case-globals"##,
},
children: &["non_camel_case_types", "non_snake_case", "non_upper_case_globals"],
},
LintGroup {
lint: Lint {
label: "rust_2018_compatibility",
description: r##"lint group for: keyword-idents, anonymous-parameters, absolute-paths-not-starting-with-crate, tyvar-behind-raw-pointer"##,
},
children: &[
"keyword_idents",
"anonymous_parameters",
"absolute_paths_not_starting_with_crate",
"tyvar_behind_raw_pointer",
],
},
LintGroup {
lint: Lint {
label: "rust_2018_idioms",
description: r##"lint group for: bare-trait-objects, unused-extern-crates, ellipsis-inclusive-range-patterns, elided-lifetimes-in-paths, explicit-outlives-requirements"##,
},
children: &[
"bare_trait_objects",
"unused_extern_crates",
"ellipsis_inclusive_range_patterns",
"elided_lifetimes_in_paths",
"explicit_outlives_requirements",
],
},
LintGroup {
lint: Lint {
label: "rust_2021_compatibility",
description: r##"lint group for: ellipsis-inclusive-range-patterns, bare-trait-objects, rust-2021-incompatible-closure-captures, rust-2021-incompatible-or-patterns, rust-2021-prefixes-incompatible-syntax, rust-2021-prelude-collisions, array-into-iter, non-fmt-panics"##,
},
children: &[
"ellipsis_inclusive_range_patterns",
"bare_trait_objects",
"rust_2021_incompatible_closure_captures",
"rust_2021_incompatible_or_patterns",
"rust_2021_prefixes_incompatible_syntax",
"rust_2021_prelude_collisions",
"array_into_iter",
"non_fmt_panics",
],
},
LintGroup {
lint: Lint {
label: "rust_2024_compatibility",
description: r##"lint group for: static-mut-refs, unsafe-op-in-unsafe-fn"##,
},
children: &["static_mut_refs", "unsafe_op_in_unsafe_fn"],
},
LintGroup {
lint: Lint {
label: "unused",
description: r##"lint group for: unused-imports, unused-variables, 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"##,
},
children: &[
"unused_imports",
"unused_variables",
"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",
],
},
LintGroup {
lint: Lint {
label: "warnings",
description: r##"lint group for: all lints that are set to issue warnings"##,
},
children: &[],
},
];
pub const RUSTDOC_LINTS: &[Lint] = &[
Lint {
label: "rustdoc::all",
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"##,
},
Lint { label: "rustdoc::bare_urls", description: r##"detects URLs that are not hyperlinks"## },
Lint {
label: "rustdoc::broken_intra_doc_links",
description: r##"failures in resolving intra-doc link targets"##,
},
Lint {
label: "rustdoc::invalid_codeblock_attributes",
description: r##"codeblock attribute looks a lot like a known one"##,
},
Lint {
label: "rustdoc::invalid_html_tags",
description: r##"detects invalid HTML tags in doc comments"##,
},
Lint {
label: "rustdoc::invalid_rust_codeblocks",
description: r##"codeblock could not be parsed as valid Rust or is empty"##,
},
Lint {
label: "rustdoc::missing_crate_level_docs",
description: r##"detects crates with no crate-level documentation"##,
},
Lint {
label: "rustdoc::missing_doc_code_examples",
description: r##"detects publicly-exported items without code samples in their documentation"##,
},
Lint {
label: "rustdoc::private_doc_tests",
description: r##"detects code samples in docs of private items not documented by rustdoc"##,
},
Lint {
label: "rustdoc::private_intra_doc_links",
description: r##"linking from a public item to a private one"##,
},
Lint {
label: "rustdoc::redundant_explicit_links",
description: r##"detects redundant explicit links in doc comments"##,
},
Lint {
label: "rustdoc::unescaped_backticks",
description: r##"detects unescaped backticks in doc comments"##,
},
];
pub const RUSTDOC_LINT_GROUPS: &[LintGroup] = &[LintGroup {
lint: Lint {
label: "rustdoc::all",
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"##,
},
children: &[
"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",
],
}];
pub const FEATURES: &[Lint] = &[
Lint {
label: "aarch64_ver_target_feature",
description: r##"# `aarch64_ver_target_feature`
The tracking issue for this feature is: [#44839]
[#44839]: https://github.com/rust-lang/rust/issues/44839
------------------------
"##,
},
Lint {
label: "abi_avr_interrupt",
description: r##"# `abi_avr_interrupt`
The tracking issue for this feature is: [#69664]
[#69664]: https://github.com/rust-lang/rust/issues/69664
------------------------
"##,
},
Lint {
label: "abi_c_cmse_nonsecure_call",
description: r##"# `abi_c_cmse_nonsecure_call`
The tracking issue for this feature is: [#81391]
[#81391]: https://github.com/rust-lang/rust/issues/81391
------------------------
The [TrustZone-M
feature](https://developer.arm.com/documentation/100690/latest/) is available
for targets with the Armv8-M architecture profile (`thumbv8m` in their target
name).
LLVM, the Rust compiler and the linker are providing
[support](https://developer.arm.com/documentation/ecm0359818/latest/) for the
TrustZone-M feature.
One of the things provided, with this unstable feature, is the
`C-cmse-nonsecure-call` function ABI. This ABI is used on function pointers to
non-secure code to mark a non-secure function call (see [section
5.5](https://developer.arm.com/documentation/ecm0359818/latest/) for details).
With this ABI, the compiler will do the following to perform the call:
* save registers needed after the call to Secure memory
* clear all registers that might contain confidential information
* clear the Least Significant Bit of the function address
* branches using the BLXNS instruction
To avoid using the non-secure stack, the compiler will constrain the number and
type of parameters/return value.
The `extern "C-cmse-nonsecure-call"` ABI is otherwise equivalent to the
`extern "C"` ABI.
<!-- NOTE(ignore) this example is specific to thumbv8m targets -->