about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-07-18 08:08:59 +0200
committerGitHub <noreply@github.com>2024-07-18 08:08:59 +0200
commit97d5edf4b1c31c0657f760c20f8388f2c2196d00 (patch)
tree7284a00d9eecdc1a40d28602009acadc46b11d2f /compiler/rustc_middle/src
parent3aafbd28e54e7da0ba53d84c4dbf37fc027775a2 (diff)
parentb84e2b7c98c687b07e28458db1e8ca68157b0d15 (diff)
downloadrust-97d5edf4b1c31c0657f760c20f8388f2c2196d00.tar.gz
rust-97d5edf4b1c31c0657f760c20f8388f2c2196d00.zip
Rollup merge of #127783 - compiler-errors:rtn-pretty, r=fee1-dead
Put the dots back in RTN pretty printing

Also don't render RTN-like bounds for methods with ty/const params.
Diffstat (limited to 'compiler/rustc_middle/src')
-rw-r--r--compiler/rustc_middle/src/ty/print/pretty.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs
index df080b2887b..57cd2dc73c4 100644
--- a/compiler/rustc_middle/src/ty/print/pretty.rs
+++ b/compiler/rustc_middle/src/ty/print/pretty.rs
@@ -1214,11 +1214,14 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
             && let ty::Alias(_, alias_ty) =
                 self.tcx().fn_sig(fn_def_id).skip_binder().output().skip_binder().kind()
             && alias_ty.def_id == def_id
+            && let generics = self.tcx().generics_of(fn_def_id)
+            // FIXME(return_type_notation): We only support lifetime params for now.
+            && generics.own_params.iter().all(|param| matches!(param.kind, ty::GenericParamDefKind::Lifetime))
         {
-            let num_args = self.tcx().generics_of(fn_def_id).count();
+            let num_args = generics.count();
             write!(self, " {{ ")?;
             self.print_def_path(fn_def_id, &args[..num_args])?;
-            write!(self, "() }}")?;
+            write!(self, "(..) }}")?;
         }
 
         Ok(())