We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d93148e commit 968027eCopy full SHA for 968027e
1 file changed
std.rs
@@ -13,3 +13,17 @@ fn _extern_spec_box_new<T>(x: T) -> Box<T> {
13
fn _extern_spec_std_mem_swap<T>(x: &mut T, y: &mut T) {
14
std::mem::swap(x, y);
15
}
16
+
17
+#[thrust::extern_spec_fn]
18
+#[thrust::requires(opt != std::option::Option::<T0>::None())]
19
+#[thrust::ensures(std::option::Option::<T0>::Some(result) == opt)]
20
+fn _extern_spec_option_unwrap<T>(opt: Option<T>) -> T {
21
+ Option::unwrap(opt)
22
+}
23
24
25
+#[thrust::requires(exists x:T0. res == std::result::Result::<T0, T1>::Ok(x))]
26
+#[thrust::ensures(std::result::Result::<T0, T1>::Ok(result) == res)]
27
+fn _extern_spec_result_unwrap<T, E: std::fmt::Debug>(res: Result<T, E>) -> T {
28
+ Result::unwrap(res)
29
0 commit comments