pub index: u32,
}
-#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy, PartialOrd, Ord)]
-pub struct RegionVid {
- pub index: u32,
-}
-
-// FIXME: We could convert this to use `newtype_index!`
-impl Idx for RegionVid {
- fn new(value: usize) -> Self {
- assert!(value < ::std::u32::MAX as usize);
- RegionVid { index: value as u32 }
- }
-
- fn index(self) -> usize {
- self.index as usize
- }
-}
+newtype_index!(RegionVid
+ {
+ pub idx
+ DEBUG_FORMAT = custom,
+ });
#[derive(Clone, Copy, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, PartialOrd, Ord)]
pub struct SkolemizedRegionVid {