newtype_index!(FirstStatementIndex
{
- DEBUG_NAME = "",
+ DEBUG_FORMAT = "{}",
MAX = SCOPE_DATA_REMAINDER_MAX,
});
newtype_index!(Local
{
- DEBUG_NAME = "_",
+ DEBUG_FORMAT = "_{}",
const RETURN_POINTER = 0,
});
///////////////////////////////////////////////////////////////////////////
// BasicBlock
-newtype_index!(BasicBlock { DEBUG_NAME = "bb" });
+newtype_index!(BasicBlock { DEBUG_FORMAT = "bb{}" });
///////////////////////////////////////////////////////////////////////////
// BasicBlockData and Terminator
/// and the index is a local.
pub type LvalueElem<'tcx> = ProjectionElem<'tcx, Local, Ty<'tcx>>;
-newtype_index!(Field { DEBUG_NAME = "field" });
+newtype_index!(Field { DEBUG_FORMAT = "field[{}]" });
impl<'tcx> Lvalue<'tcx> {
pub fn field(self, f: Field, ty: Ty<'tcx>) -> Lvalue<'tcx> {
newtype_index!(VisibilityScope
{
- DEBUG_NAME = "scope",
+ DEBUG_FORMAT = "scope[{}]",
const ARGUMENT_VISIBILITY_SCOPE = 0,
});
pub literal: Literal<'tcx>,
}
-newtype_index!(Promoted { DEBUG_NAME = "promoted" });
+newtype_index!(Promoted { DEBUG_FORMAT = "promoted[{}]" });
#[derive(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
pub enum Literal<'tcx> {
newtype_index!(
@type[$name]
@max[::std::u32::MAX]
- @debug_name[unsafe {::std::intrinsics::type_name::<$name>() }]);
+ @debug_format["{}"]);
);
// Define any constants
newtype_index!(
@type[$name]
@max[::std::u32::MAX]
- @debug_name[unsafe {::std::intrinsics::type_name::<$name>() }]
+ @debug_format["{}"]
$($tokens)+);
);
// ---- private rules ----
// Base case, user-defined constants (if any) have already been defined
- (@type[$type:ident] @max[$max:expr] @debug_name[$debug_name:expr]) => (
+ (@type[$type:ident] @max[$max:expr] @debug_format[$debug_format:expr]) => (
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord,
RustcEncodable, RustcDecodable)]
pub struct $type(pub u32);
impl ::std::fmt::Debug for $type {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
- write!(fmt, "{}{}", $debug_name, self.0)
+ write!(fmt, $debug_format, self.0)
}
}
);
// Rewrite final without comma to one that includes comma
- (@type[$type:ident] @max[$max:expr] @debug_name[$debug_name:expr]
+ (@type[$type:ident] @max[$max:expr] @debug_format[$debug_format:expr]
$name:ident = $constant:expr) => (
- newtype_index!(@type[$type] @max[$max] @debug_name[$debug_name] $name = $constant,);
+ newtype_index!(@type[$type] @max[$max] @debug_format[$debug_format] $name = $constant,);
);
// Rewrite final const without comma to one that includes comma
- (@type[$type:ident] @max[$_max:expr] @debug_name[$debug_name:expr]
+ (@type[$type:ident] @max[$_max:expr] @debug_format[$debug_format:expr]
const $name:ident = $constant:expr) => (
- newtype_index!(@type[$type] @max[$max] @debug_name[$debug_name] const $name = $constant,);
+ newtype_index!(@type[$type]
+ @max[$max]
+ @debug_format[$debug_format]
+ const $name = $constant,);
);
// Replace existing default for max
- (@type[$type:ident] @max[$_max:expr] @debug_name[$debug_name:expr]
+ (@type[$type:ident] @max[$_max:expr] @debug_format[$debug_format:expr]
MAX = $max:expr, $($tokens:tt)*) => (
- newtype_index!(@type[$type] @max[$max] @debug_name[$debug_name] $($tokens)*);
+ newtype_index!(@type[$type] @max[$max] @debug_format[$debug_format] $($tokens)*);
);
- // Replace existing default for debug_name
- (@type[$type:ident] @max[$max:expr] @debug_name[$_debug_name:expr]
- DEBUG_NAME = $debug_name:expr, $($tokens:tt)*) => (
- newtype_index!(@type[$type] @max[$max] @debug_name[$debug_name] $($tokens)*);
+ // Replace existing default for debug_format
+ (@type[$type:ident] @max[$max:expr] @debug_format[$_debug_format:expr]
+ DEBUG_FORMAT = $debug_format:expr, $($tokens:tt)*) => (
+ newtype_index!(@type[$type] @max[$max] @debug_format[$debug_format] $($tokens)*);
);
// Assign a user-defined constant (as final param)
- (@type[$type:ident] @max[$max:expr] @debug_name[$debug_name:expr]
+ (@type[$type:ident] @max[$max:expr] @debug_format[$debug_format:expr]
const $name:ident = $constant:expr, $($tokens:tt)*) => (
pub const $name: $type = $type($constant);
- newtype_index!(@type[$type] @max[$max] @debug_name[$debug_name] $($tokens)*);
+ newtype_index!(@type[$type] @max[$max] @debug_format[$debug_format] $($tokens)*);
);
}
#![feature(box_syntax)]
#![feature(conservative_impl_trait)]
#![feature(const_fn)]
-#![feature(core_intrinsics)]
#![feature(i128_type)]
#![feature(rustc_diagnostic_macros)]
#![feature(placement_in_syntax)]
}
newtype_index!(RegionIndex {
- DEBUG_NAME = "R",
+ DEBUG_FORMAT = "'_#{}r",
});
/// Right now, we piggy back on the `ReVar` to store our NLL inference
// StorageLive(_3);
// StorageLive(_4);
// StorageLive(_5);
-// _5 = promoted1;
+// _5 = promoted[1];
// _4 = &'12ds (*_5);
// StorageLive(_7);
// StorageLive(_8);
-// _8 = promoted0;
+// _8 = promoted[0];
// _7 = &'10s (*_8);
// _3 = D1<'12ds, '10s>::{{constructor}}(_4, _7);
// EndRegion('10s);
// END RUST SOURCE
// START rustc.node13.nll.0.mir
-// | R5: {bb0[6], bb0[7], bb0[8], bb0[9], bb0[10], bb0[11], bb0[12], bb0[13], bb0[14]}
+// | '_#5r: {bb0[6], bb0[7], bb0[8], bb0[9], bb0[10], bb0[11], bb0[12], bb0[13], bb0[14]}
// ...
-// | R7: {bb0[11], bb0[12], bb0[13], bb0[14]}
+// | '_#7r: {bb0[11], bb0[12], bb0[13], bb0[14]}
// END rustc.node13.nll.0.mir
// START rustc.node13.nll.0.mir
// let _2: &'_#5r mut i32;
// END RUST SOURCE
// START rustc.node12.nll.0.mir
-// | R0: {bb1[1], bb2[0], bb2[1]}
-// | R1: {bb1[1], bb2[0], bb2[1]}
+// | '_#0r: {bb1[1], bb2[0], bb2[1]}
+// | '_#1r: {bb1[1], bb2[0], bb2[1]}
// ...
// let _2: &'_#1r usize;
// END rustc.node12.nll.0.mir
// END RUST SOURCE
// START rustc.node12.nll.0.mir
-// | R4: {bb1[3], bb1[4], bb1[5], bb2[0], bb2[1]}
+// | '_#4r: {bb1[3], bb1[4], bb1[5], bb2[0], bb2[1]}
// END rustc.node12.nll.0.mir
// END RUST SOURCE
// START rustc.node12.nll.0.mir
-// | R4: {bb1[3], bb1[4], bb1[5], bb2[0], bb2[1], bb2[2], bb3[0], bb4[0], bb4[1], bb4[2], bb6[0], bb7[0], bb7[1], bb8[0]}
+// | '_#4r: {bb1[3], bb1[4], bb1[5], bb2[0], bb2[1], bb2[2], bb3[0], bb4[0], bb4[1], bb4[2], bb6[0], bb7[0], bb7[1], bb8[0]}
// END rustc.node12.nll.0.mir
// END RUST SOURCE
// START rustc.node12.nll.0.mir
-// | R0: {bb1[1], bb2[0], bb2[1]}
+// | '_#0r: {bb1[1], bb2[0], bb2[1]}
// ...
-// | R2: {bb7[2], bb7[3], bb7[4]}
-// | R3: {bb1[1], bb2[0], bb2[1], bb7[2], bb7[3], bb7[4]}
+// | '_#2r: {bb7[2], bb7[3], bb7[4]}
+// | '_#3r: {bb1[1], bb2[0], bb2[1], bb7[2], bb7[3], bb7[4]}
// ...
// let mut _2: &'_#3r usize;
// ...
// END RUST SOURCE
// START rustc.node12.nll.0.mir
-// | R0: {bb1[1], bb1[2], bb1[3], bb1[4], bb1[5], bb1[6], bb2[0], bb2[1]}
-// | R1: {bb1[1], bb1[2], bb1[3], bb1[4], bb1[5], bb1[6], bb2[0], bb2[1]}
-// | R2: {bb1[5], bb1[6], bb2[0], bb2[1]}
+// | '_#0r: {bb1[1], bb1[2], bb1[3], bb1[4], bb1[5], bb1[6], bb2[0], bb2[1]}
+// | '_#1r: {bb1[1], bb1[2], bb1[3], bb1[4], bb1[5], bb1[6], bb2[0], bb2[1]}
+// | '_#2r: {bb1[5], bb1[6], bb2[0], bb2[1]}
// END rustc.node12.nll.0.mir
// START rustc.node12.nll.0.mir
// let _2: &'_#1r usize;