From c16d3f32a489ef92e7812445ecf6dd6d5070439d Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 22 Nov 2023 10:25:52 +1100 Subject: [PATCH] Avoid unnecessary exports. --- compiler/rustc_mir_dataflow/src/drop_flag_effects.rs | 2 +- compiler/rustc_mir_dataflow/src/framework/mod.rs | 2 +- compiler/rustc_mir_dataflow/src/lib.rs | 10 +++++----- compiler/rustc_mir_dataflow/src/un_derefer.rs | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/compiler/rustc_mir_dataflow/src/drop_flag_effects.rs b/compiler/rustc_mir_dataflow/src/drop_flag_effects.rs index 81c1a50a5dd4d..90c4de1b9c567 100644 --- a/compiler/rustc_mir_dataflow/src/drop_flag_effects.rs +++ b/compiler/rustc_mir_dataflow/src/drop_flag_effects.rs @@ -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>, diff --git a/compiler/rustc_mir_dataflow/src/framework/mod.rs b/compiler/rustc_mir_dataflow/src/framework/mod.rs index 5020a1cf0b27c..a5ae1edf221cb 100644 --- a/compiler/rustc_mir_dataflow/src/framework/mod.rs +++ b/compiler/rustc_mir_dataflow/src/framework/mod.rs @@ -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}; diff --git a/compiler/rustc_mir_dataflow/src/lib.rs b/compiler/rustc_mir_dataflow/src/lib.rs index cb871ca8d5d7c..81149793c5ab1 100644 --- a/compiler/rustc_mir_dataflow/src/lib.rs +++ b/compiler/rustc_mir_dataflow/src/lib.rs @@ -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; diff --git a/compiler/rustc_mir_dataflow/src/un_derefer.rs b/compiler/rustc_mir_dataflow/src/un_derefer.rs index 874d50ffd0e21..b803ecc575ee0 100644 --- a/compiler/rustc_mir_dataflow/src/un_derefer.rs +++ b/compiler/rustc_mir_dataflow/src/un_derefer.rs @@ -3,13 +3,13 @@ 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>>, } 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); @@ -17,7 +17,7 @@ impl<'tcx> UnDerefer<'tcx> { /// 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() } @@ -25,7 +25,7 @@ impl<'tcx> UnDerefer<'tcx> { /// /// See [`PlaceRef::iter_projections`] #[inline] - pub fn iter_projections( + pub(crate) fn iter_projections( &self, place: PlaceRef<'tcx>, ) -> impl Iterator, PlaceElem<'tcx>)> + '_ {