Skip to content

Commit 39f9cd1

Browse files
committed
Update the unused lint group to include more lints
1 parent b276f8a commit 39f9cd1

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
@@ -647,7 +647,7 @@ impl LintPass for UnusedAttribute {
647647
}
648648
}
649649

650-
declare_lint!(PATH_STATEMENT, Warn,
650+
declare_lint!(pub PATH_STATEMENT, Warn,
651651
"path statements with no effect")
652652

653653
pub struct PathStatement;
@@ -671,10 +671,10 @@ impl LintPass for PathStatement {
671671
}
672672
}
673673

674-
declare_lint!(UNUSED_MUST_USE, Warn,
674+
declare_lint!(pub UNUSED_MUST_USE, Warn,
675675
"unused result of a type flagged as #[must_use]")
676676

677-
declare_lint!(UNUSED_RESULT, Allow,
677+
declare_lint!(pub UNUSED_RESULT, Allow,
678678
"unused result of an expression in a statement")
679679

680680
pub struct UnusedResult;
@@ -1149,7 +1149,7 @@ impl LintPass for UnnecessaryImportBraces {
11491149
}
11501150
}
11511151

1152-
declare_lint!(UNUSED_UNSAFE, Warn,
1152+
declare_lint!(pub UNUSED_UNSAFE, Warn,
11531153
"unnecessary use of an `unsafe` block")
11541154

11551155
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)