Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 10 pull requests #74114

Closed
wants to merge 26 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7d7221c
typeck: adding type information to projection
Azhng Jun 24, 2020
8dc1e42
libstd/net/tcp.rs: #![deny(unsafe_op_in_unsafe_fn)]
ryr3 Jul 2, 2020
d5141e6
No need to call getPageId a second time
GuillaumeGomez Mar 30, 2020
0fcb7da
Improve page hash handling
GuillaumeGomez Mar 30, 2020
fc61cca
Expand sub code blocks block content when hidden when the page hash r…
GuillaumeGomez Mar 30, 2020
cdabdfa
Simplify DOM by removing IDs for code tags
GuillaumeGomez Jun 27, 2020
2453946
Update rustdoc tests
GuillaumeGomez Jun 27, 2020
af29620
Fix links
GuillaumeGomez Jun 27, 2020
e955beb
Remove render-redirect-pages option in rustdoc
GuillaumeGomez Jul 2, 2020
ee8dd4e
Fix const prop ICE
oli-obk Jul 4, 2020
2f31426
rustdoc: Restore underline text decoration on hover for FQN in header
rye Jul 5, 2020
5fa19ad
Remove unused RUSTC_DEBUG_ASSERTIONS
tmiasko Jul 6, 2020
f226e6b
Add `read_exact_at` and `write_all_at` to WASI's `FileExt`
sunfishcode Jul 3, 2020
6196eaa
Fix the return type of Windows' `OpenOptionsExt::security_qos_flags`.
sunfishcode Jul 3, 2020
e46c187
Always resolve type@primitive as a primitive, not a module
jyn514 Jul 6, 2020
7610ab3
Expand abbreviation in core::ffi description
pierwill Jul 6, 2020
99fc337
Rollup merge of #70563 - GuillaumeGomez:page-hash-handling, r=ollie27…
Dylan-DPC Jul 6, 2020
4d24341
Rollup merge of #73870 - sexxi-goose:projection-ty, r=nikomatsakis
Dylan-DPC Jul 6, 2020
59112d3
Rollup merge of #73962 - ryr3:unsafe_tcp, r=LukasKalbertodt
Dylan-DPC Jul 6, 2020
5c267ae
Rollup merge of #74067 - rye:rustdoc-fqn-hover-underline, r=Guillaume…
Dylan-DPC Jul 6, 2020
87b8681
Rollup merge of #74074 - sunfishcode:windows-openoptionsext-return-ty…
Dylan-DPC Jul 6, 2020
51d7220
Rollup merge of #74076 - sunfishcode:wasi-fileext-newmethods, r=alexc…
Dylan-DPC Jul 6, 2020
6a8e601
Rollup merge of #74078 - jyn514:lut, r=Manishearth
Dylan-DPC Jul 6, 2020
b5cfc94
Rollup merge of #74090 - tmiasko:rustc-debug-assertions, r=RalfJung
Dylan-DPC Jul 6, 2020
8511ed6
Rollup merge of #74102 - oli-obk:const_prop_icde, r=wesleywiser
Dylan-DPC Jul 6, 2020
f36490d
Rollup merge of #74112 - pierwill:patch-2, r=sfackler
Dylan-DPC Jul 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 9 additions & 38 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
@@ -2586,8 +2586,7 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait)
let name = m.name.as_ref().unwrap();
let item_type = m.type_();
let id = cx.derive_id(format!("{}.{}", item_type, name));
let ns_id = cx.derive_id(format!("{}.{}", name, item_type.name_space()));
write!(w, "<h3 id='{id}' class='method'><code id='{ns_id}'>", id = id, ns_id = ns_id);
write!(w, "<h3 id='{id}' class='method'><code>", id = id);
render_assoc_item(w, m, AssocItemLink::Anchor(Some(&id)), ItemType::Impl);
write!(w, "</code>");
render_stability_since(w, m, t);
@@ -2972,20 +2971,14 @@ fn item_struct(w: &mut Buffer, cx: &Context, it: &clean::Item, s: &clean::Struct
ItemType::StructField,
field.name.as_ref().unwrap()
));
let ns_id = cx.derive_id(format!(
"{}.{}",
field.name.as_ref().unwrap(),
ItemType::StructField.name_space()
));
write!(
w,
"<span id=\"{id}\" class=\"{item_type} small-section-header\">\
<a href=\"#{id}\" class=\"anchor field\"></a>\
<code id=\"{ns_id}\">{name}: {ty}</code>\
<code>{name}: {ty}</code>\
</span>",
item_type = ItemType::StructField,
id = id,
ns_id = ns_id,
name = field.name.as_ref().unwrap(),
ty = ty.print()
);
@@ -3103,18 +3096,12 @@ fn item_enum(w: &mut Buffer, cx: &Context, it: &clean::Item, e: &clean::Enum) {
for variant in &e.variants {
let id =
cx.derive_id(format!("{}.{}", ItemType::Variant, variant.name.as_ref().unwrap()));
let ns_id = cx.derive_id(format!(
"{}.{}",
variant.name.as_ref().unwrap(),
ItemType::Variant.name_space()
));
write!(
w,
"<div id=\"{id}\" class=\"variant small-section-header\">\
<a href=\"#{id}\" class=\"anchor field\"></a>\
<code id='{ns_id}'>{name}",
<a href=\"#{id}\" class=\"anchor field\"></a>\
<code>{name}",
id = id,
ns_id = ns_id,
name = variant.name.as_ref().unwrap()
);
if let clean::VariantItem(ref var) = variant.inner {
@@ -3155,21 +3142,13 @@ fn item_enum(w: &mut Buffer, cx: &Context, it: &clean::Item, e: &clean::Enum) {
variant.name.as_ref().unwrap(),
field.name.as_ref().unwrap()
));
let ns_id = cx.derive_id(format!(
"{}.{}.{}.{}",
variant.name.as_ref().unwrap(),
ItemType::Variant.name_space(),
field.name.as_ref().unwrap(),
ItemType::StructField.name_space()
));
write!(
w,
"<span id=\"{id}\" class=\"variant small-section-header\">\
<a href=\"#{id}\" class=\"anchor field\"></a>\
<code id='{ns_id}'>{f}:&nbsp;{t}\
<code>{f}:&nbsp;{t}\
</code></span>",
id = id,
ns_id = ns_id,
f = field.name.as_ref().unwrap(),
t = ty.print()
);
@@ -3661,9 +3640,7 @@ fn render_impl(
// Only render when the method is not static or we allow static methods
if render_method_item {
let id = cx.derive_id(format!("{}.{}", item_type, name));
let ns_id = cx.derive_id(format!("{}.{}", name, item_type.name_space()));
write!(w, "<h4 id='{}' class=\"{}{}\">", id, item_type, extra_class);
write!(w, "<code id='{}'>", ns_id);
write!(w, "<h4 id='{}' class=\"{}{}\"><code>", id, item_type, extra_class);
render_assoc_item(w, item, link.anchor(&id), ItemType::Impl);
write!(w, "</code>");
render_stability_since_raw(w, item.stable_since(), outer_version);
@@ -3679,17 +3656,13 @@ fn render_impl(
}
clean::TypedefItem(ref tydef, _) => {
let id = cx.derive_id(format!("{}.{}", ItemType::AssocType, name));
let ns_id = cx.derive_id(format!("{}.{}", name, item_type.name_space()));
write!(w, "<h4 id='{}' class=\"{}{}\">", id, item_type, extra_class);
write!(w, "<code id='{}'>", ns_id);
write!(w, "<h4 id='{}' class=\"{}{}\"><code>", id, item_type, extra_class);
assoc_type(w, item, &Vec::new(), Some(&tydef.type_), link.anchor(&id), "");
write!(w, "</code></h4>");
}
clean::AssocConstItem(ref ty, ref default) => {
let id = cx.derive_id(format!("{}.{}", item_type, name));
let ns_id = cx.derive_id(format!("{}.{}", name, item_type.name_space()));
write!(w, "<h4 id='{}' class=\"{}{}\">", id, item_type, extra_class);
write!(w, "<code id='{}'>", ns_id);
write!(w, "<h4 id='{}' class=\"{}{}\"><code>", id, item_type, extra_class);
assoc_const(w, item, ty, default.as_ref(), link.anchor(&id), "");
write!(w, "</code>");
render_stability_since_raw(w, item.stable_since(), outer_version);
@@ -3704,9 +3677,7 @@ fn render_impl(
}
clean::AssocTypeItem(ref bounds, ref default) => {
let id = cx.derive_id(format!("{}.{}", item_type, name));
let ns_id = cx.derive_id(format!("{}.{}", name, item_type.name_space()));
write!(w, "<h4 id='{}' class=\"{}{}\">", id, item_type, extra_class);
write!(w, "<code id='{}'>", ns_id);
write!(w, "<h4 id='{}' class=\"{}{}\"><code>", id, item_type, extra_class);
assoc_type(w, item, bounds, default.as_ref(), link.anchor(&id), "");
write!(w, "</code></h4>");
}
21 changes: 7 additions & 14 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
@@ -306,14 +306,6 @@ function defocusSearchBar() {
function expandSection(id) {
var elem = document.getElementById(id);
if (elem && isHidden(elem)) {
if (elem.tagName === "CODE" && elem.parentNode.tagName === "H4") {
// We are in a trait implementation, what we want is the parent.
elem = elem.parentNode;
if (elem.id !== null && elem.id.length > 0) {
// Change the id to the parent which is "more clear" and better for users.
window.location.hash = elem.id;
}
}
var h3 = elem.parentNode.previousElementSibling;
if (h3 && h3.tagName !== "H3") {
h3 = h3.previousElementSibling; // skip div.docblock
@@ -2561,6 +2553,13 @@ function defocusSearchBar() {

onEachLazy(document.getElementsByClassName("docblock"), buildToggleWrapper);
onEachLazy(document.getElementsByClassName("sub-variant"), buildToggleWrapper);
var pageId = getPageId();

autoCollapse(pageId, getCurrentValue("rustdoc-collapse") === "true");

if (pageId !== null) {
expandSection(pageId);
}
}());

function createToggleWrapper(tog) {
@@ -2696,12 +2695,6 @@ function defocusSearchBar() {
hideSidebar();
};

autoCollapse(pageId, getCurrentValue("rustdoc-collapse") === "true");

if (pageId !== null) {
expandSection(pageId);
}

if (main) {
onEachLazy(main.getElementsByClassName("loading-content"), function(e) {
e.remove();