Auto merge of #149690 - RustyYato:inline-layout-helper, r=saethlin

Add `#[inline]` to `Layout::is_size_align_valid`

Fixes rust-lang/rust#149687

r? `@saethlin`
This commit is contained in:
bors 2025-12-07 13:43:57 +00:00
commit 1d6c526bb0
2 changed files with 2 additions and 0 deletions

View file

@ -65,6 +65,7 @@ impl Layout {
}
}
#[inline]
const fn is_size_align_valid(size: usize, align: usize) -> bool {
let Some(align) = Alignment::new(align) else { return false };
if size > Self::max_size_for_align(align) {

View file

@ -47,6 +47,7 @@ pub fn foo2() -> Box<dyn TestTrait2> {
//~ MONO_ITEM fn std::alloc::Global::alloc_impl
//~ MONO_ITEM fn std::boxed::Box::<TestStruct2>::new
//~ MONO_ITEM fn std::alloc::Layout::from_size_align_unchecked::precondition_check
//~ MONO_ITEM fn std::ptr::Alignment::new_unchecked::precondition_check
//~ MONO_ITEM fn std::ptr::NonNull::<T>::new_unchecked::precondition_check
struct Counter {