Skip to content

Conversation

@sunshowers
Copy link
Contributor

Did this by:

  • running cargo fix --edition
  • manually reverting the changes from match to if let
  • inspecting the rest of the changes

Due 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.

Created using spr 1.3.6-beta.1

// Snapshots
fn format_snapshot(state: &SnapshotState) -> impl Display {
fn format_snapshot(state: &SnapshotState) -> impl Display + use<> {
Copy link
Contributor

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?

Copy link
Contributor Author

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<>,
Copy link
Contributor

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<>?

Copy link
Contributor Author

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
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