about summary refs log tree commit diff
path: root/src/rt/rust_shape.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust_shape.cpp')
-rw-r--r--src/rt/rust_shape.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/rt/rust_shape.cpp b/src/rt/rust_shape.cpp
index 6a586860cd6..f56aa0251ce 100644
--- a/src/rt/rust_shape.cpp
+++ b/src/rt/rust_shape.cpp
@@ -42,7 +42,17 @@ type_param::make(const type_desc **tydescs, unsigned n_tydescs,
     return ptrs;
 }
 
-// Constructs type parameters from an object shape. This is a bit messy,
+// Constructs type parameters from a function shape. This is a bit messy,
+// because it requires that the function shape have a specific format.
+type_param *
+type_param::from_fn_shape(const uint8_t *sp, ptr dp, arena &arena) {
+    const type_desc *tydesc = bump_dp<const type_desc *>(dp);
+    const type_desc **descs = (const type_desc **)(dp + tydesc->size);
+    unsigned n_tydescs = tydesc->n_obj_params & 0x7fffffff;
+    return make(descs, n_tydescs, arena);
+}
+
+// Constructs type parameters from an object shape. This is also a bit messy,
 // because it requires that the object shape have a specific format.
 type_param *
 type_param::from_obj_shape(const uint8_t *sp, ptr dp, arena &arena) {
@@ -461,12 +471,6 @@ log::walk_vec(bool align, bool is_pod, const std::pair<ptr,ptr> &data) {
 }
 
 void
-log::walk_obj(bool align) {
-    out << "obj";
-    data<log,ptr>::walk_obj_contents(align, dp);
-}
-
-void
 log::walk_variant(bool align, tag_info &tinfo, uint32_t variant_id,
                   const std::pair<const uint8_t *,const uint8_t *>
                   variant_ptr_and_end) {