Pretty-print generators with their generator_kind#104931
Pretty-print generators with their generator_kind#104931bors merged 1 commit intorust-lang:masterfrom
generator_kind#104931Conversation
|
r? @eholk (rustbot has picked a reviewer for you, use r? to override) |
|
@bors r+ |
|
📌 Commit daa4845365c5fce7566063552ee52ec8627fac10 has been approved by It is now in the queue for this repository. |
There was a problem hiding this comment.
I think the nested backticks in `async` is a bit strange looking in these type errors.
Also, I'm not sure if we expect users to know what static generator movability is -- if the generator kind is Async, maybe we could just drop the static (maybe unless we pass in -Zverbose or something)?
There was a problem hiding this comment.
Agreed, I pushed an updated version that does this.
Also now uses the descr() method for explicit diagnostics that still print `async` block, but when printing the type of the block itself, the output is cleaner now.
After removing `GenFuture`, I special-cased async generators to pretty-print as `impl Future<Output = X>` mainly to avoid too much diagnostics changes originally. This now reverses that change so that async fn/blocks are pretty-printed as `[$movability `async` $something@$source-position]` in various diagnostics, and updates the tests that this touches.
daa4845 to
c96d888
Compare
|
Another case that could maybe be improved further would be: The |
|
@bors r+ Thanks for the improvements! |
Pretty-print generators with their `generator_kind` After removing `GenFuture`, I special-cased async generators to pretty-print as `impl Future<Output = X>` mainly to avoid too much diagnostics changes originally. This now reverses that change so that async fn/blocks are pretty-printed as `[$async-type@$source-position]` in various diagnostics, and updates the tests that this touches.
|
@bors r- failed in a rollup |
|
Hmm, looks like this was actually not the problem 😅 |
Pretty-print generators with their `generator_kind` After removing `GenFuture`, I special-cased async generators to pretty-print as `impl Future<Output = X>` mainly to avoid too much diagnostics changes originally. This now reverses that change so that async fn/blocks are pretty-printed as `[$async-type@$source-position]` in various diagnostics, and updates the tests that this touches.
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#95836 (Use `rust_out{exe_suffix}` for doctests) - rust-lang#104882 (notify lcnr on changes to `ObligationCtxt`) - rust-lang#104892 (Explain how to get the discriminant out of a `#[repr(T)] enum` with payload) - rust-lang#104917 (Allow non-org members to label `requires-debug-assertions`) - rust-lang#104931 (Pretty-print generators with their `generator_kind`) - rust-lang#104934 (Remove redundant `all` in cfg) - rust-lang#104944 (Support unit tests for jsondoclint) - rust-lang#104946 (rustdoc: improve popover focus handling JS) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
After removing
GenFuture, I special-cased async generators to pretty-print asimpl Future<Output = X>mainly to avoid too much diagnostics changes originally.This now reverses that change so that async fn/blocks are pretty-printed as
[$async-type@$source-position]in various diagnostics, and updates the tests that this touches.