let mut implementor_dups: FxHashMap<Symbol, (DefId, bool)> = FxHashMap::default();
for implementor in implementors {
match implementor.inner_impl().for_ {
- clean::ResolvedPath { ref path, did, .. }
- | clean::BorrowedRef {
- type_: box clean::ResolvedPath { ref path, did, .. }, ..
- } 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));
if prev_did != did {
cx.derive_id(format!("{}.{}", ItemType::Variant, variant.name.as_ref().unwrap()));
write!(
w,
- "<div id=\"{id}\" class=\"variant small-section-header\">\
+ "<h3 id=\"{id}\" class=\"variant small-section-header\">\
<a href=\"#{id}\" class=\"anchor field\"></a>\
<code>{name}",
id = id,
}
w.write_str("</code>");
render_stability_since(w, variant, it, cx.tcx());
- w.write_str("</div>");
- document(w, cx, variant, Some(it), HeadingOffset::H3);
- document_non_exhaustive(w, variant);
+ w.write_str("</h3>");
use crate::clean::Variant;
if let Some((extra, fields)) = match *variant.kind {
variant.name.as_ref().unwrap()
));
write!(w, "<div class=\"sub-variant\" id=\"{id}\">", id = variant_id);
- write!(
- w,
- "<h3>{extra}Fields of <b>{name}</b></h3><div>",
- extra = extra,
- name = variant.name.as_ref().unwrap(),
- );
+ write!(w, "<h4>{extra}Fields</h4>", extra = extra,);
+ document_non_exhaustive(w, variant);
for field in fields {
match *field.kind {
clean::StrippedItem(box clean::StructFieldItem(_)) => {}
));
write!(
w,
- "<span id=\"{id}\" class=\"variant small-section-header\">\
+ "<div class=\"sub-variant-field\">\
+ <span id=\"{id}\" class=\"variant small-section-header\">\
<a href=\"#{id}\" class=\"anchor field\"></a>\
<code>{f}: {t}</code>\
</span>",
f = field.name.as_ref().unwrap(),
t = ty.print(cx)
);
- document(w, cx, field, Some(variant), HeadingOffset::H4);
+ document(w, cx, field, Some(variant), HeadingOffset::H5);
+ write!(w, "</div>");
}
_ => unreachable!(),
}
}
- w.write_str("</div></div>");
+ w.write_str("</div>");
}
+
+ document(w, cx, variant, Some(it), HeadingOffset::H4);
}
}
let def_id = it.def_id.expect_def_id();
// 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::ResolvedPath { ref path, .. }
- | clean::BorrowedRef { type_: box clean::ResolvedPath { ref path, .. }, .. }
+ clean::Type::Path { ref path, .. }
+ | clean::BorrowedRef { type_: box clean::Type::Path { ref path, .. }, .. }
if !path.is_assoc_ty() =>
{
implementor_dups[&path.last()].1
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>");