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

Sleep::downcast_mut_pin() should not extend lifetime #3556

Closed
burakemir opened this issue Feb 2, 2024 · 1 comment · Fixed by #3557
Closed

Sleep::downcast_mut_pin() should not extend lifetime #3556

burakemir opened this issue Feb 2, 2024 · 1 comment · Fixed by #3557
Assignees
Labels
A-rt Area: runtime traits/utils C-bug Category: bug. Something is wrong. This is bad! E-easy Effort: easy. A task that would be a great starting point for a new contributor.

Comments

@burakemir
Copy link

Could you provide safety docs that explain why it is ok to extend the lifetime to static here?

pub fn downcast_mut_pin<T>(self: Pin<&mut Self>) -> Option<Pin<&'static mut T>>

@sfackler
Copy link
Contributor

sfackler commented Feb 2, 2024

That extension should definitely not be there.

seanmonstar added a commit that referenced this issue Feb 2, 2024
This lifetime extension was a mistake.

Closes #3556

BREAKING CHANGE: The returned lifetime from `Sleep::downcast_mut_pin()`
  is no longer `'static`. This shouldn't affect most usage. This sort of
  breaking change is needed because it is _wrong_.
@seanmonstar seanmonstar changed the title Unclear why this lifetime extension is justified Sleep::downcast_mut_pin() should not extend lifetime Feb 2, 2024
@seanmonstar seanmonstar added C-bug Category: bug. Something is wrong. This is bad! E-easy Effort: easy. A task that would be a great starting point for a new contributor. A-rt Area: runtime traits/utils labels Feb 2, 2024
@seanmonstar seanmonstar self-assigned this Feb 2, 2024
seanmonstar added a commit that referenced this issue Feb 5, 2024
This lifetime extension was a mistake.

Closes #3556

BREAKING CHANGE: The returned lifetime from `Sleep::downcast_mut_pin()`
  is no longer `'static`. This shouldn't affect most usage. This sort of
  breaking change is needed because it is _wrong_.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rt Area: runtime traits/utils C-bug Category: bug. Something is wrong. This is bad! E-easy Effort: easy. A task that would be a great starting point for a new contributor.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants