Skip to content

Commit

Permalink
Avoid unnecessary exports.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Nov 23, 2023
1 parent ca74194 commit c16d3f3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_mir_dataflow/src/drop_flag_effects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ pub fn drop_flag_effects_for_location<'tcx, F>(
for_location_inits(tcx, body, move_data, loc, |mpi| callback(mpi, DropFlagState::Present));
}

pub fn for_location_inits<'tcx, F>(
fn for_location_inits<'tcx, F>(
tcx: TyCtxt<'tcx>,
body: &Body<'tcx>,
move_data: &MoveData<'tcx>,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_dataflow/src/framework/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub mod graphviz;
pub mod lattice;
mod visitor;

pub use self::cursor::{AnalysisResults, ResultsClonedCursor, ResultsCursor, ResultsRefCursor};
pub use self::cursor::{ResultsClonedCursor, ResultsCursor, ResultsRefCursor};
pub use self::direction::{Backward, Direction, Forward};
pub use self::engine::{Engine, EntrySets, Results, ResultsCloned};
pub use self::lattice::{JoinSemiLattice, MaybeReachable};
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_mir_dataflow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ pub use self::drop_flag_effects::{
move_path_children_matching, on_all_children_bits, on_lookup_result_bits,
};
pub use self::framework::{
fmt, graphviz, lattice, visit_results, Analysis, AnalysisDomain, AnalysisResults, Backward,
CloneAnalysis, Direction, Engine, Forward, GenKill, GenKillAnalysis, JoinSemiLattice,
MaybeReachable, Results, ResultsCloned, ResultsClonedCursor, ResultsCursor, ResultsRefCursor,
ResultsVisitable, ResultsVisitor, SwitchIntEdgeEffects,
fmt, lattice, visit_results, Analysis, AnalysisDomain, Direction, GenKill, GenKillAnalysis,
JoinSemiLattice, MaybeReachable, Results, ResultsCursor, ResultsVisitable, ResultsVisitor,
};
use self::framework::{
Backward, CloneAnalysis, Forward, ResultsClonedCursor, SwitchIntEdgeEffects,
};

use self::move_paths::MoveData;

pub mod debuginfo;
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_mir_dataflow/src/un_derefer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ use rustc_middle::mir::*;

/// Used for reverting changes made by `DerefSeparator`
#[derive(Default, Debug)]
pub struct UnDerefer<'tcx> {
pub(crate) struct UnDerefer<'tcx> {
deref_chains: FxHashMap<Local, Vec<PlaceRef<'tcx>>>,
}

impl<'tcx> UnDerefer<'tcx> {
#[inline]
pub fn insert(&mut self, local: Local, reffed: PlaceRef<'tcx>) {
pub(crate) fn insert(&mut self, local: Local, reffed: PlaceRef<'tcx>) {
let mut chain = self.deref_chains.remove(&reffed.local).unwrap_or_default();
chain.push(reffed);
self.deref_chains.insert(local, chain);
}

/// Returns the chain of places behind `DerefTemp` locals
#[inline]
pub fn deref_chain(&self, local: Local) -> &[PlaceRef<'tcx>] {
pub(crate) fn deref_chain(&self, local: Local) -> &[PlaceRef<'tcx>] {
self.deref_chains.get(&local).map(Vec::as_slice).unwrap_or_default()
}

/// Iterates over the projections of a place and its deref chain.
///
/// See [`PlaceRef::iter_projections`]
#[inline]
pub fn iter_projections(
pub(crate) fn iter_projections(
&self,
place: PlaceRef<'tcx>,
) -> impl Iterator<Item = (PlaceRef<'tcx>, PlaceElem<'tcx>)> + '_ {
Expand Down

0 comments on commit c16d3f3

Please sign in to comment.