diff options
| author | Michael Goulet <michael@errs.io> | 2021-11-21 21:15:57 -0800 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2021-11-23 10:34:16 -0800 |
| commit | 471334e99617e20a2165b035241e6aa51bb29628 (patch) | |
| tree | 28dc58adb5c45d2ae0b6c1a8cec274c8f5815d7e | |
| parent | b84a52c95a8b7016bdadfef419e222c92133c785 (diff) | |
| download | rust-471334e99617e20a2165b035241e6aa51bb29628.tar.gz rust-471334e99617e20a2165b035241e6aa51bb29628.zip | |
Suppress noisy generator associated type
| -rw-r--r-- | compiler/rustc_middle/src/ty/print/pretty.rs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index 5a8fc943f9a..aa175baa8c7 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -890,10 +890,20 @@ pub trait PrettyPrinter<'tcx>: if !first { p!(", "); } - p!( - write("{} = ", self.tcx().associated_item(assoc_item_def_id).ident), - print(ty) - ); + p!(write("{} = ", self.tcx().associated_item(assoc_item_def_id).ident)); + + // Skip printing `<[generator@] as Generator<_>>::Return` from async blocks + match ty.skip_binder().kind() { + ty::Projection(ty::ProjectionTy { item_def_id, .. }) + if Some(*item_def_id) == self.tcx().lang_items().generator_return() => + { + p!("[async output]") + } + _ => { + p!(print(ty)) + } + } + first = false; } |
