use of unstable library feature 'proc_macro_byte_character'
Hello, I run cargo install dioxus-cli, but I get an error.
The operating system is win11. The full error is below:
error[E0658]: use of unstable library feature 'proc_macro_byte_character'
--> D:\develop\rust\cargo\registry\src\mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd\proc-macro2-1.0.81\src\wrapper.rs:871:21
|
871 | proc_macro::Literal::byte_character(byte)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #115268 https://github.com/rust-lang/rust/issues/115268 for more information
= help: add #![feature(proc_macro_byte_character)] to the crate attributes to enable
= note: this compiler was built on 2024-04-01; consider upgrading it if it is out of date
Compiling pin-project-lite v0.2.14
error[E0658]: use of unstable library feature 'proc_macro_c_str_literals'
--> D:\develop\rust\cargo\registry\src\mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd\proc-macro2-1.0.81\src\wrapper.rs:898:21
|
898 | proc_macro::Literal::c_string(string)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #119750 https://github.com/rust-lang/rust/issues/119750 for more information
= help: add #![feature(proc_macro_c_str_literals)] to the crate attributes to enable
= note: this compiler was built on 2024-04-01; consider upgrading it if it is out of date
For more information about this error, try rustc --explain E0658.
error: could not compile proc-macro2 (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile dioxus-cli v0.5.2 (https://github.com/DioxusLabs/dioxus#74352f2f), intermediate artifacts can be found at D:\data\temp\cargo-installNf9hGY.
To reuse those artifacts with a future compilation, set the environment variable CARGO_TARGET_DIR to that path.
C:\Users\86187>
I think that issue is caused by building with an older nightly compiler. You can try:
- Updating your compiler with
rustup update - Compiling with the stable compiler
- Installing the prebuilt binaries with cargo binstall:
cargo binstall dioxus-cli
Running cargo install dioxus-cli with the latest nightly compiler and latest stable compiler both work on macos