about summary refs log tree commit diff
path: root/src/libstd/unstable/intrinsics.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/unstable/intrinsics.rs')
-rw-r--r--src/libstd/unstable/intrinsics.rs20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/libstd/unstable/intrinsics.rs b/src/libstd/unstable/intrinsics.rs
index c60edad3dbd..d2807303fb2 100644
--- a/src/libstd/unstable/intrinsics.rs
+++ b/src/libstd/unstable/intrinsics.rs
@@ -38,16 +38,34 @@ pub use realstd::unstable::intrinsics::{TyDesc, Opaque, TyVisitor};
 
 pub type GlueFn = extern "Rust" fn(*i8);
 
-// NB: this has to be kept in sync with the Rust ABI.
+// NB: this has to be kept in sync with `type_desc` in `rt`
 #[lang="ty_desc"]
 #[cfg(not(test))]
 pub struct TyDesc {
+    // sizeof(T)
     size: uint,
+
+    // alignof(T)
     align: uint,
+
+    // Called on a copy of a value of type `T` *after* memcpy
     take_glue: GlueFn,
+
+    // Called when a value of type `T` is no longer needed
     drop_glue: GlueFn,
+
+    // Called by drop glue when a value of type `T` can be freed
     free_glue: GlueFn,
+
+    // Called by reflection visitor to visit a value of type `T`
     visit_glue: GlueFn,
+
+    // If T represents a box pointer (`@U` or `~U`), then
+    // `borrow_offset` is the amount that the pointer must be adjusted
+    // to find the payload.  This is always derivable from the type
+    // `U`, but in the case of `@Trait` or `~Trait` objects, the type
+    // `U` is unknown.
+    borrow_offset: uint,
 }
 
 #[lang="opaque"]