diff options
| author | Michael Goulet <michael@errs.io> | 2022-10-30 19:39:07 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-11-01 20:41:47 +0000 |
| commit | e24df2778fb7a19dfe386ad563ea216a816db94a (patch) | |
| tree | c4ff15b9e18a76568744c0ab4dd216e917071830 /compiler | |
| parent | e70cbef0c5db81079f4b5643380d6047ccd34a10 (diff) | |
Format dyn Trait better in type_name intrinsic
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_const_eval/src/util/type_name.rs | 12 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/print/pretty.rs | 2 |
2 files changed, 3 insertions, 11 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> { diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index f07c60af248..fab85c39d25 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -1137,7 +1137,7 @@ pub trait PrettyPrinter<'tcx>: // // To avoid causing instabilities in compiletest // output, sort the auto-traits alphabetically. - auto_traits.sort_by_cached_key(|did| self.tcx().def_path_str(*did)); + auto_traits.sort_by_cached_key(|did| with_no_trimmed_paths!(self.tcx().def_path_str(*did))); for def_id in auto_traits { if !first { |
