Skip to content

Commit 73e1f89

Browse files
committed
Move parse-fail tests to UI
1 parent 554b787 commit 73e1f89

File tree

541 files changed

+3128
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

541 files changed

+3128
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error: this form of character escape may only be used with characters in the range [/x00-/x7f]
2+
--> $DIR/ascii-only-character-escape.rs:14:16
3+
|
4+
LL | let x = "/x80"; //~ ERROR may only be used
5+
| ^^
6+
7+
error: this form of character escape may only be used with characters in the range [/x00-/x7f]
8+
--> $DIR/ascii-only-character-escape.rs:15:16
9+
|
10+
LL | let y = "/xff"; //~ ERROR may only be used
11+
| ^^
12+
13+
error: this form of character escape may only be used with characters in the range [/x00-/x7f]
14+
--> $DIR/ascii-only-character-escape.rs:16:16
15+
|
16+
LL | let z = "/xe2"; //~ ERROR may only be used
17+
| ^^
18+
19+
error: aborting due to 3 previous errors
20+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `.`, `;`, `?`, or `}`, found `[`
2+
--> $DIR/assoc-oddities-1.rs:20:28
3+
|
4+
LL | ..if c { a } else { b }[n]; //~ ERROR expected one of
5+
| ^ expected one of `.`, `;`, `?`, or `}` here
6+
7+
error: aborting due to previous error
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `.`, `;`, `?`, or `}`, found `[`
2+
--> $DIR/assoc-oddities-2.rs:15:29
3+
|
4+
LL | x..if c { a } else { b }[n]; //~ ERROR expected one of
5+
| ^ expected one of `.`, `;`, `?`, or `}` here
6+
7+
error: aborting due to previous error
8+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: expected identifier, found keyword `for`
2+
--> $DIR/associated-types-project-from-hrtb-explicit.rs:22:21
3+
|
4+
LL | fn foo2<I>(x: <I as for<'x> Foo<&'x isize>>::A)
5+
| ^^^ expected identifier, found keyword
6+
7+
error: expected one of `::` or `>`, found `Foo`
8+
--> $DIR/associated-types-project-from-hrtb-explicit.rs:22:29
9+
|
10+
LL | fn foo2<I>(x: <I as for<'x> Foo<&'x isize>>::A)
11+
| ^^^ expected one of `::` or `>` here
12+
13+
error: aborting due to 2 previous errors
14+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: unexpected token: `]`
2+
--> $DIR/attr-bad-meta-2.rs:11:9
3+
|
4+
LL | #[path =] //~ ERROR unexpected token: `]`
5+
| ^ unexpected token after this
6+
7+
error: aborting due to previous error
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected `]`, found `token`
2+
--> $DIR/attr-bad-meta-3.rs:11:10
3+
|
4+
LL | #[path() token] //~ ERROR expected `]`, found `token`
5+
| ^^^^^ expected `]`
6+
7+
error: aborting due to previous error
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`
2+
--> $DIR/attr-bad-meta.rs:13:7
3+
|
4+
LL | #[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`
5+
| ^ expected one of `(`, `::`, `=`, `[`, `]`, or `{` here
6+
7+
error: aborting due to previous error
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected item after attributes
2+
--> $DIR/attr-before-eof.rs:13:16
3+
|
4+
LL | #[derive(Debug)] //~ERROR expected item after attributes
5+
| ^
6+
7+
error: aborting due to previous error
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected statement after outer attribute
2+
--> $DIR/attr-dangling-in-fn.rs:17:1
3+
|
4+
LL | }
5+
| ^
6+
7+
error: aborting due to previous error
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected item after attributes
2+
--> $DIR/attr-dangling-in-mod.rs:18:14
3+
|
4+
LL | #[foo = "bar"]
5+
| ^
6+
7+
error: aborting due to previous error
8+
File renamed without changes.

src/test/ui/parser/attr.stderr

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: an inner attribute is not permitted in this context
2+
--> $DIR/attr.rs:17:3
3+
|
4+
LL | #![lang(foo)] //~ ERROR an inner attribute is not permitted in this context
5+
| ^
6+
|
7+
= note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.
8+
9+
error: aborting due to previous error
10+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected item after attributes
2+
--> $DIR/attrs-after-extern-mod.rs:22:19
3+
|
4+
LL | #[cfg(stage37)] //~ ERROR expected item after attributes
5+
| ^
6+
7+
error: aborting due to previous error
8+

