]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc-ui/invalid-syntax.rs
Rollup merge of #107048 - DebugSteven:newer-x-check-cargo, r=albertlarsan68
[rust.git] / tests / rustdoc-ui / invalid-syntax.rs
1 // check-pass
2
3 /// ```
4 /// \__________pkt->size___________/          \_result->size_/ \__pkt->size__/
5 /// ```
6 pub fn foo() {}
7 //~^^^^ WARNING could not parse code block as Rust code
8
9 /// ```
10 ///    |
11 /// LL | use foobar::Baz;
12 ///    |     ^^^^^^ did you mean `baz::foobar`?
13 /// ```
14 pub fn bar() {}
15 //~^^^^^^ WARNING could not parse code block as Rust code
16
17 /// ```
18 /// valid
19 /// ```
20 ///
21 /// ```
22 /// \_
23 /// ```
24 ///
25 /// ```text
26 /// "invalid
27 /// ```
28 pub fn valid_and_invalid() {}
29 //~^^^^^^^^ WARNING could not parse code block as Rust code
30
31 /// This is a normal doc comment, but...
32 ///
33 /// There's a code block with bad syntax in it:
34 ///
35 /// ```rust
36 /// \_
37 /// ```
38 ///
39 /// Good thing we tested it!
40 pub fn baz() {}
41 //~^^^^^^ WARNING could not parse code block as Rust code
42
43 /// Indented block start
44 ///
45 ///     code with bad syntax
46 ///     \_
47 ///
48 /// Indented block end
49 pub fn quux() {}
50 //~^^^^^ could not parse code block as Rust code
51
52 /// Unclosed fence
53 ///
54 /// ```
55 /// slkdjf
56 pub fn xyzzy() {}
57
58 /// Indented code that contains a fence
59 ///
60 ///     ```
61 pub fn blah() {}
62 //~^^ WARNING could not parse code block as Rust code
63
64 /// ```edition2018
65 /// \_
66 /// ```
67 pub fn blargh() {}
68 //~^^^^ WARNING could not parse code block as Rust code
69
70 #[doc = "```"]
71 /// \_
72 #[doc = "```"]
73 pub fn crazy_attrs() {}
74 //~^^^^ WARNING could not parse code block
75
76 /// ```rust
77 /// ```
78 pub fn empty_rust() {}
79 //~^^^ WARNING Rust code block is empty
80
81 /// ```
82 ///
83 ///
84 /// ```
85 pub fn empty_rust_with_whitespace() {}
86 //~^^^^^ WARNING Rust code block is empty
87
88 /// ```
89 /// let x = 1;
90 /// ```
91 ///
92 ///     \____/
93 ///
94 pub fn indent_after_fenced() {}
95 //~^^^ WARNING could not parse code block as Rust code
96
97 /// ```
98 /// "invalid
99 /// ```
100 pub fn invalid() {}
101 //~^^^^ WARNING could not parse code block as Rust code
102
103 /// ```
104 /// fn wook_at_my_beautifuw_bwaces_plz() {);
105 /// ```
106 pub fn uwu() {}
107 //~^^^^ WARNING could not parse code block as Rust code