Grasscutters / Cultivation

A custom launcher designed to make it as easy as possible to proxy anime game traffic to private servers.
Apache License 2.0
946 stars 159 forks source link

When compiling with the latest version of Rust, an error occurs. Downgrading Rust to version 1.75.0 allows successful compilation. #224

Closed HongchengQ closed 1 month ago

HongchengQ commented 3 months ago

When compiling with the latest version of Rust, an error occurs. Downgrading Rust to version 1.75.0 allows successful compilation. 使用最新版rust编译时会报错 解决方法为:rust降级为1.75.0

error[E0310]: the parameter type `T` may not live long enough
    --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rustc-serialize-0.3.24\src\serialize.rs:1155:5
     |
1155 |     fn decode<D: Decoder>(d: &mut D) -> Result<Cow<'static, T>, D::Error> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |     |
     |     the parameter type `T` must be valid for the static lifetime...
     |     ...so that the type `T` will meet its required lifetime bounds...
     |
note: ...that is required by this bound
    --> /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\alloc\src\borrow.rs:180:30
help: consider adding an explicit lifetime bound
     |
1151 | impl<'a, T: ?Sized + 'static> Decodable for Cow<'a, T>
     |                    +++++++++

For more information about this error, try `rustc --explain E0310`.
error: could not compile `rustc-serialize` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
       Error failed to build app: failed to build app
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

The solution is to downgrade Rust to version 1.75.0. 解决方法为:rust降级为1.75.0

Saltman155 commented 1 month ago

No downgrade required. The rustc-serialize library has been deprecated,The solution is to go into the src-tauri folder and run cargo update to update the Cargo.lock file. Recompile to solve this problem.