Skip to content

Commit 013cd5a

Browse files
Rollup merge of rust-lang#45815 - QuietMisdreavus:happy-little-notices, r=GuillaumeGomez
rustdoc: tweak notes on ignore/compile_fail examples Part of rust-lang#44927 This is a softening of these notices to mention *why* a given example has a given callout, rather then telling viewers to be careful with an example. It also changes the character used for these samples from a warning logo to a circle-i/information logo. ![image](https://user-images.githubusercontent.com/5217170/32464361-5fbb5d9e-c305-11e7-8482-ce71b97a54df.png)
2 parents 24840da + 02b3785 commit 013cd5a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/librustdoc/html/highlight.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub fn render_with_highlighting(src: &str, class: Option<&str>, id: Option<&str>
4242

4343
let mut out = Vec::new();
4444
if let Some((tooltip, class)) = tooltip {
45-
write!(out, "<div class='information'><div class='tooltip {}'><span \
45+
write!(out, "<div class='information'><div class='tooltip {}'><span \
4646
class='tooltiptext'>{}</span></div></div>",
4747
class, tooltip).unwrap();
4848
}

src/librustdoc/html/markdown.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,9 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'a, I> {
227227
))
228228
});
229229
let tooltip = if ignore {
230-
Some(("Be careful when using this code, it's not being tested!", "ignore"))
230+
Some(("This example is not tested", "ignore"))
231231
} else if compile_fail {
232-
Some(("This code doesn't compile so be extra careful!", "compile_fail"))
232+
Some(("This example deliberately fails to compile", "compile_fail"))
233233
} else {
234234
None
235235
};
@@ -638,9 +638,9 @@ pub fn render(w: &mut fmt::Formatter,
638638
))
639639
});
640640
let tooltip = if ignore {
641-
Some(("Be careful when using this code, it's not being tested!", "ignore"))
641+
Some(("This example is not tested", "ignore"))
642642
} else if compile_fail {
643-
Some(("This code doesn't compile so be extra careful!", "compile_fail"))
643+
Some(("This example deliberately fails to compile", "compile_fail"))
644644
} else {
645645
None
646646
};

src/test/rustdoc/codeblock-title.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
// ignore-tidy-linelength
1414

15-
// @has foo/fn.bar.html '//*[@class="tooltip compile_fail"]/span' "This code doesn't compile so be extra careful!"
16-
// @has foo/fn.bar.html '//*[@class="tooltip ignore"]/span' "Be careful when using this code, it's not being tested!"
15+
// @has foo/fn.bar.html '//*[@class="tooltip compile_fail"]/span' "This example deliberately fails to compile"
16+
// @has foo/fn.bar.html '//*[@class="tooltip ignore"]/span' "This example is not tested"
1717

1818
/// foo
1919
///

0 commit comments

Comments
 (0)