2020-04-19 23:40:53 +00:00
|
|
|
//@ check-pass
|
2018-09-03 20:24:11 +00:00
|
|
|
|
|
|
|
/// ```
|
|
|
|
/// \__________pkt->size___________/ \_result->size_/ \__pkt->size__/
|
|
|
|
/// ```
|
|
|
|
pub fn foo() {}
|
2019-11-08 00:00:00 +00:00
|
|
|
//~^^^^ WARNING could not parse code block as Rust code
|
2018-12-15 21:25:50 +00:00
|
|
|
|
|
|
|
/// ```
|
|
|
|
/// |
|
|
|
|
/// LL | use foobar::Baz;
|
|
|
|
/// | ^^^^^^ did you mean `baz::foobar`?
|
|
|
|
/// ```
|
|
|
|
pub fn bar() {}
|
2019-11-08 00:00:00 +00:00
|
|
|
//~^^^^^^ WARNING could not parse code block as Rust code
|
2018-12-15 21:25:50 +00:00
|
|
|
|
|
|
|
/// ```
|
|
|
|
/// valid
|
|
|
|
/// ```
|
|
|
|
///
|
|
|
|
/// ```
|
|
|
|
/// \_
|
|
|
|
/// ```
|
|
|
|
///
|
|
|
|
/// ```text
|
|
|
|
/// "invalid
|
|
|
|
/// ```
|
|
|
|
pub fn valid_and_invalid() {}
|
2019-11-08 00:00:00 +00:00
|
|
|
//~^^^^^^^^ WARNING could not parse code block as Rust code
|
2018-12-15 21:25:50 +00:00
|
|
|
|
|
|
|
/// This is a normal doc comment, but...
|
|
|
|
///
|
|
|
|
/// There's a code block with bad syntax in it:
|
|
|
|
///
|
|
|
|
/// ```rust
|
|
|
|
/// \_
|
|
|
|
/// ```
|
|
|
|
///
|
|
|
|
/// Good thing we tested it!
|
|
|
|
pub fn baz() {}
|
2019-11-08 00:00:00 +00:00
|
|
|
//~^^^^^^ WARNING could not parse code block as Rust code
|
2018-12-15 21:25:50 +00:00
|
|
|
|
|
|
|
/// Indented block start
|
|
|
|
///
|
|
|
|
/// code with bad syntax
|
|
|
|
/// \_
|
|
|
|
///
|
|
|
|
/// Indented block end
|
|
|
|
pub fn quux() {}
|
2019-11-08 00:00:00 +00:00
|
|
|
//~^^^^^ could not parse code block as Rust code
|
2018-12-15 21:25:50 +00:00
|
|
|
|
|
|
|
/// Unclosed fence
|
|
|
|
///
|
|
|
|
/// ```
|
|
|
|
/// slkdjf
|
|
|
|
pub fn xyzzy() {}
|
|
|
|
|
|
|
|
/// Indented code that contains a fence
|
|
|
|
///
|
|
|
|
/// ```
|
|
|
|
pub fn blah() {}
|
2019-11-08 00:00:00 +00:00
|
|
|
//~^^ WARNING could not parse code block as Rust code
|
2018-12-15 21:25:50 +00:00
|
|
|
|
|
|
|
/// ```edition2018
|
|
|
|
/// \_
|
|
|
|
/// ```
|
|
|
|
pub fn blargh() {}
|
2019-11-08 00:00:00 +00:00
|
|
|
//~^^^^ WARNING could not parse code block as Rust code
|
2018-12-15 21:25:50 +00:00
|
|
|
|
|
|
|
#[doc = "```"]
|
|
|
|
/// \_
|
|
|
|
#[doc = "```"]
|
|
|
|
pub fn crazy_attrs() {}
|
2021-04-26 13:11:08 +00:00
|
|
|
//~^^^^ WARNING could not parse code block
|
2019-08-19 14:19:26 +00:00
|
|
|
|
|
|
|
/// ```rust
|
|
|
|
/// ```
|
|
|
|
pub fn empty_rust() {}
|
2019-11-08 00:00:00 +00:00
|
|
|
//~^^^ WARNING Rust code block is empty
|
2019-08-19 14:19:26 +00:00
|
|
|
|
|
|
|
/// ```
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// ```
|
|
|
|
pub fn empty_rust_with_whitespace() {}
|
2019-11-08 00:00:00 +00:00
|
|
|
//~^^^^^ WARNING Rust code block is empty
|
2019-09-07 19:21:32 +00:00
|
|
|
|
|
|
|
/// ```
|
|
|
|
/// let x = 1;
|
|
|
|
/// ```
|
|
|
|
///
|
|
|
|
/// \____/
|
|
|
|
///
|
|
|
|
pub fn indent_after_fenced() {}
|
2019-11-08 00:00:00 +00:00
|
|
|
//~^^^ WARNING could not parse code block as Rust code
|
2020-01-17 23:44:44 +00:00
|
|
|
|
|
|
|
/// ```
|
|
|
|
/// "invalid
|
|
|
|
/// ```
|
|
|
|
pub fn invalid() {}
|
|
|
|
//~^^^^ WARNING could not parse code block as Rust code
|
2022-10-03 19:01:19 +00:00
|
|
|
|
|
|
|
/// ```
|
|
|
|
/// fn wook_at_my_beautifuw_bwaces_plz() {);
|
|
|
|
/// ```
|
|
|
|
pub fn uwu() {}
|
|
|
|
//~^^^^ WARNING could not parse code block as Rust code
|