Skip to content

Commit 4af8178

Browse files
committed
Add deny(unreachable_pub) to rustc_codegen_ssa.
1 parent 13e765b commit 4af8178

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

compiler/rustc_codegen_ssa/src/back/write.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ pub(crate) enum WorkItem<B: WriteBackendMethods> {
756756
}
757757

758758
impl<B: WriteBackendMethods> WorkItem<B> {
759-
pub fn module_kind(&self) -> ModuleKind {
759+
fn module_kind(&self) -> ModuleKind {
760760
match *self {
761761
WorkItem::Optimize(ref m) => m.kind,
762762
WorkItem::CopyPostLtoArtifacts(_) | WorkItem::LTO(_) => ModuleKind::Regular,

compiler/rustc_codegen_ssa/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#![allow(internal_features)]
33
#![allow(rustc::diagnostic_outside_of_impl)]
44
#![allow(rustc::untranslatable_diagnostic)]
5+
#![deny(unreachable_pub)]
56
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
67
#![doc(rust_logo)]
78
#![feature(box_patterns)]

compiler/rustc_codegen_ssa/src/mir/analyze.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf};
1313
use rustc_middle::{bug, span_bug};
1414
use tracing::debug;
1515

16-
pub fn non_ssa_locals<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
16+
pub(crate) fn non_ssa_locals<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
1717
fx: &FunctionCx<'a, 'tcx, Bx>,
1818
) -> BitSet<mir::Local> {
1919
let mir = fx.mir;
@@ -251,14 +251,14 @@ impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
251251
}
252252

253253
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
254-
pub enum CleanupKind {
254+
pub(crate) enum CleanupKind {
255255
NotCleanup,
256256
Funclet,
257257
Internal { funclet: mir::BasicBlock },
258258
}
259259

260260
impl CleanupKind {
261-
pub fn funclet_bb(self, for_bb: mir::BasicBlock) -> Option<mir::BasicBlock> {
261+
pub(crate) fn funclet_bb(self, for_bb: mir::BasicBlock) -> Option<mir::BasicBlock> {
262262
match self {
263263
CleanupKind::NotCleanup => None,
264264
CleanupKind::Funclet => Some(for_bb),
@@ -270,7 +270,7 @@ impl CleanupKind {
270270
/// MSVC requires unwinding code to be split to a tree of *funclets*, where each funclet can only
271271
/// branch to itself or to its parent. Luckily, the code we generates matches this pattern.
272272
/// Recover that structure in an analyze pass.
273-
pub fn cleanup_kinds(mir: &mir::Body<'_>) -> IndexVec<mir::BasicBlock, CleanupKind> {
273+
pub(crate) fn cleanup_kinds(mir: &mir::Body<'_>) -> IndexVec<mir::BasicBlock, CleanupKind> {
274274
fn discover_masters<'tcx>(
275275
result: &mut IndexSlice<mir::BasicBlock, CleanupKind>,
276276
mir: &mir::Body<'tcx>,

0 commit comments

Comments
 (0)