Skip to content

Commit 312e01b

Browse files
committed
Add deny(unreachable_pub) to rustc_codegen_ssa.
1 parent a27da03 commit 312e01b

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

compiler/rustc_codegen_ssa/src/back/write.rs

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

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

compiler/rustc_codegen_ssa/src/errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ impl<'a> CopyPath<'a> {
149149
}
150150
}
151151

152-
struct DebugArgPath<'a>(pub &'a Path);
152+
struct DebugArgPath<'a>(&'a Path);
153153

154154
impl IntoDiagArg for DebugArgPath<'_> {
155155
fn into_diag_arg(self) -> rustc_errors::DiagArgValue {

compiler/rustc_codegen_ssa/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#![allow(internal_features)]
55
#![allow(rustc::diagnostic_outside_of_impl)]
66
#![allow(rustc::untranslatable_diagnostic)]
7+
#![deny(unreachable_pub)]
78
#![feature(box_patterns)]
89
#![feature(if_let_guard)]
910
#![feature(let_chains)]

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)