Expand description
Some lints that are only useful in the compiler or crates that use compiler internals, such as Clippy.
Structsยง
- BadOpt
Access - Default
Hash Types - Diagnostics
- Implicit
Sysroot Crate Import - Lint
Pass Impl - Query
Stability - Span
UseEq Ctxt - Symbol
Intern String Literal - TyTy
Kind - TypeIr
Staticsยง
- BAD_
OPT_ ACCESS - The
bad_opt_accesslint detects accessing options by field instead of the wrapper function. - DEFAULT_
HASH_ TYPES - The
default_hash_typelint detects use ofstd::collections::HashMapandstd::collections::HashSet, suggesting the use ofFxHashMap/FxHashSet. - DIAGNOSTIC_
OUTSIDE_ OF_ IMPL - The
diagnostic_outside_of_impllint detects calls to functions annotated with#[rustc_lint_diagnostics]that are outside anDiagnostic,Subdiagnostic, orLintDiagnosticimpl (either hand-written or derived). - DIRECT_
USE_ OF_ RUSTC_ TYPE_ IR - The
direct_use_of_rustc_type_irlint detects usage ofrustc_type_ir. - IMPLICIT_
SYSROOT_ CRATE_ IMPORT - The
implicit_sysroot_crate_importdetects use ofextern crateto import non-sysroot crates (e.g. crates.io deps) from the sysroot, which is dangerous because these crates are not guaranteed to exist exactly once, and so may be missing entirely or appear multiple times resulting in ambiguity. - LINT_
PASS_ IMPL_ WITHOUT_ MACRO - The
lint_pass_impl_without_macrodetects manual implementations of a lint pass, without usingdeclare_lint_passor [impl_lint_pass]. - NON_
GLOB_ IMPORT_ OF_ TYPE_ IR_ INHERENT - The
non_glob_import_of_type_ir_inherent_itemlint detects non-glob imports of modulerustc_type_ir::inherent. - POTENTIAL_
QUERY_ INSTABILITY - The
potential_query_instabilitylint detects use of methods which can lead to potential query instability, such as iterating over aHashMap. - SPAN_
USE_ EQ_ CTXT - SYMBOL_
INTERN_ STRING_ LITERAL - The
symbol_intern_string_literaldetectsSymbol::internbeing called on a string literal - UNTRACKED_
QUERY_ INFORMATION - The
untracked_query_informationlint detects use of methods which leak information not tracked by the query system, such as whether aSteal<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_diagnosticlint detects messages passed to functions withimpl Into<{D,Subd}iagMessageparameters without using translatable Fluent strings. - USAGE_
OF_ QUALIFIED_ TY - The
usage_of_qualified_tylint detects usages ofty::TyKind, whereTyshould be used instead. - USAGE_
OF_ TYPE_ IR_ INHERENT - The
usage_of_type_ir_inherentlint detects usage ofrustc_type_ir::inherent. - USAGE_
OF_ TYPE_ IR_ TRAITS - The
usage_of_type_ir_traitslint detects usage ofrustc_type_ir::Interner, orrustc_infer::InferCtxtLike. - USAGE_
OF_ TY_ TYKIND - The
usage_of_ty_tykindlint detects usages ofty::TyKind::<kind>, wherety::<kind>would suffice.
Functionsยง
- gen_
args ๐ - get_
callee_ ๐span_ generic_ args_ and_ args - Checks whether an expression is a function or method call and, if so, returns its
DefId,Span,GenericArgs, and arguments. This is a slight augmentation of a similarly named Clippy function,get_callee_generic_args_and_args. - has_
unstable_ ๐into_ iter_ predicate - is_
span_ ๐ctxt_ call - is_
ty_ ๐or_ ty_ ctxt - lint_
ty_ ๐kind_ usage