Fix strings indent
This commit is contained in:
parent
6c44bcc4ff
commit
c9a48d1d73
@ -75,8 +75,7 @@ pub fn get_blanket_impls(&self, ty: Ty<'tcx>, param_env_def_id: DefId) -> Vec<It
|
||||
}
|
||||
});
|
||||
debug!(
|
||||
"get_blanket_impls: found applicable impl: {}\
|
||||
for trait_ref={:?}, ty={:?}",
|
||||
"get_blanket_impls: found applicable impl: {} for trait_ref={:?}, ty={:?}",
|
||||
may_apply, trait_ref, ty
|
||||
);
|
||||
if !may_apply {
|
||||
|
@ -391,26 +391,25 @@ fn test_render_long_html() {
|
||||
(word_cfg("unix") & word_cfg("windows") & word_cfg("debug_assertions"))
|
||||
.render_long_html(),
|
||||
"This is supported on <strong>Unix and Windows and debug-assertions enabled\
|
||||
</strong> only."
|
||||
</strong> only."
|
||||
);
|
||||
assert_eq!(
|
||||
(word_cfg("unix") | word_cfg("windows") | word_cfg("debug_assertions"))
|
||||
.render_long_html(),
|
||||
"This is supported on <strong>Unix or Windows or debug-assertions enabled\
|
||||
</strong> only."
|
||||
</strong> only."
|
||||
);
|
||||
assert_eq!(
|
||||
(!(word_cfg("unix") | word_cfg("windows") | word_cfg("debug_assertions")))
|
||||
.render_long_html(),
|
||||
"This is supported on <strong>neither Unix nor Windows nor debug-assertions \
|
||||
enabled</strong>."
|
||||
enabled</strong>."
|
||||
);
|
||||
assert_eq!(
|
||||
((word_cfg("unix") & name_value_cfg("target_arch", "x86_64"))
|
||||
| (word_cfg("windows") & name_value_cfg("target_pointer_width", "64")))
|
||||
.render_long_html(),
|
||||
"This is supported on <strong>Unix and x86-64, or Windows and 64-bit</strong> \
|
||||
only."
|
||||
"This is supported on <strong>Unix and x86-64, or Windows and 64-bit</strong> only."
|
||||
);
|
||||
assert_eq!(
|
||||
(!(word_cfg("unix") & word_cfg("windows"))).render_long_html(),
|
||||
@ -420,7 +419,7 @@ fn test_render_long_html() {
|
||||
((word_cfg("debug_assertions") | word_cfg("windows")) & word_cfg("unix"))
|
||||
.render_long_html(),
|
||||
"This is supported on <strong>(debug-assertions enabled or Windows) and Unix\
|
||||
</strong> only."
|
||||
</strong> only."
|
||||
);
|
||||
assert_eq!(
|
||||
name_value_cfg("target_feature", "sse2").render_long_html(),
|
||||
@ -430,7 +429,7 @@ fn test_render_long_html() {
|
||||
(name_value_cfg("target_arch", "x86_64") & name_value_cfg("target_feature", "sse2"))
|
||||
.render_long_html(),
|
||||
"This is supported on <strong>x86-64 and target feature \
|
||||
<code>sse2</code></strong> only."
|
||||
<code>sse2</code></strong> only."
|
||||
);
|
||||
})
|
||||
}
|
||||
|
@ -422,14 +422,13 @@ pub fn name_from_pat(p: &hir::Pat<'_>) -> String {
|
||||
PatKind::Ref(ref p, _) => name_from_pat(&**p),
|
||||
PatKind::Lit(..) => {
|
||||
warn!(
|
||||
"tried to get argument name from PatKind::Lit, \
|
||||
which is silly in function arguments"
|
||||
"tried to get argument name from PatKind::Lit, which is silly in function arguments"
|
||||
);
|
||||
"()".to_string()
|
||||
}
|
||||
PatKind::Range(..) => panic!(
|
||||
"tried to get argument name from PatKind::Range, \
|
||||
which is not allowed in function arguments"
|
||||
which is not allowed in function arguments"
|
||||
),
|
||||
PatKind::Slice(ref begin, ref mid, ref end) => {
|
||||
let begin = begin.iter().map(|p| name_from_pat(&**p));
|
||||
|
@ -416,14 +416,12 @@ fn println_condition(condition: Condition) {
|
||||
return Err(1);
|
||||
} else if !ret.is_empty() {
|
||||
diag.struct_warn(&format!(
|
||||
"theme file \"{}\" is missing CSS rules from the \
|
||||
default theme",
|
||||
"theme file \"{}\" is missing CSS rules from the default theme",
|
||||
theme_s
|
||||
))
|
||||
.warn("the theme may appear incorrect when loaded")
|
||||
.help(&format!(
|
||||
"to see what rules are missing, call `rustdoc \
|
||||
--check-theme \"{}\"`",
|
||||
"to see what rules are missing, call `rustdoc --check-theme \"{}\"`",
|
||||
theme_s
|
||||
))
|
||||
.emit();
|
||||
|
@ -561,8 +561,7 @@ fn run_global_ctxt(
|
||||
if let Some(ref m) = krate.module {
|
||||
if let None | Some("") = m.doc_value() {
|
||||
let help = "The following guide may be of use:\n\
|
||||
https://doc.rust-lang.org/nightly/rustdoc/how-to-write-documentation\
|
||||
.html";
|
||||
https://doc.rust-lang.org/nightly/rustdoc/how-to-write-documentation.html";
|
||||
tcx.struct_lint_node(
|
||||
rustc_lint::builtin::MISSING_CRATE_LEVEL_DOCS,
|
||||
ctxt.as_local_hir_id(m.def_id).unwrap(),
|
||||
@ -581,7 +580,7 @@ fn report_deprecated_attr(name: &str, diag: &rustc_errors::Handler) {
|
||||
.struct_warn(&format!("the `#![doc({})]` attribute is considered deprecated", name));
|
||||
msg.warn(
|
||||
"see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \
|
||||
for more information",
|
||||
for more information",
|
||||
);
|
||||
|
||||
if name == "no_default_passes" {
|
||||
@ -614,7 +613,7 @@ fn report_deprecated_attr(name: &str, diag: &rustc_errors::Handler) {
|
||||
report_deprecated_attr("plugins = \"...\"", diag);
|
||||
eprintln!(
|
||||
"WARNING: `#![doc(plugins = \"...\")]` \
|
||||
no longer functions; see CVE-2018-1000622"
|
||||
no longer functions; see CVE-2018-1000622"
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
@ -833,7 +833,7 @@ fn fmt_type(t: &clean::Type, f: &mut fmt::Formatter<'_>, use_absolute: bool) ->
|
||||
write!(
|
||||
f,
|
||||
"<a class=\"type\" href=\"{url}#{shortty}.{name}\" \
|
||||
title=\"type {path}::{name}\">{name}</a>",
|
||||
title=\"type {path}::{name}\">{name}</a>",
|
||||
url = url,
|
||||
shortty = ItemType::AssocType,
|
||||
name = name,
|
||||
|
@ -27,7 +27,7 @@ pub fn render_with_highlighting(
|
||||
write!(
|
||||
out,
|
||||
"<div class='information'><div class='tooltip {}'>ⓘ<span \
|
||||
class='tooltiptext'>{}</span></div></div>",
|
||||
class='tooltiptext'>{}</span></div></div>",
|
||||
class, tooltip
|
||||
)
|
||||
.unwrap();
|
||||
|
@ -210,8 +210,8 @@ pub fn render<T: Print, S: Print>(
|
||||
.collect::<String>(),
|
||||
filter_crates = if layout.generate_search_filter {
|
||||
"<select id=\"crate-search\">\
|
||||
<option value=\"All crates\">All crates</option>\
|
||||
</select>"
|
||||
<option value=\"All crates\">All crates</option>\
|
||||
</select>"
|
||||
} else {
|
||||
""
|
||||
},
|
||||
|
@ -519,8 +519,7 @@ fn next(&mut self) -> Option<Self::Item> {
|
||||
Some(Event::FootnoteReference(ref reference)) => {
|
||||
let entry = self.get_entry(&reference);
|
||||
let reference = format!(
|
||||
"<sup id=\"fnref{0}\"><a href=\"#fn{0}\">{0}\
|
||||
</a></sup>",
|
||||
"<sup id=\"fnref{0}\"><a href=\"#fn{0}\">{0}</a></sup>",
|
||||
(*entry).1
|
||||
);
|
||||
return Some(Event::Html(reference.into()));
|
||||
|
@ -140,25 +140,26 @@ fn t(input: &str, expect: &str) {
|
||||
|
||||
t(
|
||||
"# Foo bar",
|
||||
"<h1 id=\"foo-bar\" class=\"section-header\">\
|
||||
<a href=\"#foo-bar\">Foo bar</a></h1>",
|
||||
"<h1 id=\"foo-bar\" class=\"section-header\"><a href=\"#foo-bar\">Foo bar</a></h1>",
|
||||
);
|
||||
t(
|
||||
"## Foo-bar_baz qux",
|
||||
"<h2 id=\"foo-bar_baz-qux\" class=\"section-\
|
||||
header\"><a href=\"#foo-bar_baz-qux\">Foo-bar_baz qux</a></h2>",
|
||||
"<h2 id=\"foo-bar_baz-qux\" class=\"section-header\">
|
||||
<a href=\"#foo-bar_baz-qux\">Foo-bar_baz qux</a></h2>",
|
||||
);
|
||||
t(
|
||||
"### **Foo** *bar* baz!?!& -_qux_-%",
|
||||
"<h3 id=\"foo-bar-baz--qux-\" class=\"section-header\">\
|
||||
<a href=\"#foo-bar-baz--qux-\"><strong>Foo</strong> \
|
||||
<em>bar</em> baz!?!& -<em>qux</em>-%</a></h3>",
|
||||
<a href=\"#foo-bar-baz--qux-\"><strong>Foo</strong> \
|
||||
<em>bar</em> baz!?!& -<em>qux</em>-%</a>\
|
||||
</h3>",
|
||||
);
|
||||
t(
|
||||
"#### **Foo?** & \\*bar?!* _`baz`_ ❤ #qux",
|
||||
"<h4 id=\"foo--bar--baz--qux\" class=\"section-header\">\
|
||||
<a href=\"#foo--bar--baz--qux\"><strong>Foo?</strong> & *bar?!* \
|
||||
<em><code>baz</code></em> ❤ #qux</a></h4>",
|
||||
<a href=\"#foo--bar--baz--qux\"><strong>Foo?</strong> & *bar?!* \
|
||||
<em><code>baz</code></em> ❤ #qux</a>\
|
||||
</h4>",
|
||||
);
|
||||
}
|
||||
|
||||
@ -174,38 +175,32 @@ fn t(map: &mut IdMap, input: &str, expect: &str) {
|
||||
t(
|
||||
&mut map,
|
||||
"# Example",
|
||||
"<h1 id=\"example\" class=\"section-header\">\
|
||||
<a href=\"#example\">Example</a></h1>",
|
||||
"<h1 id=\"example\" class=\"section-header\"><a href=\"#example\">Example</a></h1>",
|
||||
);
|
||||
t(
|
||||
&mut map,
|
||||
"# Panics",
|
||||
"<h1 id=\"panics\" class=\"section-header\">\
|
||||
<a href=\"#panics\">Panics</a></h1>",
|
||||
"<h1 id=\"panics\" class=\"section-header\"><a href=\"#panics\">Panics</a></h1>",
|
||||
);
|
||||
t(
|
||||
&mut map,
|
||||
"# Example",
|
||||
"<h1 id=\"example-1\" class=\"section-header\">\
|
||||
<a href=\"#example-1\">Example</a></h1>",
|
||||
"<h1 id=\"example-1\" class=\"section-header\"><a href=\"#example-1\">Example</a></h1>",
|
||||
);
|
||||
t(
|
||||
&mut map,
|
||||
"# Main",
|
||||
"<h1 id=\"main-1\" class=\"section-header\">\
|
||||
<a href=\"#main-1\">Main</a></h1>",
|
||||
"<h1 id=\"main-1\" class=\"section-header\"><a href=\"#main-1\">Main</a></h1>",
|
||||
);
|
||||
t(
|
||||
&mut map,
|
||||
"# Example",
|
||||
"<h1 id=\"example-2\" class=\"section-header\">\
|
||||
<a href=\"#example-2\">Example</a></h1>",
|
||||
"<h1 id=\"example-2\" class=\"section-header\"><a href=\"#example-2\">Example</a></h1>",
|
||||
);
|
||||
t(
|
||||
&mut map,
|
||||
"# Panics",
|
||||
"<h1 id=\"panics-1\" class=\"section-header\">\
|
||||
<a href=\"#panics-1\">Panics</a></h1>",
|
||||
"<h1 id=\"panics-1\" class=\"section-header\"><a href=\"#panics-1\">Panics</a></h1>",
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1061,8 +1061,8 @@ fn to_json_string(&self) -> String {
|
||||
|
||||
let content = format!(
|
||||
"<h1 class='fqn'>\
|
||||
<span class='in-band'>List of all crates</span>\
|
||||
</h1><ul class='mod'>{}</ul>",
|
||||
<span class='in-band'>List of all crates</span>\
|
||||
</h1><ul class='mod'>{}</ul>",
|
||||
krates
|
||||
.iter()
|
||||
.map(|s| {
|
||||
@ -1311,15 +1311,16 @@ fn print(self, f: &mut Buffer) {
|
||||
write!(
|
||||
f,
|
||||
"<h1 class='fqn'>\
|
||||
<span class='out-of-band'>\
|
||||
<span id='render-detail'>\
|
||||
<a id=\"toggle-all-docs\" href=\"javascript:void(0)\" title=\"collapse all docs\">\
|
||||
[<span class='inner'>−</span>]\
|
||||
</a>\
|
||||
</span>
|
||||
</span>
|
||||
<span class='in-band'>List of all items</span>\
|
||||
</h1>"
|
||||
<span class='out-of-band'>\
|
||||
<span id='render-detail'>\
|
||||
<a id=\"toggle-all-docs\" href=\"javascript:void(0)\" \
|
||||
title=\"collapse all docs\">\
|
||||
[<span class='inner'>−</span>]\
|
||||
</a>\
|
||||
</span>
|
||||
</span>
|
||||
<span class='in-band'>List of all items</span>\
|
||||
</h1>"
|
||||
);
|
||||
print_entries(f, &self.structs, "Structs", "structs");
|
||||
print_entries(f, &self.enums, "Enums", "enums");
|
||||
@ -1349,20 +1350,20 @@ fn display(&self) -> String {
|
||||
match *self {
|
||||
Setting::Section { ref description, ref sub_settings } => format!(
|
||||
"<div class='setting-line'>\
|
||||
<div class='title'>{}</div>\
|
||||
<div class='sub-settings'>{}</div>
|
||||
</div>",
|
||||
<div class='title'>{}</div>\
|
||||
<div class='sub-settings'>{}</div>
|
||||
</div>",
|
||||
description,
|
||||
sub_settings.iter().map(|s| s.display()).collect::<String>()
|
||||
),
|
||||
Setting::Entry { ref js_data_name, ref description, ref default_value } => format!(
|
||||
"<div class='setting-line'>\
|
||||
<label class='toggle'>\
|
||||
<input type='checkbox' id='{}' {}>\
|
||||
<span class='slider'></span>\
|
||||
</label>\
|
||||
<div>{}</div>\
|
||||
</div>",
|
||||
<label class='toggle'>\
|
||||
<input type='checkbox' id='{}' {}>\
|
||||
<span class='slider'></span>\
|
||||
</label>\
|
||||
<div>{}</div>\
|
||||
</div>",
|
||||
js_data_name,
|
||||
if *default_value { " checked" } else { "" },
|
||||
description,
|
||||
@ -1876,30 +1877,29 @@ fn document_non_exhaustive(w: &mut Buffer, item: &clean::Item) {
|
||||
write!(
|
||||
w,
|
||||
"Non-exhaustive structs could have additional fields added in future. \
|
||||
Therefore, non-exhaustive structs cannot be constructed in external crates \
|
||||
using the traditional <code>Struct {{ .. }}</code> syntax; cannot be \
|
||||
matched against without a wildcard <code>..</code>; and \
|
||||
struct update syntax will not work."
|
||||
Therefore, non-exhaustive structs cannot be constructed in external crates \
|
||||
using the traditional <code>Struct {{ .. }}</code> syntax; cannot be \
|
||||
matched against without a wildcard <code>..</code>; and \
|
||||
struct update syntax will not work."
|
||||
);
|
||||
} else if item.is_enum() {
|
||||
write!(
|
||||
w,
|
||||
"Non-exhaustive enums could have additional variants added in future. \
|
||||
Therefore, when matching against variants of non-exhaustive enums, an \
|
||||
extra wildcard arm must be added to account for any future variants."
|
||||
Therefore, when matching against variants of non-exhaustive enums, an \
|
||||
extra wildcard arm must be added to account for any future variants."
|
||||
);
|
||||
} else if item.is_variant() {
|
||||
write!(
|
||||
w,
|
||||
"Non-exhaustive enum variants could have additional fields added in future. \
|
||||
Therefore, non-exhaustive enum variants cannot be constructed in external \
|
||||
crates and cannot be matched against."
|
||||
Therefore, non-exhaustive enum variants cannot be constructed in external \
|
||||
crates and cannot be matched against."
|
||||
);
|
||||
} else {
|
||||
write!(
|
||||
w,
|
||||
"This type will require a wildcard arm in any match statements or \
|
||||
constructors."
|
||||
"This type will require a wildcard arm in any match statements or constructors."
|
||||
);
|
||||
}
|
||||
|
||||
@ -2096,12 +2096,11 @@ fn cmp(i1: &clean::Item, i2: &clean::Item, idx1: usize, idx2: usize) -> Ordering
|
||||
let doc_value = myitem.doc_value().unwrap_or("");
|
||||
write!(
|
||||
w,
|
||||
"\
|
||||
<tr class='{stab}{add}module-item'>\
|
||||
<td><a class=\"{class}\" href=\"{href}\" \
|
||||
title='{title}'>{name}</a>{unsafety_flag}</td>\
|
||||
<td class='docblock-short'>{stab_tags}{docs}</td>\
|
||||
</tr>",
|
||||
"<tr class='{stab}{add}module-item'>\
|
||||
<td><a class=\"{class}\" href=\"{href}\" \
|
||||
title='{title}'>{name}</a>{unsafety_flag}</td>\
|
||||
<td class='docblock-short'>{stab_tags}{docs}</td>\
|
||||
</tr>",
|
||||
name = *myitem.name.as_ref().unwrap(),
|
||||
stab_tags = stability_tags(myitem),
|
||||
docs = MarkdownSummaryLine(doc_value, &myitem.links()).into_string(),
|
||||
@ -2250,8 +2249,7 @@ fn item_constant(w: &mut Buffer, cx: &Context, it: &clean::Item, c: &clean::Cons
|
||||
|
||||
write!(
|
||||
w,
|
||||
"{vis}const \
|
||||
{name}: {typ}",
|
||||
"{vis}const {name}: {typ}",
|
||||
vis = it.visibility.print_with_space(),
|
||||
name = it.name.as_ref().unwrap(),
|
||||
typ = c.type_.print(),
|
||||
@ -2285,8 +2283,7 @@ fn item_static(w: &mut Buffer, cx: &Context, it: &clean::Item, s: &clean::Static
|
||||
render_attributes(w, it, false);
|
||||
write!(
|
||||
w,
|
||||
"{vis}static {mutability}\
|
||||
{name}: {typ}</pre>",
|
||||
"{vis}static {mutability} {name}: {typ}</pre>",
|
||||
vis = it.visibility.print_with_space(),
|
||||
mutability = s.mutability.print_with_space(),
|
||||
name = it.name.as_ref().unwrap(),
|
||||
@ -2312,7 +2309,7 @@ fn item_function(w: &mut Buffer, cx: &Context, it: &clean::Item, f: &clean::Func
|
||||
write!(
|
||||
w,
|
||||
"{vis}{constness}{asyncness}{unsafety}{abi}fn \
|
||||
{name}{generics}{decl}{spotlight}{where_clause}</pre>",
|
||||
{name}{generics}{decl}{spotlight}{where_clause}</pre>",
|
||||
vis = it.visibility.print_with_space(),
|
||||
constness = f.header.constness.print_with_space(),
|
||||
asyncness = f.header.asyncness.print_with_space(),
|
||||
@ -2503,10 +2500,9 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait,
|
||||
fn write_small_section_header(w: &mut Buffer, id: &str, title: &str, extra_content: &str) {
|
||||
write!(
|
||||
w,
|
||||
"
|
||||
<h2 id='{0}' class='small-section-header'>\
|
||||
{1}<a href='#{0}' class='anchor'></a>\
|
||||
</h2>{2}",
|
||||
"<h2 id='{0}' class='small-section-header'>\
|
||||
{1}<a href='#{0}' class='anchor'></a>\
|
||||
</h2>{2}",
|
||||
id, title, extra_content
|
||||
)
|
||||
}
|
||||
@ -2835,7 +2831,7 @@ fn method(
|
||||
write!(
|
||||
w,
|
||||
"{}{}{}{}{}{}{}fn <a href='{href}' class='fnname'>{name}</a>\
|
||||
{generics}{decl}{spotlight}{where_clause}",
|
||||
{generics}{decl}{spotlight}{where_clause}",
|
||||
if parent == ItemType::Trait { " " } else { "" },
|
||||
meth.visibility.print_with_space(),
|
||||
header.constness.print_with_space(),
|
||||
@ -2910,9 +2906,9 @@ fn item_struct(w: &mut Buffer, cx: &Context, it: &clean::Item, s: &clean::Struct
|
||||
write!(
|
||||
w,
|
||||
"<span id=\"{id}\" class=\"{item_type} small-section-header\">\
|
||||
<a href=\"#{id}\" class=\"anchor field\"></a>\
|
||||
<code>{name}: {ty}</code>\
|
||||
</span>",
|
||||
<a href=\"#{id}\" class=\"anchor field\"></a>\
|
||||
<code>{name}: {ty}</code>\
|
||||
</span>",
|
||||
item_type = ItemType::StructField,
|
||||
id = id,
|
||||
name = field.name.as_ref().unwrap(),
|
||||
@ -2954,9 +2950,9 @@ fn item_union(w: &mut Buffer, cx: &Context, it: &clean::Item, s: &clean::Union,
|
||||
write!(
|
||||
w,
|
||||
"<span id=\"{id}\" class=\"{shortty} small-section-header\">\
|
||||
<a href=\"#{id}\" class=\"anchor field\"></a>\
|
||||
<code>{name}: {ty}</code>\
|
||||
</span>",
|
||||
<a href=\"#{id}\" class=\"anchor field\"></a>\
|
||||
<code>{name}: {ty}</code>\
|
||||
</span>",
|
||||
id = id,
|
||||
name = name,
|
||||
shortty = ItemType::StructField,
|
||||
@ -3081,9 +3077,9 @@ fn item_enum(w: &mut Buffer, cx: &Context, it: &clean::Item, e: &clean::Enum, ca
|
||||
write!(
|
||||
w,
|
||||
"<span id=\"{id}\" class=\"variant small-section-header\">\
|
||||
<a href=\"#{id}\" class=\"anchor field\"></a>\
|
||||
<code>{f}: {t}\
|
||||
</code></span>",
|
||||
<a href=\"#{id}\" class=\"anchor field\"></a>\
|
||||
<code>{f}: {t}</code>\
|
||||
</span>",
|
||||
id = id,
|
||||
f = field.name.as_ref().unwrap(),
|
||||
t = ty.print()
|
||||
@ -3296,23 +3292,19 @@ fn render_assoc_items(
|
||||
AssocItemRender::All => {
|
||||
write!(
|
||||
w,
|
||||
"\
|
||||
<h2 id='implementations' class='small-section-header'>\
|
||||
Implementations<a href='#implementations' class='anchor'></a>\
|
||||
</h2>\
|
||||
"
|
||||
"<h2 id='implementations' class='small-section-header'>\
|
||||
Implementations<a href='#implementations' class='anchor'></a>\
|
||||
</h2>"
|
||||
);
|
||||
RenderMode::Normal
|
||||
}
|
||||
AssocItemRender::DerefFor { trait_, type_, deref_mut_ } => {
|
||||
write!(
|
||||
w,
|
||||
"\
|
||||
<h2 id='deref-methods' class='small-section-header'>\
|
||||
Methods from {}<Target = {}>\
|
||||
<a href='#deref-methods' class='anchor'></a>\
|
||||
</h2>\
|
||||
",
|
||||
"<h2 id='deref-methods' class='small-section-header'>\
|
||||
Methods from {}<Target = {}>\
|
||||
<a href='#deref-methods' class='anchor'></a>\
|
||||
</h2>",
|
||||
trait_.print(),
|
||||
type_.print()
|
||||
);
|
||||
@ -3359,11 +3351,10 @@ fn render_assoc_items(
|
||||
if !impls.is_empty() {
|
||||
write!(
|
||||
w,
|
||||
"\
|
||||
<h2 id='trait-implementations' class='small-section-header'>\
|
||||
Trait Implementations<a href='#trait-implementations' class='anchor'></a>\
|
||||
</h2>\
|
||||
<div id='trait-implementations-list'>{}</div>",
|
||||
"<h2 id='trait-implementations' class='small-section-header'>\
|
||||
Trait Implementations<a href='#trait-implementations' class='anchor'></a>\
|
||||
</h2>\
|
||||
<div id='trait-implementations-list'>{}</div>",
|
||||
impls
|
||||
);
|
||||
}
|
||||
@ -3371,13 +3362,11 @@ fn render_assoc_items(
|
||||
if !synthetic.is_empty() {
|
||||
write!(
|
||||
w,
|
||||
"\
|
||||
<h2 id='synthetic-implementations' class='small-section-header'>\
|
||||
Auto Trait Implementations\
|
||||
<a href='#synthetic-implementations' class='anchor'></a>\
|
||||
</h2>\
|
||||
<div id='synthetic-implementations-list'>\
|
||||
"
|
||||
"<h2 id='synthetic-implementations' class='small-section-header'>\
|
||||
Auto Trait Implementations\
|
||||
<a href='#synthetic-implementations' class='anchor'></a>\
|
||||
</h2>\
|
||||
<div id='synthetic-implementations-list'>"
|
||||
);
|
||||
render_impls(cx, w, &synthetic, containing_item, cache);
|
||||
write!(w, "</div>");
|
||||
@ -3386,13 +3375,11 @@ fn render_assoc_items(
|
||||
if !blanket_impl.is_empty() {
|
||||
write!(
|
||||
w,
|
||||
"\
|
||||
<h2 id='blanket-implementations' class='small-section-header'>\
|
||||
Blanket Implementations\
|
||||
<a href='#blanket-implementations' class='anchor'></a>\
|
||||
</h2>\
|
||||
<div id='blanket-implementations-list'>\
|
||||
"
|
||||
"<h2 id='blanket-implementations' class='small-section-header'>\
|
||||
Blanket Implementations\
|
||||
<a href='#blanket-implementations' class='anchor'></a>\
|
||||
</h2>\
|
||||
<div id='blanket-implementations-list'>"
|
||||
);
|
||||
render_impls(cx, w, &blanket_impl, containing_item, cache);
|
||||
write!(w, "</div>");
|
||||
@ -3473,7 +3460,7 @@ fn spotlight_decl(decl: &clean::FnDecl) -> String {
|
||||
if out.is_empty() {
|
||||
out.push_str(&format!(
|
||||
"<h3 class=\"notable\">Notable traits for {}</h3>\
|
||||
<code class=\"content\">",
|
||||
<code class=\"content\">",
|
||||
impl_.for_.print()
|
||||
));
|
||||
trait_.push_str(&impl_.for_.print().to_string());
|
||||
@ -3909,8 +3896,8 @@ fn print_sidebar(cx: &Context, it: &clean::Item, buffer: &mut Buffer, cache: &Ca
|
||||
write!(
|
||||
buffer,
|
||||
"<div class='block version'>\
|
||||
<p>Version {}</p>\
|
||||
</div>",
|
||||
<p>Version {}</p>\
|
||||
</div>",
|
||||
Escape(version)
|
||||
);
|
||||
}
|
||||
@ -4185,7 +4172,7 @@ fn sidebar_struct(buf: &mut Buffer, it: &clean::Item, s: &clean::Struct) {
|
||||
if let doctree::Plain = s.struct_type {
|
||||
sidebar.push_str(&format!(
|
||||
"<a class=\"sidebar-title\" href=\"#fields\">Fields</a>\
|
||||
<div class=\"sidebar-links\">{}</div>",
|
||||
<div class=\"sidebar-links\">{}</div>",
|
||||
fields
|
||||
));
|
||||
}
|
||||
@ -4312,8 +4299,8 @@ fn sidebar_trait(buf: &mut Buffer, it: &clean::Item, t: &clean::Trait) {
|
||||
res.sort();
|
||||
sidebar.push_str(&format!(
|
||||
"<a class=\"sidebar-title\" href=\"#foreign-impls\">\
|
||||
Implementations on Foreign Types</a><div \
|
||||
class=\"sidebar-links\">{}</div>",
|
||||
Implementations on Foreign Types</a>\
|
||||
<div class=\"sidebar-links\">{}</div>",
|
||||
res.into_iter()
|
||||
.map(|(name, id)| format!("<a href=\"#{}\">{}</a>", id, Escape(&name)))
|
||||
.collect::<Vec<_>>()
|
||||
|
@ -52,7 +52,7 @@ fn fold_item(&mut self, item: clean::Item) -> Option<clean::Item> {
|
||||
Err(e) => {
|
||||
println!(
|
||||
"warning: source code was requested to be rendered, \
|
||||
but processing `{}` had an error: {}",
|
||||
but processing `{}` had an error: {}",
|
||||
item.source.filename, e
|
||||
);
|
||||
println!(" skipping rendering of source code");
|
||||
|
@ -153,7 +153,7 @@ fn opts() -> Vec<RustcOptGroup> {
|
||||
"",
|
||||
"passes",
|
||||
"list of passes to also run, you might want to pass it multiple times; a value of \
|
||||
`list` will print available passes",
|
||||
`list` will print available passes",
|
||||
"PASSES",
|
||||
)
|
||||
}),
|
||||
@ -183,7 +183,7 @@ fn opts() -> Vec<RustcOptGroup> {
|
||||
"",
|
||||
"html-in-header",
|
||||
"files to include inline in the <head> section of a rendered Markdown file \
|
||||
or generated documentation",
|
||||
or generated documentation",
|
||||
"FILES",
|
||||
)
|
||||
}),
|
||||
@ -192,7 +192,7 @@ fn opts() -> Vec<RustcOptGroup> {
|
||||
"",
|
||||
"html-before-content",
|
||||
"files to include inline between <body> and the content of a rendered \
|
||||
Markdown file or generated documentation",
|
||||
Markdown file or generated documentation",
|
||||
"FILES",
|
||||
)
|
||||
}),
|
||||
@ -201,7 +201,7 @@ fn opts() -> Vec<RustcOptGroup> {
|
||||
"",
|
||||
"html-after-content",
|
||||
"files to include inline between the content and </body> of a rendered \
|
||||
Markdown file or generated documentation",
|
||||
Markdown file or generated documentation",
|
||||
"FILES",
|
||||
)
|
||||
}),
|
||||
@ -210,7 +210,7 @@ fn opts() -> Vec<RustcOptGroup> {
|
||||
"",
|
||||
"markdown-before-content",
|
||||
"files to include inline between <body> and the content of a rendered \
|
||||
Markdown file or generated documentation",
|
||||
Markdown file or generated documentation",
|
||||
"FILES",
|
||||
)
|
||||
}),
|
||||
@ -219,7 +219,7 @@ fn opts() -> Vec<RustcOptGroup> {
|
||||
"",
|
||||
"markdown-after-content",
|
||||
"files to include inline between the content and </body> of a rendered \
|
||||
Markdown file or generated documentation",
|
||||
Markdown file or generated documentation",
|
||||
"FILES",
|
||||
)
|
||||
}),
|
||||
@ -234,8 +234,8 @@ fn opts() -> Vec<RustcOptGroup> {
|
||||
"e",
|
||||
"extend-css",
|
||||
"To add some CSS rules with a given file to generate doc with your \
|
||||
own theme. However, your theme might break if the rustdoc's generated HTML \
|
||||
changes, so be careful!",
|
||||
own theme. However, your theme might break if the rustdoc's generated HTML \
|
||||
changes, so be careful!",
|
||||
"PATH",
|
||||
)
|
||||
}),
|
||||
@ -248,7 +248,7 @@ fn opts() -> Vec<RustcOptGroup> {
|
||||
"",
|
||||
"playground-url",
|
||||
"URL to send code snippets to, may be reset by --markdown-playground-url \
|
||||
or `#![doc(html_playground_url=...)]`",
|
||||
or `#![doc(html_playground_url=...)]`",
|
||||
"URL",
|
||||
)
|
||||
}),
|
||||
@ -281,7 +281,7 @@ fn opts() -> Vec<RustcOptGroup> {
|
||||
"",
|
||||
"resource-suffix",
|
||||
"suffix to add to CSS and JavaScript files, e.g., \"light.css\" will become \
|
||||
\"light-suffix.css\"",
|
||||
\"light-suffix.css\"",
|
||||
"PATH",
|
||||
)
|
||||
}),
|
||||
@ -343,7 +343,7 @@ fn opts() -> Vec<RustcOptGroup> {
|
||||
"",
|
||||
"static-root-path",
|
||||
"Path string to force loading static files from in output pages. \
|
||||
If not set, uses combinations of '../' to reach the documentation root.",
|
||||
If not set, uses combinations of '../' to reach the documentation root.",
|
||||
"PATH",
|
||||
)
|
||||
}),
|
||||
|
@ -1157,7 +1157,7 @@ fn report_diagnostic(
|
||||
// Print the line containing the `link_range` and manually mark it with '^'s.
|
||||
diag.note(&format!(
|
||||
"the link appears in this line:\n\n{line}\n\
|
||||
{indicator: <before$}{indicator:^<found$}",
|
||||
{indicator: <before$}{indicator:^<found$}",
|
||||
line = line,
|
||||
indicator = "",
|
||||
before = link_range.start - last_new_line_offset,
|
||||
|
@ -284,8 +284,7 @@ fn fold_item(&mut self, i: Item) -> Option<Item> {
|
||||
if let Some(did) = typaram.def_id() {
|
||||
if did.is_local() && !self.retained.contains(&did) {
|
||||
debug!(
|
||||
"ImplStripper: stripped item in trait's generics; \
|
||||
removing impl"
|
||||
"ImplStripper: stripped item in trait's generics; removing impl"
|
||||
);
|
||||
return None;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
name: "strip-private",
|
||||
run: strip_private,
|
||||
description: "strips all private items from a crate which cannot be seen externally, \
|
||||
implies strip-priv-imports",
|
||||
implies strip-priv-imports",
|
||||
};
|
||||
|
||||
/// Strip private items from the point of view of a crate or externally from a
|
||||
|
Loading…
Reference in New Issue
Block a user