Make newtype_index get debug_name using reflection
This commit is contained in:
parent
9af7426b47
commit
3502bec032
3 changed files with 6 additions and 1 deletions
|
|
@ -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)]
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
|
|||
|
||||
#![feature(box_patterns)]
|
||||
#![feature(box_syntax)]
|
||||
#![feature(core_intrinsics)]
|
||||
#![feature(i128_type)]
|
||||
#![feature(rustc_diagnostic_macros)]
|
||||
#![feature(placement_in_syntax)]
|
||||
|
|
|
|||
|
|
@ -155,4 +155,4 @@ struct Region {
|
|||
points: FxHashSet<Location>,
|
||||
}
|
||||
|
||||
newtype_index!(RegionIndex, "region_index");
|
||||
newtype_index!(RegionIndex);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue