diff options
| author | bors <bors@rust-lang.org> | 2022-10-06 05:58:27 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-10-06 05:58:27 +0000 |
| commit | 4bd30785eb6e55f317b41b7c278f438807eeb174 (patch) | |
| tree | 33415b4276d016831097b86178f33af60250276f /src/librustdoc/html | |
| parent | 0152393048c4eb6c6d2aec63e9899cc86a269b44 (diff) | |
| parent | b7642fb97c0051754e4e07bacd3a72bd126de7f7 (diff) | |
Auto merge of #102726 - matthiaskrgr:rollup-2ghn38b, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - #102672 (rustdoc: remove unused CSS class `in-band`) - #102693 (Revert "Use getentropy when possible on all Apple platforms") - #102694 (Suggest calling method if fn does not exist) - #102708 (Suggest `==` to wrong assign expr) - #102710 (Add test for issue 82633) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/librustdoc/html')
| -rw-r--r-- | src/librustdoc/html/render/context.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/html/render/mod.rs | 10 | ||||
| -rw-r--r-- | src/librustdoc/html/render/write_shared.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/html/static/css/rustdoc.css | 24 | ||||
| -rw-r--r-- | src/librustdoc/html/static/js/main.js | 2 | ||||
| -rw-r--r-- | src/librustdoc/html/templates/print_item.html | 24 |
6 files changed, 25 insertions, 43 deletions
diff --git a/src/librustdoc/html/render/context.rs b/src/librustdoc/html/render/context.rs index 22a6fcd316a..902b9522429 100644 --- a/src/librustdoc/html/render/context.rs +++ b/src/librustdoc/html/render/context.rs @@ -634,9 +634,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> { write!( buf, "<div class=\"main-heading\">\ - <h1 class=\"fqn\">\ - <span class=\"in-band\">Rustdoc settings</span>\ - </h1>\ + <h1 class=\"fqn\">Rustdoc settings</h1>\ <span class=\"out-of-band\">\ <a id=\"back\" href=\"javascript:void(0)\" onclick=\"history.back();\">\ Back\ diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index aa9788fad2b..4bbb322d370 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -364,11 +364,7 @@ impl AllTypes { } } - f.write_str( - "<h1 class=\"fqn\">\ - <span class=\"in-band\">List of all items</span>\ - </h1>", - ); + f.write_str("<h1 class=\"fqn\">List of all items</h1>"); // Note: print_entries does not escape the title, because we know the current set of titles // doesn't require escaping. print_entries(f, &self.structs, ItemSection::Structs); @@ -398,9 +394,7 @@ fn scrape_examples_help(shared: &SharedContext<'_>) -> String { let mut ids = IdMap::default(); format!( "<div class=\"main-heading\">\ - <h1 class=\"fqn\">\ - <span class=\"in-band\">About scraped examples</span>\ - </h1>\ + <h1 class=\"fqn\">About scraped examples</h1>\ </div>\ <div>{}</div>", Markdown { diff --git a/src/librustdoc/html/render/write_shared.rs b/src/librustdoc/html/render/write_shared.rs index 1c88528aa20..85f63c985b3 100644 --- a/src/librustdoc/html/render/write_shared.rs +++ b/src/librustdoc/html/render/write_shared.rs @@ -517,9 +517,7 @@ if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex}; }; let content = format!( - "<h1 class=\"fqn\">\ - <span class=\"in-band\">List of all crates</span>\ - </h1><ul class=\"all-items\">{}</ul>", + "<h1 class=\"fqn\">List of all crates</h1><ul class=\"all-items\">{}</ul>", krates .iter() .map(|s| { diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 140ce3ba9fc..b86b8f9dbf8 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -148,6 +148,13 @@ h1, h2, h3, h4 { h1.fqn { margin: 0; padding: 0; + flex-grow: 1; + /* We use overflow-wrap: break-word for Safari, which doesn't recognize + `anywhere`: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap */ + overflow-wrap: break-word; + /* Then override it with `anywhere`, which is required to make non-Safari browsers break + more aggressively when we want them to. */ + overflow-wrap: anywhere; } .main-heading { display: flex; @@ -214,7 +221,7 @@ pre.rust a, .sidebar h2 a, .sidebar h3 a, .mobile-topbar h2 a, -.in-band a, +h1.fqn a, .search-results a, .module-item .stab, .import-item .stab, @@ -654,19 +661,6 @@ pre.example-line-numbers { font-weight: normal; } -.in-band { - flex-grow: 1; - margin: 0px; - padding: 0px; - /* We use overflow-wrap: break-word for Safari, which doesn't recognize - `anywhere`: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap */ - overflow-wrap: break-word; - /* Then override it with `anywhere`, which is required to make non-Safari browsers break - more aggressively when we want them to. */ - overflow-wrap: anywhere; - background-color: var(--main-background-color); -} - .docblock code, .docblock-short code, pre, .rustdoc.source .example-wrap { background-color: var(--code-block-background-color); @@ -752,7 +746,7 @@ a { display: initial; } -.in-band:hover > .anchor, .impl:hover > .anchor, .method.trait-impl:hover > .anchor, +.impl:hover > .anchor, .method.trait-impl:hover > .anchor, .type.trait-impl:hover > .anchor, .associatedconstant.trait-impl:hover > .anchor, .associatedtype.trait-impl:hover > .anchor { display: inline-block; diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index bbaf6d3b507..6d21ffdc792 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -522,7 +522,7 @@ function loadCss(cssFileName) { } let currentNbImpls = implementors.getElementsByClassName("impl").length; - const traitName = document.querySelector("h1.fqn > .in-band > .trait").textContent; + const traitName = document.querySelector("h1.fqn > .trait").textContent; const baseIdName = "impl-" + traitName + "-"; const libs = Object.getOwnPropertyNames(imp); // We don't want to include impls from this JS file, when the HTML already has them. diff --git a/src/librustdoc/html/templates/print_item.html b/src/librustdoc/html/templates/print_item.html index c755157d276..b6ce3ea3dee 100644 --- a/src/librustdoc/html/templates/print_item.html +++ b/src/librustdoc/html/templates/print_item.html @@ -1,18 +1,16 @@ <div class="main-heading"> {#- -#} <h1 class="fqn"> {#- -#} - <span class="in-band"> {#- -#} - {{-typ-}} - {#- The breadcrumbs of the item path, like std::string -#} - {%- for component in path_components -%} - <a href="{{component.path|safe}}index.html">{{component.name}}</a>::<wbr> - {%- endfor -%} - <a class="{{item_type}}" href="#">{{name}}</a> {#- -#} - <button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"> {#- -#} - <img src="{{static_root_path|safe}}clipboard{{page.resource_suffix}}.svg" {# -#} - width="19" height="18" {# -#} - alt="Copy item path"> {#- -#} - </button> {#- -#} - </span> {#- -#} + {{-typ-}} + {#- The breadcrumbs of the item path, like std::string -#} + {%- for component in path_components -%} + <a href="{{component.path|safe}}index.html">{{component.name}}</a>::<wbr> + {%- endfor -%} + <a class="{{item_type}}" href="#">{{name}}</a> {#- -#} + <button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"> {#- -#} + <img src="{{static_root_path|safe}}clipboard{{page.resource_suffix}}.svg" {# -#} + width="19" height="18" {# -#} + alt="Copy item path"> {#- -#} + </button> {#- -#} </h1> {#- -#} <span class="out-of-band"> {#- -#} {% if !stability_since_raw.is_empty() %} |
