File tree Expand file tree Collapse file tree 4 files changed +10
-1
lines changed Expand file tree Collapse file tree 4 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -406,7 +406,7 @@ impl DepGraph {
406406 for ( current_dep_node_index, edges) in current_dep_graph. edges . iter_enumerated ( ) {
407407 let start = edge_list_data. len ( ) as u32 ;
408408 // 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 ) ) ) ;
410410 let end = edge_list_data. len ( ) as u32 ;
411411
412412 debug_assert_eq ! ( current_dep_node_index. index( ) , edge_list_indices. len( ) ) ;
Original file line number Diff line number Diff line change 4343#![ feature( box_patterns) ]
4444#![ feature( box_syntax) ]
4545#![ feature( conservative_impl_trait) ]
46+ #![ feature( const_fn) ]
4647#![ feature( core_intrinsics) ]
4748#![ feature( i128_type) ]
4849#![ cfg_attr( windows, feature( libc) ) ]
Original file line number Diff line number Diff line change @@ -49,6 +49,13 @@ macro_rules! newtype_index {
4949 RustcEncodable , RustcDecodable ) ]
5050 pub struct $name( u32 ) ;
5151
52+ impl $name {
53+ // HACK use for constants
54+ pub const fn const_new( x: u32 ) -> Self {
55+ $name( x)
56+ }
57+ }
58+
5259 impl Idx for $name {
5360 fn new( value: usize ) -> Self {
5461 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!
1818
1919#![ feature( box_patterns) ]
2020#![ feature( box_syntax) ]
21+ #![ feature( const_fn) ]
2122#![ feature( core_intrinsics) ]
2223#![ feature( i128_type) ]
2324#![ feature( rustc_diagnostic_macros) ]
You can’t perform that action at this time.
0 commit comments