Skip to content

Commit f976c94

Browse files
committed
mir: Use usize instead of u32 for indexing slices.
1 parent f3f9de7 commit f976c94

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc_trans/trans/mir/lvalue.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use trans::abi;
1616
use trans::adt;
1717
use trans::base;
1818
use trans::builder::Builder;
19-
use trans::common::{self, BlockAndBuilder};
19+
use trans::common::{self, BlockAndBuilder, C_uint};
2020
use trans::consts;
2121
use trans::machine;
2222
use trans::mir::drop;
@@ -181,13 +181,13 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
181181
mir::ProjectionElem::ConstantIndex { offset,
182182
from_end: false,
183183
min_length: _ } => {
184-
let lloffset = common::C_u32(bcx.ccx(), offset);
184+
let lloffset = C_uint(bcx.ccx(), offset);
185185
project_index(self.prepare_index(bcx, lloffset))
186186
}
187187
mir::ProjectionElem::ConstantIndex { offset,
188188
from_end: true,
189189
min_length: _ } => {
190-
let lloffset = common::C_u32(bcx.ccx(), offset);
190+
let lloffset = C_uint(bcx.ccx(), offset);
191191
let lllen = self.lvalue_len(bcx, tr_base);
192192
let llindex = bcx.sub(lllen, lloffset);
193193
project_index(self.prepare_index(bcx, llindex))

0 commit comments

Comments
 (0)