about summary refs log tree commit diff
path: root/src/test/rustdoc-ui/invalid-syntax.rs
blob: 97a0f4aaec1eba117cd7f1e2ac76744ec9e54ae6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// build-pass (FIXME(62277): could be check-pass?)

/// ```
/// \__________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() {}

/// ```rust
/// ```
pub fn empty_rust() {}

/// ```
///
///
/// ```
pub fn empty_rust_with_whitespace() {}

/// ```
/// let x = 1;
/// ```
///
///     \____/
///
pub fn indent_after_fenced() {}