Auto merge of #147145 - Zalathar:rollup-s7kcs3w, r=Zalathar

Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#147100 (tests: Remove ignore-android directive for fixed issue)
 - rust-lang/rust#147116 (compiler: remove AbiAlign inside TargetDataLayout)
 - rust-lang/rust#147134 (remove explicit deref of AbiAlign for most methods)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2025-09-29 08:43:49 +00:00
commit e7ad0d7439
4 changed files with 8 additions and 8 deletions

View file

@ -150,7 +150,7 @@ fn check_size_and_align(
) {
let l = eval_goal(ra_fixture, minicore).unwrap();
assert_eq!(l.size.bytes(), size, "size mismatch");
assert_eq!(l.align.abi.bytes(), align, "align mismatch");
assert_eq!(l.align.bytes(), align, "align mismatch");
}
#[track_caller]
@ -162,7 +162,7 @@ fn check_size_and_align_expr(
) {
let l = eval_expr(ra_fixture, minicore).unwrap();
assert_eq!(l.size.bytes(), size, "size mismatch");
assert_eq!(l.align.abi.bytes(), align, "align mismatch");
assert_eq!(l.align.bytes(), align, "align mismatch");
}
#[track_caller]

View file

@ -2085,7 +2085,7 @@ impl<'db> Evaluator<'db> {
if let Some(layout) = self.layout_cache.borrow().get(&ty.to_nextsolver(interner)) {
return Ok(layout
.is_sized()
.then(|| (layout.size.bytes_usize(), layout.align.abi.bytes() as usize)));
.then(|| (layout.size.bytes_usize(), layout.align.bytes() as usize)));
}
if let DefWithBodyId::VariantId(f) = locals.body.owner
&& let Some((AdtId::EnumId(e), _)) = ty.as_adt()
@ -2104,7 +2104,7 @@ impl<'db> Evaluator<'db> {
let layout = layout?;
Ok(layout
.is_sized()
.then(|| (layout.size.bytes_usize(), layout.align.abi.bytes() as usize)))
.then(|| (layout.size.bytes_usize(), layout.align.bytes() as usize)))
}
/// A version of `self.size_of` which returns error if the type is unsized. `what` argument should
@ -2797,7 +2797,7 @@ impl<'db> Evaluator<'db> {
)?;
// FIXME: there is some leak here
let size = layout.size.bytes_usize();
let addr = self.heap_allocate(size, layout.align.abi.bytes() as usize)?;
let addr = self.heap_allocate(size, layout.align.bytes() as usize)?;
self.write_memory(addr, &result)?;
IntervalAndTy { interval: Interval { addr, size }, ty }
};

View file

@ -767,7 +767,7 @@ impl Evaluator<'_> {
"align_of generic arg is not provided".into(),
));
};
let align = self.layout(ty.to_nextsolver(interner))?.align.abi.bytes();
let align = self.layout(ty.to_nextsolver(interner))?.align.bytes();
destination.write_from_bytes(self, &align.to_le_bytes()[0..destination.size])
}
"size_of_val" => {
@ -1431,7 +1431,7 @@ impl Evaluator<'_> {
field_types.iter().next_back().unwrap().1.clone().substitute(Interner, subst);
let sized_part_size =
layout.fields.offset(field_types.iter().count() - 1).bytes_usize();
let sized_part_align = layout.align.abi.bytes() as usize;
let sized_part_align = layout.align.bytes() as usize;
let (unsized_part_size, unsized_part_align) =
self.size_align_of_unsized(&last_field_ty, metadata, locals)?;
let align = sized_part_align.max(unsized_part_align) as isize;

View file

@ -6094,7 +6094,7 @@ impl Layout {
}
pub fn align(&self) -> u64 {
self.0.align.abi.bytes()
self.0.align.bytes()
}
pub fn niches(&self) -> Option<u128> {