File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 3
3
#![ feature( const_maybe_uninit_assume_init) ]
4
4
#![ feature( const_slice_from_raw_parts_mut) ]
5
5
#![ feature( maybe_uninit_array_assume_init) ]
6
+ #![ feature( const_intoiterator_identity) ]
6
7
#![ feature( maybe_uninit_uninit_array) ]
7
8
#![ feature( const_precise_live_drops) ]
8
9
#![ feature( const_raw_ptr_comparison) ]
24
25
#![ feature( const_option) ]
25
26
#![ feature( const_deref) ]
26
27
#![ feature( const_heap) ]
28
+ #![ feature( const_iter) ]
27
29
#![ feature( const_swap) ]
28
30
#![ feature( never_type) ] // `!`
29
31
#![ feature( decl_macro) ]
32
+ #![ feature( const_for) ]
30
33
#![ feature( doc_cfg) ] // `#[doc(cfg(...))]`
31
34
#![ deny( unsafe_op_in_unsafe_fn) ]
32
35
#![ cfg_attr(
Original file line number Diff line number Diff line change @@ -209,11 +209,10 @@ fn ctz_array_lut<const LEN: usize>(x: usize) -> u32 {
209
209
impl < const LEN : usize > LutTrait for Lut < LEN > {
210
210
const LUT : & ' static [ u8 ] = & {
211
211
let mut array = [ 0u8 ; LEN ] ;
212
- // `for ` is unusable in `const fn` [ref:const_for ]
213
- let mut i = 0 ;
214
- while i < array. len ( ) {
212
+ // `[T]::iter_mut ` is unusable in `const fn` [ref:const_slice_iter ]
213
+ // `core::array::from_fn` is not `const fn` [ref:const_array_from_fn]
214
+ for i in 0 .. array. len ( ) {
215
215
array[ i] = i. trailing_zeros ( ) as u8 ;
216
- i += 1 ;
217
216
}
218
217
array
219
218
} ;
You can’t perform that action at this time.
0 commit comments