Mercurial > touhou
diff examples/stagerunner.rs @ 743:0fed350d1778
examples: Remove deprecated std::mem::uninitialized().
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Tue, 07 Jan 2020 12:34:11 +0100 |
parents | 0a250ddfae79 |
children | 5e5e7136ac92 |
line wrap: on
line diff
--- a/examples/stagerunner.rs +++ b/examples/stagerunner.rs @@ -128,7 +128,10 @@ fn main() { let game = Rc::new(RefCell::new(game)); assert_eq!(std::mem::size_of::<Vertex>(), std::mem::size_of::<FakeVertex>()); - let vertices: [Vertex; 4] = unsafe { std::mem::uninitialized() }; + let vertices: [Vertex; 4] = { + let data = std::mem::MaybeUninit::uninit(); + unsafe { data.assume_init() } + }; let mut surface = GlfwSurface::new(WindowDim::Windowed(384, 448), "Touhou", WindowOpt::default()).unwrap();