Expand description
Lints in the Rust compiler.
This contains lints which can feasibly be implemented as their own
AST visitor. Also see rustc_session::lint::builtin
, which contains the
definitions of lints that are emitted directly inside the main compiler.
To add a new lint to rustc, declare it here using declare_lint!
.
Then add code to emit the new lint in the appropriate circumstances.
If you define a new EarlyLintPass
, you will also need to add it to the
crate::early_lint_methods!
invocation in lib.rs
.
If you define a new LateLintPass
, you will also need to add it to the
crate::late_lint_methods!
invocation in lib.rs
.
Structs§
- Anonymous
Parameters - Checks for use of anonymous parameters (RFC 1685).
- AsmLabels
- Deprecated
Attr - Check for use of attributes which have been deprecated.
- Deref
Null Ptr - Double
Negations - Lint for expressions of the form
--x
that can be confused with C’s prefix decrement operator. - Ellipsis
Inclusive Range Patterns - Explicit
Outlives Requirements - Hardwired
Lints - Does nothing as a lint pass, but registers some
Lint
s that are used by other parts of the compiler. - Incomplete
Internal Features - Check for used feature gates in
INCOMPLETE_FEATURES
inrustc_feature/src/unstable.rs
. - Init
Error - Information about why a type cannot be initialized this way.
- Invalid
NoMangle Items - Invalid
Value - Keyword
Idents - Check for uses of edition keywords used as an identifier.
- Missing
Copy Implementations - Missing
Debug 🔒Implementations - Missing
Doc - Mutable
Transmutes - NonShorthand
Field Patterns - Shorthand
Assoc 🔒TyCollector - Soft
Lints - Does nothing as a lint pass, but registers some
Lint
s which are used by other parts of the compiler. - Special
Module Name - Trivial
Constraints - Lint for trait and lifetime bounds that don’t depend on type parameters which either do nothing, or stop the item from being used.
- Type
Alias Bounds - Under
Macro 🔒 - Ungated
Async FnTrack Caller - Explains corresponding feature flag must be enabled for the
#[track_caller]
attribute to do anything - Unreachable
Pub - Lint for items marked
pub
that aren’t reachable from other crates. - Unsafe
Code - Unstable
Features - Forbids using the
#[feature(...)]
attribute - Unused
DocComment - While
True
Enums§
Constants§
Statics§
- ABI_
UNSUPPORTED_ VECTOR_ TYPES - The
abi_unsupported_vector_types
lint detects function definitions and calls whose ABI depends on enabling certain target features, but those features are not enabled. - ABSOLUTE_
PATHS_ NOT_ STARTING_ WITH_ CRATE - The
absolute_paths_not_starting_with_crate
lint detects fully qualified paths that start with a module name instead ofcrate
,self
, or an extern crate name - AMBIGUOUS_
ASSOCIATED_ ITEMS - The
ambiguous_associated_items
lint detects ambiguity between associated items and enum variants. - AMBIGUOUS_
GLOB_ IMPORTS - The
ambiguous_glob_imports
lint detects glob imports that should report ambiguity errors, but previously didn’t do that due to rustc bugs. - AMBIGUOUS_
GLOB_ REEXPORTS - The
ambiguous_glob_reexports
lint detects cases where names re-exported via globs collide. Downstream users trying to use the same name re-exported from multiple globs will receive a warning pointing out redefinition of the same name. - ANONYMOUS_
PARAMETERS - The
anonymous_parameters
lint detects anonymous parameters in trait definitions. - ARITHMETIC_
OVERFLOW - The
arithmetic_overflow
lint detects that an arithmetic operation will overflow. - ASM_
SUB_ REGISTER - The
asm_sub_register
lint detects using only a subset of a register for inline asm inputs. - BAD_
ASM_ STYLE - The
bad_asm_style
lint detects the use of the.intel_syntax
and.att_syntax
directives. - BARE_
TRAIT_ OBJECTS - The
bare_trait_objects
lint suggests usingdyn Trait
for trait objects. - BINARY_
ASM_ LABELS - The
binary_asm_labels
lint detects the use of numeric labels containing only binary digits in the inlineasm!
macro. - BINDINGS_
WITH_ VARIANT_ NAME - The
bindings_with_variant_name
lint detects pattern bindings with the same name as one of the matched variants. - BREAK_
WITH_ LABEL_ AND_ LOOP - The
break_with_label_and_loop
lint detects labeledbreak
expressions with an unlabeled loop as their value expression. - COHERENCE_
LEAK_ CHECK - The
coherence_leak_check
lint detects conflicting implementations of a trait that are only distinguished by the old leak-check code. - CONFLICTING_
REPR_ HINTS - The
conflicting_repr_hints
lint detectsrepr
attributes with conflicting hints. - CONST_
EVALUATABLE_ UNCHECKED - The
const_evaluatable_unchecked
lint detects a generic constant used in a type. - CONST_
ITEM_ MUTATION - The
const_item_mutation
lint detects attempts to mutate aconst
item. - DEAD_
CODE - The
dead_code
lint detects unused, unexported items. - DEPENDENCY_
ON_ UNIT_ NEVER_ TYPE_ FALLBACK - The
dependency_on_unit_never_type_fallback
lint detects cases where code compiles with never type fallback being()
, but will stop compiling with fallback being!
. - DEPRECATED
- The
deprecated
lint detects use of deprecated items. - DEPRECATED_
IN_ FUTURE - The
deprecated_in_future
lint is internal to rustc and should not be used by user code. - DEPRECATED_
SAFE_ 2024 - The
deprecated_safe_2024
lint detects unsafe functions being used as safe functions. - DEPRECATED_
WHERE_ CLAUSE_ LOCATION - The
deprecated_where_clause_location
lint detects when a where clause in front of the equals in an associated type. - DEREF_
NULLPTR - The
deref_nullptr
lint detects when a null pointer is dereferenced, which causes undefined behavior. - DOUBLE_
NEGATIONS - The
double_negations
lint detects expressions of the form--x
. - DUPLICATE_
MACRO_ ATTRIBUTES - The
duplicate_macro_attributes
lint detects when a#[test]
-like built-in macro attribute is duplicated on an item. This lint may trigger onbench
,cfg_eval
,test
andtest_case
. - ELIDED_
LIFETIMES_ IN_ ASSOCIATED_ CONSTANT - The
elided_lifetimes_in_associated_constant
lint detects elided lifetimes in associated constants when there are other lifetimes in scope. This was accidentally supported, and this lint was later relaxed to allow eliding lifetimes to'static
when there are no lifetimes in scope. - ELIDED_
LIFETIMES_ IN_ PATHS - The
elided_lifetimes_in_paths
lint detects the use of hidden lifetime parameters. - ELIDED_
NAMED_ LIFETIMES - The
elided_named_lifetimes
lint detects when an elided lifetime ends up being a named lifetime, such as'static
or some lifetime parameter'a
. - ELLIPSIS_
INCLUSIVE_ RANGE_ PATTERNS - The
ellipsis_inclusive_range_patterns
lint detects the...
range pattern, which is deprecated. - EXPLICIT_
BUILTIN_ CFGS_ IN_ FLAGS - The
explicit_builtin_cfgs_in_flags
lint detects builtin cfgs set via the--cfg
flag. - EXPLICIT_
OUTLIVES_ REQUIREMENTS - The
explicit_outlives_requirements
lint detects unnecessary lifetime bounds that can be inferred. - EXPORTED_
PRIVATE_ DEPENDENCIES - The
exported_private_dependencies
lint detects private dependencies that are exposed in a public interface. - FFI_
UNWIND_ CALLS - The
ffi_unwind_calls
lint detects calls to foreign functions or function pointers withC-unwind
or other FFI-unwind ABIs. - FORBIDDEN_
LINT_ GROUPS - The
forbidden_lint_groups
lint detects violations offorbid
applied to a lint group. Due to a bug in the compiler, these used to be overlooked entirely. They now generate a warning. - FUNCTION_
ITEM_ REFERENCES - The
function_item_references
lint detects function references that are formatted withfmt::Pointer
or transmuted. - FUZZY_
PROVENANCE_ CASTS - The
fuzzy_provenance_casts
lint detects anas
cast between an integer and a pointer. - HIDDEN_
GLOB_ REEXPORTS - The
hidden_glob_reexports
lint detects cases where glob re-export items are shadowed by private items. - ILL_
FORMED_ ATTRIBUTE_ INPUT - The
ill_formed_attribute_input
lint detects ill-formed attribute inputs that were previously accepted and used in practice. - INCOMPLETE_
FEATURES - The
incomplete_features
lint detects unstable features enabled with thefeature
attribute that may function improperly in some or all cases. - INCOMPLETE_
INCLUDE - The
incomplete_include
lint detects the use of theinclude!
macro with a file that contains more than one expression. - INEFFECTIVE_
UNSTABLE_ TRAIT_ IMPL - The
ineffective_unstable_trait_impl
lint detects#[unstable]
attributes which are not used. - INLINE_
NO_ SANITIZE - The
inline_no_sanitize
lint detects incompatible use of#[inline(always)]
and#[no_sanitize(...)]
. - INTERNAL_
FEATURES - The
internal_features
lint detects unstable features enabled with thefeature
attribute that are internal to the compiler or standard library. - INVALID_
DOC_ ATTRIBUTES - The
invalid_doc_attributes
lint detects when the#[doc(...)]
is misused. - INVALID_
MACRO_ EXPORT_ ARGUMENTS - The
invalid_macro_export_arguments
lint detects cases where#[macro_export]
is being used with invalid arguments. - INVALID_
TYPE_ PARAM_ DEFAULT - The
invalid_type_param_default
lint detects type parameter defaults erroneously allowed in an invalid location. - INVALID_
VALUE - The
invalid_value
lint detects creating a value that is not valid, such as a null reference. - IRREFUTABLE_
LET_ PATTERNS - The
irrefutable_let_patterns
lint detects irrefutable patterns inif let
s,while let
s, andif let
guards. - KEYWORD_
IDENTS_ 2018 - The
keyword_idents_2018
lint detects edition keywords being used as an identifier. - KEYWORD_
IDENTS_ 2024 - The
keyword_idents_2024
lint detects edition keywords being used as an identifier. - LARGE_
ASSIGNMENTS - The
large_assignments
lint detects when objects of large types are being moved around. - LATE_
BOUND_ LIFETIME_ ARGUMENTS - The
late_bound_lifetime_arguments
lint detects generic lifetime arguments in path segments with late bound lifetime parameters. - LEGACY_
DERIVE_ HELPERS - The
legacy_derive_helpers
lint detects derive helper attributes that are used before they are introduced. - LINKER_
MESSAGES - The
linker_messages
lint forwards warnings from the linker. - LONG_
RUNNING_ CONST_ EVAL - The
long_running_const_eval
lint is emitted when const eval is running for a long time to ensure rustc terminates even if you accidentally wrote an infinite loop. - LOSSY_
PROVENANCE_ CASTS - The
lossy_provenance_casts
lint detects anas
cast between a pointer and an integer. - MACRO_
EXPANDED_ MACRO_ EXPORTS_ ACCESSED_ BY_ ABSOLUTE_ PATHS - The
macro_expanded_macro_exports_accessed_by_absolute_paths
lint detects macro-expandedmacro_export
macros from the current crate that cannot be referred to by absolute paths. - MACRO_
USE_ EXTERN_ CRATE - The
macro_use_extern_crate
lint detects the use of themacro_use
attribute. - META_
VARIABLE_ MISUSE - The
meta_variable_misuse
lint detects possible meta-variable misuse in macro definitions. - MISSING_
ABI - The
missing_abi
lint detects cases where the ABI is omitted fromextern
declarations. - MISSING_
COPY_ IMPLEMENTATIONS - The
missing_copy_implementations
lint detects potentially-forgotten implementations ofCopy
for public types. - MISSING_
DEBUG_ 🔒IMPLEMENTATIONS - The
missing_debug_implementations
lint detects missing implementations offmt::Debug
for public types. - MISSING_
DOCS - The
missing_docs
lint detects missing documentation for public items. - MISSING_
FRAGMENT_ SPECIFIER - The
missing_fragment_specifier
lint is issued when an unused pattern in amacro_rules!
macro definition has a meta-variable (e.g.$e
) that is not followed by a fragment specifier (e.g.:expr
). - MISSING_
UNSAFE_ ON_ EXTERN - The
missing_unsafe_on_extern
lint detects missing unsafe keyword on extern declarations. - MUST_
NOT_ SUSPEND - The
must_not_suspend
lint guards against values that shouldn’t be held across suspend points (.await
) - MUTABLE_
TRANSMUTES 🔒 - The
mutable_transmutes
lint catches transmuting from&T
to&mut T
because it is undefined behavior. - NAMED_
ARGUMENTS_ USED_ POSITIONALLY - The
named_arguments_used_positionally
lint detects cases where named arguments are only used positionally in format strings. This usage is valid but potentially very confusing. - NAMED_
ASM_ LABELS - The
named_asm_labels
lint detects the use of named labels in the inlineasm!
macro. - NEVER_
TYPE_ FALLBACK_ FLOWING_ INTO_ UNSAFE - The
never_type_fallback_flowing_into_unsafe
lint detects cases where never type fallback affects unsafe function calls. - NON_
CONTIGUOUS_ RANGE_ ENDPOINTS - The
non_contiguous_range_endpoints
lint detects likely off-by-one errors when using exclusive range patterns. - NON_
EXHAUSTIVE_ OMITTED_ PATTERNS - The
non_exhaustive_omitted_patterns
lint aims to help consumers of a#[non_exhaustive]
struct or enum who want to match all of its fields/variants explicitly. - NON_
SHORTHAND_ 🔒FIELD_ PATTERNS - The
non_shorthand_field_patterns
lint detects usingStruct { x: x }
instead ofStruct { x }
in a pattern. - NO_
MANGLE_ 🔒CONST_ ITEMS - The
no_mangle_const_items
lint detects anyconst
items with theno_mangle
attribute. - NO_
MANGLE_ 🔒GENERIC_ ITEMS - The
no_mangle_generic_items
lint detects generic items that must be mangled. - OUT_
OF_ SCOPE_ MACRO_ CALLS - The
out_of_scope_macro_calls
lint detectsmacro_rules
called when they are not in scope, above their definition, which may happen in key-value attributes. - OVERLAPPING_
RANGE_ ENDPOINTS - The
overlapping_range_endpoints
lint detectsmatch
arms that have range patterns that overlap on their endpoints. - PATTERNS_
IN_ FNS_ WITHOUT_ BODY - The
patterns_in_fns_without_body
lint detectsmut
identifier patterns as a parameter in functions without a body. - PRIVATE_
BOUNDS - The
private_bounds
lint detects types in a secondary interface of an item, that are more private than the item itself. Secondary interface of an item consists of bounds on generic parameters and where clauses, including supertraits for trait items. - PRIVATE_
INTERFACES - The
private_interfaces
lint detects types in a primary interface of an item, that are more private than the item itself. Primary interface of an item is all its interface except for bounds on generic parameters and where clauses. - PRIVATE_
MACRO_ USE - The
private_macro_use
lint detects private macros that are imported with#[macro_use]
. - PROC_
MACRO_ DERIVE_ RESOLUTION_ FALLBACK - The
proc_macro_derive_resolution_fallback
lint detects proc macro derives using inaccessible names from parent modules. - PTR_
TO_ INTEGER_ TRANSMUTE_ IN_ CONSTS - The
ptr_to_integer_transmute_in_consts
lint detects pointer to integer transmute in const functions and associated constants. - PUB_
USE_ OF_ PRIVATE_ EXTERN_ CRATE - The
pub_use_of_private_extern_crate
lint detects a specific situation of re-exporting a privateextern crate
. - REDUNDANT_
IMPORTS - The
redundant_imports
lint detects imports that are redundant due to being imported already; either through a previous import, or being present in the prelude. - REDUNDANT_
LIFETIMES - The
redundant_lifetimes
lint detects lifetime parameters that are redundant because they are equal to another named lifetime. - REFINING_
IMPL_ TRAIT_ INTERNAL - The
refining_impl_trait_internal
lint detectsimpl Trait
return types in method signatures that are refined by a trait implementation, meaning the implementation adds information about the return type that is not present in the trait. - REFINING_
IMPL_ TRAIT_ REACHABLE - The
refining_impl_trait_reachable
lint detectsimpl Trait
return types in method signatures that are refined by a publically reachable trait implementation, meaning the implementation adds information about the return type that is not present in the trait. - RENAMED_
AND_ REMOVED_ LINTS - The
renamed_and_removed_lints
lint detects lints that have been renamed or removed. - REPR_
TRANSPARENT_ EXTERNAL_ PRIVATE_ FIELDS - The
repr_transparent_external_private_fields
lint detects types marked#[repr(transparent)]
that (transitively) contain an external ZST type marked#[non_exhaustive]
or containing private fields - RUST_
2021_ INCOMPATIBLE_ CLOSURE_ CAPTURES - The
rust_2021_incompatible_closure_captures
lint detects variables that aren’t completely captured in Rust 2021, such that theDrop
order of their fields may differ between Rust 2018 and 2021. - RUST_
2021_ INCOMPATIBLE_ OR_ PATTERNS - The
rust_2021_incompatible_or_patterns
lint detects usage of old versions of or-patterns. - RUST_
2021_ PREFIXES_ INCOMPATIBLE_ SYNTAX - The
rust_2021_prefixes_incompatible_syntax
lint detects identifiers that will be parsed as a prefix instead in Rust 2021. - RUST_
2021_ PRELUDE_ COLLISIONS - The
rust_2021_prelude_collisions
lint detects the usage of trait methods which are ambiguous with traits added to the prelude in future editions. - RUST_
2024_ GUARDED_ STRING_ INCOMPATIBLE_ SYNTAX - The
rust_2024_guarded_string_incompatible_syntax
lint detects#
tokens that will be parsed as part of a guarded string literal in Rust 2024. - RUST_
2024_ INCOMPATIBLE_ PAT - The
rust_2024_incompatible_pat
lint detects patterns whose meaning will change in the Rust 2024 edition. - RUST_
2024_ PRELUDE_ COLLISIONS - The
rust_2024_prelude_collisions
lint detects the usage of trait methods which are ambiguous with traits added to the prelude in future editions. - SELF_
CONSTRUCTOR_ FROM_ OUTER_ ITEM - The
self_constructor_from_outer_item
lint detects cases where theSelf
constructor was silently allowed due to a bug in the resolver, and which may produce surprising and unintended behavior. - SEMICOLON_
IN_ EXPRESSIONS_ FROM_ MACROS - The
semicolon_in_expressions_from_macros
lint detects trailing semicolons in macro bodies when the macro is invoked in expression position. This was previous accepted, but is being phased out. - SINGLE_
USE_ LIFETIMES - The
single_use_lifetimes
lint detects lifetimes that are only used once. - SOFT_
UNSTABLE - The
soft_unstable
lint detects unstable features that were unintentionally allowed on stable. - SPECIAL_
MODULE_ NAME - The
special_module_name
lint detects module declarations for files that have a special meaning. - STABLE_
FEATURES - The
stable_features
lint detects afeature
attribute that has since been made stable. - SUPERTRAIT_
ITEM_ SHADOWING_ DEFINITION - The
supertrait_item_shadowing_definition
lint detects when the definition of an item that is provided by both a subtrait and supertrait is shadowed, preferring the subtrait. - SUPERTRAIT_
ITEM_ SHADOWING_ USAGE - The
supertrait_item_shadowing_usage
lint detects when the usage of an item that is provided by both a subtrait and supertrait is shadowed, preferring the subtrait. - TAIL_
EXPR_ DROP_ ORDER - The
tail_expr_drop_order
lint looks for those values generated at the tail expression location, that runs a customDrop
destructor. Some of them may be dropped earlier in Edition 2024 that they used to in Edition 2021 and prior. This lint detects those cases and provides you information on those values and their custom destructor implementations. Your discretion on this information is required. - TEST_
UNSTABLE_ LINT - The
test_unstable_lint
lint tests unstable lints and is perma-unstable. - TEXT_
DIRECTION_ CODEPOINT_ IN_ COMMENT - The
text_direction_codepoint_in_comment
lint detects Unicode codepoints in comments that change the visual representation of text on screen in a way that does not correspond to their on memory representation. - TRIVIAL_
BOUNDS 🔒 - The
trivial_bounds
lint detects trait bounds that don’t depend on any type parameters. - TRIVIAL_
CASTS - The
trivial_casts
lint detects trivial casts which could be replaced with coercion, which may require a temporary variable. - TRIVIAL_
NUMERIC_ CASTS - The
trivial_numeric_casts
lint detects trivial numeric casts of types which could be removed. - TYPE_
ALIAS_ 🔒BOUNDS - The
type_alias_bounds
lint detects bounds in type aliases. - TYVAR_
BEHIND_ RAW_ POINTER - The
tyvar_behind_raw_pointer
lint detects raw pointer to an inference variable. - UNCONDITIONAL_
PANIC - The
unconditional_panic
lint detects an operation that will cause a panic at runtime. - UNCONDITIONAL_
RECURSION - The
unconditional_recursion
lint detects functions that cannot return without calling themselves. - UNCOVERED_
PARAM_ IN_ PROJECTION - The
uncovered_param_in_projection
lint detects a violation of one of Rust’s orphan rules for foreign trait implementations that concerns the use of type parameters inside trait associated type paths (“projections”) whose output may not be a local type that is mistakenly considered to “cover” said parameters which is unsound and which may be rejected by a future version of the compiler. - UNDEFINED_
NAKED_ FUNCTION_ ABI - The
undefined_naked_function_abi
lint detects naked function definitions that either do not specify an ABI or specify the Rust ABI. - UNEXPECTED_
CFGS - The
unexpected_cfgs
lint detects unexpected conditional compilation conditions. - UNFULFILLED_
LINT_ EXPECTATIONS - The
unfulfilled_lint_expectations
lint detects when a lint expectation is unfulfilled. - UNGATED_
ASYNC_ 🔒FN_ TRACK_ CALLER - The
ungated_async_fn_track_caller
lint warns when the#[track_caller]
attribute is used on an async function without enabling the corresponding unstable feature flag. - UNINHABITED_
STATIC - The
uninhabited_static
lint detects uninhabited statics. - UNKNOWN_
CRATE_ TYPES - The
unknown_crate_types
lint detects an unknown crate type found in acrate_type
attribute. - UNKNOWN_
LINTS - The
unknown_lints
lint detects unrecognized lint attributes. - UNKNOWN_
OR_ MALFORMED_ DIAGNOSTIC_ ATTRIBUTES - The
unknown_or_malformed_diagnostic_attributes
lint detects unrecognized or otherwise malformed diagnostic attributes. - UNNAMEABLE_
TEST_ ITEMS - The
unnameable_test_items
lint detects#[test]
functions that are not able to be run by the test harness because they are in a position where they are not nameable. - UNNAMEABLE_
TYPES - The
unnameable_types
lint detects types for which you can get objects of that type, but cannot name the type itself. - UNREACHABLE_
CODE - The
unreachable_code
lint detects unreachable code paths. - UNREACHABLE_
PATTERNS - The
unreachable_patterns
lint detects unreachable patterns. - UNREACHABLE_
PUB - The
unreachable_pub
lint triggers forpub
items not reachable from other crates - that means neither directly accessible, nor reexported (withpub use
), nor leaked through things like return types (which theunnameable_types
lint can detect if desired). - UNSAFE_
ATTR_ OUTSIDE_ UNSAFE - The
unsafe_attr_outside_unsafe
lint detects a missing unsafe keyword on attributes considered unsafe. - UNSAFE_
CODE 🔒 - The
unsafe_code
lint catches usage ofunsafe
code and other potentially unsound constructs likeno_mangle
,export_name
, andlink_section
. - UNSAFE_
OP_ IN_ UNSAFE_ FN - The
unsafe_op_in_unsafe_fn
lint detects unsafe operations in unsafe functions without an explicit unsafe block. - UNSTABLE_
FEATURES 🔒 - The
unstable_features
lint detects uses of#![feature]
. - UNSTABLE_
NAME_ COLLISIONS - The
unstable_name_collisions
lint detects that you have used a name that the standard library plans to add in the future. - UNSTABLE_
SYNTAX_ PRE_ EXPANSION - The
unstable_syntax_pre_expansion
lint detects the use of unstable syntax that is discarded during attribute expansion. - UNSUPPORTED_
FN_ PTR_ CALLING_ CONVENTIONS - The
unsupported_fn_ptr_calling_conventions
lint is output whenever there is a use of a target dependent calling convention on a target that does not support this calling convention on a function pointer. - UNUSED_
ASSIGNMENTS - The
unused_assignments
lint detects assignments that will never be read. - UNUSED_
ASSOCIATED_ TYPE_ BOUNDS - The
unused_associated_type_bounds
lint is emitted when an associated type bound is added to a trait object, but the associated type has awhere Self: Sized
bound, and is thus unavailable on the trait object anyway. - UNUSED_
ATTRIBUTES - The
unused_attributes
lint detects attributes that were not used by the compiler. - UNUSED_
CRATE_ DEPENDENCIES - The
unused_crate_dependencies
lint detects crate dependencies that are never used. - UNUSED_
DOC_ COMMENTS - The
unused_doc_comments
lint detects doc comments that aren’t used byrustdoc
. - UNUSED_
EXTERN_ CRATES - The
unused_extern_crates
lint guards againstextern crate
items that are never used. - UNUSED_
FEATURES - The
unused_features
lint detects unused or unknown features found in crate-levelfeature
attributes. - UNUSED_
IMPORTS - The
unused_imports
lint detects imports that are never used. - UNUSED_
LABELS - The
unused_labels
lint detects labels that are never used. - UNUSED_
LIFETIMES - The
unused_lifetimes
lint detects lifetime parameters that are never used. - UNUSED_
MACROS - The
unused_macros
lint detects macros that were not used. - UNUSED_
MACRO_ RULES - The
unused_macro_rules
lint detects macro rules that were not used. - UNUSED_
MUT - The
unused_mut
lint detects mut variables which don’t need to be mutable. - UNUSED_
QUALIFICATIONS - The
unused_qualifications
lint detects unnecessarily qualified names. - UNUSED_
UNSAFE - The
unused_unsafe
lint detects unnecessary use of anunsafe
block. - UNUSED_
VARIABLES - The
unused_variables
lint detects variables which are not used in any way. - USELESS_
DEPRECATED - The
useless_deprecated
lint detects deprecation attributes with no effect. - WARNINGS
- The
warnings
lint allows you to change the level of other lints which produce warnings. - WHILE_
TRUE 🔒 - The
while_true
lint detectswhile true { }
.
Functions§
- has_doc 🔒
- type_
implements_ 🔒negative_ copy_ modulo_ regions - Check whether a
ty
has a negativeCopy
implementation, ignoring outlives constraints. - warn_
if_ 🔒doc