summaryrefslogtreecommitdiff
path: root/dhall/src/semantics/nze/lazy.rs
diff options
context:
space:
mode:
authorNadrieril2020-11-03 20:35:22 +0000
committerNadrieril2020-11-03 23:18:58 +0000
commitecc5242463308c16f38dbd5015b9f264f990b76a (patch)
tree4585a98c7ef97a3b3afa1934a9d184cfb89040d1 /dhall/src/semantics/nze/lazy.rs
parent85d946016d67515aa70fa01338512e3fd7df408e (diff)
Remove NirInternal
Diffstat (limited to 'dhall/src/semantics/nze/lazy.rs')
-rw-r--r--dhall/src/semantics/nze/lazy.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/dhall/src/semantics/nze/lazy.rs b/dhall/src/semantics/nze/lazy.rs
index 550f69a..d3b5c8d 100644
--- a/dhall/src/semantics/nze/lazy.rs
+++ b/dhall/src/semantics/nze/lazy.rs
@@ -63,6 +63,17 @@ where
}
}
+/// This implementation evaluates before cloning, because we can't clone the contents of a `Cell`.
+impl<Src, Tgt> Clone for Lazy<Src, Tgt>
+where
+ Src: Eval<Tgt>,
+ Tgt: Clone,
+{
+ fn clone(&self) -> Self {
+ Self::new_completed(self.force().clone())
+ }
+}
+
impl<Src, Tgt> Debug for Lazy<Src, Tgt>
where
Tgt: Debug,