]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-ui/invalid-syntax.rs
Auto merge of #63871 - BatmanAoD:FloatFnMustUse, r=withoutboats
[rust.git] / src / test / rustdoc-ui / invalid-syntax.rs
1 // build-pass (FIXME(62277): could be check-pass?)
2
3 /// ```
4 /// \__________pkt->size___________/          \_result->size_/ \__pkt->size__/
5 /// ```
6 pub fn foo() {}
7
8 /// ```
9 ///    |
10 /// LL | use foobar::Baz;
11 ///    |     ^^^^^^ did you mean `baz::foobar`?
12 /// ```
13 pub fn bar() {}
14
15 /// ```
16 /// valid
17 /// ```
18 ///
19 /// ```
20 /// \_
21 /// ```
22 ///
23 /// ```text
24 /// "invalid
25 /// ```
26 pub fn valid_and_invalid() {}
27
28 /// This is a normal doc comment, but...
29 ///
30 /// There's a code block with bad syntax in it:
31 ///
32 /// ```rust
33 /// \_
34 /// ```
35 ///
36 /// Good thing we tested it!
37 pub fn baz() {}
38
39 /// Indented block start
40 ///
41 ///     code with bad syntax
42 ///     \_
43 ///
44 /// Indented block end
45 pub fn quux() {}
46
47 /// Unclosed fence
48 ///
49 /// ```
50 /// slkdjf
51 pub fn xyzzy() {}
52
53 /// Indented code that contains a fence
54 ///
55 ///     ```
56 pub fn blah() {}
57
58 /// ```edition2018
59 /// \_
60 /// ```
61 pub fn blargh() {}
62
63 #[doc = "```"]
64 /// \_
65 #[doc = "```"]
66 pub fn crazy_attrs() {}
67
68 /// ```rust
69 /// ```
70 pub fn empty_rust() {}
71
72 /// ```
73 ///
74 ///
75 /// ```
76 pub fn empty_rust_with_whitespace() {}
77
78 /// ```
79 /// let x = 1;
80 /// ```
81 ///
82 ///     \____/
83 ///
84 pub fn indent_after_fenced() {}