From 4b29fa3a9e329814c98df3463841eeb288f1630c Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 17 Mar 2020 23:47:35 +0000 Subject: Remove never_type feature --- dhall/src/syntax/ast/expr.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'dhall/src/syntax') diff --git a/dhall/src/syntax/ast/expr.rs b/dhall/src/syntax/ast/expr.rs index ce0a3d2..8023771 100644 --- a/dhall/src/syntax/ast/expr.rs +++ b/dhall/src/syntax/ast/expr.rs @@ -257,10 +257,12 @@ impl Expr { } } -pub fn trivial_result(x: Result) -> T { +// Empty enum to indicate that no error can occur +enum X {} +fn trivial_result(x: Result) -> T { match x { Ok(x) => x, - Err(e) => e, + Err(e) => match e {}, } } -- cgit v1.2.3