mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Reduce pub
usage.
This commit is contained in:
parent
c16d3f32a4
commit
64a8c4ddda
@ -15,7 +15,7 @@ use super::fmt::{DebugDiffWithAdapter, DebugWithAdapter, DebugWithContext};
|
||||
use super::{Analysis, CallReturnPlaces, Direction, Results, ResultsRefCursor, ResultsVisitor};
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub enum OutputStyle {
|
||||
pub(crate) enum OutputStyle {
|
||||
AfterOnly,
|
||||
BeforeAndAfter,
|
||||
}
|
||||
@ -29,7 +29,7 @@ impl OutputStyle {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Formatter<'res, 'mir, 'tcx, A>
|
||||
pub(crate) struct Formatter<'res, 'mir, 'tcx, A>
|
||||
where
|
||||
A: Analysis<'tcx>,
|
||||
{
|
||||
@ -43,7 +43,7 @@ impl<'res, 'mir, 'tcx, A> Formatter<'res, 'mir, 'tcx, A>
|
||||
where
|
||||
A: Analysis<'tcx>,
|
||||
{
|
||||
pub fn new(
|
||||
pub(crate) fn new(
|
||||
body: &'mir Body<'tcx>,
|
||||
results: &'res mut Results<'tcx, A>,
|
||||
style: OutputStyle,
|
||||
@ -55,7 +55,7 @@ where
|
||||
|
||||
/// A pair of a basic block and an index into that basic blocks `successors`.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||
pub struct CfgEdge {
|
||||
pub(crate) struct CfgEdge {
|
||||
source: BasicBlock,
|
||||
index: usize,
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ use rustc_span::Span;
|
||||
|
||||
pub struct SanityCheck;
|
||||
|
||||
pub fn has_rustc_mir_with(tcx: TyCtxt<'_>, def_id: DefId, name: Symbol) -> Option<MetaItem> {
|
||||
fn has_rustc_mir_with(tcx: TyCtxt<'_>, def_id: DefId, name: Symbol) -> Option<MetaItem> {
|
||||
for attr in tcx.get_attrs(def_id, sym::rustc_mir) {
|
||||
let items = attr.meta_item_list();
|
||||
for item in items.iter().flat_map(|l| l.iter()) {
|
||||
@ -101,10 +101,8 @@ impl<'tcx> MirPass<'tcx> for SanityCheck {
|
||||
/// (If there are any calls to `rustc_peek` that do not match the
|
||||
/// expression form above, then that emits an error as well, but those
|
||||
/// errors are not intended to be used for unit tests.)
|
||||
pub fn sanity_check_via_rustc_peek<'tcx, A>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
mut cursor: ResultsCursor<'_, 'tcx, A>,
|
||||
) where
|
||||
fn sanity_check_via_rustc_peek<'tcx, A>(tcx: TyCtxt<'tcx>, mut cursor: ResultsCursor<'_, 'tcx, A>)
|
||||
where
|
||||
A: RustcPeekAt<'tcx>,
|
||||
{
|
||||
let def_id = cursor.body().source.def_id();
|
||||
@ -185,7 +183,7 @@ impl PeekCallKind {
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct PeekCall {
|
||||
struct PeekCall {
|
||||
arg: Local,
|
||||
kind: PeekCallKind,
|
||||
span: Span,
|
||||
@ -233,7 +231,7 @@ impl PeekCall {
|
||||
}
|
||||
}
|
||||
|
||||
pub trait RustcPeekAt<'tcx>: Analysis<'tcx> {
|
||||
trait RustcPeekAt<'tcx>: Analysis<'tcx> {
|
||||
fn peek_at(
|
||||
&self,
|
||||
tcx: TyCtxt<'tcx>,
|
||||
|
@ -921,7 +921,7 @@ impl Map {
|
||||
}
|
||||
|
||||
/// Locates the given place, if it exists in the tree.
|
||||
pub fn find_extra(
|
||||
fn find_extra(
|
||||
&self,
|
||||
place: PlaceRef<'_>,
|
||||
extra: impl IntoIterator<Item = TrackElem>,
|
||||
|
Loading…
Reference in New Issue
Block a user