1
Fork 0

Fix inlining

This commit is contained in:
Aaron Hill 2018-02-15 18:45:52 -05:00
parent 94fd4f360b
commit 64a1f6fbfd
No known key found for this signature in database
GPG key ID: B4087E510E98B164
2 changed files with 15 additions and 5 deletions

View file

@ -2451,6 +2451,8 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
<ul class='item-list' id='synthetic-implementors-list'>
";
let mut synthetic_types = Vec::new();
if let Some(implementors) = cache.implementors.get(&it.def_id) {
// The DefId is for the first Type found with that name. The bool is
// if any Types with the same name but different DefId have been found.
@ -2506,6 +2508,9 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
if t.auto {
write!(w, "{}", synthetic_impl_header)?;
for implementor in synthetic {
synthetic_types.extend(
collect_paths_for_type(implementor.inner_impl().for_.clone())
);
render_implementor(cx, implementor, w, &implementor_dups)?;
}
write!(w, "</ul>")?;
@ -2516,13 +2521,13 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
write!(w, "{}", impl_header)?;
write!(w, "</ul>")?;
write!(w, r#"<script type="text/javascript">window.inlined_types=new Set();</script>"#)?;
if t.auto {
write!(w, "{}", synthetic_impl_header)?;
write!(w, "</ul>")?;
}
}
write!(w, r#"<script type="text/javascript">window.inlined_types=new Set({});</script>"#,
as_json(&synthetic_types))?;
write!(w, r#"<script type="text/javascript" async
src="{root_path}/implementors/{path}/{ty}.{name}.js">