Skip to content

Commit 55c9f96

Browse files
committed
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`.
1 parent c2f74c3 commit 55c9f96

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

compiler/rustc_mir_dataflow/src/impls/borrowed_locals.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::{AnalysisDomain, GenKill, GenKillAnalysis};
1111
/// At present, this is used as a very limited form of alias analysis. For example,
1212
/// `MaybeBorrowedLocals` is used to compute which locals are live during a yield expression for
1313
/// immovable coroutines.
14-
#[derive(Clone, Copy)]
14+
#[derive(Clone)]
1515
pub struct MaybeBorrowedLocals;
1616

1717
impl MaybeBorrowedLocals {

compiler/rustc_mir_dataflow/src/impls/liveness.rs

-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ impl DefUse {
217217
/// This is basically written for dead store elimination and nothing else.
218218
///
219219
/// All of the caveats of `MaybeLiveLocals` apply.
220-
#[derive(Clone, Copy)]
221220
pub struct MaybeTransitiveLiveLocals<'a> {
222221
always_live: &'a BitSet<Local>,
223222
}

compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use rustc_middle::mir::*;
77
use super::MaybeBorrowedLocals;
88
use crate::{GenKill, ResultsCursor};
99

10-
#[derive(Clone)]
1110
pub struct MaybeStorageLive<'a> {
1211
always_live_locals: Cow<'a, BitSet<Local>>,
1312
}
@@ -80,7 +79,6 @@ impl<'tcx, 'a> crate::GenKillAnalysis<'tcx> for MaybeStorageLive<'a> {
8079
}
8180
}
8281

83-
#[derive(Clone)]
8482
pub struct MaybeStorageDead<'a> {
8583
always_live_locals: Cow<'a, BitSet<Local>>,
8684
}

0 commit comments

Comments
 (0)