Skip to content

Commit 27b4a1f

Browse files
committed
Add warn(unreachable_pub) to rustc_mir_build.
1 parent d059f4f commit 27b4a1f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

compiler/rustc_mir_build/src/check_unsafety.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ impl UnsafeOpKind {
993993
}
994994
}
995995

996-
pub fn check_unsafety(tcx: TyCtxt<'_>, def: LocalDefId) {
996+
pub(crate) fn check_unsafety(tcx: TyCtxt<'_>, def: LocalDefId) {
997997
// Closures and inline consts are handled by their owner, if it has a body
998998
// Also, don't safety check custom MIR
999999
if tcx.is_typeck_child(def.to_def_id()) || tcx.has_attr(def, sym::custom_mir) {

compiler/rustc_mir_build/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#![feature(if_let_guard)]
99
#![feature(let_chains)]
1010
#![feature(try_blocks)]
11+
#![warn(unreachable_pub)]
1112
// tidy-alphabetical-end
1213

1314
mod build;

0 commit comments

Comments
 (0)