about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2022-02-09 19:37:10 -0300
committerSantiago Pastorino <spastorino@gmail.com>2022-02-14 12:57:20 -0300
commitf4bb4500ddb4a54b5c33908861e821317c589850 (patch)
tree699f26273a6081bee0eb94da6841d265faad34c1 /compiler/rustc_data_structures/src
parent3fd89a662a8360bbcd64da1353be8bf3b8833af5 (diff)
Call the method fork instead of clone and add proper comments
Diffstat (limited to 'compiler/rustc_data_structures/src')
-rw-r--r--compiler/rustc_data_structures/src/snapshot_map/mod.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_data_structures/src/snapshot_map/mod.rs b/compiler/rustc_data_structures/src/snapshot_map/mod.rs
index b4cc85293f7..8a50179cd3b 100644
--- a/compiler/rustc_data_structures/src/snapshot_map/mod.rs
+++ b/compiler/rustc_data_structures/src/snapshot_map/mod.rs
@@ -13,6 +13,7 @@ mod tests;
 pub type SnapshotMapStorage<K, V> = SnapshotMap<K, V, FxHashMap<K, V>, ()>;
 pub type SnapshotMapRef<'a, K, V, L> = SnapshotMap<K, V, &'a mut FxHashMap<K, V>, &'a mut L>;
 
+#[derive(Clone)]
 pub struct SnapshotMap<K, V, M = FxHashMap<K, V>, L = VecLog<UndoLog<K, V>>> {
     map: M,
     undo_log: L,
@@ -30,6 +31,7 @@ where
     }
 }
 
+#[derive(Clone)]
 pub enum UndoLog<K, V> {
     Inserted(K),
     Overwrite(K, V),