Skip to content

Commit ed9d6c3

Browse files
committed
change offset from u32 to u64
1 parent 08dfbfb commit ed9d6c3

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
@@ -1807,7 +1807,7 @@ pub enum ProjectionElem<V, T> {
18071807
/// ```
18081808
ConstantIndex {
18091809
/// index or -index (in Python terms), depending on from_end
1810-
offset: u32,
1810+
offset: u64,
18111811
/// The thing being indexed must be at least this long. For arrays this
18121812
/// is always the exact length.
18131813
min_length: u32,
@@ -1821,8 +1821,8 @@ pub enum ProjectionElem<V, T> {
18211821
/// If `from_end` is true `slice[from..slice.len() - to]`.
18221822
/// Otherwise `array[from..to]`.
18231823
Subslice {
1824-
from: u32,
1825-
to: u32,
1824+
from: u64,
1825+
to: u64,
18261826
/// Whether `to` counts from the start or end of the array/slice.
18271827
/// For `PlaceElem`s this is `true` if and only if the base is a slice.
18281828
/// 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
@@ -1595,8 +1595,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
15951595
desired_action: InitializationRequiringAction,
15961596
place_span: (PlaceRef<'tcx>, Span),
15971597
maybe_uninits: &BitSet<MovePathIndex>,
1598-
from: u32,
1599-
to: u32,
1598+
from: u64,
1599+
to: u64,
16001600
) {
16011601
if let Some(mpi) = self.move_path_for_place(place_span.0) {
16021602
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
@@ -645,7 +645,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
645645
PlaceTy::from_ty(match base_ty.kind {
646646
ty::Array(inner, _) => {
647647
assert!(!from_end, "array subslices should not use from_end");
648-
tcx.mk_array(inner, (to - from) as u64)
648+
tcx.mk_array(inner, (to - from))
649649
}
650650
ty::Slice(..) => {
651651
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
@@ -675,7 +675,7 @@ where
675675
let tcx = self.tcx();
676676

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

0 commit comments

Comments
 (0)