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 when using as a dep #8

Closed
utx0 opened this issue Oct 6, 2024 · 5 comments · Fixed by #10
Closed

Compiler error when using as a dep #8

utx0 opened this issue Oct 6, 2024 · 5 comments · Fixed by #10

Comments

@utx0
Copy link

utx0 commented Oct 6, 2024

Started to get the following compiler error, and cant for the life of me work out why?

error[E0310]: the parameter type `S` may not live long enough
  --> /home/utx0/.cargo/registry/src/index.crates.io-6f17d22bba15001f/streamunordered-0.5.3/src/task.rs:80:9
   |
80 |         waker_ref(this)
   |         ^^^^^^^^^^^^^^^
   |         |
   |         the parameter type `S` must be valid for the static lifetime...
   |         ...so that the type `S` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound
   |
77 | impl<S: 'static> Task<S> {
   |       +++++++++
@utx0
Copy link
Author

utx0 commented Oct 6, 2024

❯ rustc -V
rustc 1.81.0 (eeb90cda1 2024-09-04) (Fedora 1.81.0-1.fc40)

@utx0
Copy link
Author

utx0 commented Oct 6, 2024

This PR fixed my current issue; #9

@dariusc93
Copy link

The issue is because futures-util 0.3.31 added a static lifetime to wake_ref.

@jonhoo
Copy link
Owner

jonhoo commented Oct 19, 2024

Ah, interesting, yes, this is rust-lang/futures-rs#2830, which is a breaking change but was allowed since it was a soundness fix (as per conventions around semver). I'll do the same for streamunordered 👍

jonhoo added a commit that referenced this issue Oct 19, 2024
This is technically a breaking change, but allowed since it fixes a
soundness issue in futures-util (rust-lang/futures-rs#2830).

Fixes #8.
Closes #9.
jonhoo added a commit that referenced this issue Oct 19, 2024
This is technically a breaking change, but allowed since it fixes a
soundness issue in futures-util (rust-lang/futures-rs#2830).

Fixes #8.
Closes #9.
@jonhoo
Copy link
Owner

jonhoo commented Oct 19, 2024

Released in 0.5.4 🎉

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 a pull request may close this issue.

3 participants