Rollup merge of #102904 - compiler-errors:rpitit-verbosely, r=cjgillot

Print return-position `impl Trait` in trait verbosely if `-Zverbose`

Makes the behavior a bit closer to regular `impl Trait` printing
This commit is contained in:
Dylan DPC
2022-10-13 18:19:20 +05:30
committed by GitHub
+3 -1
View File
@@ -637,7 +637,9 @@ fn pretty_print_type(mut self, ty: Ty<'tcx>) -> Result<Self::Type, Self::Error>
p!(print_def_path(def_id, &[]));
}
ty::Projection(ref data) => {
if self.tcx().def_kind(data.item_def_id) == DefKind::ImplTraitPlaceholder {
if !(self.tcx().sess.verbose() || NO_QUERIES.with(|q| q.get()))
&& self.tcx().def_kind(data.item_def_id) == DefKind::ImplTraitPlaceholder
{
return self.pretty_print_opaque_impl_type(data.item_def_id, data.substs);
} else {
p!(print(data))