w,
"<tr><td><code>{}extern crate {} as {};",
myitem.visibility.print_with_space(myitem.def_id, cx),
- anchor(myitem.def_id, &*src.as_str(), cx),
+ anchor(myitem.def_id.expect_real(), &*src.as_str(), cx),
myitem.name.as_ref().unwrap(),
),
None => write!(
w,
"<tr><td><code>{}extern crate {};",
myitem.visibility.print_with_space(myitem.def_id, cx),
- anchor(myitem.def_id, &*myitem.name.as_ref().unwrap().as_str(), cx),
+ anchor(
+ myitem.def_id.expect_real(),
+ &*myitem.name.as_ref().unwrap().as_str(),
+ cx
+ ),
),
}
w.write_str("</code></td></tr>");
// Just need an item with the correct def_id and attrs
let import_item = clean::Item {
- def_id: import_def_id,
+ def_id: import_def_id.into(),
attrs: import_attrs,
cfg: ast_attrs.cfg(cx.sess()),
..myitem.clone()
}
// If there are methods directly on this trait object, render them here.
- render_assoc_items(w, cx, it, it.def_id, AssocItemRender::All);
+ render_assoc_items(w, cx, it, it.def_id.expect_real(), AssocItemRender::All);
if let Some(implementors) = cx.cache.implementors.get(&it.def_id) {
// The DefId is for the first Type found with that name. The bool is
write_small_section_header(w, "foreign-impls", "Implementations on Foreign Types", "");
for implementor in foreign {
- let assoc_link = AssocItemLink::GotoSource(
- implementor.impl_item.def_id,
- &implementor.inner_impl().provided_trait_methods,
- );
+ let provided_methods = implementor.inner_impl().provided_trait_methods(cx.tcx());
+ let assoc_link =
+ AssocItemLink::GotoSource(implementor.impl_item.def_id, &provided_methods);
render_impl(
w,
cx,
path = if it.def_id.is_local() {
cx.current.join("/")
} else {
- let (ref path, _) = cx.cache.external_paths[&it.def_id];
+ let (ref path, _) = cx.cache.external_paths[&it.def_id.expect_real()];
path[..path.len() - 1].join("/")
},
ty = it.type_(),
// won't be visible anywhere in the docs. It would be nice to also show
// associated items from the aliased type (see discussion in #32077), but
// we need #14072 to make sense of the generics.
- render_assoc_items(w, cx, it, it.def_id, AssocItemRender::All)
+ render_assoc_items(w, cx, it, it.def_id.expect_real(), AssocItemRender::All)
}
fn item_opaque_ty(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::OpaqueTy) {
// won't be visible anywhere in the docs. It would be nice to also show
// associated items from the aliased type (see discussion in #32077), but
// we need #14072 to make sense of the generics.
- render_assoc_items(w, cx, it, it.def_id, AssocItemRender::All)
+ render_assoc_items(w, cx, it, it.def_id.expect_real(), AssocItemRender::All)
}
fn item_typedef(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Typedef) {
// won't be visible anywhere in the docs. It would be nice to also show
// associated items from the aliased type (see discussion in #32077), but
// we need #14072 to make sense of the generics.
- render_assoc_items(w, cx, it, it.def_id, AssocItemRender::All)
+ render_assoc_items(w, cx, it, it.def_id.expect_real(), AssocItemRender::All)
}
fn item_union(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::Union) {
document(w, cx, field, Some(it));
}
}
- render_assoc_items(w, cx, it, it.def_id, AssocItemRender::All)
+ render_assoc_items(w, cx, it, it.def_id.expect_real(), AssocItemRender::All)
}
fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum) {
render_stability_since(w, variant, it, cx.tcx());
}
}
- render_assoc_items(w, cx, it, it.def_id, AssocItemRender::All)
+ render_assoc_items(w, cx, it, it.def_id.expect_real(), AssocItemRender::All)
}
fn item_macro(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Macro) {
fn item_primitive(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item) {
document(w, cx, it, None);
- render_assoc_items(w, cx, it, it.def_id, AssocItemRender::All)
+ render_assoc_items(w, cx, it, it.def_id.expect_real(), AssocItemRender::All)
}
fn item_constant(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, c: &clean::Constant) {
}
}
}
- render_assoc_items(w, cx, it, it.def_id, AssocItemRender::All)
+ render_assoc_items(w, cx, it, it.def_id.expect_real(), AssocItemRender::All)
}
fn item_static(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::Static) {
document(w, cx, it, None);
- render_assoc_items(w, cx, it, it.def_id, AssocItemRender::All)
+ render_assoc_items(w, cx, it, it.def_id.expect_real(), AssocItemRender::All)
}
fn item_keyword(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item) {