From de268948149b570cd01b994f8b2cd3738b60cc7a Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 14 Aug 2022 03:03:43 +0300 Subject: refactor(tvix/eval): remove Error::InvalidKeyType 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 Tested-by: BuildkiteCI --- tvix/eval/src/errors.rs | 4 ---- tvix/eval/src/value/attrs.rs | 6 +----- 2 files changed, 1 insertion(+), 9 deletions(-) (limited to 'tvix') 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()), } } -- cgit 1.4.1