about summary refs log tree commit diff
path: root/compiler/rustc_mir_dataflow/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-11-23 16:59:13 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2023-11-27 10:35:42 +1100
commit389e2cc69a917ea7ddc40bef0c1bda0466b423db (patch)
tree499d9c4e2eecc6843e6bbde0525f319e37fb8345 /compiler/rustc_mir_dataflow/src
parentb85cba87e45b75010f138006f0f17c5883a452bc (diff)
downloadrust-389e2cc69a917ea7ddc40bef0c1bda0466b423db.tar.gz
rust-389e2cc69a917ea7ddc40bef0c1bda0466b423db.zip
Remove some unused code relating to `ResultsCloned`.
Diffstat (limited to 'compiler/rustc_mir_dataflow/src')
-rw-r--r--compiler/rustc_mir_dataflow/src/framework/cursor.rs13
-rw-r--r--compiler/rustc_mir_dataflow/src/framework/engine.rs14
-rw-r--r--compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs12
-rw-r--r--compiler/rustc_mir_dataflow/src/lib.rs2
4 files changed, 2 insertions, 39 deletions
diff --git a/compiler/rustc_mir_dataflow/src/framework/cursor.rs b/compiler/rustc_mir_dataflow/src/framework/cursor.rs
index 5a77b2eff72..e27666d590b 100644
--- a/compiler/rustc_mir_dataflow/src/framework/cursor.rs
+++ b/compiler/rustc_mir_dataflow/src/framework/cursor.rs
@@ -1,6 +1,6 @@
 //! Random access inspection of the results of a dataflow analysis.
 
-use crate::{framework::BitSetExt, CloneAnalysis};
+use crate::framework::BitSetExt;
 
 use std::borrow::{Borrow, BorrowMut};
 use std::cmp::Ordering;
@@ -104,17 +104,6 @@ where
     }
 }
 
-impl<'res, 'mir, 'tcx, A> ResultsClonedCursor<'res, 'mir, 'tcx, A>
-where
-    A: Analysis<'tcx> + CloneAnalysis,
-{
-    /// Creates a new cursor over the same `Results`. Note that the cursor's position is *not*
-    /// copied.
-    pub fn new_cursor(&self) -> Self {
-        Self::new(self.body, self.results.reclone_analysis())
-    }
-}
-
 impl<'mir, 'tcx, A, R> ResultsCursor<'mir, 'tcx, A, R>
 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 00a74b0d770..78b57008233 100644
--- a/compiler/rustc_mir_dataflow/src/framework/engine.rs
+++ b/compiler/rustc_mir_dataflow/src/framework/engine.rs
@@ -116,20 +116,6 @@ where
     }
 }
 
-impl<'res, 'tcx, A> ResultsCloned<'res, 'tcx, A>
-where
-    A: Analysis<'tcx> + CloneAnalysis,
-{
-    /// Creates a new `Results` type with a cloned `Analysis` and borrowed entry sets.
-    pub fn reclone_analysis(&self) -> Self {
-        Results {
-            analysis: self.analysis.clone_analysis(),
-            entry_sets: self.entry_sets,
-            _marker: PhantomData,
-        }
-    }
-}
-
 /// A solver for dataflow problems.
 pub struct Engine<'mir, 'tcx, A>
 where
diff --git a/compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs b/compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs
index 5a58e3af8be..7f6668fe27c 100644
--- a/compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs
+++ b/compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs
@@ -18,12 +18,6 @@ impl<'a> MaybeStorageLive<'a> {
     }
 }
 
-impl crate::CloneAnalysis for MaybeStorageLive<'_> {
-    fn clone_analysis(&self) -> Self {
-        self.clone()
-    }
-}
-
 impl<'tcx, 'a> crate::AnalysisDomain<'tcx> for MaybeStorageLive<'a> {
     type Domain = BitSet<Local>;
 
@@ -173,12 +167,6 @@ impl<'res, 'mir, 'tcx> MaybeRequiresStorage<'res, 'mir, 'tcx> {
     }
 }
 
-impl crate::CloneAnalysis for MaybeRequiresStorage<'_, '_, '_> {
-    fn clone_analysis(&self) -> Self {
-        Self { borrowed_locals: self.borrowed_locals.new_cursor() }
-    }
-}
-
 impl<'tcx> crate::AnalysisDomain<'tcx> for MaybeRequiresStorage<'_, '_, 'tcx> {
     type Domain = BitSet<Local>;
 
diff --git a/compiler/rustc_mir_dataflow/src/lib.rs b/compiler/rustc_mir_dataflow/src/lib.rs
index d218f033d62..abe9dd45ea1 100644
--- a/compiler/rustc_mir_dataflow/src/lib.rs
+++ b/compiler/rustc_mir_dataflow/src/lib.rs
@@ -23,7 +23,7 @@ pub use self::framework::{
     fmt, lattice, visit_results, Analysis, AnalysisDomain, Direction, GenKill, GenKillAnalysis,
     JoinSemiLattice, MaybeReachable, Results, ResultsCursor, ResultsVisitable, ResultsVisitor,
 };
-use self::framework::{Backward, CloneAnalysis, ResultsClonedCursor, SwitchIntEdgeEffects};
+use self::framework::{Backward, ResultsClonedCursor, SwitchIntEdgeEffects};
 use self::move_paths::MoveData;
 
 pub mod debuginfo;