diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-09-13 09:49:28 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-09-13 09:58:30 +1000 |
| commit | 55c9f9626575f93d0f7cb8b51523a8891a065dc4 (patch) | |
| tree | ab7e594d0e8a76779075b8107a482dc5110cf610 /compiler/rustc_mir_dataflow/src/impls | |
| parent | c2f74c3f928aeb503f15b4e9ef5778e77f3058b8 (diff) | |
| download | rust-55c9f9626575f93d0f7cb8b51523a8891a065dc4.tar.gz rust-55c9f9626575f93d0f7cb8b51523a8891a065dc4.zip | |
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`.
Diffstat (limited to 'compiler/rustc_mir_dataflow/src/impls')
| -rw-r--r-- | compiler/rustc_mir_dataflow/src/impls/borrowed_locals.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_mir_dataflow/src/impls/liveness.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs | 2 |
3 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_mir_dataflow/src/impls/borrowed_locals.rs b/compiler/rustc_mir_dataflow/src/impls/borrowed_locals.rs index e8e78fb8a89..8b082ef2667 100644 --- a/compiler/rustc_mir_dataflow/src/impls/borrowed_locals.rs +++ b/compiler/rustc_mir_dataflow/src/impls/borrowed_locals.rs @@ -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 { diff --git a/compiler/rustc_mir_dataflow/src/impls/liveness.rs b/compiler/rustc_mir_dataflow/src/impls/liveness.rs index 24a4b32ceb7..1559c131a37 100644 --- a/compiler/rustc_mir_dataflow/src/impls/liveness.rs +++ b/compiler/rustc_mir_dataflow/src/impls/liveness.rs @@ -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>, } diff --git a/compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs b/compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs index 9f2f0187698..6bf54c8db41 100644 --- a/compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs +++ b/compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs @@ -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>>, } |
