Rollup merge of #95225 - compiler-errors:impl-future-generator-ty, r=oli-obk
remove `[async output]` from `impl Future` pretty-printing self-explanatory, guess it's not as helpful as I thought when I added it 4 months ago re https://github.com/rust-lang/rust/issues/95089#issuecomment-1075482851
This commit is contained in:
commit
1f346bd6a5
16 changed files with 39 additions and 34 deletions
|
@ -41,6 +41,7 @@
|
|||
#![feature(new_uninit)]
|
||||
#![feature(nll)]
|
||||
#![feature(once_cell)]
|
||||
#![feature(let_chains)]
|
||||
#![feature(let_else)]
|
||||
#![feature(min_specialization)]
|
||||
#![feature(trusted_len)]
|
||||
|
|
|
@ -896,44 +896,48 @@ pub trait PrettyPrinter<'tcx>:
|
|||
);
|
||||
|
||||
if !generics.is_empty() || !assoc_items.is_empty() {
|
||||
p!("<");
|
||||
let mut first = true;
|
||||
|
||||
for ty in generics {
|
||||
if !first {
|
||||
if first {
|
||||
p!("<");
|
||||
first = false;
|
||||
} else {
|
||||
p!(", ");
|
||||
}
|
||||
p!(print(trait_ref.rebind(*ty)));
|
||||
first = false;
|
||||
}
|
||||
|
||||
for (assoc_item_def_id, term) in assoc_items {
|
||||
if !first {
|
||||
// Skip printing `<[generator@] as Generator<_>>::Return` from async blocks
|
||||
if let Some(ty) = term.skip_binder().ty() &&
|
||||
let ty::Projection(ty::ProjectionTy { item_def_id, .. }) = ty.kind() &&
|
||||
Some(*item_def_id) == self.tcx().lang_items().generator_return() {
|
||||
continue;
|
||||
}
|
||||
|
||||
if first {
|
||||
p!("<");
|
||||
first = false;
|
||||
} else {
|
||||
p!(", ");
|
||||
}
|
||||
|
||||
p!(write("{} = ", self.tcx().associated_item(assoc_item_def_id).name));
|
||||
|
||||
match term.skip_binder() {
|
||||
Term::Ty(ty) => {
|
||||
// Skip printing `<[generator@] as Generator<_>>::Return` from async blocks
|
||||
if matches!(
|
||||
ty.kind(), ty::Projection(ty::ProjectionTy { item_def_id, .. })
|
||||
if Some(*item_def_id) == self.tcx().lang_items().generator_return()
|
||||
) {
|
||||
p!("[async output]")
|
||||
} else {
|
||||
p!(print(ty))
|
||||
}
|
||||
p!(print(ty))
|
||||
}
|
||||
Term::Const(c) => {
|
||||
p!(print(c));
|
||||
}
|
||||
};
|
||||
|
||||
first = false;
|
||||
}
|
||||
|
||||
p!(">");
|
||||
if !first {
|
||||
p!(">");
|
||||
}
|
||||
}
|
||||
|
||||
first = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue