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:
commit
bbc1109b79
4 changed files with 186 additions and 27 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue