about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-08-28 19:53:59 +0200
committerGitHub <noreply@github.com>2023-08-28 19:53:59 +0200
commit07a32e2dbd99b831812c42c510be21c240b11562 (patch)
tree4ba58da6d1b3926288f8483aabb129fd13a3d565 /compiler/rustc_trait_selection/src
parentde6b03b4f160657b79a11a5c7e7a6d96d511546d (diff)
parentecf2f68e45178fa377cf0343c8573c62e81585e1 (diff)
downloadrust-07a32e2dbd99b831812c42c510be21c240b11562.tar.gz
rust-07a32e2dbd99b831812c42c510be21c240b11562.zip
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`.
Diffstat (limited to 'compiler/rustc_trait_selection/src')
-rw-r--r--compiler/rustc_trait_selection/src/traits/specialize/mod.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs
index 729cf2f3313..efab29743f4 100644
--- a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs
@@ -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('>');
     }