-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Accommodate yield points in the format_args expansion #93461
Merged
Merged
Conversation
This file contains 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
rustbot
added
the
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
label
Jan 29, 2022
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Jan 29, 2022
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
danielhenrymantilla
approved these changes
Jan 30, 2022
danielhenrymantilla
approved these changes
Jan 30, 2022
Currently fails with: error: future cannot be sent between threads safely --> $DIR/src/test/ui/fmt/format-with-yield-point.rs:21:17 | LL | assert_send(with_await()); | ^^^^^^^^^^^^ future returned by `with_await` is not `Send` | = help: the trait `Sync` is not implemented for `core::fmt::Opaque` note: future is not `Send` as this value is used across an await --> $DIR/src/test/ui/fmt/format-with-yield-point.rs:11:37 | LL | println!("{} {:?}", "", async {}.await); | --------------------------------^^^^^^- | | | | | await occurs here, with `$crate::format_args_nl!($($arg)*)` maybe used later | has type `ArgumentV1<'_>` which is not `Send` | `$crate::format_args_nl!($($arg)*)` is later dropped here note: required by a bound in `assert_send` --> $DIR/src/test/ui/fmt/format-with-yield-point.rs:18:24 | LL | fn assert_send(_: impl Send) {} | ^^^^ required by this bound in `assert_send` error: future cannot be sent between threads safely --> $DIR/src/test/ui/fmt/format-with-yield-point.rs:22:17 | LL | assert_send(with_macro_call()); | ^^^^^^^^^^^^^^^^^ future returned by `with_macro_call` is not `Send` | = help: the trait `Sync` is not implemented for `core::fmt::Opaque` note: future is not `Send` as this value is used across an await --> $DIR/src/test/ui/fmt/format-with-yield-point.rs:6:17 | LL | async {}.await | ^^^^^^ await occurs here, with `$crate::format_args_nl!($($arg)*)` maybe used later ... LL | println!("{} {:?}", "", m!()); | ----------------------------- | | | | | in this macro invocation | has type `ArgumentV1<'_>` which is not `Send` | `$crate::format_args_nl!($($arg)*)` is later dropped here note: required by a bound in `assert_send` --> $DIR/src/test/ui/fmt/format-with-yield-point.rs:18:24 | LL | fn assert_send(_: impl Send) {} | ^^^^ required by this bound in `assert_send` = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors
|
davidtwco
approved these changes
Jan 31, 2022
@bors r+ |
📌 Commit 858d6a0 has been approved by |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Jan 31, 2022
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 31, 2022
…askrgr Rollup of 8 pull requests Successful merges: - rust-lang#93395 (Improve suggestion for escaping reserved keywords) - rust-lang#93403 (review the total_cmp documentation) - rust-lang#93461 (Accommodate yield points in the format_args expansion) - rust-lang#93462 (Document `SystemTime` platform precision) - rust-lang#93471 (unix: Use metadata for `DirEntry::file_type` fallback) - rust-lang#93480 (Remove deprecated and unstable slice_partition_at_index functions) - rust-lang#93485 (core: Remove some redundant {}s from the sorting code) - rust-lang#93494 (kmc-solid: Inherit the calling task's base priority in `Thread::new`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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.
Fixes #93274.
For the case
println!("{} {:?}", "", async {}.await)
in the issue, the expansion before:After: