about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorEduard Burtescu <edy.burt@gmail.com>2015-03-15 04:01:57 +0200
committerEduard Burtescu <edy.burt@gmail.com>2015-03-17 21:00:23 +0200
commite256b7f049b44fa697b9f9c5e75b4433a7d9ffdf (patch)
tree05ed074d9080f696cb047c6df587ceef976f6897 /src/libcore
parent3e98ab560a56492d70932066bb4d46f3a6a1bd4c (diff)
downloadrust-e256b7f049b44fa697b9f9c5e75b4433a7d9ffdf.tar.gz
rust-e256b7f049b44fa697b9f9c5e75b4433a7d9ffdf.zip
Replace TyDesc and its uses with trait vtables and a type_name intrinsic.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/intrinsics.rs7
1 files changed, 7 insertions, 0 deletions
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<T>() -> usize;
 
     /// Get a static pointer to a type descriptor.
+    #[cfg(stage0)] // SNAP 270a677
     pub fn get_tydesc<T: ?Sized>() -> *const TyDesc;
 
+    /// Gets a static string slice containing the name of a type.
+    #[cfg(not(stage0))] // SNAP 270a677
+    pub fn type_name<T: ?Sized>() -> &'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.