Skip to content

Commit 7977250

Browse files
committed
Make sure all ui/parse tests have -Z parse-only
Except those testing parsing during macro expansion
1 parent 64c0efa commit 7977250

File tree

109 files changed

+151
-119
lines changed

Some content is hidden

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

109 files changed

+151
-119
lines changed

src/test/ui/parser/attr-bad-meta-2.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-flags: -Z parse-only
12+
1113
#[path =] //~ ERROR unexpected token: `]`
1214
mod m {}

src/test/ui/parser/attr-bad-meta-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: unexpected token: `]`
2-
--> $DIR/attr-bad-meta-2.rs:11:9
2+
--> $DIR/attr-bad-meta-2.rs:13:9
33
|
44
LL | #[path =] //~ ERROR unexpected token: `]`
55
| ^ unexpected token after this

src/test/ui/parser/attr-bad-meta-3.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-flags: -Z parse-only
12+
1113
#[path() token] //~ ERROR expected `]`, found `token`
1214
mod m {}

src/test/ui/parser/attr-bad-meta-3.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected `]`, found `token`
2-
--> $DIR/attr-bad-meta-3.rs:11:10
2+
--> $DIR/attr-bad-meta-3.rs:13:10
33
|
44
LL | #[path() token] //~ ERROR expected `]`, found `token`
55
| ^^^^^ expected `]`

src/test/ui/parser/attr-bad-meta.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-flags: -Z parse-only
12+
1113
#![feature(unrestricted_attribute_tokens)]
1214

1315
#[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`

src/test/ui/parser/attr-bad-meta.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`
2-
--> $DIR/attr-bad-meta.rs:13:7
2+
--> $DIR/attr-bad-meta.rs:15:7
33
|
44
LL | #[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`
55
| ^ expected one of `(`, `::`, `=`, `[`, `]`, or `{` here

src/test/ui/parser/closure-return-syntax.rs

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
// Test that we cannot parse a closure with an explicit return type
1212
// unless it uses braces.
1313

