1
Fork 0

Add warn(unreachable_pub) to rustc_mir_build.

This commit is contained in:
Nicholas Nethercote 2024-08-29 10:13:19 +10:00
parent 938daf6033
commit c16e2899dc
2 changed files with 2 additions and 1 deletions

View file

@ -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) {

View file

@ -8,6 +8,7 @@
#![feature(if_let_guard)]
#![feature(let_chains)]
#![feature(try_blocks)]
#![warn(unreachable_pub)]
// tidy-alphabetical-end
mod build;