Skip to content

Commit 333592e

Browse files
committed
Update the unused lint group to include more lints
1 parent 94bcd35 commit 333592e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/librustc/lint/builtin.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ impl LintPass for UnusedAttribute {
631631
}
632632
}
633633

634-
declare_lint!(PATH_STATEMENT, Warn,
634+
declare_lint!(pub PATH_STATEMENT, Warn,
635635
"path statements with no effect")
636636

637637
pub struct PathStatement;
@@ -655,10 +655,10 @@ impl LintPass for PathStatement {
655655
}
656656
}
657657

658-
declare_lint!(UNUSED_MUST_USE, Warn,
658+
declare_lint!(pub UNUSED_MUST_USE, Warn,
659659
"unused result of a type flagged as #[must_use]")
660660

661-
declare_lint!(UNUSED_RESULT, Allow,
661+
declare_lint!(pub UNUSED_RESULT, Allow,
662662
"unused result of an expression in a statement")
663663

664664
pub struct UnusedResult;
@@ -1136,7 +1136,7 @@ impl LintPass for UnnecessaryImportBraces {
11361136
}
11371137
}
11381138

1139-
declare_lint!(UNUSED_UNSAFE, Warn,
1139+
declare_lint!(pub UNUSED_UNSAFE, Warn,
11401140
"unnecessary use of an `unsafe` block")
11411141

11421142
pub struct UnusedUnsafe;

src/librustc/lint/context.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ impl LintStore {
203203

204204
add_lint_group!(sess, "unused",
205205
UNUSED_IMPORTS, UNUSED_VARIABLE, DEAD_ASSIGNMENT, DEAD_CODE,
206-
UNUSED_MUT, UNREACHABLE_CODE, UNUSED_EXTERN_CRATE)
206+
UNUSED_MUT, UNREACHABLE_CODE, UNUSED_EXTERN_CRATE, UNUSED_MUST_USE,
207+
UNUSED_UNSAFE, UNUSED_RESULT, PATH_STATEMENT)
207208

208209
// We have one lint pass defined in this module.
209210
self.register_pass(sess, false, box GatherNodeLevels as LintPassObject);

0 commit comments

Comments
 (0)