Skip to content

Commit 9af90ff

Browse files
authored
Rollup merge of #107490 - notriddle:notriddle/rm-sidebar-tooltip, r=GuillaumeGomez
rustdoc: remove inconsistently-present sidebar tooltips Discussed in https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Inconsistent.20sidebar.20tooltips/near/323565625
2 parents 400b03a + 3a20cbf commit 9af90ff

File tree

4 files changed

+4
-41
lines changed

4 files changed

+4
-41
lines changed

src/librustdoc/html/render/context.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use super::search_index::build_index;
1818
use super::write_shared::write_shared;
1919
use super::{
2020
collect_spans_and_sources, print_sidebar, scrape_examples_help, sidebar_module_like, AllTypes,
21-
LinkFromSrc, NameDoc, StylePath,
21+
LinkFromSrc, StylePath,
2222
};
2323

2424
use crate::clean::{self, types::ExternalLocation, ExternalCrate};
@@ -256,7 +256,7 @@ impl<'tcx> Context<'tcx> {
256256
}
257257

258258
/// Construct a map of items shown in the sidebar to a plain-text summary of their docs.
259-
fn build_sidebar_items(&self, m: &clean::Module) -> BTreeMap<String, Vec<NameDoc>> {
259+
fn build_sidebar_items(&self, m: &clean::Module) -> BTreeMap<String, Vec<String>> {
260260
// BTreeMap instead of HashMap to get a sorted output
261261
let mut map: BTreeMap<_, Vec<_>> = BTreeMap::new();
262262
let mut inserted: FxHashMap<ItemType, FxHashSet<Symbol>> = FxHashMap::default();
@@ -274,10 +274,7 @@ impl<'tcx> Context<'tcx> {
274274
if inserted.entry(short).or_default().insert(myname) {
275275
let short = short.to_string();
276276
let myname = myname.to_string();
277-
map.entry(short).or_default().push((
278-
myname,
279-
Some(item.doc_value().map_or_else(String::new, |s| plain_text_summary(&s))),
280-
));
277+
map.entry(short).or_default().push(myname);
281278
}
282279
}
283280

src/librustdoc/html/render/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ use crate::scrape_examples::{CallData, CallLocation};
8383
use crate::try_none;
8484
use crate::DOC_RUST_LANG_ORG_CHANNEL;
8585

86-
/// A pair of name and its optional document.
87-
pub(crate) type NameDoc = (String, Option<String>);
88-
8986
pub(crate) fn ensure_trailing_slash(v: &str) -> impl fmt::Display + '_ {
9087
crate::html::format::display_fn(move |f| {
9188
if !v.ends_with('/') && !v.is_empty() { write!(f, "{}/", v) } else { f.write_str(v) }

src/librustdoc/html/static/js/main.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -455,10 +455,7 @@ function loadCss(cssUrl) {
455455
const ul = document.createElement("ul");
456456
ul.className = "block " + shortty;
457457

458-
for (const item of filtered) {
459-
const name = item[0];
460-
const desc = item[1]; // can be null
461-
458+
for (const name of filtered) {
462459
let path;
463460
if (shortty === "mod") {
464461
path = name + "/index.html";
@@ -468,7 +465,6 @@ function loadCss(cssUrl) {
468465
const current_page = document.location.href.split("/").pop();
469466
const link = document.createElement("a");
470467
link.href = path;
471-
link.title = desc;
472468
if (path === current_page) {
473469
link.className = "current";
474470
}

tests/rustdoc/markdown-summaries.rs

-27
This file was deleted.

0 commit comments

Comments
 (0)