-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
macros: allow temporary lifetime extension in select #6722
Conversation
// regression test for https://github.com/tokio-rs/tokio/issues/6721 | ||
#[tokio::test] | ||
async fn temporary_lifetime_extension() { | ||
tokio::select! { | ||
() = &mut std::future::ready(()) => {}, | ||
} | ||
} |
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.
I have verified that this test does not compile without the fix.
// Safety: Nothing must be moved out of `futures`. This is to | ||
// satisfy the requirement of `Pin::new_unchecked` called below. | ||
// | ||
// We can't use the `pin!` macro for this because `futures` is a | ||
// tuple and the standard library provides no way to pin-project to | ||
// the fields of a tuple. | ||
let mut futures = ( $( $crate::macros::support::IntoFuture::into_future($fut) , )+ ); | ||
let mut futures = ($( $crate::macros::support::IntoFuture::into_future( | ||
$crate::count_field!( futures_init.$($skip)* ) |
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.
Should we delete some indentations here?
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.
Shrug.
Bumps tokio from 1.39.1 to 1.39.2. Release notes Sourced from tokio's releases. Tokio v1.39.2 1.39.2 (July 27th, 2024) This release fixes a regression where the select! macro stopped accepting expressions that make use of temporary lifetime extension. (#6722) #6722: tokio-rs/tokio#6722 Commits f602eae chore: prepare Tokio v1.39.2 (#6730) 438def7 macros: allow temporary lifetime extension in select (#6722) ee8d4d1 chore: fix ci failures (#6725) 3297052 ci: test Quinn in CI (#6719) See full diff in compare view Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase. Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: @dependabot rebase will rebase this PR @dependabot recreate will recreate this PR, overwriting any edits that have been made to it @dependabot merge will merge this PR after your CI passes on it @dependabot squash and merge will squash and merge this PR after your CI passes on it @dependabot cancel merge will cancel a previously requested merge and block automerging @dependabot reopen will reopen this PR if it is closed @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
In the 1.39.0 release, we merged #6710 which allows the use of
IntoFuture
values withtokio::select!
. Unfortunately, this resulted in a breaking change where the macro would no longer accept expressions that make use of temporary lifetime extension. This PR fixes the breaking change.Fixes: #6721