[−][src]Module rustc_lint::builtin
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Lints in the Rust compiler.
This contains lints which can feasibly be implemented as their own
AST visitor. Also see rustc::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.
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
(also, note that such lints will need to be defined in
rustc::lint::builtin
, not here).
If you define a new LintPass
, you will also need to add it to the
add_builtin!
or add_builtin_with_new!
invocation in lib.rs
.
Use the former for unit-like structs and the latter for structs with
a pub fn new()
.
Modules
parser |
[ Experimental ] Some lints that are buffered from |
Structs
AnonymousParameters |
[ Experimental ] Checks for use of anonymous parameters (RFC 1685) |
BadRepr |
[ Experimental ] Checks for incorrect use use of |
BoxPointers |
[ Experimental ]
|
DeprecatedAttr |
[ Experimental ] Checks for use of attributes which have been deprecated. |
EllipsisInclusiveRangePatterns |
[ Experimental ]
|
HardwiredLints |
[ Experimental ] Does nothing as a lint pass, but registers some |
InvalidNoMangleItems |
[ Experimental ]
|
KeywordIdents |
[ Experimental ] Checks for uses of edtion keywords used as an identifier |
MissingCopyImplementations |
[ Experimental ]
|
MissingDebugImplementations |
[ Experimental ]
|
MissingDoc |
[ Experimental ]
|
MutableTransmutes |
[ Experimental ]
|
NonShorthandFieldPatterns |
[ Experimental ]
|
PluginAsLibrary |
[ Experimental ]
|
SoftLints |
[ Experimental ] Does nothing as a lint pass, but registers some |
TrivialConstraints |
[ Experimental ] Lint for trait and lifetime bounds that don't depend on type parameters which either do nothing, or stop the item from being used. |
TypeAliasBounds |
[ Experimental ] Lint for trait and lifetime bounds in type aliases being mostly ignored: They are relevant when using associated types, but otherwise neither checked at definition site nor enforced at use site. |
UnconditionalRecursion |
[ Experimental ]
|
UnionsWithDropFields |
[ Experimental ] Lint for unions that contain fields with possibly non-trivial destructors. |
UnnameableTestItems |
[ Experimental ]
|
UnreachablePub |
[ Experimental ] Lint for items marked |
UnsafeCode |
[ Experimental ]
|
UnstableFeatures |
[ Experimental ] Forbids using the |
UnusedBrokenConst |
[ Experimental ] Lint constants that are erroneous. Without this lint, we might not get any diagnostic if the constant is unused within this crate, even though downstream crates can't use it without producing an error. |
UnusedBrokenConstVisitor |
[ Experimental ]
|
UnusedDocComment |
[ Experimental ]
|
WhileTrue |
[ Experimental ]
|
Enums
BuiltinLintDiagnostics |
[ Experimental ]
|
Statics
Functions
check_const |
[ Experimental ]
|
validate_const |
[ Experimental ]
|