From 471334e99617e20a2165b035241e6aa51bb29628 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sun, 21 Nov 2021 21:15:57 -0800 Subject: [PATCH] Suppress noisy generator associated type --- compiler/rustc_middle/src/ty/print/pretty.rs | 18 ++++++++++++++---- 1 file 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; }