rust-lang / rustlings

:crab: Small exercises to get you used to reading and writing Rust code!
https://rustlings.cool
MIT License
52.69k stars 10.02k forks source link

Rustlings failed to compile: E0658 #2055

Closed solarisNT closed 1 month ago

solarisNT commented 1 month ago

While trying to compile the Rustlings package, the compiler seems to choke and die on the very last step.

Output from cargo install rustlings

Updating crates.io index
  Installing rustlings v6.1.0
    Updating crates.io index
   Compiling proc-macro2 v1.0.86
   Compiling unicode-ident v1.0.12
   Compiling libc v0.2.155
   Compiling cfg-if v1.0.0
   Compiling serde v1.0.204
   Compiling version_check v0.9.4
   Compiling ahash v0.8.11
   Compiling rustversion v1.0.17
   Compiling zerocopy v0.7.35
   Compiling log v0.4.22
   Compiling quote v1.0.36
   Compiling once_cell v1.19.0
   Compiling syn v2.0.72
   Compiling autocfg v1.3.0
   Compiling mio v0.8.11
   Compiling lock_api v0.4.12
   Compiling heck v0.5.0
   Compiling parking_lot_core v0.9.10
   Compiling crossbeam-utils v0.8.20
   Compiling allocator-api2 v0.2.18
   Compiling signal-hook v0.3.17
   Compiling signal-hook-registry v1.4.2
   Compiling scopeguard v1.2.0
   Compiling smallvec v1.13.2
   Compiling hashbrown v0.14.5
   Compiling utf8parse v0.2.2
   Compiling anstyle-parse v0.2.4
   Compiling inotify-sys v0.1.5
   Compiling itoa v1.0.11
   Compiling ryu v1.0.18
   Compiling colorchoice v1.0.1
   Compiling paste v1.0.15
   Compiling anstyle v1.0.7
   Compiling either v1.13.0
   Compiling bitflags v1.3.2
   Compiling same-file v1.0.6
   Compiling is_terminal_polyfill v1.70.0
   Compiling anstyle-query v1.1.0
   Compiling equivalent v1.0.1
   Compiling indexmap v2.2.6
   Compiling itertools v0.13.0
   Compiling anstream v0.6.14
   Compiling walkdir v2.5.0
   Compiling inotify v0.9.6
   Compiling crossbeam-channel v0.5.13
   Compiling signal-hook-mio v0.2.3
   Compiling parking_lot v0.12.3
   Compiling castaway v0.2.3
   Compiling filetime v0.2.23
   Compiling serde_json v1.0.120
   Compiling unicode-segmentation v1.11.0
   Compiling unicode-width v0.1.13
   Compiling clap_lex v0.7.1
   Compiling strsim v0.11.1
   Compiling static_assertions v1.1.0
   Compiling anyhow v1.0.86
   Compiling serde_derive v1.0.204
   Compiling strum_macros v0.26.4
   Compiling winnow v0.6.15
   Compiling bitflags v2.6.0
   Compiling crossterm v0.27.0
   Compiling clap_builder v4.5.10
   Compiling strum v0.26.3
   Compiling clap_derive v4.5.8
   Compiling stability v0.2.1
   Compiling compact_str v0.7.1
   Compiling unicode-truncate v1.1.0
   Compiling toml_datetime v0.6.6
   Compiling serde_spanned v0.6.6
   Compiling toml_edit v0.22.16
   Compiling notify v6.1.1
   Compiling lru v0.12.3
   Compiling cassowary v0.3.0
   Compiling rustlings-macros v6.1.0
   Compiling ratatui v0.27.0
   Compiling notify-debouncer-mini v0.4.1
   Compiling clap v4.5.10
   Compiling os_pipe v1.2.0
   Compiling rustlings v6.1.0
error[E0658]: use of unstable library feature 'result_option_inspect'
  --> /home/solaris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustlings-6.1.0/src/watch.rs:61:10
   |
61 |         .inspect_err(|_| eprintln!("{NOTIFY_ERR}"))?;
   |          ^^^^^^^^^^^
   |
   = note: see issue #91345 <https://github.com/rust-lang/rust/issues/91345> for more information

error[E0658]: use of unstable library feature 'result_option_inspect'
  --> /home/solaris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustlings-6.1.0/src/watch.rs:65:14
   |
65 |             .inspect_err(|_| eprintln!("{NOTIFY_ERR}"))?;
   |              ^^^^^^^^^^^
   |
   = note: see issue #91345 <https://github.com/rust-lang/rust/issues/91345> for more information

For more information about this error, try `rustc --explain E0658`.
error: could not compile `rustlings` (bin "rustlings") due to 2 previous errors
error: failed to compile `rustlings v6.1.0`, intermediate artifacts can be found at `/tmp/cargo-installOhk4kv`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
mo8it commented 1 month ago

You have an old Rust version. Rustlings requires the latest Rust version. To fix this, please run rustup update

solarisNT commented 1 month ago

This is the output when I run rustup update

info: no updatable toolchains installed
info: cleaning up downloads & tmp directories
info: self-update is disabled for this build of rustup
info: any updates to rustup will need to be fetched with your system package manager

I feel like there's something I'm missing

mo8it commented 1 month ago

You installed Rust using your package manager on Linux. Uninstall this older version and install Rust using the official method: https://www.rust-lang.org/tools/install