Skip to content

Commit 479251d

Browse files
committed
some more changes
1 parent ed9d6c3 commit 479251d

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

src/librustc_middle/mir/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2496,7 +2496,7 @@ impl<'tcx> UserTypeProjections {
24962496
self.map_projections(|pat_ty_proj| pat_ty_proj.index())
24972497
}
24982498

2499-
pub fn subslice(self, from: u32, to: u32) -> Self {
2499+
pub fn subslice(self, from: u64, to: u64) -> Self {
25002500
self.map_projections(|pat_ty_proj| pat_ty_proj.subslice(from, to))
25012501
}
25022502

@@ -2542,7 +2542,7 @@ impl UserTypeProjection {
25422542
self
25432543
}
25442544

2545-
pub(crate) fn subslice(mut self, from: u32, to: u32) -> Self {
2545+
pub(crate) fn subslice(mut self, from: u64, to: u64) -> Self {
25462546
self.projs.push(ProjectionElem::Subslice { from, to, from_end: true });
25472547
self
25482548
}

src/librustc_mir/transform/elaborate_drops.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,10 @@ impl<'a, 'b, 'tcx> DropElaborator<'a, 'tcx> for Elaborator<'a, 'b, 'tcx> {
218218
})
219219
}
220220

221-
fn array_subpath(&self, path: Self::Path, index: u32, size: u32) -> Option<Self::Path> {
221+
fn array_subpath(&self, path: Self::Path, index: u64, size: u64) -> Option<Self::Path> {
222222
dataflow::move_path_children_matching(self.ctxt.move_data(), path, |e| match e {
223223
ProjectionElem::ConstantIndex { offset, min_length, from_end } => {
224-
debug_assert!(size == *min_length, "min_length should be exact for arrays");
224+
debug_assert!(size == *min_length as u64, "min_length should be exact for arrays");
225225
assert!(!from_end, "from_end should not be used for array element ConstantIndex");
226226
*offset == index
227227
}

src/librustc_mir/util/aggregate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ pub fn expand_aggregate<'tcx>(
5252
.enumerate()
5353
.map(move |(i, (op, ty))| {
5454
let lhs_field = if let AggregateKind::Array(_) = kind {
55-
// FIXME(eddyb) `offset` should be u64.
5655
let offset = i as u64;
5756
assert_eq!(offset as usize, i);
5857
tcx.mk_place_elem(

src/librustc_mir/util/elaborate_drops.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub trait DropElaborator<'a, 'tcx>: fmt::Debug {
8888
fn field_subpath(&self, path: Self::Path, field: Field) -> Option<Self::Path>;
8989
fn deref_subpath(&self, path: Self::Path) -> Option<Self::Path>;
9090
fn downcast_subpath(&self, path: Self::Path, variant: VariantIdx) -> Option<Self::Path>;
91-
fn array_subpath(&self, path: Self::Path, index: u32, size: u32) -> Option<Self::Path>;
91+
fn array_subpath(&self, path: Self::Path, index: u64, size: u64) -> Option<Self::Path>;
9292
}
9393

9494
#[derive(Debug)]
@@ -676,7 +676,7 @@ where
676676

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

0 commit comments

Comments
 (0)