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 99#![ feature( cfg_target_has_atomic) ]
1010#![ feature( const_assume) ]
1111#![ feature( const_cell_into_inner) ]
12+ #![ feature( const_convert) ]
1213#![ feature( const_maybe_uninit_assume_init) ]
14+ #![ feature( const_num_from_num) ]
1315#![ feature( const_ptr_read) ]
1416#![ feature( const_ptr_write) ]
1517#![ feature( const_ptr_offset) ]
1618#![ feature( const_trait_impl) ]
17- #![ feature( const_num_from_num) ]
1819#![ feature( core_intrinsics) ]
1920#![ feature( core_private_bignum) ]
2021#![ feature( core_private_diy_float) ]
@@ -84,6 +85,7 @@ mod char;
8485mod clone;
8586mod cmp;
8687mod const_ptr;
88+ mod convert;
8789mod fmt;
8890mod hash;
8991mod intrinsics;
You can’t perform that action at this time.
0 commit comments