summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-ui/invalid-syntax.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/rustdoc-ui/invalid-syntax.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/rustdoc-ui/invalid-syntax.rs')
-rw-r--r--tests/rustdoc-ui/invalid-syntax.rs107
1 files changed, 107 insertions, 0 deletions
diff --git a/tests/rustdoc-ui/invalid-syntax.rs b/tests/rustdoc-ui/invalid-syntax.rs
new file mode 100644
index 000000000..acb2a6f08
--- /dev/null
+++ b/tests/rustdoc-ui/invalid-syntax.rs
@@ -0,0 +1,107 @@
+// check-pass
+
+/// ```
+/// \__________pkt->size___________/ \_result->size_/ \__pkt->size__/
+/// ```
+pub fn foo() {}
+//~^^^^ WARNING could not parse code block as Rust code
+
+/// ```
+/// |
+/// LL | use foobar::Baz;
+/// | ^^^^^^ did you mean `baz::foobar`?
+/// ```
+pub fn bar() {}
+//~^^^^^^ WARNING could not parse code block as Rust code
+
+/// ```
+/// valid
+/// ```
+///
+/// ```
+/// \_
+/// ```
+///
+/// ```text
+/// "invalid
+/// ```
+pub fn valid_and_invalid() {}
+//~^^^^^^^^ WARNING could not parse code block as Rust code
+
+/// 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() {}
+//~^^^^^^ WARNING could not parse code block as Rust code
+
+/// Indented block start
+///
+/// code with bad syntax
+/// \_
+///
+/// Indented block end
+pub fn quux() {}
+//~^^^^^ could not parse code block as Rust code
+
+/// Unclosed fence
+///
+/// ```
+/// slkdjf
+pub fn xyzzy() {}
+
+/// Indented code that contains a fence
+///
+/// ```
+pub fn blah() {}
+//~^^ WARNING could not parse code block as Rust code
+
+/// ```edition2018
+/// \_
+/// ```
+pub fn blargh() {}
+//~^^^^ WARNING could not parse code block as Rust code
+
+#[doc = "```"]
+/// \_
+#[doc = "```"]
+pub fn crazy_attrs() {}
+//~^^^^ WARNING could not parse code block
+
+/// ```rust
+/// ```
+pub fn empty_rust() {}
+//~^^^ WARNING Rust code block is empty
+
+/// ```
+///
+///
+/// ```
+pub fn empty_rust_with_whitespace() {}
+//~^^^^^ WARNING Rust code block is empty
+
+/// ```
+/// let x = 1;
+/// ```
+///
+/// \____/
+///
+pub fn indent_after_fenced() {}
+//~^^^ WARNING could not parse code block as Rust code
+
+/// ```
+/// "invalid
+/// ```
+pub fn invalid() {}
+//~^^^^ WARNING could not parse code block as Rust code
+
+/// ```
+/// fn wook_at_my_beautifuw_bwaces_plz() {);
+/// ```
+pub fn uwu() {}
+//~^^^^ WARNING could not parse code block as Rust code