Skip to content

Commit 471334e

Browse files
Suppress noisy generator associated type
1 parent b84a52c commit 471334e

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

compiler/rustc_middle/src/ty/print/pretty.rs

+14-4
Original file line numberDiff line numberDiff line change
@@ -890,10 +890,20 @@ pub trait PrettyPrinter<'tcx>:
890890
if !first {
891891
p!(", ");
892892
}
893-
p!(
894-
write("{} = ", self.tcx().associated_item(assoc_item_def_id).ident),
895-
print(ty)
896-
);
893+
p!(write("{} = ", self.tcx().associated_item(assoc_item_def_id).ident));
894+
895+
// Skip printing `<[generator@] as Generator<_>>::Return` from async blocks
896+
match ty.skip_binder().kind() {
897+
ty::Projection(ty::ProjectionTy { item_def_id, .. })
898+
if Some(*item_def_id) == self.tcx().lang_items().generator_return() =>
899+
{
900+
p!("[async output]")
901+
}
902+
_ => {
903+
p!(print(ty))
904+
}
905+
}
906+
897907
first = false;
898908
}
899909

0 commit comments

Comments
 (0)