File tree 4 files changed +10
-1
lines changed
4 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -406,7 +406,7 @@ impl DepGraph {
406
406
for ( current_dep_node_index, edges) in current_dep_graph. edges . iter_enumerated ( ) {
407
407
let start = edge_list_data. len ( ) as u32 ;
408
408
// This should really just be a memcpy :/
409
- edge_list_data. extend ( edges. iter ( ) . map ( |i| SerializedDepNodeIndex ( i. index ) ) ) ;
409
+ edge_list_data. extend ( edges. iter ( ) . map ( |i| SerializedDepNodeIndex ( i. index ( ) as u32 ) ) ) ;
410
410
let end = edge_list_data. len ( ) as u32 ;
411
411
412
412
debug_assert_eq ! ( current_dep_node_index. index( ) , edge_list_indices. len( ) ) ;
Original file line number Diff line number Diff line change 43
43
#![ feature( box_patterns) ]
44
44
#![ feature( box_syntax) ]
45
45
#![ feature( conservative_impl_trait) ]
46
+ #![ feature( const_fn) ]
46
47
#![ feature( core_intrinsics) ]
47
48
#![ feature( i128_type) ]
48
49
#![ cfg_attr( windows, feature( libc) ) ]
Original file line number Diff line number Diff line change @@ -49,6 +49,13 @@ macro_rules! newtype_index {
49
49
RustcEncodable , RustcDecodable ) ]
50
50
pub struct $name( u32 ) ;
51
51
52
+ impl $name {
53
+ // HACK use for constants
54
+ pub const fn const_new( x: u32 ) -> Self {
55
+ $name( x)
56
+ }
57
+ }
58
+
52
59
impl Idx for $name {
53
60
fn new( value: usize ) -> Self {
54
61
assert!( value < ( :: std:: u32 :: MAX ) as usize ) ;
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
18
18
19
19
#![ feature( box_patterns) ]
20
20
#![ feature( box_syntax) ]
21
+ #![ feature( const_fn) ]
21
22
#![ feature( core_intrinsics) ]
22
23
#![ feature( i128_type) ]
23
24
#![ feature( rustc_diagnostic_macros) ]
You can’t perform that action at this time.
0 commit comments