diff options
| author | Andy Russell <arussell123@gmail.com> | 2018-12-15 16:25:50 -0500 |
|---|---|---|
| committer | Andy Russell <arussell123@gmail.com> | 2019-01-14 21:21:21 -0500 |
| commit | 8c93798e9f80d6d6ed9a2ab4b01af06a8fea23b7 (patch) | |
| tree | 43874bdc32b8aca520aace508d119bfa5aa3fda3 /src/test/rustdoc-ui/invalid-syntax.rs | |
| parent | ee10d99b9a44c57f450678310b16e651d08075cd (diff) | |
| download | rust-8c93798e9f80d6d6ed9a2ab4b01af06a8fea23b7.tar.gz rust-8c93798e9f80d6d6ed9a2ab4b01af06a8fea23b7.zip | |
rustdoc: check code block syntax in early pass
Diffstat (limited to 'src/test/rustdoc-ui/invalid-syntax.rs')
| -rw-r--r-- | src/test/rustdoc-ui/invalid-syntax.rs | 61 |
1 files changed, 60 insertions, 1 deletions
diff --git a/src/test/rustdoc-ui/invalid-syntax.rs b/src/test/rustdoc-ui/invalid-syntax.rs index 537816be8d7..924e0386d31 100644 --- a/src/test/rustdoc-ui/invalid-syntax.rs +++ b/src/test/rustdoc-ui/invalid-syntax.rs @@ -1,7 +1,66 @@ // compile-pass -// compile-flags: --error-format=human /// ``` /// \__________pkt->size___________/ \_result->size_/ \__pkt->size__/ /// ``` pub fn foo() {} + +/// ``` +/// | +/// LL | use foobar::Baz; +/// | ^^^^^^ did you mean `baz::foobar`? +/// ``` +pub fn bar() {} + +/// ``` +/// valid +/// ``` +/// +/// ``` +/// \_ +/// ``` +/// +/// ```text +/// "invalid +/// ``` +pub fn valid_and_invalid() {} + +/// 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() {} + +/// Indented block start +/// +/// code with bad syntax +/// \_ +/// +/// Indented block end +pub fn quux() {} + +/// Unclosed fence +/// +/// ``` +/// slkdjf +pub fn xyzzy() {} + +/// Indented code that contains a fence +/// +/// ``` +pub fn blah() {} + +/// ```edition2018 +/// \_ +/// ``` +pub fn blargh() {} + +#[doc = "```"] +/// \_ +#[doc = "```"] +pub fn crazy_attrs() {} |
