mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Actually print all the relevant parts of a coroutine in verbose mode
This commit is contained in:
@@ -841,6 +841,12 @@ fn pretty_print_type(&mut self, ty: Ty<'tcx>) -> Result<(), PrintError> {
|
||||
p!(
|
||||
" upvar_tys=",
|
||||
print(args.as_coroutine().tupled_upvars_ty()),
|
||||
" resume_ty=",
|
||||
print(args.as_coroutine().resume_ty()),
|
||||
" yield_ty=",
|
||||
print(args.as_coroutine().yield_ty()),
|
||||
" return_ty=",
|
||||
print(args.as_coroutine().return_ty()),
|
||||
" witness=",
|
||||
print(args.as_coroutine().witness())
|
||||
);
|
||||
|
||||
@@ -5,11 +5,11 @@ LL | let x = async || {};
|
||||
| -- the expected `async` closure body
|
||||
LL |
|
||||
LL | let () = x();
|
||||
| ^^ --- this expression has type `{static main::{closure#0}::{closure#0}<?17t> upvar_tys=?16t witness=?6t}`
|
||||
| ^^ --- this expression has type `{static main::{closure#0}::{closure#0}<?17t> upvar_tys=?16t resume_ty=ResumeTy yield_ty=() return_ty=() witness=?6t}`
|
||||
| |
|
||||
| expected `async` closure body, found `()`
|
||||
|
|
||||
= note: expected `async` closure body `{static main::{closure#0}::{closure#0}<?17t> upvar_tys=?16t witness=?6t}`
|
||||
= note: expected `async` closure body `{static main::{closure#0}::{closure#0}<?17t> upvar_tys=?16t resume_ty=ResumeTy yield_ty=() return_ty=() witness=?6t}`
|
||||
found unit type `()`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
@@ -9,7 +9,7 @@ LL | | drop(a);
|
||||
LL | | });
|
||||
| |______^ coroutine is not `Sync`
|
||||
|
|
||||
= help: within `{main::{closure#0} upvar_tys=() witness={main::{closure#0}}}`, the trait `Sync` is not implemented for `NotSync`
|
||||
= 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`
|
||||
note: coroutine is not `Sync` as this value is used across a yield
|
||||
--> $DIR/coroutine-print-verbose-2.rs:20:9
|
||||
|
|
||||
@@ -34,7 +34,7 @@ LL | | drop(a);
|
||||
LL | | });
|
||||
| |______^ coroutine is not `Send`
|
||||
|
|
||||
= help: within `{main::{closure#1} upvar_tys=() witness={main::{closure#1}}}`, the trait `Send` is not implemented for `NotSend`
|
||||
= 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`
|
||||
note: coroutine is not `Send` as this value is used across a yield
|
||||
--> $DIR/coroutine-print-verbose-2.rs:27:9
|
||||
|
|
||||
|
||||
@@ -11,7 +11,7 @@ LL | | };
|
||||
| |_____^ expected `()`, found coroutine
|
||||
|
|
||||
= note: expected unit type `()`
|
||||
found coroutine `{main::{closure#0} upvar_tys=?4t witness=?6t}`
|
||||
found coroutine `{main::{closure#0} upvar_tys=?4t resume_ty=() yield_ty=i32 return_ty=&'?1 str witness=?6t}`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
||||
Reference in New Issue
Block a user