diff options
| author | Tom Milligan <tom@reinfer.io> | 2019-08-19 15:19:26 +0100 |
|---|---|---|
| committer | Tom Milligan <tom@reinfer.io> | 2019-08-19 16:02:57 +0100 |
| commit | 0ec2e9fcebd18d98a32884786e1c4bbaf3db1ce0 (patch) | |
| tree | 847f6de824c84e35a3c367e6dfb1b1bb30730a0b /src/test/rustdoc-ui | |
| parent | ea52be482ab4945fda63cb65b6a198309a041e3c (diff) | |
| download | rust-0ec2e9fcebd18d98a32884786e1c4bbaf3db1ce0.tar.gz rust-0ec2e9fcebd18d98a32884786e1c4bbaf3db1ce0.zip | |
librustdoc: warn on empty doc test
Diffstat (limited to 'src/test/rustdoc-ui')
| -rw-r--r-- | src/test/rustdoc-ui/invalid-syntax.rs | 10 | ||||
| -rw-r--r-- | src/test/rustdoc-ui/invalid-syntax.stderr | 22 |
2 files changed, 32 insertions, 0 deletions
diff --git a/src/test/rustdoc-ui/invalid-syntax.rs b/src/test/rustdoc-ui/invalid-syntax.rs index 2b02d47d4b8..3ef66e273d0 100644 --- a/src/test/rustdoc-ui/invalid-syntax.rs +++ b/src/test/rustdoc-ui/invalid-syntax.rs @@ -64,3 +64,13 @@ pub fn blargh() {} /// \_ #[doc = "```"] pub fn crazy_attrs() {} + +/// ```rust +/// ``` +pub fn empty_rust() {} + +/// ``` +/// +/// +/// ``` +pub fn empty_rust_with_whitespace() {} diff --git a/src/test/rustdoc-ui/invalid-syntax.stderr b/src/test/rustdoc-ui/invalid-syntax.stderr index 3bebbecb9df..36209e29277 100644 --- a/src/test/rustdoc-ui/invalid-syntax.stderr +++ b/src/test/rustdoc-ui/invalid-syntax.stderr @@ -179,6 +179,28 @@ LL | | #[doc = "```"] | = help: mark blocks that do not contain Rust code as text: ```text +warning: Rust code block is empty + --> $DIR/invalid-syntax.rs:68:5 + | +LL | /// ```rust + | _____^ +LL | | /// ``` + | |_______^ + +warning: Rust code block is empty + --> $DIR/invalid-syntax.rs:72:5 + | +LL | /// ``` + | _____^ +LL | | /// +LL | | /// +LL | | /// ``` + | |_______^ +help: mark blocks that do not contain Rust code as text + | +LL | /// ```text + | ^^^^^^^ + error: unknown start of token: \ --> <rustdoc-highlighting>:1:1 | |
