Repository: thomas-mauran/chess-tui (language: rust)

Issue:
Failed to build with latest nightly rustc.
<!--
Hi there, sorry `chess-tui` is not working as expected.
Please fill this bug report conscientiously.
A detailed and complete issue is more likely to be processed quickly.
-->

## Description
Failed to build with latest rustc due to deprecated feature `[stdsimd]` in `ahash`. Successfully built when use `rustc 1.78.0-nightly (b11fbfbf3 2024-02-03)` (an older nightly version) or stable rustc.
<!--
A clear and concise description of what the bug is.
-->

## To Reproduce
```shell
rustup update
rustup default nightly # should be 1.85.0 in 2024-12-04
git clone https://github.com/thomas-mauran/chess-tui
cd chess-tui
cargo build --release
```
<!--
Try to reduce the issue to a simple code sample exhibiting the problem.
Ideally, fork the project and add a test or an example.
-->

## Expected behavior
Built successfully.
<!--
A clear and concise description of what you expected to happen.
-->

## Error message

<!--
If applicable, add screenshots, gifs or videos to help explain your problem.
-->

```
cargo build --release
   Compiling ahash v0.8.6
error[E0635]: unknown feature `stdsimd`
  --> ~/.cargo/registry/src/rsproxy.cn-0dccff568467c15b/ahash-0.8.6/src/lib.rs:99:42
   |
99 | #![cfg_attr(feature = "stdsimd", feature(stdsimd))]
   |                                          ^^^^^^^

For more information about this error, try `rustc --explain E0635`.
error: could not compile `ahash` (lib) due to 1 previous error
```

## Environment

<!--
Add a description of the systems where you are observing the issue. For example:
- OS: Linux
- Terminal Emulator: xterm
- Font: Inconsolata (Patched)
- Crate version: 0.7
- Backend: termion
-->

- OS: Ubuntu 22.04.5 LTS on Windows 10 x86_64
- Terminal Emulator: vscode
- Font: consolas
- Crate version: 1.5.0
- Backend: none

## Additional context

Rustc: rustc 1.85.0-nightly (c44b3d50f 2024-12-03)

Update `ahash` to `0.89` and above may solve the problem. Run `cargo tree -i ahash` and we get:

```plaintext
ahash v0.8.6
└── hashbrown v0.14.3
    └── lru v0.12.1
        └── ratatui v0.28.1
            └── chess-tui v1.5.0 (/home/adamska/chess-tui)
```

So update `ratatui` may solve this problem, but I'm not sure which version the is most appropriate. Or just compile with stable rustc.

<!--
Add any other context about the problem here.
If you already looked into the issue, include all the leads you have explored.
-->

Failed to build with latest nightly rustc.
<!--
Hi there, sorry `chess-tui` is not working as expected.
Please fill this bug report conscientiously.
A detailed and complete issue is more likely to be processed quickly.
-->

## Description
Failed to build with latest rustc due to deprecated feature `[stdsimd]` in `ahash`. Successfully built when use `rustc 1.78.0-nightly (b11fbfbf3 2024-02-03)` (an older nightly version) or stable rustc.
<!--
A clear and concise description of what the bug is.
-->

## To Reproduce
```shell
rustup update
rustup default nightly # should be 1.85.0 in 2024-12-04
git clone https://github.com/thomas-mauran/chess-tui
cd chess-tui
cargo build --release
```
<!--
Try to reduce the issue to a simple code sample exhibiting the problem.
Ideally, fork the project and add a test or an example.
-->

## Expected behavior
Built successfully.
<!--
A clear and concise description of what you expected to happen.
-->

## Error message

<!--
If applicable, add screenshots, gifs or videos to help explain your problem.
-->

```
cargo build --release
   Compiling ahash v0.8.6
error[E0635]: unknown feature `stdsimd`
  --> ~/.cargo/registry/src/rsproxy.cn-0dccff568467c15b/ahash-0.8.6/src/lib.rs:99:42
   |
99 | #![cfg_attr(feature = "stdsimd", feature(stdsimd))]
   |                                          ^^^^^^^

For more information about this error, try `rustc --explain E0635`.
error: could not compile `ahash` (lib) due to 1 previous error
```

## Environment

<!--
Add a description of the systems where you are observing the issue. For example:
- OS: Linux
- Terminal Emulator: xterm
- Font: Inconsolata (Patched)
- Crate version: 0.7
- Backend: termion
-->

- OS: Ubuntu 22.04.5 LTS on Windows 10 x86_64
- Terminal Emulator: vscode
- Font: consolas
- Crate version: 1.5.0
- Backend: none

## Additional context

Rustc: rustc 1.85.0-nightly (c44b3d50f 2024-12-03)

