summaryrefslogtreecommitdiff
path: root/backends/fstar
diff options
context:
space:
mode:
authorSon HO2024-04-26 10:55:47 +0200
committerGitHub2024-04-26 10:55:47 +0200
commit5da597289c1723aa59bf87ad5075675820c18f73 (patch)
treed63e2f44c75634674a3e4eabb57ff08c0ae441ac /backends/fstar
parent2df6dd65b84a2fd9aad4f716f323bf3f85bf82db (diff)
parentfe8d14cd8b7ba907d5248d574619e93e6d1d253a (diff)
Merge pull request #125 from zhassan-aws/core-option-unwrap
Add `core::option::unwrap` builtin
Diffstat (limited to '')
-rw-r--r--backends/fstar/Primitives.fst6
1 files changed, 6 insertions, 0 deletions
diff --git a/backends/fstar/Primitives.fst b/backends/fstar/Primitives.fst
index c7c9f9db..9951ccc3 100644
--- a/backends/fstar/Primitives.fst
+++ b/backends/fstar/Primitives.fst
@@ -540,6 +540,12 @@ let core_clone_CloneI128 : core_clone_Clone i128 = {
clone = fun x -> Ok (core_clone_impls_CloneI128_clone x)
}
+(** [core::option::{core::option::Option<T>}::unwrap] *)
+let core_option_Option_unwrap (t : Type0) (x : option t) : result t =
+ match x with
+ | None -> Fail Failure
+ | Some x -> Ok x
+
(*** core::ops *)
// Trait declaration: [core::ops::index::Index]