]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/ty/sty.rs
Auto merge of #46054 - nikomatsakis:nll-master-to-rust-master-1, r=arielb1
[rust.git] / src / librustc / ty / sty.rs
index 85755c01d31027cf8e119f3ec04c14d1a8de4687..caf78309cc2389721deaa871dddf354e39770adb 100644 (file)
@@ -998,22 +998,11 @@ pub struct FloatVid {
     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 {