about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc/metadata/tydecode.rs3
-rw-r--r--src/librustc/middle/region.rs8
2 files changed, 5 insertions, 6 deletions
diff --git a/src/librustc/metadata/tydecode.rs b/src/librustc/metadata/tydecode.rs
index 59f938d9489..7a111003aa8 100644
--- a/src/librustc/metadata/tydecode.rs
+++ b/src/librustc/metadata/tydecode.rs
@@ -269,7 +269,7 @@ impl<'a,'tcx> TyDecoder<'a,'tcx> {
                 assert_eq!(self.next(), '[');
                 let node_id = self.parse_uint() as ast::NodeId;
                 assert_eq!(self.next(), '|');
-                let first_stmt_index = self.parse_uint();
+                let first_stmt_index = self.parse_u32();
                 assert_eq!(self.next(), ']');
                 let block_remainder = region::BlockRemainder {
                     block: node_id, first_statement_index: first_stmt_index,
@@ -717,4 +717,3 @@ fn parse_unsafety(c: char) -> ast::Unsafety {
         _ => panic!("parse_unsafety: bad unsafety {}", c)
     }
 }
-
diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs
index dafc1e900f3..5ccbffa40a3 100644
--- a/src/librustc/middle/region.rs
+++ b/src/librustc/middle/region.rs
@@ -144,7 +144,7 @@ impl DestructionScopeData {
          RustcDecodable, Debug, Copy)]
 pub struct BlockRemainder {
     pub block: ast::NodeId,
-    pub first_statement_index: usize,
+    pub first_statement_index: u32,
 }
 
 impl CodeExtent {
@@ -207,7 +207,7 @@ impl CodeExtent {
                         //
                         // (This is the special case aluded to in the
                         // doc-comment for this method)
-                        let stmt_span = blk.stmts[r.first_statement_index].span;
+                        let stmt_span = blk.stmts[r.first_statement_index as usize].span;
                         Some(Span { lo: stmt_span.hi, ..blk.span })
                     }
                 }
@@ -310,7 +310,7 @@ impl InnermostDeclaringBlock {
 struct DeclaringStatementContext {
     stmt_id: ast::NodeId,
     block_id: ast::NodeId,
-    stmt_index: usize,
+    stmt_index: u32,
 }
 
 impl DeclaringStatementContext {
@@ -711,7 +711,7 @@ fn resolve_block(visitor: &mut RegionResolutionVisitor, blk: &ast::Block) {
                 let declaring = DeclaringStatementContext {
                     stmt_id: stmt_id,
                     block_id: blk.id,
-                    stmt_index: i,
+                    stmt_index: i as u32,
                 };
                 record_superlifetime(
                     visitor, declaring.to_code_extent(), statement.span);