Skip to content

Commit 1d10117

Browse files
authored
Rollup merge of #134741 - compiler-errors:coroutine-verbose, r=lqd
Actually print all the relevant parts of a coroutine in verbose mode I need to actually see these components, idk why we weren't printing them :)
2 parents a247d7b + 9bcd1de commit 1d10117

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

Diff for: compiler/rustc_middle/src/ty/print/pretty.rs

+6
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,12 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
841841
p!(
842842
" upvar_tys=",
843843
print(args.as_coroutine().tupled_upvars_ty()),
844+
" resume_ty=",
845+
print(args.as_coroutine().resume_ty()),
846+
" yield_ty=",
847+
print(args.as_coroutine().yield_ty()),
848+
" return_ty=",
849+
print(args.as_coroutine().return_ty()),
844850
" witness=",
845851
print(args.as_coroutine().witness())
846852
);

Diff for: tests/ui/async-await/async-closures/def-path.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ LL | let x = async || {};
55
| -- the expected `async` closure body
66
LL |
77
LL | let () = x();
8-
| ^^ --- this expression has type `{static main::{closure#0}::{closure#0}<?17t> upvar_tys=?16t witness=?6t}`
8+
| ^^ --- this expression has type `{static main::{closure#0}::{closure#0}<?17t> upvar_tys=?16t resume_ty=ResumeTy yield_ty=() return_ty=() witness=?6t}`
99
| |
1010
| expected `async` closure body, found `()`
1111
|
12-
= note: expected `async` closure body `{static main::{closure#0}::{closure#0}<?17t> upvar_tys=?16t witness=?6t}`
12+
= note: expected `async` closure body `{static main::{closure#0}::{closure#0}<?17t> upvar_tys=?16t resume_ty=ResumeTy yield_ty=() return_ty=() witness=?6t}`
1313
found unit type `()`
1414

1515
error: aborting due to 1 previous error

Diff for: tests/ui/coroutine/print/coroutine-print-verbose-2.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | | drop(a);
99
LL | | });
1010
| |______^ coroutine is not `Sync`
1111
|
12-
= help: within `{main::{closure#0} upvar_tys=() witness={main::{closure#0}}}`, the trait `Sync` is not implemented for `NotSync`
12+
= help: within `{main::{closure#0} upvar_tys=() resume_ty=() yield_ty=() return_ty=() witness={main::{closure#0}}}`, the trait `Sync` is not implemented for `NotSync`
1313
note: coroutine is not `Sync` as this value is used across a yield
1414
--> $DIR/coroutine-print-verbose-2.rs:20:9
1515
|
@@ -34,7 +34,7 @@ LL | | drop(a);
3434
LL | | });
3535
| |______^ coroutine is not `Send`
3636
|
37-
= help: within `{main::{closure#1} upvar_tys=() witness={main::{closure#1}}}`, the trait `Send` is not implemented for `NotSend`
37+
= help: within `{main::{closure#1} upvar_tys=() resume_ty=() yield_ty=() return_ty=() witness={main::{closure#1}}}`, the trait `Send` is not implemented for `NotSend`
3838
note: coroutine is not `Send` as this value is used across a yield
3939
--> $DIR/coroutine-print-verbose-2.rs:27:9
4040
|

Diff for: tests/ui/coroutine/print/coroutine-print-verbose-3.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LL | | };
1111
| |_____^ expected `()`, found coroutine
1212
|
1313
= note: expected unit type `()`
14-
found coroutine `{main::{closure#0} upvar_tys=?4t witness=?6t}`
14+
found coroutine `{main::{closure#0} upvar_tys=?4t resume_ty=() yield_ty=i32 return_ty=&'?1 str witness=?6t}`
1515

1616
error: aborting due to 1 previous error
1717

0 commit comments

Comments
 (0)