Skip to content

Commit c16e289

Browse files
committed
Add warn(unreachable_pub) to rustc_mir_build.
1 parent 938daf6 commit c16e289

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
@@ -1027,7 +1027,7 @@ impl UnsafeOpKind {
10271027
}
10281028
}
10291029

1030-
pub fn check_unsafety(tcx: TyCtxt<'_>, def: LocalDefId) {
1030+
pub(crate) fn check_unsafety(tcx: TyCtxt<'_>, def: LocalDefId) {
10311031
// Closures and inline consts are handled by their owner, if it has a body
10321032
// Also, don't safety check custom MIR
10331033
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)