]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/box-maybe-uninit.rs
Rollup merge of #56425 - scottmcm:redo-vec-set_len-docs, r=Centril
[rust.git] / src / test / codegen / box-maybe-uninit.rs
1 // compile-flags: -O
2 #![crate_type="lib"]
3 #![feature(maybe_uninit)]
4
5 use std::mem::MaybeUninit;
6
7 // Boxing a `MaybeUninit` value should not copy junk from the stack
8 #[no_mangle]
9 pub fn box_uninitialized() -> Box<MaybeUninit<usize>> {
10     // CHECK-LABEL: @box_uninitialized
11     // CHECK-NOT: store
12     Box::new(MaybeUninit::uninitialized())
13 }