mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-15 20:45:45 +03:00
b805f2c4dc
Previously, compile_fail and ignore code examples displayed a tooltip indicating this in the documentation. This tooltip has now also been added to should_panic examples.
27 lines
542 B
Rust
27 lines
542 B
Rust
#![crate_name = "foo"]
|
|
|
|
// ignore-tidy-linelength
|
|
|
|
// @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
|
|
///
|
|
/// ```compile_fail
|
|
/// foo();
|
|
/// ```
|
|
///
|
|
/// ```ignore (tidy)
|
|
/// goo();
|
|
/// ```
|
|
///
|
|
/// ```should_panic
|
|
/// hoo();
|
|
/// ```
|
|
///
|
|
/// ```
|
|
/// let x = 0;
|
|
/// ```
|
|
pub fn bar() -> usize { 2 }
|