]> git.lizzy.rs Git - rust.git/commitdiff
mir: Use usize instead of u32 for indexing slices.
authorEduard Burtescu <edy.burt@gmail.com>
Thu, 10 Mar 2016 00:03:00 +0000 (02:03 +0200)
committerEduard Burtescu <edy.burt@gmail.com>
Thu, 17 Mar 2016 19:51:55 +0000 (21:51 +0200)
src/librustc_trans/trans/mir/lvalue.rs

index b6f942c4637e3a383c41ce0eb8414aef59e34a19..a8c675493806ff5c3bed3015136bd09b9e5747dd 100644 (file)
@@ -16,7 +16,7 @@
 use trans::adt;
 use trans::base;
 use trans::builder::Builder;
-use trans::common::{self, BlockAndBuilder};
+use trans::common::{self, BlockAndBuilder, C_uint};
 use trans::consts;
 use trans::machine;
 use trans::mir::drop;
@@ -181,13 +181,13 @@ pub fn trans_lvalue(&mut self,
                     mir::ProjectionElem::ConstantIndex { offset,
                                                          from_end: false,
                                                          min_length: _ } => {
-                        let lloffset = common::C_u32(bcx.ccx(), offset);
+                        let lloffset = C_uint(bcx.ccx(), offset);
                         project_index(self.prepare_index(bcx, lloffset))
                     }
                     mir::ProjectionElem::ConstantIndex { offset,
                                                          from_end: true,
                                                          min_length: _ } => {
-                        let lloffset = common::C_u32(bcx.ccx(), offset);
+                        let lloffset = C_uint(bcx.ccx(), offset);
                         let lllen = self.lvalue_len(bcx, tr_base);
                         let llindex = bcx.sub(lllen, lloffset);
                         project_index(self.prepare_index(bcx, llindex))