Skip to content

Commit 71e0978

Browse files
committed
change offset from u32 to u64
1 parent dba162a commit 71e0978

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

src/librustc_middle/mir/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,7 @@ pub enum ProjectionElem<V, T> {
15311531
/// ```
15321532
ConstantIndex {
15331533
/// index or -index (in Python terms), depending on from_end
1534-
offset: u32,
1534+
offset: u64,
15351535
/// The thing being indexed must be at least this long. For arrays this
15361536
/// is always the exact length.
15371537
min_length: u32,
@@ -1545,8 +1545,8 @@ pub enum ProjectionElem<V, T> {
15451545
/// If `from_end` is true `slice[from..slice.len() - to]`.
15461546
/// Otherwise `array[from..to]`.
15471547
Subslice {
1548-
from: u32,
1549-
to: u32,
1548+
from: u64,
1549+
to: u64,
15501550
/// Whether `to` counts from the start or end of the array/slice.
15511551
/// For `PlaceElem`s this is `true` if and only if the base is a slice.
15521552
/// For `ProjectionKind`, this can also be `true` for arrays.

src/librustc_mir/borrow_check/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,8 +1693,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
16931693
desired_action: InitializationRequiringAction,
16941694
place_span: (PlaceRef<'tcx>, Span),
16951695
maybe_uninits: &BitSet<MovePathIndex>,
1696-
from: u32,
1697-
to: u32,
1696+
from: u64,
1697+
to: u64,
16981698
) {
16991699
if let Some(mpi) = self.move_path_for_place(place_span.0) {
17001700
let move_paths = &self.move_data.move_paths;

src/librustc_mir/borrow_check/type_check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
649649
PlaceTy::from_ty(match base_ty.kind {
650650
ty::Array(inner, _) => {
651651
assert!(!from_end, "array subslices should not use from_end");
652-
tcx.mk_array(inner, (to - from) as u64)
652+
tcx.mk_array(inner, (to - from))
653653
}
654654
ty::Slice(..) => {
655655
assert!(from_end, "slice subslices should use from_end");

src/librustc_mir/util/aggregate.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,12 @@ pub fn expand_aggregate<'tcx>(
5353
.map(move |(i, (op, ty))| {
5454
let lhs_field = if let AggregateKind::Array(_) = kind {
5555
// FIXME(eddyb) `offset` should be u64.
56-
let offset = i as u32;
56+
let offset = i as u64;
5757
assert_eq!(offset as usize, i);
5858
tcx.mk_place_elem(
5959
lhs,
6060
ProjectionElem::ConstantIndex {
6161
offset,
62-
// FIXME(eddyb) `min_length` doesn't appear to be used.
6362
min_length: offset + 1,
6463
from_end: false,
6564
},

src/librustc_mir/util/elaborate_drops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ where
744744
let tcx = self.tcx();
745745

746746
if let Some(size) = opt_size {
747-
let size: u32 = size.try_into().unwrap_or_else(|_| {
747+
let size: u64 = size.try_into().unwrap_or_else(|_| {
748748
bug!("move out check isn't implemented for array sizes bigger than u32::MAX");
749749
});
750750
let fields: Vec<(Place<'tcx>, Option<D::Path>)> = (0..size)

0 commit comments

Comments
 (0)