diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-11-23 18:50:25 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-11-27 10:35:43 +1100 |
| commit | 5f5263bfc82a199dfc1121022d855bb7545046ac (patch) | |
| tree | f737404c919590dfe0b1c4eec8cf6695184555ef /compiler/rustc_mir_dataflow/src | |
| parent | cf82b410f91082bce79bb70d5d94633f946a3b77 (diff) | |
| download | rust-5f5263bfc82a199dfc1121022d855bb7545046ac.tar.gz rust-5f5263bfc82a199dfc1121022d855bb7545046ac.zip | |
Remove `ResultsRefCursor`.
It's no longer used.
Diffstat (limited to 'compiler/rustc_mir_dataflow/src')
| -rw-r--r-- | compiler/rustc_mir_dataflow/src/framework/cursor.rs | 14 | ||||
| -rw-r--r-- | compiler/rustc_mir_dataflow/src/framework/engine.rs | 15 | ||||
| -rw-r--r-- | compiler/rustc_mir_dataflow/src/framework/mod.rs | 2 |
3 files changed, 2 insertions, 29 deletions
diff --git a/compiler/rustc_mir_dataflow/src/framework/cursor.rs b/compiler/rustc_mir_dataflow/src/framework/cursor.rs index e27666d590b..6033f331966 100644 --- a/compiler/rustc_mir_dataflow/src/framework/cursor.rs +++ b/compiler/rustc_mir_dataflow/src/framework/cursor.rs @@ -39,17 +39,6 @@ where { type EntrySets = E; } -impl<'a, 'tcx, A, E> AnalysisResults<'tcx, A> for &'a mut Results<'tcx, A, E> -where - A: Analysis<'tcx>, - E: Borrow<EntrySets<'tcx, A>>, -{ - type EntrySets = E; -} - -/// A `ResultsCursor` that borrows the underlying `Results`. -pub type ResultsRefCursor<'res, 'mir, 'tcx, A> = - ResultsCursor<'mir, 'tcx, A, &'res mut Results<'tcx, A>>; /// A `ResultsCursor` which uses a cloned `Analysis` while borrowing the underlying `Results`. This /// allows multiple cursors over the same `Results`. @@ -62,9 +51,6 @@ pub type ResultsClonedCursor<'res, 'mir, 'tcx, A> = /// the same order as the `DIRECTION` of the analysis. In the worst case—when statements are /// visited in *reverse* order—performance will be quadratic in the number of statements in the /// block. The order in which basic blocks are inspected has no impact on performance. -/// -/// A `ResultsCursor` can either own (the default) or borrow the dataflow results it inspects. The -/// type of ownership is determined by `R` (see `ResultsRefCursor` above). pub struct ResultsCursor<'mir, 'tcx, A, R = Results<'tcx, A>> where A: Analysis<'tcx>, diff --git a/compiler/rustc_mir_dataflow/src/framework/engine.rs b/compiler/rustc_mir_dataflow/src/framework/engine.rs index 90fc91d0123..cb8bbf0bff4 100644 --- a/compiler/rustc_mir_dataflow/src/framework/engine.rs +++ b/compiler/rustc_mir_dataflow/src/framework/engine.rs @@ -25,7 +25,7 @@ use super::fmt::DebugWithContext; use super::graphviz; use super::{ visit_results, Analysis, AnalysisDomain, Direction, GenKill, GenKillAnalysis, GenKillSet, - JoinSemiLattice, ResultsClonedCursor, ResultsCursor, ResultsRefCursor, ResultsVisitor, + JoinSemiLattice, ResultsClonedCursor, ResultsCursor, ResultsVisitor, }; pub type EntrySets<'tcx, A> = IndexVec<BasicBlock, <A as AnalysisDomain<'tcx>>::Domain>; @@ -82,19 +82,6 @@ where impl<'tcx, A> Results<'tcx, A> where - A: Analysis<'tcx>, -{ - /// Creates a `ResultsCursor` that can inspect these `Results`. - pub fn as_results_cursor<'a, 'mir>( - &'a mut self, - body: &'mir mir::Body<'tcx>, - ) -> ResultsRefCursor<'a, 'mir, 'tcx, A> { - ResultsCursor::new(body, self) - } -} - -impl<'tcx, A> Results<'tcx, A> -where A: Analysis<'tcx> + Copy, { /// Creates a `ResultsCursor` that can inspect these `Results`. diff --git a/compiler/rustc_mir_dataflow/src/framework/mod.rs b/compiler/rustc_mir_dataflow/src/framework/mod.rs index 36c02e329e3..d732ea5d4ea 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::{ResultsClonedCursor, ResultsCursor, ResultsRefCursor}; +pub use self::cursor::{ResultsClonedCursor, ResultsCursor}; pub use self::direction::{Backward, Direction, Forward}; pub use self::engine::{Engine, EntrySets, Results, ResultsCloned}; pub use self::lattice::{JoinSemiLattice, MaybeReachable}; |
