Skip to content

Commit 64a8c4d

Browse files
committed
Reduce pub usage.
1 parent c16d3f3 commit 64a8c4d

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

compiler/rustc_mir_dataflow/src/framework/graphviz.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use super::fmt::{DebugDiffWithAdapter, DebugWithAdapter, DebugWithContext};
1515
use super::{Analysis, CallReturnPlaces, Direction, Results, ResultsRefCursor, ResultsVisitor};
1616

1717
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
18-
pub enum OutputStyle {
18+
pub(crate) enum OutputStyle {
1919
AfterOnly,
2020
BeforeAndAfter,
2121
}
@@ -29,7 +29,7 @@ impl OutputStyle {
2929
}
3030
}
3131

32-
pub struct Formatter<'res, 'mir, 'tcx, A>
32+
pub(crate) struct Formatter<'res, 'mir, 'tcx, A>
3333
where
3434
A: Analysis<'tcx>,
3535
{
@@ -43,7 +43,7 @@ impl<'res, 'mir, 'tcx, A> Formatter<'res, 'mir, 'tcx, A>
4343
where
4444
A: Analysis<'tcx>,
4545
{
46-
pub fn new(
46+
pub(crate) fn new(
4747
body: &'mir Body<'tcx>,
4848
results: &'res mut Results<'tcx, A>,
4949
style: OutputStyle,
@@ -55,7 +55,7 @@ where
5555

5656
/// A pair of a basic block and an index into that basic blocks `successors`.
5757
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
58-
pub struct CfgEdge {
58+
pub(crate) struct CfgEdge {
5959
source: BasicBlock,
6060
index: usize,
6161
}

compiler/rustc_mir_dataflow/src/rustc_peek.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use rustc_span::Span;
2121

2222
pub struct SanityCheck;
2323

24-
pub fn has_rustc_mir_with(tcx: TyCtxt<'_>, def_id: DefId, name: Symbol) -> Option<MetaItem> {
24+
fn has_rustc_mir_with(tcx: TyCtxt<'_>, def_id: DefId, name: Symbol) -> Option<MetaItem> {
2525
for attr in tcx.get_attrs(def_id, sym::rustc_mir) {
2626
let items = attr.meta_item_list();
2727
for item in items.iter().flat_map(|l| l.iter()) {
@@ -101,10 +101,8 @@ impl<'tcx> MirPass<'tcx> for SanityCheck {
101101
/// (If there are any calls to `rustc_peek` that do not match the
102102
/// expression form above, then that emits an error as well, but those
103103
/// errors are not intended to be used for unit tests.)
104-
pub fn sanity_check_via_rustc_peek<'tcx, A>(
105-
tcx: TyCtxt<'tcx>,
106-
mut cursor: ResultsCursor<'_, 'tcx, A>,
107-
) where
104+
fn sanity_check_via_rustc_peek<'tcx, A>(tcx: TyCtxt<'tcx>, mut cursor: ResultsCursor<'_, 'tcx, A>)
105+
where
108106
A: RustcPeekAt<'tcx>,
109107
{
110108
let def_id = cursor.body().source.def_id();
@@ -185,7 +183,7 @@ impl PeekCallKind {
185183
}
186184

187185
#[derive(Clone, Copy, Debug)]
188-
pub struct PeekCall {
186+
struct PeekCall {
189187
arg: Local,
190188
kind: PeekCallKind,
191189
span: Span,
@@ -233,7 +231,7 @@ impl PeekCall {
233231
}
234232
}
235233

236-
pub trait RustcPeekAt<'tcx>: Analysis<'tcx> {
234+
trait RustcPeekAt<'tcx>: Analysis<'tcx> {
237235
fn peek_at(
238236
&self,
239237
tcx: TyCtxt<'tcx>,

compiler/rustc_mir_dataflow/src/value_analysis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ impl Map {
921921
}
922922

923923
/// Locates the given place, if it exists in the tree.
924-
pub fn find_extra(
924+
fn find_extra(
925925
&self,
926926
place: PlaceRef<'_>,
927927
extra: impl IntoIterator<Item = TrackElem>,

0 commit comments

Comments
 (0)