PistonDevelopers / piston

A modular game engine written in Rust

Home Page:https://www.piston.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

thread 'main' panicked at 'attempted to zero-initialize type `glutin::ContextWrapper<glutin::PossiblyCurrent, glutin::Window>`, which is invalid'

watcher00090 opened this issue · comments

Hello,

I copied the quick example from the homepage of the Piston website and tried to run it on my machine. However, I'm getting the following runtime error:

thread 'main' panicked at 'attempted to zero-initialize type glutin::ContextWrapper<glutin::PossiblyCurrent, glutin::Window>, which is invalid', C:\Users\pcp071098.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\mem\mod.rs:622:9
stack backtrace:
0: std::panicking::begin_panic_handler
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library\std\src\panicking.rs:483
1: core::panicking::panic_fmt
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library\core\src\panicking.rs:85
2: core::panicking::panic
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library\core\src\panicking.rs:50
3: core::mem::zeroed
at C:\Users\pcp071098.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\mem\mod.rs:622
4: glutin_window::{{impl}}::make_current
at C:\Users\pcp071098.cargo\registry\src\github.com-1ecc6299db9ec823\pistoncore-glutin_window-0.67.0\src\lib.rs:539
5: piston_window::PistonWindow<glutin_window::GlutinWindow>::draw_2d<glutin_window::GlutinWindow,input::Event,closure-0,tuple<>>
at C:\Users\pcp071098.cargo\registry\src\github.com-1ecc6299db9ec823\piston_window-0.116.0\src\lib.rs:286
6: chinese_checkers::main
at .\src\main.rs:10
7: core::ops::function::FnOnce::call_once<fn(),tuple<>>
at C:\Users\pcp071098.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:227
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.
error: process didn't exit successfully: target\debug\chinese_checkers.exe (exit code: 101)

Our only dependency at the moment is:

[dependencies]
piston_window = "0.116.0"

System:
Windows 10 Pro
rustc 1.48.0 (7eac88abb 2020-11-16)
cargo 1.48.0 (65cbdd2dc 2020-10-14)

Thank you,
James

After adding the dependencies piston = "0.52.1" and piston2d-graphics = "0.39.0" to the Cargo.toml the error went away.