diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index c9cf42b93..8c1617fb0 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -85,6 +85,8 @@ jobs:
touch src/lib.rs
export RUST_MIN_STACK=800000000
time cargo coq-of-rust
+ sed -i 's/Module Impl_core_default_Default_where_core_default_Default_T_for_array_expr_T./(* Module Impl_core_default_Default_where_core_default_Default_T_for_array_expr_T./' src/array/mod.v
+ sed -i 's/End Impl_core_default_Default_where_core_default_Default_T_for_array_expr_T./End Impl_core_default_Default_where_core_default_Default_T_for_array_expr_T. *)/' src/array/mod.v
rsync -rcv src/ ../../../../CoqOfRust/core/ --include='*/' --include='*.v' --include='*.rs' --exclude='*'
cd ../../../..
endGroup
diff --git a/CoqOfRust/alloc/collections/vec_deque/into_iter.v b/CoqOfRust/alloc/collections/vec_deque/into_iter.v
index 90e9767de..62a67a378 100644
--- a/CoqOfRust/alloc/collections/vec_deque/into_iter.v
+++ b/CoqOfRust/alloc/collections/vec_deque/into_iter.v
@@ -1345,7 +1345,7 @@ Module collections.
[ N ]
[ Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ T ]
] :=
- repeat (|
+ lib.repeat (|
M.read (|
get_constant (|
"alloc::collections::vec_deque::into_iter::next_chunk_discriminant",
diff --git a/CoqOfRust/alloc/str.v b/CoqOfRust/alloc/str.v
index d18cacd92..32cbdc2db 100644
--- a/CoqOfRust/alloc/str.v
+++ b/CoqOfRust/alloc/str.v
@@ -8072,7 +8072,7 @@ Module str.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 16 ]
[ Ty.path "bool" ] :=
- repeat (| Value.Bool false, Value.Integer IntegerKind.Usize 16 |) in
+ lib.repeat (| Value.Bool false, Value.Integer IntegerKind.Usize 16 |) in
let~ _ : Ty.tuple [] :=
M.read (|
M.loop (|
diff --git a/CoqOfRust/alloc/string.v b/CoqOfRust/alloc/string.v
index ec6fa2c1f..9dd53217f 100644
--- a/CoqOfRust/alloc/string.v
+++ b/CoqOfRust/alloc/string.v
@@ -5703,7 +5703,7 @@ Module string.
M.borrow (|
Pointer.Kind.MutRef,
M.alloc (|
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 4
|)
@@ -7806,7 +7806,7 @@ Module string.
|) in
let~ bits :
Ty.apply (Ty.path "array") [ Value.Integer IntegerKind.Usize 4 ] [ Ty.path "u8" ] :=
- repeat (| Value.Integer IntegerKind.U8 0, Value.Integer IntegerKind.Usize 4 |) in
+ lib.repeat (| Value.Integer IntegerKind.U8 0, Value.Integer IntegerKind.Usize 4 |) in
let~ bits :
Ty.apply (Ty.path "&") [] [ Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ] ] :=
M.call_closure (|
@@ -14847,7 +14847,7 @@ Module string.
M.borrow (|
Pointer.Kind.MutRef,
M.alloc (|
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 4
|)
diff --git a/CoqOfRust/alloc/vec/into_iter.v b/CoqOfRust/alloc/vec/into_iter.v
index 5927de1e6..d02824630 100644
--- a/CoqOfRust/alloc/vec/into_iter.v
+++ b/CoqOfRust/alloc/vec/into_iter.v
@@ -1899,7 +1899,7 @@ Module vec.
[ N ]
[ Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ T ]
] :=
- repeat (|
+ lib.repeat (|
M.read (|
get_constant (|
"alloc::vec::into_iter::next_chunk_discriminant",
diff --git a/CoqOfRust/alloy_primitives/bits/address.v b/CoqOfRust/alloy_primitives/bits/address.v
index 174498746..0918278bd 100644
--- a/CoqOfRust/alloy_primitives/bits/address.v
+++ b/CoqOfRust/alloy_primitives/bits/address.v
@@ -1093,7 +1093,10 @@ Module bits.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 32 ]
[ Ty.path "u8" ] :=
- repeat (| Value.Integer IntegerKind.U8 0, Value.Integer IntegerKind.Usize 32 |) in
+ lib.repeat (|
+ Value.Integer IntegerKind.U8 0,
+ Value.Integer IntegerKind.Usize 32
+ |) in
let~ _ : Ty.tuple [] :=
M.call_closure (|
Ty.tuple [],
@@ -2404,7 +2407,10 @@ Module bits.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 85 ]
[ Ty.path "u8" ] :=
- repeat (| Value.Integer IntegerKind.U8 0, Value.Integer IntegerKind.Usize 85 |) in
+ lib.repeat (|
+ Value.Integer IntegerKind.U8 0,
+ Value.Integer IntegerKind.Usize 85
+ |) in
let~ _ : Ty.tuple [] :=
M.write (|
M.SubPointer.get_array_field (| bytes, Value.Integer IntegerKind.Usize 0 |),
diff --git a/CoqOfRust/alloy_primitives/bits/fixed.v b/CoqOfRust/alloy_primitives/bits/fixed.v
index 2daea6c98..6c7f6c3ff 100644
--- a/CoqOfRust/alloy_primitives/bits/fixed.v
+++ b/CoqOfRust/alloy_primitives/bits/fixed.v
@@ -4588,7 +4588,7 @@ Module bits.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 13 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 13
|) in
@@ -5868,7 +5868,7 @@ Module bits.
"alloy_primitives::bits::fixed::FixedBytes"
[ N ]
[]
- [ repeat (| Value.Integer IntegerKind.U8 0, N |) ]
+ [ lib.repeat (| Value.Integer IntegerKind.U8 0, N |) ]
|))).
Global Instance AssociatedConstant_value_ZERO :
@@ -5924,7 +5924,7 @@ Module bits.
(let x := M.alloc (| x |) in
M.read (|
let~ bytes : Ty.apply (Ty.path "array") [ N ] [ Ty.path "u8" ] :=
- repeat (| Value.Integer IntegerKind.U8 0, N |) in
+ lib.repeat (| Value.Integer IntegerKind.U8 0, N |) in
let~ _ : Ty.tuple [] :=
M.read (|
M.match_operator (|
@@ -5998,7 +5998,7 @@ Module bits.
"alloy_primitives::bits::fixed::FixedBytes"
[ N ]
[]
- [ repeat (| M.read (| byte |), N |) ]))
+ [ lib.repeat (| M.read (| byte |), N |) ]))
| _, _, _ => M.impossible "wrong number of arguments"
end.
@@ -6130,7 +6130,7 @@ Module bits.
|)
|) in
let~ result : Ty.apply (Ty.path "array") [ Z ] [ Ty.path "u8" ] :=
- repeat (| Value.Integer IntegerKind.U8 0, Z |) in
+ lib.repeat (| Value.Integer IntegerKind.U8 0, Z |) in
let~ i : Ty.path "usize" := Value.Integer IntegerKind.Usize 0 in
let~ _ : Ty.tuple [] :=
M.read (|
diff --git a/CoqOfRust/alloy_primitives/bits/function.v b/CoqOfRust/alloy_primitives/bits/function.v
index c4f9c452f..c8746d0cb 100644
--- a/CoqOfRust/alloy_primitives/bits/function.v
+++ b/CoqOfRust/alloy_primitives/bits/function.v
@@ -193,7 +193,10 @@ Module bits.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 32 ]
[ Ty.path "u8" ] :=
- repeat (| Value.Integer IntegerKind.U8 0, Value.Integer IntegerKind.Usize 32 |) in
+ lib.repeat (|
+ Value.Integer IntegerKind.U8 0,
+ Value.Integer IntegerKind.Usize 32
+ |) in
let~ _ : Ty.tuple [] :=
M.call_closure (|
Ty.tuple [],
@@ -331,7 +334,10 @@ Module bits.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 24 ]
[ Ty.path "u8" ] :=
- repeat (| Value.Integer IntegerKind.U8 0, Value.Integer IntegerKind.Usize 24 |) in
+ lib.repeat (|
+ Value.Integer IntegerKind.U8 0,
+ Value.Integer IntegerKind.Usize 24
+ |) in
let~ _ : Ty.tuple [] :=
M.call_closure (|
Ty.tuple [],
diff --git a/CoqOfRust/alloy_primitives/bits/links/fixed.v b/CoqOfRust/alloy_primitives/bits/links/fixed.v
index cef1f3c4a..2914b5a2a 100644
--- a/CoqOfRust/alloy_primitives/bits/links/fixed.v
+++ b/CoqOfRust/alloy_primitives/bits/links/fixed.v
@@ -6,6 +6,7 @@ Require Import alloy_primitives.bits.fixed.
Require Import core.convert.links.mod.
Require Import core.links.array.
Require Import core.links.borrow.
+Require Import core.ops.links.index.
Module Impl_FixedBytes.
Definition Self (N: Usize.t) : Set :=
@@ -74,3 +75,16 @@ Module Impl_Borrow_Array_u8_N_for_FixedBytes_N.
Admitted.
End Impl_Borrow_Array_u8_N_for_FixedBytes_N.
Export Impl_Borrow_Array_u8_N_for_FixedBytes_N.
+
+Module Impl_Index_for_FixedBytes_N.
+ Definition Self (N: Usize.t) : Set :=
+ FixedBytes.t N.
+
+ (* type Output = <[u8; N] as Index<__IdxT>>::Output *)
+ Definition Output : Set :=
+ list U8.t.
+
+ Instance run (N: Usize.t) (__IdxT : Set) `{Link __IdxT} : Index.Run (Self N) __IdxT Output.
+ Admitted.
+End Impl_Index_for_FixedBytes_N.
+Export Impl_Index_for_FixedBytes_N.
diff --git a/CoqOfRust/alloy_primitives/bytes/links/mod.v b/CoqOfRust/alloy_primitives/bytes/links/mod.v
index b64632d51..6fba7d417 100644
--- a/CoqOfRust/alloy_primitives/bytes/links/mod.v
+++ b/CoqOfRust/alloy_primitives/bytes/links/mod.v
@@ -82,6 +82,16 @@ Module Impl_Deref_for_Bytes.
End Impl_Deref_for_Bytes.
Export Impl_Deref_for_Bytes.
+(* impl DerefMut for Bytes *)
+Module Impl_DerefMut_for_Bytes.
+ Definition Self : Set :=
+ Bytes.t.
+
+ Instance run : DerefMut.Run Self bytes.Bytes.t.
+ Admitted.
+End Impl_DerefMut_for_Bytes.
+Export Impl_DerefMut_for_Bytes.
+
Module Impl_Bytes.
Definition Self : Set :=
Bytes.t.
@@ -92,6 +102,14 @@ Module Impl_Bytes.
constructor.
run_symbolic.
Admitted.
+
+ (* pub fn copy_from_slice(data: &[u8]) -> Self *)
+ Instance run_copy_from_slice (data : Ref.t Pointer.Kind.Ref (list U8.t)) :
+ Run.Trait bytes_.Impl_alloy_primitives_bytes__Bytes.copy_from_slice [] [] [ φ data ] Self.
+ Proof.
+ constructor.
+ run_symbolic.
+ Admitted.
End Impl_Bytes.
Export Impl_Bytes.
diff --git a/CoqOfRust/alloy_primitives/signature/primitive_sig.v b/CoqOfRust/alloy_primitives/signature/primitive_sig.v
index 8e35bc0e6..be0262748 100644
--- a/CoqOfRust/alloy_primitives/signature/primitive_sig.v
+++ b/CoqOfRust/alloy_primitives/signature/primitive_sig.v
@@ -2013,7 +2013,10 @@ Module signature.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 65 ]
[ Ty.path "u8" ] :=
- repeat (| Value.Integer IntegerKind.U8 0, Value.Integer IntegerKind.Usize 65 |) in
+ lib.repeat (|
+ Value.Integer IntegerKind.U8 0,
+ Value.Integer IntegerKind.Usize 65
+ |) in
let~ _ : Ty.tuple [] :=
M.call_closure (|
Ty.tuple [],
diff --git a/CoqOfRust/alloy_primitives/signature/sig.v b/CoqOfRust/alloy_primitives/signature/sig.v
index 01be83023..20cb26b98 100644
--- a/CoqOfRust/alloy_primitives/signature/sig.v
+++ b/CoqOfRust/alloy_primitives/signature/sig.v
@@ -2299,7 +2299,10 @@ Module signature.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 65 ]
[ Ty.path "u8" ] :=
- repeat (| Value.Integer IntegerKind.U8 0, Value.Integer IntegerKind.Usize 65 |) in
+ lib.repeat (|
+ Value.Integer IntegerKind.U8 0,
+ Value.Integer IntegerKind.Usize 65
+ |) in
let~ _ : Ty.tuple [] :=
M.call_closure (|
Ty.tuple [],
diff --git a/CoqOfRust/alloy_primitives/signed/utils.v b/CoqOfRust/alloy_primitives/signed/utils.v
index 07d5dfc46..a1278985f 100644
--- a/CoqOfRust/alloy_primitives/signed/utils.v
+++ b/CoqOfRust/alloy_primitives/signed/utils.v
@@ -513,7 +513,7 @@ Module signed.
|)
|) in
let~ limbs : Ty.apply (Ty.path "array") [ LIMBS ] [ Ty.path "u64" ] :=
- repeat (|
+ lib.repeat (|
M.read (|
get_associated_constant (| Ty.path "u64", "MAX", Ty.path "u64" |)
|),
@@ -679,7 +679,7 @@ Module signed.
|)
|) in
let~ limbs : Ty.apply (Ty.path "array") [ LIMBS ] [ Ty.path "u64" ] :=
- repeat (| Value.Integer IntegerKind.U64 0, LIMBS |) in
+ lib.repeat (| Value.Integer IntegerKind.U64 0, LIMBS |) in
let~ _ : Ty.tuple [] :=
M.write (|
M.SubPointer.get_array_field (|
@@ -743,7 +743,7 @@ Module signed.
ltac:(M.monadic
(M.read (|
let~ limbs : Ty.apply (Ty.path "array") [ LIMBS ] [ Ty.path "u64" ] :=
- repeat (| Value.Integer IntegerKind.U64 0, LIMBS |) in
+ lib.repeat (| Value.Integer IntegerKind.U64 0, LIMBS |) in
M.alloc (|
Value.StructTuple
"alloy_primitives::signed::int::Signed"
@@ -839,7 +839,7 @@ Module signed.
|)
|) in
let~ limbs : Ty.apply (Ty.path "array") [ LIMBS ] [ Ty.path "u64" ] :=
- repeat (| Value.Integer IntegerKind.U64 0, LIMBS |) in
+ lib.repeat (| Value.Integer IntegerKind.U64 0, LIMBS |) in
let~ _ : Ty.tuple [] :=
M.write (|
M.SubPointer.get_array_field (| limbs, Value.Integer IntegerKind.Usize 0 |),
diff --git a/CoqOfRust/bytes/buf/buf_impl.v b/CoqOfRust/bytes/buf/buf_impl.v
index 12f70e0f8..d1933dd93 100644
--- a/CoqOfRust/bytes/buf/buf_impl.v
+++ b/CoqOfRust/bytes/buf/buf_impl.v
@@ -1066,7 +1066,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 2 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 2
|) in
@@ -1437,7 +1437,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 2 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 2
|) in
@@ -1808,7 +1808,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 2 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 2
|) in
@@ -2174,7 +2174,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 2 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 2
|) in
@@ -2545,7 +2545,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 2 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 2
|) in
@@ -2916,7 +2916,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 2 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 2
|) in
@@ -3282,7 +3282,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 4 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 4
|) in
@@ -3653,7 +3653,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 4 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 4
|) in
@@ -4024,7 +4024,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 4 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 4
|) in
@@ -4390,7 +4390,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 4 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 4
|) in
@@ -4761,7 +4761,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 4 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 4
|) in
@@ -5132,7 +5132,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 4 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 4
|) in
@@ -5498,7 +5498,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 8 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 8
|) in
@@ -5869,7 +5869,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 8 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 8
|) in
@@ -6240,7 +6240,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 8 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 8
|) in
@@ -6606,7 +6606,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 8 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 8
|) in
@@ -6977,7 +6977,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 8 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 8
|) in
@@ -7348,7 +7348,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 8 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 8
|) in
@@ -7714,7 +7714,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 16 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 16
|) in
@@ -8085,7 +8085,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 16 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 16
|) in
@@ -8456,7 +8456,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 16 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 16
|) in
@@ -8822,7 +8822,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 16 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 16
|) in
@@ -9193,7 +9193,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 16 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 16
|) in
@@ -9564,7 +9564,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 16 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 16
|) in
@@ -9700,7 +9700,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 8 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 8
|) in
@@ -9800,7 +9800,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 8 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 8
|) in
@@ -10062,7 +10062,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 8 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 8
|) in
@@ -10162,7 +10162,7 @@ Module buf.
(Ty.path "array")
[ Value.Integer IntegerKind.Usize 8 ]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 8
|) in
diff --git a/CoqOfRust/bytes/links/bytes.v b/CoqOfRust/bytes/links/bytes.v
index 144dc5acb..316cb3874 100644
--- a/CoqOfRust/bytes/links/bytes.v
+++ b/CoqOfRust/bytes/links/bytes.v
@@ -36,6 +36,14 @@ Module Impl_Bytes.
bytes.Impl_bytes_bytes_Bytes.len [] [] [ φ self ]
Usize.t.
Admitted.
+
+ (* pub fn clear(&mut self) *)
+ Instance run_clear (self : Ref.t Pointer.Kind.MutRef Self) :
+ Run.Trait bytes.Impl_bytes_bytes_Bytes.clear [] [] [φ self] unit.
+ Proof.
+ constructor.
+ run_symbolic.
+ Admitted.
End Impl_Bytes.
Export Impl_Bytes.
diff --git a/CoqOfRust/core/array/iter.v b/CoqOfRust/core/array/iter.v
index dd6f73ce1..216bba91d 100644
--- a/CoqOfRust/core/array/iter.v
+++ b/CoqOfRust/core/array/iter.v
@@ -260,7 +260,7 @@ Module array.
(Ty.path "array")
[ N ]
[ Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ T ] ] :=
- repeat (|
+ lib.repeat (|
M.read (|
get_constant (|
"core::array::iter::empty_discriminant",
@@ -2201,7 +2201,7 @@ Module array.
[ T ]
[
("data",
- repeat (|
+ lib.repeat (|
M.read (|
get_constant (|
"core::array::iter::clone_discriminant",
diff --git a/CoqOfRust/core/escape.v b/CoqOfRust/core/escape.v
index fdaa0eb7d..cfed0bf35 100644
--- a/CoqOfRust/core/escape.v
+++ b/CoqOfRust/core/escape.v
@@ -89,7 +89,10 @@ Module escape.
M.read (| get_constant (| "core::escape::backslash_discriminant", Ty.tuple [] |) |) in
let~ output :
Ty.apply (Ty.path "array") [ N ] [ Ty.path "core::ascii::ascii_char::AsciiChar" ] :=
- repeat (| Value.StructTuple "core::ascii::ascii_char::AsciiChar::Null" [] [] [], N |) in
+ lib.repeat (|
+ Value.StructTuple "core::ascii::ascii_char::AsciiChar::Null" [] [] [],
+ N
+ |) in
let~ _ : Ty.tuple [] :=
M.write (|
M.SubPointer.get_array_field (| output, Value.Integer IntegerKind.Usize 0 |),
@@ -150,7 +153,10 @@ Module escape.
M.read (| get_constant (| "core::escape::hex_escape_discriminant", Ty.tuple [] |) |) in
let~ output :
Ty.apply (Ty.path "array") [ N ] [ Ty.path "core::ascii::ascii_char::AsciiChar" ] :=
- repeat (| Value.StructTuple "core::ascii::ascii_char::AsciiChar::Null" [] [] [], N |) in
+ lib.repeat (|
+ Value.StructTuple "core::ascii::ascii_char::AsciiChar::Null" [] [] [],
+ N
+ |) in
let~ hi : Ty.path "core::ascii::ascii_char::AsciiChar" :=
M.read (|
M.SubPointer.get_array_field (|
@@ -253,7 +259,10 @@ Module escape.
M.read (| get_constant (| "core::escape::verbatim_discriminant", Ty.tuple [] |) |) in
let~ output :
Ty.apply (Ty.path "array") [ N ] [ Ty.path "core::ascii::ascii_char::AsciiChar" ] :=
- repeat (| Value.StructTuple "core::ascii::ascii_char::AsciiChar::Null" [] [] [], N |) in
+ lib.repeat (|
+ Value.StructTuple "core::ascii::ascii_char::AsciiChar::Null" [] [] [],
+ N
+ |) in
let~ _ : Ty.tuple [] :=
M.write (|
M.SubPointer.get_array_field (| output, Value.Integer IntegerKind.Usize 0 |),
@@ -517,7 +526,7 @@ Module escape.
ltac:(M.monadic
(let~ arr :
Ty.apply (Ty.path "array") [ Value.Integer IntegerKind.Usize 256 ] [ Ty.path "u8" ] :=
- repeat (| Value.Integer IntegerKind.U8 0, Value.Integer IntegerKind.Usize 256 |) in
+ lib.repeat (| Value.Integer IntegerKind.U8 0, Value.Integer IntegerKind.Usize 256 |) in
let~ idx : Ty.path "usize" := Value.Integer IntegerKind.Usize 0 in
let~ _ : Ty.tuple [] :=
M.read (|
@@ -784,7 +793,10 @@ Module escape.
|) in
let~ output :
Ty.apply (Ty.path "array") [ N ] [ Ty.path "core::ascii::ascii_char::AsciiChar" ] :=
- repeat (| Value.StructTuple "core::ascii::ascii_char::AsciiChar::Null" [] [] [], N |) in
+ lib.repeat (|
+ Value.StructTuple "core::ascii::ascii_char::AsciiChar::Null" [] [] [],
+ N
+ |) in
let~ _ : Ty.tuple [] :=
M.write (|
M.SubPointer.get_array_field (| output, Value.Integer IntegerKind.Usize 3 |),
@@ -1388,7 +1400,7 @@ Module escape.
[]
[
("data",
- repeat (|
+ lib.repeat (|
Value.StructTuple "core::ascii::ascii_char::AsciiChar::Null" [] [] [],
N
|));
diff --git a/CoqOfRust/core/fmt/float.v b/CoqOfRust/core/fmt/float.v
index f9c826e59..d679e7f3e 100644
--- a/CoqOfRust/core/fmt/float.v
+++ b/CoqOfRust/core/fmt/float.v
@@ -179,7 +179,7 @@ Module fmt.
[ Value.Integer IntegerKind.Usize 1024 ]
[ Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ Ty.path "u8" ]
] :=
- repeat (|
+ lib.repeat (|
M.call_closure (|
Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ Ty.path "u8" ],
M.get_associated_function (|
@@ -202,7 +202,7 @@ Module fmt.
[]
[ Ty.path "core::num::fmt::Part" ]
] :=
- repeat (|
+ lib.repeat (|
M.call_closure (|
Ty.apply
(Ty.path "core::mem::maybe_uninit::MaybeUninit")
@@ -357,7 +357,7 @@ Module fmt.
[ Value.Integer IntegerKind.Usize 17 ]
[ Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ Ty.path "u8" ]
] :=
- repeat (|
+ lib.repeat (|
M.call_closure (|
Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ Ty.path "u8" ],
M.get_associated_function (|
@@ -380,7 +380,7 @@ Module fmt.
[]
[ Ty.path "core::num::fmt::Part" ]
] :=
- repeat (|
+ lib.repeat (|
M.call_closure (|
Ty.apply
(Ty.path "core::mem::maybe_uninit::MaybeUninit")
@@ -668,7 +668,7 @@ Module fmt.
[ Value.Integer IntegerKind.Usize 1024 ]
[ Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ Ty.path "u8" ]
] :=
- repeat (|
+ lib.repeat (|
M.call_closure (|
Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ Ty.path "u8" ],
M.get_associated_function (|
@@ -691,7 +691,7 @@ Module fmt.
[]
[ Ty.path "core::num::fmt::Part" ]
] :=
- repeat (|
+ lib.repeat (|
M.call_closure (|
Ty.apply
(Ty.path "core::mem::maybe_uninit::MaybeUninit")
@@ -848,7 +848,7 @@ Module fmt.
[ Value.Integer IntegerKind.Usize 17 ]
[ Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ Ty.path "u8" ]
] :=
- repeat (|
+ lib.repeat (|
M.call_closure (|
Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ Ty.path "u8" ],
M.get_associated_function (|
@@ -871,7 +871,7 @@ Module fmt.
[]
[ Ty.path "core::num::fmt::Part" ]
] :=
- repeat (|
+ lib.repeat (|
M.call_closure (|
Ty.apply
(Ty.path "core::mem::maybe_uninit::MaybeUninit")
diff --git a/CoqOfRust/core/fmt/mod.v b/CoqOfRust/core/fmt/mod.v
index 568d7dbde..346f6c675 100644
--- a/CoqOfRust/core/fmt/mod.v
+++ b/CoqOfRust/core/fmt/mod.v
@@ -479,7 +479,7 @@ Module fmt.
M.borrow (|
Pointer.Kind.MutRef,
M.alloc (|
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 4
|)
@@ -5357,7 +5357,7 @@ Module fmt.
[ Value.Integer IntegerKind.Usize 5
]
[ Ty.path "u8" ] :=
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 5
|) in
@@ -14715,7 +14715,7 @@ Module fmt.
M.borrow (|
Pointer.Kind.MutRef,
M.alloc (|
- repeat (|
+ lib.repeat (|
Value.Integer IntegerKind.U8 0,
Value.Integer IntegerKind.Usize 4
|)
diff --git a/CoqOfRust/core/fmt/num.v b/CoqOfRust/core/fmt/num.v
index 8e9620811..3ba0f6208 100644
--- a/CoqOfRust/core/fmt/num.v
+++ b/CoqOfRust/core/fmt/num.v
@@ -826,7 +826,7 @@ Module fmt.
[ Value.Integer IntegerKind.Usize 128 ]
[ Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ Ty.path "u8" ]
] :=
- repeat (|
+ lib.repeat (|
M.call_closure (|
Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ Ty.path "u8" ],
M.get_associated_function (|
@@ -6829,7 +6829,7 @@ Module fmt.
[]
[ Ty.path "u8" ]
] :=
- repeat (|
+ lib.repeat (|
M.call_closure (|
Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ Ty.path "u8" ],
M.get_associated_function (|
@@ -7648,7 +7648,7 @@ Module fmt.
[]
[ Ty.path "u8" ]
] :=
- repeat (|
+ lib.repeat (|
M.call_closure (|
Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ Ty.path "u8" ],
M.get_associated_function (|
@@ -8467,7 +8467,7 @@ Module fmt.
[]
[ Ty.path "u8" ]
] :=
- repeat (|
+ lib.repeat (|
M.call_closure (|
Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ Ty.path "u8" ],
M.get_associated_function (|
@@ -9286,7 +9286,7 @@ Module fmt.
[]
[ Ty.path "u8" ]
] :=
- repeat (|
+ lib.repeat (|
M.call_closure (|
Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ Ty.path "u8" ],
M.get_associated_function (|
@@ -10105,7 +10105,7 @@ Module fmt.
[]
[ Ty.path "u8" ]
] :=
- repeat (|
+ lib.repeat (|
M.call_closure (|
Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ Ty.path "u8" ],
M.get_associated_function (|
@@ -11448,7 +11448,7 @@ Module fmt.
[]
[ Ty.path "u8" ]
] :=
- repeat (|
+ lib.repeat (|
M.call_closure (|
Ty.apply
(Ty.path "core::mem::maybe_uninit::MaybeUninit")
@@ -11935,7 +11935,7 @@ Module fmt.
[]
[ Ty.path "u8" ]
] :=
- repeat (|
+ lib.repeat (|
M.call_closure (|
Ty.apply
(Ty.path "core::mem::maybe_uninit::MaybeUninit")
@@ -15463,7 +15463,7 @@ Module fmt.
[]
[ Ty.path "u8" ]
] :=
- repeat (|
+ lib.repeat (|
M.call_closure (|
Ty.apply
(Ty.path "core::mem::maybe_uninit::MaybeUninit")
@@ -15949,7 +15949,7 @@ Module fmt.
[]
[ Ty.path "u8" ]
] :=
- repeat (|
+ lib.repeat (|
M.call_closure (|
Ty.apply
(Ty.path "core::mem::maybe_uninit::MaybeUninit")
@@ -18466,7 +18466,7 @@ Module fmt.
[ Value.Integer IntegerKind.Usize 39 ]
[ Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ Ty.path "u8" ]
] :=
- repeat (|
+ lib.repeat (|
M.call_closure (|
Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ Ty.path "u8" ],
M.get_associated_function (|
diff --git a/CoqOfRust/core/iter/adapters/copied.v b/CoqOfRust/core/iter/adapters/copied.v
index 758b26e66..2009151c5 100644
--- a/CoqOfRust/core/iter/adapters/copied.v
+++ b/CoqOfRust/core/iter/adapters/copied.v
@@ -1360,7 +1360,7 @@ Module iter.
[ N ]
[ Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ T ]
] :=
- repeat (|
+ lib.repeat (|
M.read (|
get_constant (|
"core::iter::adapters::copied::spec_next_chunk_discriminant",
diff --git a/CoqOfRust/core/iter/adapters/filter.v b/CoqOfRust/core/iter/adapters/filter.v
index 38f4ccccb..1af849322 100644
--- a/CoqOfRust/core/iter/adapters/filter.v
+++ b/CoqOfRust/core/iter/adapters/filter.v
@@ -170,7 +170,7 @@ Module iter.
"Item"
]
] :=
- repeat (|
+ lib.repeat (|
M.read (|
get_constant (|
"core::iter::adapters::filter::next_chunk_dropless_discriminant",
diff --git a/CoqOfRust/core/iter/adapters/filter_map.v b/CoqOfRust/core/iter/adapters/filter_map.v
index 5df81b67a..df993f0a6 100644
--- a/CoqOfRust/core/iter/adapters/filter_map.v
+++ b/CoqOfRust/core/iter/adapters/filter_map.v
@@ -582,7 +582,7 @@ Module iter.
(Ty.path "array")
[ N ]
[ Ty.apply (Ty.path "core::mem::maybe_uninit::MaybeUninit") [] [ B ] ] :=
- repeat (|
+ lib.repeat (|
M.read (|
get_constant (|
"core::iter::adapters::filter_map::next_chunk_discriminant",
diff --git a/CoqOfRust/core/iter/adapters/map_windows.v b/CoqOfRust/core/iter/adapters/map_windows.v
index c9099d964..5f84b2bcc 100644
--- a/CoqOfRust/core/iter/adapters/map_windows.v
+++ b/CoqOfRust/core/iter/adapters/map_windows.v
@@ -1518,7 +1518,7 @@ Module iter.
|)
]
|);
- repeat (|
+ lib.repeat (|
M.read (|
get_constant (|
"core::iter::adapters::map_windows::try_from_iter_discriminant",
@@ -2745,7 +2745,7 @@ Module iter.
("buffer",
Value.Array
[
- repeat (|
+ lib.repeat (|
M.read (|
get_constant (|
"core::iter::adapters::map_windows::clone_discriminant",
@@ -2754,7 +2754,7 @@ Module iter.
|),
N
|);
- repeat (|
+ lib.repeat (|
M.read (|
get_constant (|
"core::iter::adapters::map_windows::clone_discriminant",
diff --git a/CoqOfRust/core/iter/traits/links/iterator.v b/CoqOfRust/core/iter/traits/links/iterator.v
index 97afab2a4..9d3b1f495 100644
--- a/CoqOfRust/core/iter/traits/links/iterator.v
+++ b/CoqOfRust/core/iter/traits/links/iterator.v
@@ -6,6 +6,7 @@ Require Import core.links.array.
Require Import core.links.option.
Require Import core.links.result.
Require Import core.num.links.nonzero.
+Require Import core.ops.links.function.
(* pub trait Iterator *)
Module Iterator.
@@ -192,6 +193,18 @@ Module Iterator.
where Self: Sized,
F: FnMut(Self::Item) -> bool { ... }
*)
+ Definition Run_any
+ (Self : Set) `{Link Self}
+ (Item : Set) `{Link Item} :
+ Set :=
+ TraitMethod.C (trait Self) "any" (fun method =>
+ forall
+ (F : Set) `{Link F}
+ (self : Ref.t Pointer.Kind.MutRef Self)
+ (f : F)
+ `(FnMut.Run F Item bool),
+ Run.Trait method [] [Φ F] [φ self; φ f] bool
+ ).
(*
fn find
(&mut self, predicate: P) -> Option
@@ -323,5 +336,6 @@ Module Iterator.
count : Run_count Self;
last : Run_last Self Item;
advance_by : Run_advance_by Self;
+ any : Run_any Self Item;
}.
End Iterator.
diff --git a/CoqOfRust/core/links/option.v b/CoqOfRust/core/links/option.v
index b1ff72329..8e51449e0 100644
--- a/CoqOfRust/core/links/option.v
+++ b/CoqOfRust/core/links/option.v
@@ -32,12 +32,15 @@ Module Option.
Proof. now intros; subst. Qed.
Smpl Add apply of_value_with_None : of_value.
- Lemma of_value_with_Some {A : Set} `{Link A} (value : A) value' :
+ Lemma of_value_with_Some
+ A' (A : Set) `{Link A}
+ value' (value : A) :
+ A' = Φ A ->
value' = φ value ->
- Value.StructTuple "core::option::Option::Some" [] [Φ A] [value'] =
+ Value.StructTuple "core::option::Option::Some" [] [A'] [value'] =
φ (Some value).
Proof. intros; subst; reflexivity. Qed.
- Smpl Add apply of_value_with_Some : of_value.
+ Smpl Add unshelve eapply of_value_with_Some : of_value.
Definition of_value_None A' :
OfTy.t A' ->
@@ -49,13 +52,14 @@ Module Option.
Defined.
Smpl Add unshelve eapply of_value_None : of_value.
- Definition of_value_Some A' value' :
- forall
- (of_value_value : OfValue.t value'),
- A' = Φ (OfValue.get_Set of_value_value) ->
+ Definition of_value_Some A' value'
+ (H_A' : OfTy.t A')
+ (value : OfTy.get_Set H_A') :
+ value' = φ value ->
OfValue.t (Value.StructTuple "core::option::Option::Some" [] [A'] [value']).
Proof.
- intros [A ? value] **.
+ intros.
+ destruct H_A' as [A].
eapply OfValue.Make with (A := option A) (value := Some value).
now subst.
Defined.
@@ -178,3 +182,13 @@ Module Impl_Try_for_Option.
Admitted.
End Impl_Try_for_Option.
Export Impl_Try_for_Option.
+
+(* impl ops::FromResidual