]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/html/format.rs
Reduce clean::Type size by replacing a DefId (only used to check for display) with...
[rust.git] / src / librustdoc / html / format.rs
index 528eb6410cb371b5adf392f536e4308677854ea6..abfeb96f6bfd41c3caefa956e21f2a832195b115 100644 (file)
@@ -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))?