File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ macro_rules! newtype_index {
136
136
] ;
137
137
138
138
unsafe {
139
- $type:: from_u32_unchecked ( value)
139
+ $type { private : value }
140
140
}
141
141
}
142
142
@@ -153,13 +153,13 @@ macro_rules! newtype_index {
153
153
154
154
/// Extract value of this index as a usize.
155
155
#[ inline]
156
- $v const fn as_u32( self ) -> u32 {
156
+ $v fn as_u32( self ) -> u32 {
157
157
self . private
158
158
}
159
159
160
160
/// Extract value of this index as a u32.
161
161
#[ inline]
162
- $v const fn as_usize( self ) -> usize {
162
+ $v fn as_usize( self ) -> usize {
163
163
self . as_u32( ) as usize
164
164
}
165
165
}
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
24
24
#![ feature( box_syntax) ]
25
25
#![ feature( crate_visibility_modifier) ]
26
26
#![ feature( core_intrinsics) ]
27
+ #![ feature( const_fn) ]
27
28
#![ feature( decl_macro) ]
28
29
#![ cfg_attr( stage0, feature( macro_vis_matcher) ) ]
29
30
#![ feature( exhaustive_patterns) ]
You can’t perform that action at this time.
0 commit comments