about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-08-29 10:13:19 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-08-29 20:13:06 +1000
commitc16e2899dc550b2bc3d04f25eae69c87a3b83824 (patch)
treee6d4dca3ea5de1e2ccb4a9564cc89b9174f221ea
parent938daf6033514c190957349354f0c89264370a41 (diff)
downloadrust-c16e2899dc550b2bc3d04f25eae69c87a3b83824.tar.gz
rust-c16e2899dc550b2bc3d04f25eae69c87a3b83824.zip
Add `warn(unreachable_pub)` to `rustc_mir_build`.
-rw-r--r--compiler/rustc_mir_build/src/check_unsafety.rs2
-rw-r--r--compiler/rustc_mir_build/src/lib.rs1
2 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_mir_build/src/check_unsafety.rs b/compiler/rustc_mir_build/src/check_unsafety.rs
index 60cd49b88b4..4ce796cea7a 100644
--- a/compiler/rustc_mir_build/src/check_unsafety.rs
+++ b/compiler/rustc_mir_build/src/check_unsafety.rs
@@ -1027,7 +1027,7 @@ impl UnsafeOpKind {
     }
 }
 
-pub fn check_unsafety(tcx: TyCtxt<'_>, def: LocalDefId) {
+pub(crate) fn check_unsafety(tcx: TyCtxt<'_>, def: LocalDefId) {
     // Closures and inline consts are handled by their owner, if it has a body
     // Also, don't safety check custom MIR
     if tcx.is_typeck_child(def.to_def_id()) || tcx.has_attr(def, sym::custom_mir) {
diff --git a/compiler/rustc_mir_build/src/lib.rs b/compiler/rustc_mir_build/src/lib.rs
index 66004179b10..3dbb552cdbb 100644
--- a/compiler/rustc_mir_build/src/lib.rs
+++ b/compiler/rustc_mir_build/src/lib.rs
@@ -8,6 +8,7 @@
 #![feature(if_let_guard)]
 #![feature(let_chains)]
 #![feature(try_blocks)]
+#![warn(unreachable_pub)]
 // tidy-alphabetical-end
 
 mod build;