提交 ab43c1e9 编写于 作者: N Niko Matsakis

add `const_fn` feature

上级 e5e72f66
...@@ -136,7 +136,7 @@ impl $type { ...@@ -136,7 +136,7 @@ impl $type {
]; ];
unsafe { unsafe {
$type::from_u32_unchecked(value) $type { private: value }
} }
} }
...@@ -153,13 +153,13 @@ impl $type { ...@@ -153,13 +153,13 @@ impl $type {
/// Extract value of this index as a usize. /// Extract value of this index as a usize.
#[inline] #[inline]
$v const fn as_u32(self) -> u32 { $v fn as_u32(self) -> u32 {
self.private self.private
} }
/// Extract value of this index as a u32. /// Extract value of this index as a u32.
#[inline] #[inline]
$v const fn as_usize(self) -> usize { $v fn as_usize(self) -> usize {
self.as_u32() as usize self.as_u32() as usize
} }
} }
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(crate_visibility_modifier)] #![feature(crate_visibility_modifier)]
#![feature(core_intrinsics)] #![feature(core_intrinsics)]
#![feature(const_fn)]
#![feature(decl_macro)] #![feature(decl_macro)]
#![cfg_attr(stage0, feature(macro_vis_matcher))] #![cfg_attr(stage0, feature(macro_vis_matcher))]
#![feature(exhaustive_patterns)] #![feature(exhaustive_patterns)]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册