From 333592edde810324c9730a89372fa5164d10871d Mon Sep 17 00:00:00 2001 From: P1start Date: Sat, 13 Sep 2014 13:58:35 +1200 Subject: [PATCH] Update the `unused` lint group to include more lints --- src/librustc/lint/builtin.rs | 8 ++++---- src/librustc/lint/context.rs | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs index 7a59aeb57895..8ffda8bd8275 100644 --- a/src/librustc/lint/builtin.rs +++ b/src/librustc/lint/builtin.rs @@ -631,7 +631,7 @@ impl LintPass for UnusedAttribute { } } -declare_lint!(PATH_STATEMENT, Warn, +declare_lint!(pub PATH_STATEMENT, Warn, "path statements with no effect") pub struct PathStatement; @@ -655,10 +655,10 @@ impl LintPass for PathStatement { } } -declare_lint!(UNUSED_MUST_USE, Warn, +declare_lint!(pub UNUSED_MUST_USE, Warn, "unused result of a type flagged as #[must_use]") -declare_lint!(UNUSED_RESULT, Allow, +declare_lint!(pub UNUSED_RESULT, Allow, "unused result of an expression in a statement") pub struct UnusedResult; @@ -1136,7 +1136,7 @@ impl LintPass for UnnecessaryImportBraces { } } -declare_lint!(UNUSED_UNSAFE, Warn, +declare_lint!(pub UNUSED_UNSAFE, Warn, "unnecessary use of an `unsafe` block") pub struct UnusedUnsafe; diff --git a/src/librustc/lint/context.rs b/src/librustc/lint/context.rs index 51852a347d16..bb277511463b 100644 --- a/src/librustc/lint/context.rs +++ b/src/librustc/lint/context.rs @@ -203,7 +203,8 @@ impl LintStore { add_lint_group!(sess, "unused", UNUSED_IMPORTS, UNUSED_VARIABLE, DEAD_ASSIGNMENT, DEAD_CODE, - UNUSED_MUT, UNREACHABLE_CODE, UNUSED_EXTERN_CRATE) + UNUSED_MUT, UNREACHABLE_CODE, UNUSED_EXTERN_CRATE, UNUSED_MUST_USE, + UNUSED_UNSAFE, UNUSED_RESULT, PATH_STATEMENT) // We have one lint pass defined in this module. self.register_pass(sess, false, box GatherNodeLevels as LintPassObject);