Files
rust/src/test/codegen/box-maybe-uninit.rs

14 lines
342 B
Rust
Raw Normal View History

2018-09-20 20:57:25 +02:00
// compile-flags: -O
#![crate_type="lib"]
#![feature(maybe_uninit)]
use std::mem::MaybeUninit;
// Boxing a `MaybeUninit` value should not copy junk from the stack
#[no_mangle]
pub fn box_uninitialized() -> Box<MaybeUninit<usize>> {
// CHECK-LABEL: @box_uninitialized
// CHECK-NOT: store
Box::new(MaybeUninit::uninitialized())
}