Skip to content

Conversation

@fpdotmonkey
Copy link

Layout::array was updated in rust-lang/rust@a32305a8 to check that array sizes fit in isize::MAX, so I've propogated the change to vec-alloc here.

Layout::array was updated in rust-lang/rust@a32305a8
to check that array sizes fit in isize::MAX, so I've propogated the
change to vec-alloc here.
@fpdotmonkey
Copy link
Author

I'm curious if the expect could be moved into the else block. This would mean you wouldn't get the nice error message for the case of [T; 1] where size_of::<T>() > isize::MAX, but is that actually possible to make?

@scottmcm
Copy link
Member

scottmcm commented Nov 8, 2025

Correct, no allocation or type in rust can have size greater than isize::MAX -- that's how the alloc::Layout type can use the unchecked constructor from size_of+align_of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants