Skip to content

Commit

Permalink
Update the unused lint group to include more lints
Browse files Browse the repository at this point in the history
  • Loading branch information
ftxqxd committed Oct 3, 2014
1 parent 94bcd35 commit 333592e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/librustc/lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/librustc/lint/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 333592e

Please sign in to comment.