]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/html/render/print_item.rs
Auto merge of #91255 - b-naber:normalization-ice, r=jackh276
[rust.git] / src / librustdoc / html / render / print_item.rs
index f8a16fb9b713d0af1d345b78179dea9b0a30e453..62fdec15af42091bf4db8381f2d815bf84b09140 100644 (file)
@@ -727,10 +727,10 @@ fn trait_item(w: &mut Buffer, cx: &Context<'_>, m: &clean::Item, t: &clean::Item
         let mut implementor_dups: FxHashMap<Symbol, (DefId, bool)> = FxHashMap::default();
         for implementor in implementors {
             match implementor.inner_impl().for_ {
-                clean::Type::ResolvedPath { ref path }
-                | clean::BorrowedRef {
-                    type_: box clean::Type::ResolvedPath { ref path }, ..
-                } if !path.is_assoc_ty() => {
+                clean::Type::Path { ref path }
+                | clean::BorrowedRef { type_: box clean::Type::Path { ref path }, .. }
+                    if !path.is_assoc_ty() =>
+                {
                     let did = path.def_id();
                     let &mut (prev_did, ref mut has_duplicates) =
                         implementor_dups.entry(path.last()).or_insert((did, false));
@@ -1452,14 +1452,15 @@ fn render_implementor(
 ) {
     // If there's already another implementor that has the same abridged name, use the
     // full path, for example in `std::iter::ExactSizeIterator`
-    let use_absolute =
-        match implementor.inner_impl().for_ {
-            clean::Type::ResolvedPath { ref path, .. }
-            | clean::BorrowedRef {
-                type_: box clean::Type::ResolvedPath { ref path, .. }, ..
-            } if !path.is_assoc_ty() => implementor_dups[&path.last()].1,
-            _ => false,
-        };
+    let use_absolute = match implementor.inner_impl().for_ {
+        clean::Type::Path { ref path, .. }
+        | clean::BorrowedRef { type_: box clean::Type::Path { ref path, .. }, .. }
+            if !path.is_assoc_ty() =>
+        {
+            implementor_dups[&path.last()].1
+        }
+        _ => false,
+    };
     render_impl(
         w,
         cx,
@@ -1768,6 +1769,13 @@ fn write_size_of_layout(w: &mut Buffer, layout: &Layout, tag_size: u64) {
                  the type was too big.</p>"
             );
         }
+        Err(LayoutError::NormalizationFailure(_, _)) => {
+            writeln!(
+                w,
+                "<p><strong>Note:</strong> Encountered an error during type layout; \
+                the type failed to be normalized.</p>"
+            )
+        }
     }
 
     writeln!(w, "</div>");