summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/util
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-10-30 19:39:07 +0000
committerMichael Goulet <michael@errs.io>2022-11-01 20:41:47 +0000
commite24df2778fb7a19dfe386ad563ea216a816db94a (patch)
treec4ff15b9e18a76568744c0ab4dd216e917071830 /compiler/rustc_const_eval/src/util
parente70cbef0c5db81079f4b5643380d6047ccd34a10 (diff)
downloadrust-e24df2778fb7a19dfe386ad563ea216a816db94a.tar.gz
rust-e24df2778fb7a19dfe386ad563ea216a816db94a.zip
Format dyn Trait better in type_name intrinsic
Diffstat (limited to 'compiler/rustc_const_eval/src/util')
-rw-r--r--compiler/rustc_const_eval/src/util/type_name.rs12
1 files changed, 2 insertions, 10 deletions
diff --git a/compiler/rustc_const_eval/src/util/type_name.rs b/compiler/rustc_const_eval/src/util/type_name.rs
index 221efc6f981..08a6d69b8e4 100644
--- a/compiler/rustc_const_eval/src/util/type_name.rs
+++ b/compiler/rustc_const_eval/src/util/type_name.rs
@@ -73,18 +73,10 @@ impl<'tcx> Printer<'tcx> for AbsolutePathPrinter<'tcx> {
     }
 
     fn print_dyn_existential(
-        mut self,
+        self,
         predicates: &'tcx ty::List<ty::Binder<'tcx, ty::ExistentialPredicate<'tcx>>>,
     ) -> Result<Self::DynExistential, Self::Error> {
-        let mut first = true;
-        for p in predicates {
-            if !first {
-                write!(self, "+")?;
-            }
-            first = false;
-            self = p.print(self)?;
-        }
-        Ok(self)
+        self.pretty_print_dyn_existential(predicates)
     }
 
     fn path_crate(mut self, cnum: CrateNum) -> Result<Self::Path, Self::Error> {