Update `ahash` to `0.89` and above may solve the problem. Run `cargo tree -i ahash` and we get:

```plaintext
ahash v0.8.6
└── hashbrown v0.14.3
    └── lru v0.12.1
        └── ratatui v0.28.1
            └── chess-tui v1.5.0 (/home/adamska/chess-tui)
```

So update `ratatui` may solve this problem, but I'm not sure which version the is most appropriate. Or just compile with stable rustc.

<!--
Add any other context about the problem here.
If you already looked into the issue, include all the leads you have explored.
-->



Discussion / hints:
Back to the dependencies tree
```plaintext
ahash v0.8.6
└── hashbrown v0.14.3
    └── lru v0.12.1
        └── ratatui v0.28.1
            └── chess-tui v1.5.0 (/home/adamska/chess-tui)
```
I took a quick view at crates.io and found that hashbrown v0.15.0 has removed ahash from its dependencies. run `cargo update -p hashbrown` will update it to 0.14.6, that may help. But `cargo update -p lru` will update hashbrown to 0.15.0, I guess that's better. After this everything works well.
Back to the dependencies tree
```plaintext
ahash v0.8.6
└── hashbrown v0.14.3
    └── lru v0.12.1
        └── ratatui v0.28.1
            └── chess-tui v1.5.0 (/home/adamska/chess-tui)
```
I took a quick view at crates.io and found that hashbrown v0.15.0 has removed ahash from its dependencies. run `cargo update -p hashbrown` will update it to 0.14.6, that may help. But `cargo update -p lru` will update hashbrown to 0.15.0, I guess that's better. After this everything works well.

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index 33b5917..eb0f17a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,18 +1,6 @@
 # This file is automatically @generated by Cargo.
 # It is not intended for manual editing.
-version = 3
-
-[[package]]
-name = "ahash"
-version = "0.8.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a"
-dependencies = [
- "cfg-if",
- "once_cell",
- "version_check",
- "zerocopy",
-]
+version = 4
 
 [[package]]
 name = "allocator-api2"
@@ -230,6 +218,12 @@ version = "1.9.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
 
+[[package]]
+name = "equivalent"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
+
 [[package]]
 name = "errno"
 version = "0.3.9"
@@ -240,6 +234,12 @@ dependencies = [
  "windows-sys 0.52.0",
 ]
 
+[[package]]
+name = "foldhash"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2"
+
 [[package]]
 name = "getrandom"
 version = "0.2.11"
@@ -253,12 +253,13 @@ dependencies = [
 
 [[package]]
 name = "hashbrown"
-version = "0.14.3"
+version = "0.15.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
+checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
 dependencies = [
- "ahash",
  "allocator-api2",
+ "equivalent",
+ "foldhash",
 ]
 
 [[package]]
@@ -345,9 +346,9 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
 
 [[package]]
 name = "lru"
-version = "0.12.1"
+version = "0.12.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2994eeba8ed550fd9b47a0b38f0242bc3344e496483c6180b69139cc2fa5d1d7"
+checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38"
 dependencies = [
  "hashbrown",
 ]
@@ -365,12 +366,6 @@ dependencies = [
  "windows-sys 0.52.0",
 ]
 
-[[package]]
-name = "once_cell"
-version = "1.18.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
-
 [[package]]
 name = "option-ext"
 version = "0.2.0"
@@ -670,12 +665,6 @@ version = "0.2.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
 
-[[package]]
-name = "version_check"
-version = "0.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
-
 [[package]]
 name = "wasi"
 version = "0.11.0+wasi-snapshot-preview1"
@@ -835,23 +824,3 @@ name = "windows_x86_64_msvc"
 version = "0.52.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
-
-[[package]]
-name = "zerocopy"
-version = "0.7.29"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d075cf85bbb114e933343e087b92f2146bac0d55b534cbb8188becf0039948e"
-dependencies = [
- "zerocopy-derive",
-]
-
-[[package]]
-name = "zerocopy-derive"
-version = "0.7.29"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "86cd5ca076997b97ef09d3ad65efe811fa68c9e874cb636ccb211223a813b0c2"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
diff --git a/src/game_logic/ui.rs b/src/game_logic/ui.rs
index c0cae0d..ebb388f 100644
--- a/src/game_logic/ui.rs
+++ b/src/game_logic/ui.rs
@@ -107,8 +107,7 @@ impl UI {
         }
     }
 
-    /// CURSOR MOVEMENT
-
+    // CURSOR MOVEMENT
     /// Move the cursor up
     pub fn cursor_up(&mut self, authorized_positions: Vec<Coord>) {
         if self.is_cell_selected() {


Test patch: