about summary refs log tree commit diff
path: root/src/librustc_data_structures
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2017-10-03 14:19:56 -0300
committerSantiago Pastorino <spastorino@gmail.com>2017-10-04 23:50:53 -0300
commit3502bec0322829d8bbe61b65c62bb796814e4bd3 (patch)
tree48566266dc58eb6366446c6cbeb3dfc91ed67315 /src/librustc_data_structures
parent9af7426b47a99f5f4b06c79d1e294e424eb74a1f (diff)
downloadrust-3502bec0322829d8bbe61b65c62bb796814e4bd3.tar.gz
rust-3502bec0322829d8bbe61b65c62bb796814e4bd3.zip
Make newtype_index get debug_name using reflection
Diffstat (limited to 'src/librustc_data_structures')
-rw-r--r--src/librustc_data_structures/indexed_vec.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc_data_structures/indexed_vec.rs b/src/librustc_data_structures/indexed_vec.rs
index 01fb2930687..82882f94440 100644
--- a/src/librustc_data_structures/indexed_vec.rs
+++ b/src/librustc_data_structures/indexed_vec.rs
@@ -40,6 +40,10 @@ impl Idx for u32 {
 
 #[macro_export]
 macro_rules! newtype_index {
+    ($name:ident) => (
+        newtype_index!($name, unsafe { ::std::intrinsics::type_name::<$name>() });
+    );
+
     ($name:ident, $debug_name:expr) => (
         #[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord,
          RustcEncodable, RustcDecodable)]