Skip to content

Commit

Permalink
Add warn(unreachable_pub) to rustc_mir_build.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Aug 29, 2024
1 parent 938daf6 commit c16e289
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_mir_build/src/check_unsafety.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_mir_build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#![feature(if_let_guard)]
#![feature(let_chains)]
#![feature(try_blocks)]
#![warn(unreachable_pub)]
// tidy-alphabetical-end

mod build;
Expand Down

0 comments on commit c16e289

Please sign in to comment.