about summary refs log tree commit diff
path: root/tvix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-14T00·03+0300
committertazjin <tazjin@tvl.su>2022-08-30T17·13+0000
commitde268948149b570cd01b994f8b2cd3738b60cc7a (patch)
tree8d3ed52be54aba31929cac8363979d006e1d2878 /tvix
parentab9407bded75d184ed694afe3564230fd09578ed (diff)
refactor(tvix/eval): remove Error::InvalidKeyType r/4538
We're confident that we're handling all branches that can reasonably
occur from valid AST, any other cases should be considered a critical
evaluator bug and panic rather than surfacing something that looks
like user error.

Change-Id: If96966eb32b8ff12fcaeb9ea3b0c8fc51b6abd11
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6205
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix')
-rw-r--r--tvix/eval/src/errors.rs4
-rw-r--r--tvix/eval/src/value/attrs.rs6
2 files changed, 1 insertions, 9 deletions
diff --git a/tvix/eval/src/errors.rs b/tvix/eval/src/errors.rs
index 4b4610f1e9b2..e262d9def417 100644
--- a/tvix/eval/src/errors.rs
+++ b/tvix/eval/src/errors.rs
@@ -6,10 +6,6 @@ pub enum Error {
         key: String,
     },
 
-    InvalidKeyType {
-        given: &'static str,
-    },
-
     AttributeNotFound {
         name: String,
     },
diff --git a/tvix/eval/src/value/attrs.rs b/tvix/eval/src/value/attrs.rs
index 76a0fe3cf646..03c12a6617cf 100644
--- a/tvix/eval/src/value/attrs.rs
+++ b/tvix/eval/src/value/attrs.rs
@@ -256,11 +256,7 @@ impl NixAttrs {
                     continue;
                 }
 
-                other => {
-                    return Err(Error::InvalidKeyType {
-                        given: other.type_of(),
-                    })
-                }
+                other => panic!("unexpected attribute key type: {}", other.type_of()),
             }
         }