nkaz001 / hftbacktest

A high-frequency trading and market-making backtesting tool in Python and Rust, which accounts for limit orders, queue positions, and latencies, utilizing full tick data for trades and order books, with real-world crypto market-making examples for Binance Futures
MIT License
1.78k stars 357 forks source link

Rust compile error for examples #102

Closed xiandong79 closed 1 month ago

xiandong79 commented 1 month ago
cd hftbacktest/hftbacktest

cargo build --release

I got

error[E0658]: use of unstable library feature 'slice_ptr_len'
  --> hftbacktest/src/backtest/reader.rs:72:18
   |
72 |         self.ptr.len()
   |                  ^^^
   |
   = note: see issue #71146 <https://github.com/rust-lang/rust/issues/71146> for more information

with

cargo 1.78.0 (54d8815d0 2024-03-26)
lijiachang commented 1 month ago
rustup install nightly
rustup override set nightly
xiandong79 commented 1 month ago
rustup install nightly
rustup override set nightly

Success! Thanks

nkaz001 commented 1 month ago

For rust version 1.79 and above, it works in the stable release; there is no need to switch to nightly.