Error during compilation

Hi,

Since the last commit, I can’t compile anymore Valutwarden.

Here the error:

error[E0658]: use of unstable library feature 'proc_macro_is_available'
  --> /home/adrien/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.34/src/detection.rs:28:21
   |
28 |     let available = proc_macro::is_available();
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #71436 <https://github.com/rust-lang/rust/issues/71436> for more information
   = help: add `#![feature(proc_macro_is_available)]` to the crate attributes to enable

For more information about this error, try `rustc --explain E0658`.
error: could not compile `proc-macro2` due to previous error
error: build failed

Rustup version:

rustup -V
rustup 1.24.3 (ce5817a94 2021-05-31)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.57.0-nightly (003d8d3f5 2021-10-04)`

Rustc version:

rustc -V
rustc 1.57.0-nightly (003d8d3f5 2021-10-04)

Cargo version:

cargo -V
cargo 1.57.0-nightly (d56b42c54 2021-09-27)

What to do?

Thanks!

Try to do a cargo clean first and try again.

Even when performing a cargo clean, I still get the same error…

You are using an older nightly version of rust then is configured via the rust-toolchain file, it should be using 2021-12-24, you are still using an older version. Maybe that causes an issue here.

I installed Rust this way:

curl -Lo /tmp/sh.rustup.rs -sSf https://sh.rustup.rs
bash -E /tmp/sh.rustup.rs -y --default-host x86_64-unknown-linux-gnu --default-toolchain nightly --profile minimal
source ~/.cargo/env
rm -f /tmp/sh.rustup.rs

To update the toolchain, I perform this command:

rustup update

The versions seems up to date… Otherwise, how to?

If you are within the vaultwarden source folder, you should see the following output when you run rustc -vV and cargo -vV

both rustc and cargo check the file rust-toolchain and adjust the version to be used upon that.
The latest main branch has nightly-2021-12-25 (Which shows the nightly 2021-12-24).

$ rustc -vV
rustc 1.59.0-nightly (475b00aa4 2021-12-24)
binary: rustc
commit-hash: 475b00aa4037461b506539a06d15ca6091b461a7
commit-date: 2021-12-24
host: x86_64-unknown-linux-gnu
release: 1.59.0-nightly
LLVM version: 13.0.0

$ cargo -vV
cargo 1.59.0-nightly (fcef61230 2021-12-17)
release: 1.59.0-nightly
commit-hash: fcef61230c3b6213b6b0d233a36ba4ebd1649ec3
commit-date: 2021-12-17
host: x86_64-unknown-linux-gnu
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.80.0-DEV (sys:0.4.51+curl-7.80.0 vendored ssl:OpenSSL/1.1.1l)
os: Ubuntu 20.04 (focal) [64-bit]

If you are in any other location like in /tmp for example this should be the output.

$ rustc -vV
rustc 1.60.0-nightly (1bd4fdc94 2022-01-12)
binary: rustc
commit-hash: 1bd4fdc943513e1004f498bbf289279c9784fc6f
commit-date: 2022-01-12
host: x86_64-unknown-linux-gnu
release: 1.60.0-nightly
LLVM version: 13.0.0

$ cargo -vV
cargo 1.60.0-nightly (358e79fe5 2022-01-04)
release: 1.60.0-nightly
commit-hash: 358e79fe56fe374649275ca7aebaafd57ade0e8d
commit-date: 2022-01-04
host: x86_64-unknown-linux-gnu
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.80.0-DEV (sys:0.4.51+curl-7.80.0 vendored ssl:OpenSSL/1.1.1l)
os: Ubuntu 20.04 (focal) [64-bit]