about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-10-13 18:19:20 +0530
committerGitHub <noreply@github.com>2022-10-13 18:19:20 +0530
commitdbff6a91c1e50344f56bfa45fda3512afc8669a0 (patch)
tree27ebd7d1ca30b781d6fe50f0b6a82af5f8b542ff /compiler
parent376c81c94a05ea13aaef9462cf6ff744b396374f (diff)
parent61f097308b90f79300d7a577ea9d9cfb494458fe (diff)
downloadrust-dbff6a91c1e50344f56bfa45fda3512afc8669a0.tar.gz
rust-dbff6a91c1e50344f56bfa45fda3512afc8669a0.zip
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
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_middle/src/ty/print/pretty.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs
index c0607a102a9..66354196b4e 100644
--- a/compiler/rustc_middle/src/ty/print/pretty.rs
+++ b/compiler/rustc_middle/src/ty/print/pretty.rs
@@ -637,7 +637,9 @@ pub trait PrettyPrinter<'tcx>:
                 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))