From e256b7f049b44fa697b9f9c5e75b4433a7d9ffdf Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Sun, 15 Mar 2015 04:01:57 +0200 Subject: Replace TyDesc and its uses with trait vtables and a type_name intrinsic. --- src/libcore/intrinsics.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/libcore') diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index 7fccb93f2a0..ead5da92bd9 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -44,10 +44,12 @@ use marker::Sized; +#[cfg(stage0)] // SNAP 270a677 pub type GlueFn = extern "Rust" fn(*const i8); #[lang="ty_desc"] #[derive(Copy)] +#[cfg(stage0)] // SNAP 270a677 pub struct TyDesc { // sizeof(T) pub size: usize, @@ -197,8 +199,13 @@ extern "rust-intrinsic" { pub fn pref_align_of() -> usize; /// Get a static pointer to a type descriptor. + #[cfg(stage0)] // SNAP 270a677 pub fn get_tydesc() -> *const TyDesc; + /// Gets a static string slice containing the name of a type. + #[cfg(not(stage0))] // SNAP 270a677 + pub fn type_name() -> &'static str; + /// Gets an identifier which is globally unique to the specified type. This /// function will return the same value for a type regardless of whichever /// crate it is invoked in. -- cgit 1.4.1-3-g733a5