tests/ui/async-await/drop-option-future.rs: New regression test#154155
Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom Mar 21, 2026
Merged
tests/ui/async-await/drop-option-future.rs: New regression test#154155rust-bors[bot] merged 1 commit intorust-lang:mainfrom
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Conversation
The test began compiling with `nightly-2022-11-25`, and more specifically 9f36f98. The test fails to compile with `nightly-2022-11-24`: $ rustc +nightly-2022-11-24 --edition 2018 tests/ui/async-await/drop-option-future.rs error[E0597]: `value` does not live long enough --> tests/ui/async-await/drop-option-future.rs:12:22 | 12 | f = Some(async { value }); | --^^^^^-- | | | | | borrowed value does not live long enough | value captured here by generator 13 | core::mem::drop(f); 14 | } | - | | | `value` dropped here while still borrowed | borrow might be used here, when `f` is dropped and runs the destructor for type `Option<impl Future<Output = i32>>` The fix 9f36f98 does not appear to affect or include a regression test for our issue, so let's add that test.
Collaborator
|
r? @mati865 rustbot has assigned @mati865. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Member
|
@bors r+ |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Mar 20, 2026
tests/ui/async-await/drop-option-future.rs: New regression test The test began compiling with `nightly-2022-11-25`. I bisected it further, and the commit that made it compile was 9f36f98 (rust-lang#104321). The test fails to compile with `nightly-2022-11-24`: $ rustc +nightly-2022-11-24 --edition 2018 tests/ui/async-await/drop-option-future.rs error[E0597]: `value` does not live long enough --> tests/ui/async-await/drop-option-future.rs:12:22 | 12 | f = Some(async { value }); | --^^^^^-- | | | | | borrowed value does not live long enough | value captured here by generator 13 | core::mem::drop(f); 14 | } | - | | | `value` dropped here while still borrowed | borrow might be used here, when `f` is dropped and runs the destructor for type `Option<impl Future<Output = i32>>` The fix 9f36f98 does not appear to affect or include a regression test for the rust-lang#98077 case, so let's add that test. Closes rust-lang#98077 since we add the test from that issue.
This was referenced Mar 20, 2026
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 21, 2026
…uwer Rollup of 6 pull requests Successful merges: - #154154 (Emit fewer errors for incorrect rtn and `=` -> `:` typos in bindings) - #154155 (tests/ui/async-await/drop-option-future.rs: New regression test) - #146961 (Allow passing `expr` metavariable as `cfg` predicate) - #154118 (don't suggest non-deriveable traits for unions) - #154120 (Start migrating `DecorateDiagCompat::Builtin` items to `DecorateDiagCompat::Dynamic`) - #154156 (Moving issue-52049 to borrowck)
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 21, 2026
…uwer Rollup of 6 pull requests Successful merges: - #154154 (Emit fewer errors for incorrect rtn and `=` -> `:` typos in bindings) - #154155 (tests/ui/async-await/drop-option-future.rs: New regression test) - #146961 (Allow passing `expr` metavariable as `cfg` predicate) - #154118 (don't suggest non-deriveable traits for unions) - #154120 (Start migrating `DecorateDiagCompat::Builtin` items to `DecorateDiagCompat::Dynamic`) - #154156 (Moving issue-52049 to borrowck)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The test began compiling with
nightly-2022-11-25. I bisected it further, and the commit that made it compile was 9f36f98 (#104321). The test fails to compile withnightly-2022-11-24:The fix 9f36f98 does not appear to affect or include a regression test for the #98077 case, so let's add that test.
Closes #98077 since we add the test from that issue.