1
Fork 0

Rollup merge of #115322 - estebank:list-tweak, r=compiler-errors

Tweak output of `to_pretty_impl_header` involving only anon lifetimes

Do not print `impl<> Foo for &Bar`.
This commit is contained in:
Matthias Krüger 2023-08-28 19:53:59 +02:00 committed by GitHub
commit 07a32e2dbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 24 deletions

View file

@ -472,17 +472,11 @@ pub(crate) fn to_pretty_impl_header(tcx: TyCtxt<'_>, impl_def_id: DefId) -> Opti
let mut types_without_default_bounds = FxIndexSet::default();
let sized_trait = tcx.lang_items().sized_trait();
if !args.is_empty() {
let arg_names = args.iter().map(|k| k.to_string()).filter(|k| k != "'_").collect::<Vec<_>>();
if !arg_names.is_empty() {
types_without_default_bounds.extend(args.types());
w.push('<');
w.push_str(
&args
.iter()
.map(|k| k.to_string())
.filter(|k| k != "'_")
.collect::<Vec<_>>()
.join(", "),
);
w.push_str(&arg_names.join(", "));
w.push('>');
}