rustc_lint

Module internal

Source
Expand description

Some lints that are only useful in the compiler or crates that use compiler internals, such as Clippy.

Structsยง

BadOptAccess
DefaultHashTypes
Diagnostics
LintPassImpl
QueryStability
SpanUseEqCtxt
SymbolInternStringLiteral
TyTyKind
TypeIr

Staticsยง

BAD_OPT_ACCESS
The bad_opt_access lint detects accessing options by field instead of the wrapper function.
DEFAULT_HASH_TYPES
The default_hash_type lint detects use of std::collections::HashMap and std::collections::HashSet, suggesting the use of FxHashMap/FxHashSet.
DIAGNOSTIC_OUTSIDE_OF_IMPL
The diagnostic_outside_of_impl lint detects calls to functions annotated with #[rustc_lint_diagnostics] that are outside an Diagnostic, Subdiagnostic, or LintDiagnostic impl (either hand-written or derived).
LINT_PASS_IMPL_WITHOUT_MACRO
The lint_pass_impl_without_macro detects manual implementations of a lint pass, without using declare_lint_pass or [impl_lint_pass].
NON_GLOB_IMPORT_OF_TYPE_IR_INHERENT
The non_glob_import_of_type_ir_inherent_item lint detects non-glob imports of module rustc_type_ir::inherent.
POTENTIAL_QUERY_INSTABILITY
The potential_query_instability lint detects use of methods which can lead to potential query instability, such as iterating over a HashMap.
SPAN_USE_EQ_CTXT
SYMBOL_INTERN_STRING_LITERAL
The symbol_intern_string_literal detects Symbol::intern being called on a string literal
UNTRACKED_QUERY_INFORMATION
The untracked_query_information lint detects use of methods which leak information not tracked by the query system, such as whether a Steal<T> value has already been stolen. In order not to break incremental compilation, such methods must be used very carefully or not at all.
UNTRANSLATABLE_DIAGNOSTIC
The untranslatable_diagnostic lint detects messages passed to functions with impl Into<{D,Subd}iagMessage parameters without using translatable Fluent strings.
USAGE_OF_QUALIFIED_TY
The usage_of_qualified_ty lint detects usages of ty::TyKind, where Ty should be used instead.
USAGE_OF_TYPE_IR_INHERENT
The usage_of_type_ir_inherent lint detects usage rustc_type_ir::inherent.
USAGE_OF_TY_TYKIND
The usage_of_ty_tykind lint detects usages of ty::TyKind::<kind>, where ty::<kind> would suffice.

Functionsยง

gen_args ๐Ÿ”’
is_span_ctxt_call ๐Ÿ”’
is_ty_or_ty_ctxt ๐Ÿ”’
lint_ty_kind_usage ๐Ÿ”’
typeck_results_of_method_fn ๐Ÿ”’
Helper function for lints that check for expressions with calls and use typeck results to get the DefId and GenericArgsRef of the function.