1
Fork 0

Rollup merge of #114587 - ouz-a:smir_allocation, r=oli-obk

Convert Const to Allocation in smir

Continuation of previous pr https://github.com/rust-lang/rust/pull/114466

cc https://github.com/rust-lang/project-stable-mir/issues/15

r? `@oli-obk`
This commit is contained in:
Matthias Krüger 2023-08-09 23:00:00 +02:00 committed by GitHub
commit bbc1109b79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 186 additions and 27 deletions

View file

@ -329,6 +329,9 @@ impl<Prov: Provenance, Bytes: AllocBytes> Allocation<Prov, (), Bytes> {
/// Try to create an Allocation of `size` bytes, panics if there is not enough memory
/// available to the compiler to do so.
///
/// Example use case: To obtain an Allocation filled with specific data,
/// first call this function and then call write_scalar to fill in the right data.
pub fn uninit(size: Size, align: Align) -> Self {
match Self::uninit_inner(size, align, || {
panic!("Allocation::uninit called with panic_on_fail had allocation failure");