Skip to content

Commit 827fa43

Browse files
committed
Reduce visibility of MirPass and related things.
They're now all just used within this crate.
1 parent 2aae619 commit 827fa43

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

‎compiler/rustc_mir_transform/src/pass_manager.rs‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const fn c_name(name: &'static str) -> &'static str {
5959
/// A streamlined trait that you can implement to create a pass; the
6060
/// pass will be named after the type, and it will consist of a main
6161
/// loop that goes over each available MIR and applies `run_pass`.
62-
pubtraitMirPass<'tcx>{
62+
pub(super)traitMirPass<'tcx>{
6363
fnname(&self) -> &'staticstr{
6464
// FIXME Simplify the implementation once more `str` methods get const-stable.
6565
// See copypaste in `MirLint`
@@ -86,7 +86,7 @@ pub trait MirPass<'tcx> {
8686
}
8787

8888
/// Just like `MirPass`, except it cannot mutate `Body`.
89-
pubtraitMirLint<'tcx>{
89+
pub(super)traitMirLint<'tcx>{
9090
fnname(&self) -> &'staticstr{
9191
// FIXME Simplify the implementation once more `str` methods get const-stable.
9292
// See copypaste in `MirPass`
@@ -105,7 +105,7 @@ pub trait MirLint<'tcx> {
105105

106106
/// An adapter for `MirLint`s that implements `MirPass`.
107107
#[derive(Debug,Clone)]
108-
pubstructLint<T>(pubT);
108+
pub(super)structLint<T>(pubT);
109109

110110
impl<'tcx,T>MirPass<'tcx>forLint<T>
111111
where
@@ -128,7 +128,7 @@ where
128128
}
129129
}
130130

131-
pubstructWithMinOptLevel<T>(pubu32,pubT);
131+
pub(super)structWithMinOptLevel<T>(pubu32,pubT);
132132

133133
impl<'tcx,T>MirPass<'tcx>forWithMinOptLevel<T>
134134
where
@@ -149,7 +149,7 @@ where
149149

150150
/// Run the sequence of passes without validating the MIR after each pass. The MIR is still
151151
/// validated at the end.
152-
pubfnrun_passes_no_validate<'tcx>(
152+
pub(super)fnrun_passes_no_validate<'tcx>(
153153
tcx:TyCtxt<'tcx>,
154154
body:&mutBody<'tcx>,
155155
passes:&[&dynMirPass<'tcx>],
@@ -159,7 +159,7 @@ pub fn run_passes_no_validate<'tcx>(
159159
}
160160

161161
/// The optional `phase_change` is applied after executing all the passes, if present
162-
pubfnrun_passes<'tcx>(
162+
pub(super)fnrun_passes<'tcx>(
163163
tcx:TyCtxt<'tcx>,
164164
body:&mutBody<'tcx>,
165165
passes:&[&dynMirPass<'tcx>],
@@ -168,7 +168,7 @@ pub fn run_passes<'tcx>(
168168
run_passes_inner(tcx, body, passes, phase_change,true);
169169
}
170170

171-
pubfnshould_run_pass<'tcx,P>(tcx:TyCtxt<'tcx>,pass:&P) -> bool
171+
pub(super)fnshould_run_pass<'tcx,P>(tcx:TyCtxt<'tcx>,pass:&P) -> bool
172172
where
173173
P:MirPass<'tcx> + ?Sized,
174174
{
@@ -264,11 +264,11 @@ fn run_passes_inner<'tcx>(
264264
}
265265
}
266266

267-
pubfnvalidate_body<'tcx>(tcx:TyCtxt<'tcx>,body:&mutBody<'tcx>,when:String){
267+
pub(super)fnvalidate_body<'tcx>(tcx:TyCtxt<'tcx>,body:&mutBody<'tcx>,when:String){
268268
validate::Validator{ when,mir_phase: body.phase}.run_pass(tcx, body);
269269
}
270270

271-
pubfndump_mir_for_pass<'tcx>(
271+
pub(super)fndump_mir_for_pass<'tcx>(
272272
tcx:TyCtxt<'tcx>,
273273
body:&Body<'tcx>,
274274
pass_name:&str,
@@ -284,7 +284,7 @@ pub fn dump_mir_for_pass<'tcx>(
284284
);
285285
}
286286

287-
pubfndump_mir_for_phase_change<'tcx>(tcx:TyCtxt<'tcx>,body:&Body<'tcx>){
287+
pub(super)fndump_mir_for_phase_change<'tcx>(tcx:TyCtxt<'tcx>,body:&Body<'tcx>){
288288
assert_eq!(body.pass_count,0);
289289
mir::dump_mir(tcx,true, body.phase.name(),&"after", body, |_, _| Ok(()))
290290
}

0 commit comments

Comments
 (0)