14+
// compile-flags: -Z parse-only
15+
1416
fn main() {
1517
let x = || -> i32 22;
1618
//~^ ERROR expected one of `!`, `(`, `+`, `::`, `<`, or `{`, found `22`

src/test/ui/parser/closure-return-syntax.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected one of `!`, `(`, `+`, `::`, `<`, or `{`, found `22`
2-
--> $DIR/closure-return-syntax.rs:15:23
2+
--> $DIR/closure-return-syntax.rs:17:23
33
|
44
LL | let x = || -> i32 22;
55
| ^^ expected one of `!`, `(`, `+`, `::`, `<`, or `{` here

src/test/ui/parser/doc-after-struct-field.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -Z continue-parse-after-error
11+
// compile-flags: -Z parse-only -Z continue-parse-after-error
1212

1313
struct X {
1414
a: u8 /** document a */,

src/test/ui/parser/doc-before-fn-rbrace.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -Z continue-parse-after-error
11+
// compile-flags: -Z parse-only -Z continue-parse-after-error
12+
1213
fn main() {
1314
/// document
1415
//~^ ERROR found a documentation comment that doesn't document anything

src/test/ui/parser/doc-before-fn-rbrace.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0585]: found a documentation comment that doesn't document anything
2-
--> $DIR/doc-before-fn-rbrace.rs:13:5
2+
--> $DIR/doc-before-fn-rbrace.rs:14:5
33
|
44
LL | /// document
55
| ^^^^^^^^^^^^

src/test/ui/parser/doc-before-identifier.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -Z continue-parse-after-error
11+
// compile-flags: -Z parse-only -Z continue-parse-after-error
12+
1213
fn /// document
1314
foo() {}
1415
//~^^ ERROR expected identifier, found `/// document`

src/test/ui/parser/doc-before-identifier.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected identifier, found `/// document`
2-
--> $DIR/doc-before-identifier.rs:12:4
2+
--> $DIR/doc-before-identifier.rs:13:4
33
|
44
LL | fn /// document
55
| ^^^^^^^^^^^^ expected identifier

src/test/ui/parser/doc-before-mod-rbrace.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -Z continue-parse-after-error
11+
// compile-flags: -Z parse-only -Z continue-parse-after-error
12+
1213
mod Foo {
1314
/// document
1415
//~^ ERROR expected item after doc comment
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
error: expected item after doc comment
2-
--> $DIR/doc-before-mod-rbrace.rs:13:5
2+
--> $DIR/doc-before-mod-rbrace.rs:14:5
33
|
44
LL | /// document
55
| ^^^^^^^^^^^^
66

7-
error[E0601]: `main` function not found in crate `doc_before_mod_rbrace`
8-
|
9-
= note: consider adding a `main` function to `$DIR/doc-before-mod-rbrace.rs`
10-
11-
error: aborting due to 2 previous errors
7+
error: aborting due to previous error
128

13-
For more information about this error, try `rustc --explain E0601`.

src/test/ui/parser/doc-before-struct-rbrace-1.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -Z continue-parse-after-error
11+
// compile-flags: -Z parse-only -Z continue-parse-after-error
12+
1213
struct X {
1314
a: u8,
1415
/// document

src/test/ui/parser/doc-before-struct-rbrace-1.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0585]: found a documentation comment that doesn't document anything
2-
--> $DIR/doc-before-struct-rbrace-1.rs:14:5
2+
--> $DIR/doc-before-struct-rbrace-1.rs:15:5
33
|
44
LL | /// document
55
| ^^^^^^^^^^^^

src/test/ui/parser/doc-before-struct-rbrace-2.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -Z continue-parse-after-error
11+
// compile-flags: -Z parse-only -Z continue-parse-after-error
12+
1213
struct X {
1314
a: u8 /// document
1415
//~^ ERROR found a documentation comment that doesn't document anything

src/test/ui/parser/doc-before-struct-rbrace-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0585]: found a documentation comment that doesn't document anything
2-
--> $DIR/doc-before-struct-rbrace-2.rs:13:11
2+
--> $DIR/doc-before-struct-rbrace-2.rs:14:11
33
|
44
LL | a: u8 /// document
55
| ^^^^^^^^^^^^

src/test/ui/parser/extern-crate-unexpected-token.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-flags: -Z parse-only
12+
1113
extern crte foo; //~ ERROR expected one of `crate`, `fn`, or `{`, found `crte`

src/test/ui/parser/extern-crate-unexpected-token.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected one of `crate`, `fn`, or `{`, found `crte`
2-
--> $DIR/extern-crate-unexpected-token.rs:11:8
2+
--> $DIR/extern-crate-unexpected-token.rs:13:8
33
|
44
LL | extern crte foo; //~ ERROR expected one of `crate`, `fn`, or `{`, found `crte`
55
| ^^^^ expected one of `crate`, `fn`, or `{` here

src/test/ui/parser/if-in-in.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// compile-flags: -Z parse-only
2+
13
fn main() {
24
for i in in 1..2 {
35
println!("{}", i);

src/test/ui/parser/if-in-in.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected iterable, found keyword `in`
2-
--> $DIR/if-in-in.rs:2:14
2+
--> $DIR/if-in-in.rs:4:14
33
|
44
LL | for i in in 1..2 {
55
| ---^^

src/test/ui/parser/inverted-parameters.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-flags: -Z parse-only
12+
1113
struct S;
1214

1315
impl S {

src/test/ui/parser/inverted-parameters.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected one of `:` or `@`, found `bar`
2-
--> $DIR/inverted-parameters.rs:14:24
2+
--> $DIR/inverted-parameters.rs:16:24
33
|
44
LL | fn foo(&self, &str bar) {}
55
| -----^^^
@@ -8,7 +8,7 @@ LL | fn foo(&self, &str bar) {}
88
| help: declare the type after the parameter binding: `<identifier>: <type>`
99

1010
error: expected one of `:` or `@`, found `quux`
11-
--> $DIR/inverted-parameters.rs:20:10
11+
--> $DIR/inverted-parameters.rs:22:10
1212
|
1313
LL | fn baz(S quux, xyzzy: i32) {}
1414
| --^^^^
@@ -17,25 +17,25 @@ LL | fn baz(S quux, xyzzy: i32) {}
1717
| help: declare the type after the parameter binding: `<identifier>: <type>`
1818

1919
error: expected one of `:` or `@`, found `a`
20-
--> $DIR/inverted-parameters.rs:25:12
20+
--> $DIR/inverted-parameters.rs:27:12
2121
|
2222
LL | fn one(i32 a b) {}
2323
| ^ expected one of `:` or `@` here
2424

2525
error: expected `:`, found `(`
26-
--> $DIR/inverted-parameters.rs:28:23
26+
--> $DIR/inverted-parameters.rs:30:23
2727
|
2828
LL | fn pattern((i32, i32) (a, b)) {}
2929
| ^ expected `:`
3030

3131
error: expected one of `:` or `@`, found `)`
32-
--> $DIR/inverted-parameters.rs:31:12
32+
--> $DIR/inverted-parameters.rs:33:12
3333
|
3434
LL | fn fizz(i32) {}
3535
| ^ expected one of `:` or `@` here
3636

3737
error: expected one of `:` or `@`, found `S`
38-
--> $DIR/inverted-parameters.rs:34:23
38+
--> $DIR/inverted-parameters.rs:36:23
3939
|
4040
LL | fn missing_colon(quux S) {}
4141
| -----^

src/test/ui/parser/issue-10636-2.rs

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
// FIXME(31528) we emit a bunch of silly errors here due to continuing past the
1212
// first one. This would be easy-ish to address by better recovery in tokenisation.
1313

14+
// compile-flags: -Z parse-only
15+
1416
pub fn trace_option(option: Option<isize>) {
1517
option.map(|some| 42;
1618
//~^ ERROR: expected one of

src/test/ui/parser/issue-10636-2.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: incorrect close delimiter: `}`
2-
--> $DIR/issue-10636-2.rs:18:1
2+
--> $DIR/issue-10636-2.rs:20:1
33
|
44
LL | pub fn trace_option(option: Option<isize>) {
55
| - close delimiter possibly meant for this
@@ -10,13 +10,13 @@ LL | } //~ ERROR: incorrect close delimiter
1010
| ^ incorrect close delimiter
1111

1212
error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;`
13-
--> $DIR/issue-10636-2.rs:15:25
13+
--> $DIR/issue-10636-2.rs:17:25
1414
|
1515
LL | option.map(|some| 42;
1616
| ^ expected one of `)`, `,`, `.`, `?`, or an operator here
1717

1818
error: expected expression, found `)`
19-
--> $DIR/issue-10636-2.rs:18:1
19+
--> $DIR/issue-10636-2.rs:20:1
2020
|
2121
LL | } //~ ERROR: incorrect close delimiter
2222
| ^ expected expression

src/test/ui/parser/issue-15980.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-flags: -Z parse-only
12+
1113
use std::io;
1214

1315
fn main(){
1416
let x: io::IoResult<()> = Ok(());
15-
//~^ ERROR cannot find type `IoResult` in module `io`
16-
//~| NOTE did you mean `Result`?
1717
match x {
1818
Err(ref e) if e.kind == io::EndOfFile {
1919
//~^ NOTE while parsing this struct

src/test/ui/parser/issue-15980.stderr

+1-8
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,5 @@ LL | //~^ NOTE expected one of `.`, `=>`, `?`, or an operator here
1616
LL | _ => {}
1717
| ^ unexpected token
1818

19-
error[E0412]: cannot find type `IoResult` in module `io`
20-
--> $DIR/issue-15980.rs:14:16
21-
|
22-
LL | let x: io::IoResult<()> = Ok(());
23-
| ^^^^^^^^ did you mean `Result`?
24-
25-
error: aborting due to 3 previous errors
19+
error: aborting due to 2 previous errors
2620

27-
For more information about this error, try `rustc --explain E0412`.

src/test/ui/parser/issue-22647.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-flags: -Z parse-only
12+
1113
fn main() {
1214
let caller<F> = |f: F| //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<`
1315
where F: Fn() -> i32

src/test/ui/parser/issue-22647.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected one of `:`, `;`, `=`, or `@`, found `<`
2-
--> $DIR/issue-22647.rs:12:15
2+
--> $DIR/issue-22647.rs:14:15
33
|
44
LL | let caller<F> = |f: F| //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<`
55
| ^ expected one of `:`, `;`, `=`, or `@` here

src/test/ui/parser/issue-22712.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-flags: -Z parse-only
12+
1113
struct Foo<B> {
1214
buffer: B
1315
}

src/test/ui/parser/issue-22712.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected one of `:`, `;`, `=`, or `@`, found `<`
2-
--> $DIR/issue-22712.rs:16:12
2+
--> $DIR/issue-22712.rs:18:12
33
|
44
LL | let Foo<Vec<u8>> //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<`
55
| ^ expected one of `:`, `;`, `=`, or `@` here

src/test/ui/parser/issue-24197.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-flags: -Z parse-only
12+
1113
fn main() {
1214
let buf[0] = 0; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[`
1315
}

src/test/ui/parser/issue-24197.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected one of `:`, `;`, `=`, or `@`, found `[`
2-
--> $DIR/issue-24197.rs:12:12
2+
--> $DIR/issue-24197.rs:14:12
33
|
44
LL | let buf[0] = 0; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[`
55
| ^ expected one of `:`, `;`, `=`, or `@` here

src/test/ui/parser/issue-24375.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-flags: -Z parse-only
12+
1113
static tmp : [&'static str; 2] = ["hello", "he"];
1214

1315
fn main() {

src/test/ui/parser/issue-24375.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected one of `=>`, `@`, `if`, or `|`, found `[`
2-
--> $DIR/issue-24375.rs:16:12
2+
--> $DIR/issue-24375.rs:18:12
33
|
44
LL | tmp[0] => {} //~ ERROR expected one of `=>`, `@`, `if`, or `|`, found `[`
55
| ^ expected one of `=>`, `@`, `if`, or `|` here

src/test/ui/parser/issue-33455.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-flags: -Z parse-only
12+
1113
use foo.bar; //~ ERROR expected one of `::`, `;`, or `as`, found `.`

src/test/ui/parser/issue-33455.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected one of `::`, `;`, or `as`, found `.`
2-
--> $DIR/issue-33455.rs:11:8
2+
--> $DIR/issue-33455.rs:13:8
33
|
44
LL | use foo.bar; //~ ERROR expected one of `::`, `;`, or `as`, found `.`
55
| ^ expected one of `::`, `;`, or `as` here

src/test/ui/parser/issue-41155.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
impl S { //~ ERROR cannot find type
11+
// compile-flags: -Z parse-only
12+
13+
impl S {
1214
pub
1315
} //~ ERROR expected one of
1416

0 commit comments

Comments
 (0)