Skip to content

More links for stack functions + fix for string translations #694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 10 additions & 14 deletions CoqOfRust/alloc/alloc.v
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Module alloc.
M.get_associated_function (| Ty.path "core::fmt::Formatter", "write_str", [], [] |),
[
M.borrow (| Pointer.Kind.MutRef, M.deref (| M.read (| f |) |) |);
M.borrow (| Pointer.Kind.Ref, M.deref (| M.read (| Value.String "Global" |) |) |)
M.borrow (| Pointer.Kind.Ref, M.deref (| mk_str (| "Global" |) |) |)
]
|)))
| _, _, _ => M.impossible "wrong number of arguments"
Expand Down Expand Up @@ -831,9 +831,8 @@ Module alloc.
M.alloc (|
Value.Array
[
M.read (|
Value.String
"`new_layout.size()` must be greater than or equal to `old_layout.size()`"
mk_str (|
"`new_layout.size()` must be greater than or equal to `old_layout.size()`"
|)
]
|)
Expand Down Expand Up @@ -1822,9 +1821,8 @@ Module alloc.
M.alloc (|
Value.Array
[
M.read (|
Value.String
"`new_layout.size()` must be smaller than or equal to `old_layout.size()`"
mk_str (|
"`new_layout.size()` must be smaller than or equal to `old_layout.size()`"
|)
]
|)
Expand Down Expand Up @@ -2654,9 +2652,7 @@ Module alloc.
M.deref (|
M.borrow (|
Pointer.Kind.Ref,
M.alloc (|
Value.Array [ M.read (| Value.String "allocation failed" |) ]
|)
M.alloc (| Value.Array [ mk_str (| "allocation failed" |) ] |)
|)
|)
|)
Expand Down Expand Up @@ -2792,8 +2788,8 @@ Module alloc.
M.alloc (|
Value.Array
[
M.read (| Value.String "memory allocation of " |);
M.read (| Value.String " bytes failed" |)
mk_str (| "memory allocation of " |);
mk_str (| " bytes failed" |)
]
|)
|)
Expand Down Expand Up @@ -2857,8 +2853,8 @@ Module alloc.
M.alloc (|
Value.Array
[
M.read (| Value.String "memory allocation of " |);
M.read (| Value.String " bytes failed" |)
mk_str (| "memory allocation of " |);
mk_str (| " bytes failed" |)
]
|)
|)
Expand Down
5 changes: 2 additions & 3 deletions CoqOfRust/alloc/borrow.v
Original file line number Diff line number Diff line change
Expand Up @@ -588,9 +588,8 @@ Module borrow.
[]
|),
[
M.read (|
Value.String
"internal error: entered unreachable code"
mk_str (|
"internal error: entered unreachable code"
|)
]
|)
Expand Down
18 changes: 3 additions & 15 deletions CoqOfRust/alloc/boxed/convert.v
Original file line number Diff line number Diff line change
Expand Up @@ -1510,11 +1510,7 @@ Module boxed.
M.call_closure (|
Ty.path "never",
M.get_function (| "core::panicking::panic", [], [] |),
[
M.read (|
Value.String "assertion failed: self.is::<T>()"
|)
]
[ mk_str (| "assertion failed: self.is::<T>()" |) ]
|)
|)
|)));
Expand Down Expand Up @@ -1754,11 +1750,7 @@ Module boxed.
M.call_closure (|
Ty.path "never",
M.get_function (| "core::panicking::panic", [], [] |),
[
M.read (|
Value.String "assertion failed: self.is::<T>()"
|)
]
[ mk_str (| "assertion failed: self.is::<T>()" |) ]
|)
|)
|)));
Expand Down Expand Up @@ -2027,11 +2019,7 @@ Module boxed.
M.call_closure (|
Ty.path "never",
M.get_function (| "core::panicking::panic", [], [] |),
[
M.read (|
Value.String "assertion failed: self.is::<T>()"
|)
]
[ mk_str (| "assertion failed: self.is::<T>()" |) ]
|)
|)
|)));
Expand Down
28 changes: 7 additions & 21 deletions CoqOfRust/alloc/boxed/thin.v
Original file line number Diff line number Diff line change
Expand Up @@ -1384,9 +1384,8 @@ Module boxed.
[]
|),
[
M.read (|
Value.String
"assertion failed: value_offset == 0 && T::IS_ZST && H::IS_ZST"
mk_str (|
"assertion failed: value_offset == 0 && T::IS_ZST && H::IS_ZST"
|)
]
|)
Expand Down Expand Up @@ -1787,9 +1786,8 @@ Module boxed.
[]
|),
[
M.read (|
Value.String
"assertion failed: value_offset == 0 && mem::size_of::<T>() == 0 && mem::size_of::<H>() == 0"
mk_str (|
"assertion failed: value_offset == 0 && mem::size_of::<T>() == 0 && mem::size_of::<H>() == 0"
|)
]
|)
Expand Down Expand Up @@ -2081,11 +2079,7 @@ Module boxed.
M.call_closure (|
Ty.path "never",
M.get_function (| "core::panicking::panic", [], [] |),
[
M.read (|
Value.String "assertion failed: mem::size_of::<T>() == 0"
|)
]
[ mk_str (| "assertion failed: mem::size_of::<T>() == 0" |) ]
|)
|)
|)));
Expand Down Expand Up @@ -2183,11 +2177,7 @@ Module boxed.
M.call_closure (|
Ty.path "never",
M.get_function (| "core::panicking::panic", [], [] |),
[
M.read (|
Value.String "assertion failed: value_ptr.is_aligned()"
|)
]
[ mk_str (| "assertion failed: value_ptr.is_aligned()" |) ]
|)
|)
|)));
Expand Down Expand Up @@ -2465,11 +2455,7 @@ Module boxed.
M.call_closure (|
Ty.path "never",
M.get_function (| "core::panicking::panic", [], [] |),
[
M.read (|
Value.String "assertion failed: hp.is_aligned()"
|)
]
[ mk_str (| "assertion failed: hp.is_aligned()" |) ]
|)
|)
|)));
Expand Down
69 changes: 16 additions & 53 deletions CoqOfRust/alloc/collections/binary_heap/mod.v
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Module collections.
M.borrow (| Pointer.Kind.MutRef, M.deref (| M.read (| f |) |) |);
M.borrow (|
Pointer.Kind.Ref,
M.deref (| M.read (| Value.String "PeekMut" |) |)
M.deref (| mk_str (| "PeekMut" |) |)
|)
]
|)
Expand Down Expand Up @@ -371,11 +371,7 @@ Module collections.
M.call_closure (|
Ty.path "never",
M.get_function (| "core::panicking::panic", [], [] |),
[
M.read (|
Value.String "assertion failed: !self.heap.is_empty()"
|)
]
[ mk_str (| "assertion failed: !self.heap.is_empty()" |) ]
|)
|)
|)));
Expand Down Expand Up @@ -559,11 +555,7 @@ Module collections.
M.call_closure (|
Ty.path "never",
M.get_function (| "core::panicking::panic", [], [] |),
[
M.read (|
Value.String
"assertion failed: !self.heap.is_empty()"
|)
[ mk_str (| "assertion failed: !self.heap.is_empty()" |)
]
|)
|)
Expand Down Expand Up @@ -4951,11 +4943,7 @@ Module collections.
M.call_closure (|
Ty.path "never",
M.get_function (| "core::panicking::panic", [], [] |),
[
M.read (|
Value.String "assertion failed: pos < data.len()"
|)
]
[ mk_str (| "assertion failed: pos < data.len()" |) ]
|)
|)
|)));
Expand Down Expand Up @@ -5159,11 +5147,7 @@ Module collections.
M.call_closure (|
Ty.path "never",
M.get_function (| "core::panicking::panic", [], [] |),
[
M.read (|
Value.String "assertion failed: index != self.pos"
|)
]
[ mk_str (| "assertion failed: index != self.pos" |) ]
|)
|)
|)));
Expand Down Expand Up @@ -5233,11 +5217,7 @@ Module collections.
M.call_closure (|
Ty.path "never",
M.get_function (| "core::panicking::panic", [], [] |),
[
M.read (|
Value.String "assertion failed: index < self.data.len()"
|)
]
[ mk_str (| "assertion failed: index < self.data.len()" |) ]
|)
|)
|)));
Expand Down Expand Up @@ -5353,11 +5333,7 @@ Module collections.
M.call_closure (|
Ty.path "never",
M.get_function (| "core::panicking::panic", [], [] |),
[
M.read (|
Value.String "assertion failed: index != self.pos"
|)
]
[ mk_str (| "assertion failed: index != self.pos" |) ]
|)
|)
|)));
Expand Down Expand Up @@ -5427,11 +5403,7 @@ Module collections.
M.call_closure (|
Ty.path "never",
M.get_function (| "core::panicking::panic", [], [] |),
[
M.read (|
Value.String "assertion failed: index < self.data.len()"
|)
]
[ mk_str (| "assertion failed: index < self.data.len()" |) ]
|)
|)
|)));
Expand Down Expand Up @@ -5765,10 +5737,7 @@ Module collections.
|),
[
M.borrow (| Pointer.Kind.MutRef, M.deref (| M.read (| f |) |) |);
M.borrow (|
Pointer.Kind.Ref,
M.deref (| M.read (| Value.String "Iter" |) |)
|)
M.borrow (| Pointer.Kind.Ref, M.deref (| mk_str (| "Iter" |) |) |)
]
|)
|)
Expand Down Expand Up @@ -6290,7 +6259,7 @@ Module collections.
M.borrow (| Pointer.Kind.MutRef, M.deref (| M.read (| f |) |) |);
M.borrow (|
Pointer.Kind.Ref,
M.deref (| M.read (| Value.String "IntoIter" |) |)
M.deref (| mk_str (| "IntoIter" |) |)
|)
]
|)
Expand Down Expand Up @@ -6885,11 +6854,8 @@ Module collections.
|),
[
M.borrow (| Pointer.Kind.MutRef, M.deref (| M.read (| f |) |) |);
M.borrow (|
Pointer.Kind.Ref,
M.deref (| M.read (| Value.String "IntoIterSorted" |) |)
|);
M.borrow (| Pointer.Kind.Ref, M.deref (| M.read (| Value.String "inner" |) |) |);
M.borrow (| Pointer.Kind.Ref, M.deref (| mk_str (| "IntoIterSorted" |) |) |);
M.borrow (| Pointer.Kind.Ref, M.deref (| mk_str (| "inner" |) |) |);
M.borrow (|
Pointer.Kind.Ref,
M.deref (|
Expand Down Expand Up @@ -7148,8 +7114,8 @@ Module collections.
|),
[
M.borrow (| Pointer.Kind.MutRef, M.deref (| M.read (| f |) |) |);
M.borrow (| Pointer.Kind.Ref, M.deref (| M.read (| Value.String "Drain" |) |) |);
M.borrow (| Pointer.Kind.Ref, M.deref (| M.read (| Value.String "iter" |) |) |);
M.borrow (| Pointer.Kind.Ref, M.deref (| mk_str (| "Drain" |) |) |);
M.borrow (| Pointer.Kind.Ref, M.deref (| mk_str (| "iter" |) |) |);
M.borrow (|
Pointer.Kind.Ref,
M.deref (|
Expand Down Expand Up @@ -7482,11 +7448,8 @@ Module collections.
|),
[
M.borrow (| Pointer.Kind.MutRef, M.deref (| M.read (| f |) |) |);
M.borrow (|
Pointer.Kind.Ref,
M.deref (| M.read (| Value.String "DrainSorted" |) |)
|);
M.borrow (| Pointer.Kind.Ref, M.deref (| M.read (| Value.String "inner" |) |) |);
M.borrow (| Pointer.Kind.Ref, M.deref (| mk_str (| "DrainSorted" |) |) |);
M.borrow (| Pointer.Kind.Ref, M.deref (| mk_str (| "inner" |) |) |);
M.borrow (|
Pointer.Kind.Ref,
M.deref (|
Expand Down
Loading
Loading