Skip to content

Commit ab43c1e

Browse files
committed
add const_fn feature
1 parent e5e72f6 commit ab43c1e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/librustc_data_structures/indexed_vec.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ macro_rules! newtype_index {
136136
];
137137

138138
unsafe {
139-
$type::from_u32_unchecked(value)
139+
$type { private: value }
140140
}
141141
}
142142

@@ -153,13 +153,13 @@ macro_rules! newtype_index {
153153

154154
/// Extract value of this index as a usize.
155155
#[inline]
156-
$v const fn as_u32(self) -> u32 {
156+
$v fn as_u32(self) -> u32 {
157157
self.private
158158
}
159159

160160
/// Extract value of this index as a u32.
161161
#[inline]
162-
$v const fn as_usize(self) -> usize {
162+
$v fn as_usize(self) -> usize {
163163
self.as_u32() as usize
164164
}
165165
}

src/librustc_mir/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
2424
#![feature(box_syntax)]
2525
#![feature(crate_visibility_modifier)]
2626
#![feature(core_intrinsics)]
27+
#![feature(const_fn)]
2728
#![feature(decl_macro)]
2829
#![cfg_attr(stage0, feature(macro_vis_matcher))]
2930
#![feature(exhaustive_patterns)]

0 commit comments

Comments
 (0)