Hands-on Rust: Example code fails to run without crashing

@herbert

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.

@herbert

I did find that if if I locked the bracket-terminal version to 0.8.5, the example code, compiles and runs correctly and without panics.

I compared the Cargo.lock in the base directory of the HandOn... repo and the copied example and noticed the bracket-terminal versions were different.

Since I am new to rust, I am still trying to discern why they are different.