Copying the example code from GitHub - thebracket/HandsOnRust: The source code that accompanies Hands-on Rust: Effective Learning through 2D Game Development and Play by Herbert Wolverson, phase by phase, and running cargo run
produces an executable that crashes with a panic.
For example, copying the entire contents of HandsOnRust/EntitiesComponentsAndSystems/playerecs/ and then building:
Finished `dev` profile [unoptimized + debuginfo] target(s) in 24.19s
Running `target/debug/playerecs`
thread 'main' panicked at library/core/src/panicking.rs:220:5:
unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread caused non-unwinding panic. aborting.
Aborted (core dumped)
When the same code is build within the repo directories, it builds and runs without an error.
I do not yet understand why this is different.