Skip to content

Commit 111bf06

Browse files
authored
Unrolled build for #144148
Rollup merge of #144148 - compiler-errors:async-print-hack, r=lqd Remove pretty print hack for async blocks I introduced this hack 3 years ago, but it's not needed anymore, probably due to #104321.
2 parents 81af9d4 + e6f2830 commit 111bf06

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

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

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,30 +1210,6 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
12101210
}
12111211

12121212
for (assoc_item_def_id, term) in assoc_items {
1213-
// Skip printing `<{coroutine@} as Coroutine<_>>::Return` from async blocks,
1214-
// unless we can find out what coroutine return type it comes from.
1215-
let term = if let Some(ty) = term.skip_binder().as_type()
1216-
&& let ty::Alias(ty::Projection, proj) = ty.kind()
1217-
&& let Some(assoc) = tcx.opt_associated_item(proj.def_id)
1218-
&& assoc
1219-
.trait_container(tcx)
1220-
.is_some_and(|def_id| tcx.is_lang_item(def_id, LangItem::Coroutine))
1221-
&& assoc.opt_name() == Some(rustc_span::sym::Return)
1222-
{
1223-
if let ty::Coroutine(_, args) = args.type_at(0).kind() {
1224-
let return_ty = args.as_coroutine().return_ty();
1225-
if !return_ty.is_ty_var() {
1226-
return_ty.into()
1227-
} else {
1228-
continue;
1229-
}
1230-
} else {
1231-
continue;
1232-
}
1233-
} else {
1234-
term.skip_binder()
1235-
};
1236-
12371213
if first {
12381214
p!("<");
12391215
first = false;
@@ -1243,7 +1219,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
12431219

12441220
p!(write("{} = ", tcx.associated_item(assoc_item_def_id).name()));
12451221

1246-
match term.kind() {
1222+
match term.skip_binder().kind() {
12471223
TermKind::Ty(ty) => p!(print(ty)),
12481224
TermKind::Const(c) => p!(print(c)),
12491225
};

0 commit comments

Comments
 (0)