Skip to content

Remove unsafe lifetime transmute in vt::Stream#178

Merged
lhecker merged 1 commit intomicrosoft:mainfrom
arkeet:lifetime-transmute
May 22, 2025
Merged

Remove unsafe lifetime transmute in vt::Stream#178
lhecker merged 1 commit intomicrosoft:mainfrom
arkeet:lifetime-transmute

Conversation

@arkeet
Copy link
Contributor

@arkeet arkeet commented May 21, 2025

A lending iterator ties the item lifetime to the borrow of self, so writing the lifetimes that way Just Works.

I also make input::Stream an actual Iterator, since it had no reason not to be.

Meanwhile, make input::Stream an actual Iterator.
@arkeet
Copy link
Contributor Author

arkeet commented May 21, 2025

@microsoft-github-policy-service agree

Copy link
Member

@lhecker lhecker left a comment

Choose a reason for hiding this comment

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

Thank you for improving this! It's way better now.

@lhecker lhecker merged commit 4cf157c into microsoft:main May 22, 2025
1 check passed
@arkeet arkeet deleted the lifetime-transmute branch May 22, 2025 17:24
diabloproject pushed a commit to diabloproject/edit that referenced this pull request May 29, 2025
A lending iterator ties the item lifetime to the borrow of `self`,
so writing the lifetimes that way Just Works.
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