about summary refs log tree commit diff
path: root/tvix/eval/src/value/attrs.rs
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2022-10-13T04·12-0400
committertazjin <tazjin@tvl.su>2022-10-17T11·29+0000
commit0063e7e913c199538fe67d55e714dd34c09cece3 (patch)
treea3e0a15c8f19491afb98442fef0102fec77df163 /tvix/eval/src/value/attrs.rs
parent2a3d49810482b36de9f2d3087e5064545183dbb3 (diff)
feat(nix/eval): Implement builtins.functionArgs r/5155
Now that we're tracking formals on Lambda this ends up being quite easy;
we just pull them off of the Lambda for the argument closure and use
them to construct the result attribute set.

Change-Id: I811cb61ec34c6bef123a4043000b18c0e4ea0125
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7003
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/value/attrs.rs')
-rw-r--r--tvix/eval/src/value/attrs.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/tvix/eval/src/value/attrs.rs b/tvix/eval/src/value/attrs.rs
index 6ee3efee67..a67fd2f3e3 100644
--- a/tvix/eval/src/value/attrs.rs
+++ b/tvix/eval/src/value/attrs.rs
@@ -127,6 +127,10 @@ mod arbitrary {
 }
 
 impl NixAttrs {
+    pub fn empty() -> Self {
+        Self(AttrsRep::Empty)
+    }
+
     /// Return an attribute set containing the merge of the two
     /// provided sets. Keys from the `other` set have precedence.
     pub fn update(self, other: Self) -> Self {