Skip to content

Commit 8e81596

Browse files
committed
Add unclosed brace in use tree test
1 parent 010c236 commit 8e81596

File tree

2 files changed

+165
-0
lines changed

2 files changed

+165
-0
lines changed
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
use foo::{bar, baz;
2+
//~^ ERROR expected one of `,`, `::`, `as`, or `}`, found `;`
3+
4+
use std::fmt::Display;
5+
//~^ ERROR expected identifier, found keyword `use`
6+
//~| ERROR expected one of `,`, `::`, `as`, or `}`, found `std`
7+
//~| ERROR expected one of `,`, `::`, `as`, or `}`, found `;`
8+
9+
mod bar { }
10+
//~^ ERROR expected identifier, found keyword `mod`
11+
//~| ERROR expected one of `,`, `::`, `as`, or `}`, found `bar`
12+
//~| ERROR expected one of `,`, `::`, `as`, or `}`, found `{`
13+
14+
mod baz { }
15+
//~^ ERROR expected identifier, found keyword `mod`
16+
//~| ERROR expected one of `,`, `::`, `as`, or `}`, found `{`
17+
//~| ERROR expected one of `,`, `::`, `as`, or `}`, found `baz`
18+
//~| ERROR expected one of `,` or `}`, found keyword `mod`
19+
20+
fn main() {}
21+
//~^ ERROR expected identifier, found keyword `fn`
22+
//~| ERROR expected one of `,`, `::`, `as`, or `}`, found `(`
23+
//~| ERROR expected one of `,` or `}`, found keyword `fn`
24+
//~| ERROR expected one of `,`, `::`, `as`, or `}`, found `main`
25+
26+
//~ ERROR this file contains an unclosed delimiter
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
error: this file contains an unclosed delimiter
2+
--> $DIR/use-unclosed-brace.rs:26:51
3+
|
4+
LL | use foo::{bar, baz;
5+
| - unclosed delimiter
6+
...
7+
LL |
8+
| ^
9+
10+
error: expected identifier, found keyword `use`
11+
--> $DIR/use-unclosed-brace.rs:4:1
12+
|
13+
LL | use std::fmt::Display;
14+
| ^^^ expected identifier, found keyword
15+
16+
error: expected one of `,`, `::`, `as`, or `}`, found `;`
17+
--> $DIR/use-unclosed-brace.rs:1:19
18+
|
19+
LL | use foo::{bar, baz;
20+
| - ^ expected one of `,`, `::`, `as`, or `}`
21+
| |
22+
| unclosed delimiter
23+
|
24+
help: `}` may belong here
25+
|
26+
LL | use foo::{bar, baz};
27+
| ^
28+
help: missing `,`
29+
|
30+
LL | use foo::{bar, baz,;
31+
| ^
32+
33+
error: expected one of `,`, `::`, `as`, or `}`, found `std`
34+
--> $DIR/use-unclosed-brace.rs:4:5
35+
|
36+
LL | use std::fmt::Display;
37+
| -^^^ expected one of `,`, `::`, `as`, or `}`
38+
| |
39+
| help: missing `,`
40+
41+
error: expected identifier, found keyword `mod`
42+
--> $DIR/use-unclosed-brace.rs:9:1
43+
|
44+
LL | mod bar { }
45+
| ^^^ expected identifier, found keyword
46+
47+
error: expected one of `,`, `::`, `as`, or `}`, found `;`
48+
--> $DIR/use-unclosed-brace.rs:4:22
49+
|
50+
LL | use std::fmt::Display;
51+
| ^
52+
| |
53+
| expected one of `,`, `::`, `as`, or `}`
54+
| help: missing `,`
55+
56+
error: expected one of `,`, `::`, `as`, or `}`, found `bar`
57+
--> $DIR/use-unclosed-brace.rs:9:5
58+
|
59+
LL | mod bar { }
60+
| -^^^ expected one of `,`, `::`, `as`, or `}`
61+
| |
62+
| help: missing `,`
63+
64+
error: expected one of `,`, `::`, `as`, or `}`, found `{`
65+
--> $DIR/use-unclosed-brace.rs:9:9
66+
|
67+
LL | mod bar { }
68+
| -^ expected one of `,`, `::`, `as`, or `}`
69+
| |
70+
| help: missing `,`
71+
72+
error: expected identifier, found keyword `mod`
73+
--> $DIR/use-unclosed-brace.rs:14:1
74+
|
75+
LL | mod baz { }
76+
| ^^^ expected identifier, found keyword
77+
78+
error: expected one of `,` or `}`, found keyword `mod`
79+
--> $DIR/use-unclosed-brace.rs:14:1
80+
|
81+
LL | mod bar { }
82+
| -
83+
| |
84+
| expected one of `,` or `}`
85+
| help: missing `,`
86+
...
87+
LL | mod baz { }
88+
| ^^^ unexpected token
89+
90+
error: expected one of `,`, `::`, `as`, or `}`, found `baz`
91+
--> $DIR/use-unclosed-brace.rs:14:5
92+
|
93+
LL | mod baz { }
94+
| -^^^ expected one of `,`, `::`, `as`, or `}`
95+
| |
96+
| help: missing `,`
97+
98+
error: expected one of `,`, `::`, `as`, or `}`, found `{`
99+
--> $DIR/use-unclosed-brace.rs:14:9
100+
|
101+
LL | mod baz { }
102+
| -^ expected one of `,`, `::`, `as`, or `}`
103+
| |
104+
| help: missing `,`
105+
106+
error: expected identifier, found keyword `fn`
107+
--> $DIR/use-unclosed-brace.rs:20:1
108+
|
109+
LL | fn main() {}
110+
| ^^ expected identifier, found keyword
111+
112+
error: expected one of `,` or `}`, found keyword `fn`
113+
--> $DIR/use-unclosed-brace.rs:20:1
114+
|
115+
LL | mod baz { }
116+
| -
117+
| |
118+
| expected one of `,` or `}`
119+
| help: missing `,`
120+
...
121+
LL | fn main() {}
122+
| ^^ unexpected token
123+
124+
error: expected one of `,`, `::`, `as`, or `}`, found `main`
125+
--> $DIR/use-unclosed-brace.rs:20:4
126+
|
127+
LL | fn main() {}
128+
| -^^^^ expected one of `,`, `::`, `as`, or `}`
129+
| |
130+
| help: missing `,`
131+
132+
error: expected one of `,`, `::`, `as`, or `}`, found `(`
133+
--> $DIR/use-unclosed-brace.rs:20:8
134+
|
135+
LL | fn main() {}
136+
| ^ expected one of `,`, `::`, `as`, or `}`
137+
138+
error: aborting due to 16 previous errors
139+

0 commit comments

Comments
 (0)