mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Remove unnecessary Clone
/Copy
derives from analyses.
No analysis needs `Copy`, and `MaybeBorrowedLocals` is the only analysis that needs `Clone`. In `locals_live_across_suspend_points` it gets cloned so it can be used within a `MaybeRequiresStorage`.
This commit is contained in:
parent
c2f74c3f92
commit
55c9f96265
@ -11,7 +11,7 @@ use crate::{AnalysisDomain, GenKill, GenKillAnalysis};
|
||||
/// At present, this is used as a very limited form of alias analysis. For example,
|
||||
/// `MaybeBorrowedLocals` is used to compute which locals are live during a yield expression for
|
||||
/// immovable coroutines.
|
||||
#[derive(Clone, Copy)]
|
||||
#[derive(Clone)]
|
||||
pub struct MaybeBorrowedLocals;
|
||||
|
||||
impl MaybeBorrowedLocals {
|
||||
|
@ -217,7 +217,6 @@ impl DefUse {
|
||||
/// This is basically written for dead store elimination and nothing else.
|
||||
///
|
||||
/// All of the caveats of `MaybeLiveLocals` apply.
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct MaybeTransitiveLiveLocals<'a> {
|
||||
always_live: &'a BitSet<Local>,
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ use rustc_middle::mir::*;
|
||||
use super::MaybeBorrowedLocals;
|
||||
use crate::{GenKill, ResultsCursor};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct MaybeStorageLive<'a> {
|
||||
always_live_locals: Cow<'a, BitSet<Local>>,
|
||||
}
|
||||
@ -80,7 +79,6 @@ impl<'tcx, 'a> crate::GenKillAnalysis<'tcx> for MaybeStorageLive<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct MaybeStorageDead<'a> {
|
||||
always_live_locals: Cow<'a, BitSet<Local>>,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user