Remove CloneAnalysis.

It's only implemented for analyses that implement `Copy`, which means
it's basically a complicated synonym for `Copy`. So this commit removes
it and uses `Copy` directly. (That direct use will be removed in a later
commit.)
This commit is contained in:
Nicholas Nethercote
2023-11-23 17:17:52 +11:00
parent 389e2cc69a
commit d957c47183
2 changed files with 5 additions and 29 deletions

View File

@@ -246,21 +246,6 @@ pub trait Analysis<'tcx>: AnalysisDomain<'tcx> {
}
}
/// Defines an `Analysis` which can be cloned for use in multiple `ResultsCursor`s or
/// `ResultsVisitor`s. Note this need not be a full clone, only enough of one to be used with a new
/// `ResultsCursor` or `ResultsVisitor`
pub trait CloneAnalysis {
fn clone_analysis(&self) -> Self;
}
impl<'tcx, A> CloneAnalysis for A
where
A: Analysis<'tcx> + Copy,
{
fn clone_analysis(&self) -> Self {
*self
}
}
/// A gen/kill dataflow problem.
///
/// Each method in this trait has a corresponding one in `Analysis`. However, these methods only