Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler error in rustc-serialize #19

Open
subwaystation opened this issue Mar 19, 2024 · 3 comments
Open

compiler error in rustc-serialize #19

subwaystation opened this issue Mar 19, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@subwaystation
Copy link

Hi @danydoerr :)

When compiling with

cargo --version
cargo 1.76.0 (c84b36747 2024-01-18)

I get the following error:

cargo build --release
   Compiling thiserror-impl v1.0.40
   Compiling getrandom v0.2.9
   Compiling io-lifetimes v1.0.10
   Compiling num_cpus v1.15.0
   Compiling clap_derive v4.5.3
   Compiling serde_json v1.0.114
   Compiling rustc-serialize v0.3.24
   Compiling regex v1.7.3
   Compiling strum_macros v0.25.3
   Compiling time v0.3.34
   Compiling rustix v0.37.19
   Compiling rand_core v0.6.4
   Compiling rayon-core v1.11.0
error[E0310]: the parameter type `T` may not live long enough
    --> /home/ubuntu/.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>
     |                    +++++++++

   Compiling rand_chacha v0.3.1
   Compiling rand v0.8.5
   Compiling rayon v1.7.0
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...

Any ideas? THanks!

@danydoerr
Copy link
Member

It seems that rustc-serialize is broken.

I am aware of this, and already implemented a fix. But it will take a couple of weeks until I push another release.

@subwaystation
Copy link
Author

Understandable! Dirty quick fix: Delete Cargo.lock. Rebuilding and then it worked for me.

@danydoerr
Copy link
Member

Fantastic! Thanks. In the updated version, there won't be any dependency to rustc-serialize

@heringerp heringerp added the bug Something isn't working label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants