Module rustc::lint::builtin[src]

Lints built in to rustc.

This is a sibling of lint::context in order to ensure that lints implemented here use the same public API as lint plugins.

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. You can do that in an existing LintPass if it makes sense, or in a new LintPass, or using Session::add_lint elsewhere in the compiler. Only do the latter if the check can't be written cleanly as a LintPass.

If you define a new LintPass, you will also need to add it to the add_builtin! or add_builtin_with_new! invocation in context.rs. Use the former for unit-like structs and the latter for structs with a pub fn new().

Structs

CTypes
HardwiredLints

Does nothing as a lint pass, but registers some Lints which are used by other parts of the compiler.

HeapMemory
MissingDoc
NonCamelCaseTypes
NonSnakeCaseFunctions
NonUppercasePatternStatics
NonUppercaseStatics
PathStatement
RawPointerDeriving
Stability

Checks for use of items with #[deprecated], #[experimental] and #[unstable] attributes, or no stability attribute.

TypeLimits
UnnecessaryAllocation
UnnecessaryParens
UnsafeBlock
UnusedAttribute
UnusedCasts
UnusedMut
UnusedResult
UnusedUnsafe
UppercaseVariables
WhileTrue

Statics

pub static DEAD_ASSIGNMENT: &'static Lint = &lint_initializer!($name, $level, $desc);  
pub static DEAD_CODE: &'static Lint = &lint_initializer!($name, $level, $desc);  
pub static UNKNOWN_CRATE_TYPE: &'static Lint = &lint_initializer!($name, $level, $desc);  
pub static UNKNOWN_FEATURES: &'static Lint = &lint_initializer!($name, $level, $desc);  
pub static UNNECESSARY_QUALIFICATION: &'static Lint = &lint_initializer!($name, $level, $desc);  
pub static UNREACHABLE_CODE: &'static Lint = &lint_initializer!($name, $level, $desc);  
pub static UNRECOGNIZED_LINT: &'static Lint = &lint_initializer!($name, $level, $desc);  
pub static UNUSED_IMPORTS: &'static Lint = &lint_initializer!($name, $level, $desc);  
pub static UNUSED_VARIABLE: &'static Lint = &lint_initializer!($name, $level, $desc);  
pub static VARIANT_SIZE_DIFFERENCE: &'static Lint = &lint_initializer!($name, $level, $desc);  
pub static VISIBLE_PRIVATE_TYPES: &'static Lint = &lint_initializer!($name, $level, $desc);  
pub static WARNINGS: &'static Lint = &lint_initializer!($name, $level, $desc);