diff options
author | Nadrieril | 2020-03-17 23:47:35 +0000 |
---|---|---|
committer | Nadrieril | 2020-03-17 23:47:58 +0000 |
commit | 4b29fa3a9e329814c98df3463841eeb288f1630c (patch) | |
tree | 4c933c9228e74e9b12351ea797c38d161eb6fe80 /dhall/src/syntax/ast | |
parent | 71fddc59b5b427f52dd2f0cd76f788eb995a4e2e (diff) |
Remove never_type feature
Diffstat (limited to 'dhall/src/syntax/ast')
-rw-r--r-- | dhall/src/syntax/ast/expr.rs | 6 |
1 files changed, 4 insertions, 2 deletions
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<T>(x: Result<T, !>) -> T { +// Empty enum to indicate that no error can occur +enum X {} +fn trivial_result<T>(x: Result<T, X>) -> T { match x { Ok(x) => x, - Err(e) => e, + Err(e) => match e {}, } } |