diff options
| author | bors <bors@rust-lang.org> | 2014-01-11 07:31:40 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-01-11 07:31:40 -0800 |
| commit | 4bdda359c3cf41e36ba01ca6aef826aca7cc81c0 (patch) | |
| tree | 87bdabc86631457e1e352294122088e8cd0722e0 /src/libstd | |
| parent | 99df8a3f158aebc76a3bd3a87e367a9d01108633 (diff) | |
| parent | 08ac616d379bb181e55b08f88e8c5342ee8d63a2 (diff) | |
| download | rust-4bdda359c3cf41e36ba01ca6aef826aca7cc81c0.tar.gz rust-4bdda359c3cf41e36ba01ca6aef826aca7cc81c0.zip | |
auto merge of #11252 : eddyb/rust/ty-cleanup, r=pcwalton
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/unstable/intrinsics.rs | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/src/libstd/unstable/intrinsics.rs b/src/libstd/unstable/intrinsics.rs index d6b33fda745..acd1cfcf901 100644 --- a/src/libstd/unstable/intrinsics.rs +++ b/src/libstd/unstable/intrinsics.rs @@ -47,9 +47,9 @@ pub use realstd::unstable::intrinsics::{TyDesc, Opaque, TyVisitor, TypeId}; pub type GlueFn = extern "Rust" fn(*i8); -// NB: this has to be kept in sync with `type_desc` in `rt` +// NOTE remove after next snapshot #[lang="ty_desc"] -#[cfg(not(test))] +#[cfg(not(test), stage0)] pub struct TyDesc { // sizeof(T) size: uint, @@ -80,6 +80,35 @@ pub struct TyDesc { name: &'static str } +#[lang="ty_desc"] +#[cfg(not(test), not(stage0))] +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 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, + + // Name corresponding to the type + name: &'static str +} + #[lang="opaque"] #[cfg(not(test))] pub enum Opaque { } |
