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

Fix building on nightly. #749

Closed
wants to merge 1 commit into from
Closed

Fix building on nightly. #749

wants to merge 1 commit into from

Conversation

iddm
Copy link

@iddm iddm commented May 21, 2024

It fixes an issue when the crate couldn't be built using nightly due to time dependency.

See rust-lang/rust#125319.

@iddm
Copy link
Author

iddm commented May 21, 2024

The problem is reproducible using currently nightly rust:

Without the fix, cargo +nightly test

error[E0282]: type annotations needed for `Box<_>`
  --> /home/<user>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.20/src/format_description/parse/mod.rs:83:9
   |
83 |     let items = format_items
   |         ^^^^^
...
86 |     Ok(items.into())
   |              ---- type must be known at this point
   |
help: consider giving `items` an explicit type, where the placeholders `_` are specified
   |
83 |     let items: Box<_> = format_items
   |              ++++++++

   Compiling url v2.5.0
   Compiling num-bigint v0.4.5
   Compiling num-iter v0.1.45
   Compiling regex-automata v0.4.5
For more information about this error, try `rustc --explain E0282`.
error: could not compile `time` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

With the update dependency, it builds fine. In the future, I suggest running the tests using +nightly to prevent this from happening again.

P.S. Running the tests using nightly might only seem unnecessary, but it is crucial: when there is another crate depending one way or another - on serde_with, and this crate is built with nightly for testing, for example, to use the sanitiser - it should be possible to build it this way.

@YaacovHazan
Copy link

@iddm why the Rust CI cancelled?

@iddm
Copy link
Author

iddm commented May 21, 2024

@iddm why the Rust CI cancelled?

The MSRV of this crate has to be increased as well. Now it is too old and the new time crate requires it to be higher.

Copy link
Owner

@jonasbb jonasbb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for rasing that issue. I think this only needs a bump in the Cargo.lock. An update of the Cargo.toml possible but the ~ version requirement is there on purpose. You can simply bump the MSRV everywhere to 1.67 to get the CI going.

The CI is checking on nightly, not sure why you imply otherwise.

@iddm
Copy link
Author

iddm commented May 22, 2024

Thanks for rasing that issue. I think this only needs a bump in the Cargo.lock. An update of the Cargo.toml possible but the ~ version requirement is there on purpose. You can simply bump the MSRV everywhere to 1.67 to get the CI going.

The CI is checking on nightly, not sure why you imply otherwise.

Thanks for the response! So I just add the ~ back and the old version 0.3.11 then and push an updated Cargo.lock?

It fixes an issue when the crate couldn't be built using nightly due to time dependency.

See <rust-lang/rust#125319>.
@jonasbb
Copy link
Owner

jonasbb commented May 22, 2024

I created a smaller PR with #750 that for now doesn't touch chrono, thus avoiding those errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants