about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTyler Mandry <tmandry@gmail.com>2019-06-26 14:08:33 -0700
committerTyler Mandry <tmandry@gmail.com>2019-06-28 15:39:33 -0700
commitaee13574f2a31f5e8b6293a06de2622e554c7172 (patch)
treeea59cfd0e59691d930448449ab347b683c9f7fd9
parent11b09e7f9e8f5e5600be65a16daa564af60d8c57 (diff)
downloadrust-aee13574f2a31f5e8b6293a06de2622e554c7172.tar.gz
rust-aee13574f2a31f5e8b6293a06de2622e554c7172.zip
Remove Clone requirement
-rw-r--r--src/librustc_mir/dataflow/at_location.rs1
-rw-r--r--src/librustc_mir/dataflow/impls/storage_liveness.rs1
-rw-r--r--src/librustc_mir/dataflow/mod.rs3
-rw-r--r--src/librustc_mir/transform/generator.rs3
4 files changed, 3 insertions, 5 deletions
diff --git a/src/librustc_mir/dataflow/at_location.rs b/src/librustc_mir/dataflow/at_location.rs
index 7f5c77007ae..f0014602e2d 100644
--- a/src/librustc_mir/dataflow/at_location.rs
+++ b/src/librustc_mir/dataflow/at_location.rs
@@ -61,7 +61,6 @@ pub trait FlowsAtLocation {
 /// (e.g., via `reconstruct_statement_effect` and
 /// `reconstruct_terminator_effect`; don't forget to call
 /// `apply_local_effect`).
-#[derive(Clone)]
 pub struct FlowAtLocation<'tcx, BD, DR = DataflowResults<'tcx, BD>>
 where
     BD: BitDenotation<'tcx>,
diff --git a/src/librustc_mir/dataflow/impls/storage_liveness.rs b/src/librustc_mir/dataflow/impls/storage_liveness.rs
index 64d0ae016a3..0a3ae252be0 100644
--- a/src/librustc_mir/dataflow/impls/storage_liveness.rs
+++ b/src/librustc_mir/dataflow/impls/storage_liveness.rs
@@ -76,7 +76,6 @@ impl<'a, 'tcx> BottomValue for MaybeStorageLive<'a, 'tcx> {
 /// In the case of a movable generator, borrowed_locals can be `None` and we
 /// will not consider borrows in this pass. This relies on the fact that we only
 /// use this pass at yield points for these generators.
-#[derive(Clone)]
 pub struct RequiresStorage<'mir, 'tcx, 'b> {
     body: &'mir Body<'tcx>,
     borrowed_locals:
diff --git a/src/librustc_mir/dataflow/mod.rs b/src/librustc_mir/dataflow/mod.rs
index 060b2be5cd9..c4edc23a1de 100644
--- a/src/librustc_mir/dataflow/mod.rs
+++ b/src/librustc_mir/dataflow/mod.rs
@@ -345,8 +345,7 @@ pub(crate) trait DataflowResultsConsumer<'a, 'tcx: 'a> {
 }
 
 /// Allows iterating dataflow results in a flexible and reasonably fast way.
-#[derive(Clone)]
-pub struct DataflowResultsCursor<'mir, 'tcx, BD, DR>
+pub struct DataflowResultsCursor<'mir, 'tcx, BD, DR = DataflowResults<'tcx, BD>>
 where
     BD: BitDenotation<'tcx>,
     DR: Borrow<DataflowResults<'tcx, BD>>,
diff --git a/src/librustc_mir/transform/generator.rs b/src/librustc_mir/transform/generator.rs
index 54f69adb69c..c5f0f36b8b9 100644
--- a/src/librustc_mir/transform/generator.rs
+++ b/src/librustc_mir/transform/generator.rs
@@ -446,8 +446,9 @@ fn locals_live_across_suspend_points(
     // for.
     let requires_storage_analysis = RequiresStorage::new(body, &borrowed_locals_result);
     let requires_storage =
-        do_dataflow(tcx, body, def_id, &[], &dead_unwinds, requires_storage_analysis.clone(),
+        do_dataflow(tcx, body, def_id, &[], &dead_unwinds, requires_storage_analysis,
                     |bd, p| DebugFormatted::new(&bd.body().local_decls[p]));
+    let requires_storage_analysis = RequiresStorage::new(body, &borrowed_locals_result);
 
     // Calculate the liveness of MIR locals ignoring borrows.
     let mut live_locals = liveness::LiveVarSet::new_empty(body.local_decls.len());