-
Notifications
You must be signed in to change notification settings - Fork 63
[meta] migrate to 2024 edition #9398
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
[meta] migrate to 2024 edition #9398
Conversation
Created using spr 1.3.6-beta.1
|
|
||
| // Snapshots | ||
| fn format_snapshot(state: &SnapshotState) -> impl Display { | ||
| fn format_snapshot(state: &SnapshotState) -> impl Display + use<> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks strange! Just making sure I understand: if we didn't have + use<> here, Rust 2024 would infer that the impl Display we're returning is tied to the &SnapshotState lifetime, but because we say use<>, we're explicitly saying that we're returning a type that doesn't?
Which one did Rust 2021 infer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah this specific one was added automatically and doesn't end up being strictly required, but in general yeah, in Rust 2021 the output wouldn't be tied to state's lifetime, but in Rust 2024 it is tied to that lifetime by default.
| ) -> Result<impl ExactSizeIterator<Item = DeliveryAndEvent> + 'static, Error> | ||
| { | ||
| ) -> Result< | ||
| impl ExactSizeIterator<Item = DeliveryAndEvent> + 'static + use<>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does 'static not already imply use<>?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question -- I think the 'static isn't used as part of reasoning like that to keep the rules simpler. Note that this was automatically added by cargo fix --edition.
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Did this by:
cargo fix --editionmatchtoif letDue to drop order changes outlined here and here, this change is not as risk-free as I would like (potentially causing future cancellation issues, or maybe resolving latent ones). But hopefully a full release cycle would be enough time to bake these changes.