1
Fork 0

place evaluation: require the original pointer to be aligned if an access happens

This commit is contained in:
Ralf Jung 2023-09-05 15:12:18 +02:00
parent ea9a24e32e
commit f3f9b795bd
22 changed files with 266 additions and 219 deletions

View file

@ -267,6 +267,7 @@ where
let len = base.len(self)?;
let field_layout = base.layout().field(self, 0);
// Ensure that all the offsets are in-bounds once, up-front.
debug!("project_array_fields: {base:?} {len}");
base.offset(len * stride, self.layout_of(self.tcx.types.unit).unwrap(), self)?;
// Create the iterator.
Ok(ArrayIterator { base, range: 0..len, stride, field_layout, _phantom: PhantomData })