rust/tests/pass/move-uninit-primval.rs

15 lines
202 B
Rust
Raw Normal View History

2019-07-06 02:33:22 -05:00
#![allow(deprecated)]
2022-07-09 09:13:19 -05:00
use std::mem;
2016-12-21 19:26:52 -06:00
struct Foo {
2022-07-09 09:13:19 -05:00
_inner: mem::MaybeUninit<i32>,
2016-12-21 19:26:52 -06:00
}
fn main() {
unsafe {
2022-07-09 09:13:19 -05:00
let foo = Foo { _inner: mem::uninitialized() };
2016-12-21 19:26:52 -06:00
let _bar = foo;
}
}