summaryrefslogtreecommitdiff
path: root/dhall/src/syntax
diff options
context:
space:
mode:
authorNadrieril Feneanar2020-03-18 00:01:11 +0000
committerGitHub2020-03-18 00:01:11 +0000
commitf42ab8acdaa4dee753b7daccfed1ca3c8738095a (patch)
tree9fba7dd6d865884c0651af2dd7e01b243a0f25f0 /dhall/src/syntax
parent71fddc59b5b427f52dd2f0cd76f788eb995a4e2e (diff)
parent40441abd2d6c2938244fa1bb2ca26ee9b8e4ab27 (diff)
Merge pull request #146 from Nadrieril/never_never
Use stable toolchain 🎉
Diffstat (limited to '')
-rw-r--r--dhall/src/syntax/ast/expr.rs6
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 {},
}
}