File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change
1
+ #[ test]
2
+ fn convert ( ) {
3
+ const fn from ( x : i32 ) -> i32 {
4
+ i32:: from ( x)
5
+ }
6
+
7
+ const FOO : i32 = from ( 42 ) ;
8
+ assert_eq ! ( FOO , 42 ) ;
9
+
10
+ const fn into ( x : Vec < String > ) -> Vec < String > {
11
+ x. into ( )
12
+ }
13
+
14
+ const BAR : Vec < String > = into ( Vec :: new ( ) ) ;
15
+ assert_eq ! ( BAR , Vec :: <String >:: new( ) ) ;
16
+ }
Original file line number Diff line number Diff line change 9
9
#![ feature( cfg_target_has_atomic) ]
10
10
#![ feature( const_assume) ]
11
11
#![ feature( const_cell_into_inner) ]
12
+ #![ feature( const_convert) ]
12
13
#![ feature( const_maybe_uninit_assume_init) ]
14
+ #![ feature( const_num_from_num) ]
13
15
#![ feature( const_ptr_read) ]
14
16
#![ feature( const_ptr_write) ]
15
17
#![ feature( const_ptr_offset) ]
16
18
#![ feature( const_trait_impl) ]
17
- #![ feature( const_num_from_num) ]
18
19
#![ feature( core_intrinsics) ]
19
20
#![ feature( core_private_bignum) ]
20
21
#![ feature( core_private_diy_float) ]
@@ -84,6 +85,7 @@ mod char;
84
85
mod clone;
85
86
mod cmp;
86
87
mod const_ptr;
88
+ mod convert;
87
89
mod fmt;
88
90
mod hash;
89
91
mod intrinsics;
You can’t perform that action at this time.
0 commit comments