]> git.lizzy.rs Git - rust.git/commitdiff
add `const_fn` feature
authorNiko Matsakis <niko@alum.mit.edu>
Thu, 6 Sep 2018 19:33:54 +0000 (15:33 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Fri, 7 Sep 2018 17:28:23 +0000 (13:28 -0400)
src/librustc_data_structures/indexed_vec.rs
src/librustc_mir/lib.rs

index 31dba2c2cdfbe0a2e381cdad9e41ae89889035a7..186bc6d43ccc560a0afb47d0fd27ee926167357a 100644 (file)
@@ -136,7 +136,7 @@ impl $type {
                 ];
 
                 unsafe {
-                    $type::from_u32_unchecked(value)
+                    $type { private: value }
                 }
             }
 
@@ -153,13 +153,13 @@ impl $type {
 
             /// Extract value of this index as a usize.
             #[inline]
-            $v const fn as_u32(self) -> u32 {
+            $v fn as_u32(self) -> u32 {
                 self.private
             }
 
             /// Extract value of this index as a u32.
             #[inline]
-            $v const fn as_usize(self) -> usize {
+            $v fn as_usize(self) -> usize {
                 self.as_u32() as usize
             }
         }
index be04f75c7260c3dfe8699c7592745961fe0b797a..d4024981c3754cac0e1445afc1c59b0d81730505 100644 (file)
@@ -24,6 +24,7 @@
 #![feature(box_syntax)]
 #![feature(crate_visibility_modifier)]
 #![feature(core_intrinsics)]
+#![feature(const_fn)]
 #![feature(decl_macro)]
 #![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(exhaustive_patterns)]