diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2021-04-04 00:19:36 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-04 00:19:36 +0900 |
| commit | 0daec04d657141e2eb2cea1675dd3e44624a8671 (patch) | |
| tree | 0f67f477e1c6bc69744ebe0fa569e81ca1b34570 /src/librustdoc/html/render | |
| parent | 3b40d2c1f3ef12c602c804282ff262fd694ffbba (diff) | |
| parent | 1fe0fe47fcd88c67887b45293351a653b548e86a (diff) | |
| download | rust-0daec04d657141e2eb2cea1675dd3e44624a8671.tar.gz rust-0daec04d657141e2eb2cea1675dd3e44624a8671.zip | |
Rollup merge of #83756 - camelid:internal-rename-doc-spotlight, r=GuillaumeGomez
rustdoc: Rename internal uses of `spotlight` I didn't make these renames in #80965 because I didn't want the PR to conflict with #80914.
Diffstat (limited to 'src/librustdoc/html/render')
| -rw-r--r-- | src/librustdoc/html/render/mod.rs | 14 | ||||
| -rw-r--r-- | src/librustdoc/html/render/print_item.rs | 10 |
2 files changed, 13 insertions, 11 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 07bd26a4c5e..a8a08fb23e0 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -1045,7 +1045,7 @@ fn render_assoc_item( write!( w, "{}{}{}{}{}{}{}fn <a href=\"{href}\" class=\"fnname\">{name}</a>\ - {generics}{decl}{spotlight}{where_clause}", + {generics}{decl}{notable_traits}{where_clause}", if parent == ItemType::Trait { " " } else { "" }, vis, constness, @@ -1057,7 +1057,7 @@ fn render_assoc_item( name = name, generics = g.print(cache, tcx), decl = d.full_print(cache, tcx, header_len, indent, header.asyncness), - spotlight = spotlight_decl(&d, cache, tcx), + notable_traits = notable_traits_decl(&d, cache, tcx), where_clause = print_where_clause(g, cache, tcx, indent, end_newline), ) } @@ -1341,7 +1341,7 @@ fn should_render_item(item: &clean::Item, deref_mut_: bool, cache: &Cache) -> bo } } -fn spotlight_decl(decl: &clean::FnDecl, cache: &Cache, tcx: TyCtxt<'_>) -> String { +fn notable_traits_decl(decl: &clean::FnDecl, cache: &Cache, tcx: TyCtxt<'_>) -> String { let mut out = Buffer::html(); let mut trait_ = String::new(); @@ -1349,9 +1349,11 @@ fn spotlight_decl(decl: &clean::FnDecl, cache: &Cache, tcx: TyCtxt<'_>) -> Strin if let Some(impls) = cache.impls.get(&did) { for i in impls { let impl_ = i.inner_impl(); - if impl_.trait_.def_id().map_or(false, |d| { - cache.traits.get(&d).map(|t| t.is_spotlight).unwrap_or(false) - }) { + if impl_ + .trait_ + .def_id() + .map_or(false, |d| cache.traits.get(&d).map(|t| t.is_notable).unwrap_or(false)) + { if out.is_empty() { write!( &mut out, diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index 25314f87eb5..0cdfe435b9c 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -10,9 +10,9 @@ use rustc_span::hygiene::MacroKind; use rustc_span::symbol::{kw, sym, Symbol}; use super::{ - collect_paths_for_type, document, ensure_trailing_slash, item_ty_to_strs, render_assoc_item, - render_assoc_items, render_attributes, render_impl, render_stability_since_raw, spotlight_decl, - write_srclink, AssocItemLink, Context, + collect_paths_for_type, document, ensure_trailing_slash, item_ty_to_strs, notable_traits_decl, + render_assoc_item, render_assoc_items, render_attributes, render_impl, + render_stability_since_raw, write_srclink, AssocItemLink, Context, }; use crate::clean::{self, GetDefId}; use crate::formats::cache::Cache; @@ -381,7 +381,7 @@ fn item_function(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, f: &clean:: write!( w, "{vis}{constness}{asyncness}{unsafety}{abi}fn \ - {name}{generics}{decl}{spotlight}{where_clause}</pre>", + {name}{generics}{decl}{notable_traits}{where_clause}</pre>", vis = it.visibility.print_with_space(cx.tcx(), it.def_id, cx.cache()), constness = f.header.constness.print_with_space(), asyncness = f.header.asyncness.print_with_space(), @@ -391,7 +391,7 @@ fn item_function(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, f: &clean:: generics = f.generics.print(cx.cache(), cx.tcx()), where_clause = print_where_clause(&f.generics, cx.cache(), cx.tcx(), 0, true), decl = f.decl.full_print(cx.cache(), cx.tcx(), header_len, 0, f.header.asyncness), - spotlight = spotlight_decl(&f.decl, cx.cache(), cx.tcx()), + notable_traits = notable_traits_decl(&f.decl, cx.cache(), cx.tcx()), ); document(w, cx, it, None) } |
