Rollup merge of #73476 - JakobDegen:should_panic_rustdoc, r=GuillaumeGomez
Added tooltip for should_panic code examples This change adds a tooltip to the documentation for `should_panic` examples. It currently displays identically to `compile_fail` examples, save for the changed text. It may be helpful to change the color that this displays in to make it visually more clear what is going on, but I'm unsure if additional colors wouldn't just be distracting. I brought this [up on internals](https://internals.rust-lang.org/t/indicating-that-an-example-is-should-panic-in-docs/12544) a few days ago, and there seemed to be a mild positive response to it.
This commit is contained in:
commit
6c53a0c2b5
5 changed files with 46 additions and 1 deletions
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
// @has foo/fn.bar.html '//*[@class="tooltip compile_fail"]/span' "This example deliberately fails to compile"
|
||||
// @has foo/fn.bar.html '//*[@class="tooltip ignore"]/span' "This example is not tested"
|
||||
// @has foo/fn.bar.html '//*[@class="tooltip should_panic"]/span' "This example panics"
|
||||
|
||||
/// foo
|
||||
///
|
||||
|
|
@ -15,6 +16,10 @@
|
|||
/// goo();
|
||||
/// ```
|
||||
///
|
||||
/// ```should_panic
|
||||
/// hoo();
|
||||
/// ```
|
||||
///
|
||||
/// ```
|
||||
/// let x = 0;
|
||||
/// ```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue