about summary refs log tree commit diff
path: root/src/librustdoc/html
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2022-04-12 15:06:31 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2022-05-15 13:38:26 +0200
commit4054c0f3e6cecddadcc2aa19d7c97efed5611a4b (patch)
tree81b14c8e599d98ed98d5c05b3456f5ce56a8a830 /src/librustdoc/html
parente1ec3260d79497080ca86540562d410ba67d2a95 (diff)
downloadrust-4054c0f3e6cecddadcc2aa19d7c97efed5611a4b.tar.gz
rust-4054c0f3e6cecddadcc2aa19d7c97efed5611a4b.zip
Reduce clean::Type size by replacing a DefId (only used to check for display) with a boolean
Diffstat (limited to 'src/librustdoc/html')
-rw-r--r--src/librustdoc/html/format.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs
index 528eb6410cb..abfeb96f6bf 100644
--- a/src/librustdoc/html/format.rs
+++ b/src/librustdoc/html/format.rs
@@ -982,11 +982,7 @@ fn fmt_type<'cx>(
                 write!(f, "impl {}", print_generic_bounds(bounds, cx))
             }
         }
-        clean::QPath { ref assoc, ref self_type, ref trait_, ref self_def_id } => {
-            let should_show_cast = !trait_.segments.is_empty()
-                && self_def_id
-                    .zip(Some(trait_.def_id()))
-                    .map_or(!self_type.is_self_type(), |(id, trait_)| id != trait_);
+        clean::QPath { ref assoc, ref self_type, ref trait_, should_show_cast } => {
             if f.alternate() {
                 if should_show_cast {
                     write!(f, "<{:#} as {:#}>::", self_type.print(cx), trait_.print(cx))?