Just pass Layout directly to box_new_uninit

We have a constant for it already (used in `RawVec` for basically the same polymorphization) so let's use it.

Conveniently, it can even be safe that way!
This commit is contained in:
Scott McMurray
2026-02-16 16:39:32 -08:00
parent 3c9faa0d03
commit 1b767bf623
7 changed files with 97 additions and 186 deletions
@@ -45,8 +45,6 @@ pub fn foo2() -> Box<dyn TestTrait2> {
//~ MONO_ITEM fn foo2
//~ MONO_ITEM fn std::alloc::Global::alloc_impl_runtime
//~ 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 {