src/test/ui/parser/bad-char-literals.stderr

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
error: character constant must be escaped: '
2+
--> $DIR/bad-char-literals.rs:17:6
3+
|
4+
LL | ''';
5+
| ^
6+
7+
error: character constant must be escaped: /n
8+
--> $DIR/bad-char-literals.rs:21:6
9+
|
10+
LL | '
11+
| ______^
12+
LL | | ';
13+
| |_
14+
15+
error: character constant must be escaped: /r
16+
--> $DIR/bad-char-literals.rs:26:6
17+
|
18+
LL | ''; //~ ERROR: character constant must be escaped: /r
19+
| ^
20+
21+
error: character constant must be escaped: /t
22+
--> $DIR/bad-char-literals.rs:29:6
23+
|
24+
LL | ' ';
25+
| ^^^^
26+
27+
error: aborting due to 4 previous errors
28+
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
error: ABI spec with a suffix is invalid
2+
--> $DIR/bad-lit-suffixes.rs:15:5
3+
|
4+
LL | "C"suffix //~ ERROR ABI spec with a suffix is invalid
5+
| ^^^^^^^^^
6+
7+
error: ABI spec with a suffix is invalid
8+
--> $DIR/bad-lit-suffixes.rs:19:5
9+
|
10+
LL | "C"suffix //~ ERROR ABI spec with a suffix is invalid
11+
| ^^^^^^^^^
12+
13+
error: string literal with a suffix is invalid
14+
--> $DIR/bad-lit-suffixes.rs:23:5
15+
|
16+
LL | ""suffix; //~ ERROR string literal with a suffix is invalid
17+
| ^^^^^^^^
18+
19+
error: byte string literal with a suffix is invalid
20+
--> $DIR/bad-lit-suffixes.rs:24:5
21+
|
22+
LL | b""suffix; //~ ERROR byte string literal with a suffix is invalid
23+
| ^^^^^^^^^
24+
25+
error: string literal with a suffix is invalid
26+
--> $DIR/bad-lit-suffixes.rs:25:5
27+
|
28+
LL | r#""#suffix; //~ ERROR string literal with a suffix is invalid
29+
| ^^^^^^^^^^^
30+
31+
error: byte string literal with a suffix is invalid
32+
--> $DIR/bad-lit-suffixes.rs:26:5
33+
|
34+
LL | br#""#suffix; //~ ERROR byte string literal with a suffix is invalid
35+
| ^^^^^^^^^^^^
36+
37+
error: char literal with a suffix is invalid
38+
--> $DIR/bad-lit-suffixes.rs:27:5
39+
|
40+
LL | 'a'suffix; //~ ERROR char literal with a suffix is invalid
41+
| ^^^^^^^^^
42+
43+
error: byte literal with a suffix is invalid
44+
--> $DIR/bad-lit-suffixes.rs:28:5
45+
|
46+
LL | b'a'suffix; //~ ERROR byte literal with a suffix is invalid
47+
| ^^^^^^^^^^
48+
49+
error: invalid width `1024` for integer literal
50+
--> $DIR/bad-lit-suffixes.rs:30:5
51+
|
52+
LL | 1234u1024; //~ ERROR invalid width `1024` for integer literal
53+
| ^^^^^^^^^
54+
|
55+
= help: valid widths are 8, 16, 32, 64 and 128
56+
57+
error: invalid width `1024` for integer literal
58+
--> $DIR/bad-lit-suffixes.rs:31:5
59+
|
60+
LL | 1234i1024; //~ ERROR invalid width `1024` for integer literal
61+
| ^^^^^^^^^
62+
|
63+
= help: valid widths are 8, 16, 32, 64 and 128
64+
65+
error: invalid width `1024` for float literal
66+
--> $DIR/bad-lit-suffixes.rs:32:5
67+
|
68+
LL | 1234f1024; //~ ERROR invalid width `1024` for float literal
69+
| ^^^^^^^^^
70+
|
71+
= help: valid widths are 32 and 64
72+
73+
error: invalid width `1024` for float literal
74+
--> $DIR/bad-lit-suffixes.rs:33:5
75+
|
76+
LL | 1234.5f1024; //~ ERROR invalid width `1024` for float literal
77+
| ^^^^^^^^^^^
78+
|
79+
= help: valid widths are 32 and 64
80+
81+
error: invalid suffix `suffix` for numeric literal
82+
--> $DIR/bad-lit-suffixes.rs:35:5
83+
|
84+
LL | 1234suffix; //~ ERROR invalid suffix `suffix` for numeric literal
85+
| ^^^^^^^^^^
86+
|
87+
= help: the suffix must be one of the integral types (`u32`, `isize`, etc)
88+
89+
error: invalid suffix `suffix` for numeric literal
90+
--> $DIR/bad-lit-suffixes.rs:36:5
91+
|
92+
LL | 0b101suffix; //~ ERROR invalid suffix `suffix` for numeric literal
93+
| ^^^^^^^^^^^
94+
|
95+
= help: the suffix must be one of the integral types (`u32`, `isize`, etc)
96+
97+
error: invalid suffix `suffix` for float literal
98+
--> $DIR/bad-lit-suffixes.rs:37:5
99+
|
100+
LL | 1.0suffix; //~ ERROR invalid suffix `suffix` for float literal
101+
| ^^^^^^^^^
102+
|
103+
= help: valid suffixes are `f32` and `f64`
104+
105+
error: invalid suffix `suffix` for float literal
106+
--> $DIR/bad-lit-suffixes.rs:38:5
107+
|
108+
LL | 1.0e10suffix; //~ ERROR invalid suffix `suffix` for float literal
109+
| ^^^^^^^^^^^^
110+
|
111+
= help: valid suffixes are `f32` and `f64`
112+
113+
error: aborting due to 16 previous errors
114+
File renamed without changes.

src/test/ui/parser/bad-match.stderr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `:`, `;`, `=`, or `@`, found `x`
2+
--> $DIR/bad-match.rs:16:13
3+
|
4+
LL | let isize x = 5;
5+
| ^ expected one of `:`, `;`, `=`, or `@` here
6+
7+
error: aborting due to previous error
8+
File renamed without changes.

src/test/ui/parser/bad-name.stderr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `:`, `;`, `=`, or `@`, found `.`
2+
--> $DIR/bad-name.rs:16:8
3+
|
4+
LL | let x.y::<isize>.z foo;
5+
| ^ expected one of `:`, `;`, `=`, or `@` here
6+
7+
error: aborting due to previous error
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate)
2+
--> $DIR/bad-pointer-type.rs:13:11
3+
|
4+
LL | fn foo(_: *()) {
5+
| ^
6+
7+
error: aborting due to previous error
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected identifier, found keyword `false`
2+
--> $DIR/bad-value-ident-false.rs:13:4
3+
|
4+
LL | fn false() { } //~ ERROR expected identifier, found keyword `false`
5+
| ^^^^^ expected identifier, found keyword
6+
7+
error: aborting due to previous error
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected identifier, found keyword `true`
2+
--> $DIR/bad-value-ident-true.rs:13:4
3+
|
4+
LL | fn true() { } //~ ERROR expected identifier, found keyword `true`
5+
| ^^^^ expected identifier, found keyword
6+
7+
error: aborting due to previous error
8+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3`
2+
--> $DIR/better-expected.rs:14:19
3+
|
4+
LL | let x: [isize 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3`
5+
| - ^ expected one of 7 possible tokens here
6+
| |
7+
| while parsing the type for `x`
8+
9+
error: aborting due to previous error
10+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected `,`
2+
--> $DIR/bind-struct-early-modifiers.rs:16:19
3+
|
4+
LL | Foo { ref x: ref x } => {}, //~ ERROR expected `,`
5+
| ^
6+
7+
error: aborting due to previous error
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected identifier, found `>`
2+
--> $DIR/bound-single-question-mark.rs:13:10
3+
|
4+
LL | fn f<T: ?>() {} //~ ERROR expected identifier, found `>`
5+
| ^ expected identifier
6+
7+
error: aborting due to previous error
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `,`, `:`, or `>`, found `'b`
2+
--> $DIR/bounds-lifetime-1.rs:13:17
3+
|
4+
LL | type A = for<'a 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `'b`
5+
| ^^ expected one of `,`, `:`, or `>` here
6+
7+
error: aborting due to previous error
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `,`, `:`, or `>`, found `+`
2+
--> $DIR/bounds-lifetime-2.rs:13:17
3+
|
4+
LL | type A = for<'a + 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `+`
5+
| ^ expected one of `,`, `:`, or `>` here
6+
7+
error: aborting due to previous error
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected `:`, found `;`
2+
--> $DIR/bounds-lifetime-where-1.rs:13:16
3+
|
4+
LL | type A where 'a; //~ ERROR expected `:`, found `;`
5+
| ^ expected `:`
6+
7+
error: aborting due to previous error
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `=`, lifetime, or type, found `,`
2+
--> $DIR/bounds-lifetime-where.rs:20:14
3+
|
4+
LL | type A where , = u8; //~ ERROR expected one of `=`, lifetime, or type, found `,`
5+
| ^ expected one of `=`, lifetime, or type here
6+
7+
error: aborting due to previous error
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `>`, identifier, or lifetime, found `,`
2+
--> $DIR/bounds-lifetime.rs:21:14
3+
|
4+
LL | type A = for<,> fn(); //~ ERROR expected one of `>`, identifier, or lifetime, found `,`
5+
| ^ expected one of `>`, identifier, or lifetime here
6+
7+
error: aborting due to previous error
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `!`, `(`, `+`, `::`, `:`, `<`, `==`, or `=`, found `,`
2+
--> $DIR/bounds-type-where.rs:20:15
3+
|
4+
LL | type A where T, = u8;
5+
| ^ expected one of 8 possible tokens here
6+
7+
error: aborting due to previous error
8+

0 commit comments

Comments
 (0)