Crate rustc_lint

Source
Expand description

Lints, aka compiler warnings.

A ‘lint’ check is a kind of miscellaneous constraint that a user might want to enforce, but might reasonably want to permit as well, on a module-by-module basis. They contrast with static constraints enforced by other phases of the compiler, which are generally required to hold in order to compile the program at all.

Most lints can be written as LintPass instances. These run after all other analyses. The LintPasses built into rustc are defined within [rustc_session::lint::builtin], which has further comments on how to add such a lint. rustc can also load external lint plugins, as is done for Clippy.

See https://rustc-dev-guide.rust-lang.org/diagnostics.html for an overview of how lints are implemented.

§Note

This API is completely unstable and subject to change.

Re-exports§

Modules§

Macros§

Structs§

Enums§

Statics§

  • The array_into_iter lint detects calling into_iter on arrays.
  • The boxed_slice_into_iter lint detects calling into_iter on boxed slices.
  • Raw content of Fluent resource for this crate, generated by fluent_messages macro, imported by rustc_driver to include all crates’ resources in one bundle.

Traits§

Functions§

Type Aliases§