Skip to content

Commit 3309d0f

Browse files
committed
Add test enum-lack-comma-suggestion-issue-142311.rs
Signed-off-by: xizheyin <[email protected]>
1 parent b6685d7 commit 3309d0f

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
enum Foo {
2+
/// Like the noise a sheep makes
3+
Bar
4+
/// Like where people drink
5+
//~^ ERROR expected one of `(`, `,`, `=`, `{`, or `}`, found doc comment `/// Like where people drink`
6+
Baa///xxxxxx
7+
//~^ ERROR expected one of `(`, `,`, `=`, `{`, or `}`, found doc comment `///xxxxxx`
8+
Baz///xxxxxx
9+
//~^ ERROR expected one of `(`, `,`, `=`, `{`, or `}`, found doc comment `///xxxxxx`
10+
}
11+
12+
fn main() {}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
error: expected one of `(`, `,`, `=`, `{`, or `}`, found doc comment `/// Like where people drink`
2+
--> $DIR/enum-lack-comma-suggestion-issue-142311.rs:4:5
3+
|
4+
LL | Bar
5+
| - expected one of `(`, `,`, `=`, `{`, or `}`
6+
LL | /// Like where people drink
7+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ unexpected token
8+
|
9+
help: add a space before the last `/` to write a regular comment
10+
|
11+
LL | // / Like where people drink
12+
| +
13+
help: missing `,`
14+
|
15+
LL | Bar,
16+
| +
17+
18+
error: expected one of `(`, `,`, `=`, `{`, or `}`, found doc comment `///xxxxxx`
19+
--> $DIR/enum-lack-comma-suggestion-issue-142311.rs:6:8
20+
|
21+
LL | Baa///xxxxxx
22+
| ^^^^^^^^^ expected one of `(`, `,`, `=`, `{`, or `}`
23+
|
24+
help: add a space before the last `/` to write a regular comment
25+
|
26+
LL | Baa// /xxxxxx
27+
| +
28+
help: missing `,`
29+
|
30+
LL | Baa,///xxxxxx
31+
| +
32+
33+
error: expected one of `(`, `,`, `=`, `{`, or `}`, found doc comment `///xxxxxx`
34+
--> $DIR/enum-lack-comma-suggestion-issue-142311.rs:8:8
35+
|
36+
LL | Baz///xxxxxx
37+
| ^^^^^^^^^ expected one of `(`, `,`, `=`, `{`, or `}`
38+
|
39+
= help: doc comments must come before what they document, if a comment was intended use `//`
40+
= help: enum variants can be `Variant`, `Variant = <integer>`, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }`
41+
help: add a space before the last `/` to write a regular comment
42+
|
43+
LL | Baz// /xxxxxx
44+
| +
45+
46+
error: aborting due to 3 previous errors
47+

0 commit comments

Comments
 (0)