diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index aa4e44df2ef94..71a89cd6d76b4 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -379,7 +379,6 @@ impl<'a> Builder<'a> { test::Ui, test::RunPass, test::CompileFail, - test::ParseFail, test::RunFail, test::RunPassValgrind, test::MirOpt, diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 6e6f772a7f351..fe04a91011ee5 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -773,12 +773,6 @@ default_test!(CompileFail { suite: "compile-fail" }); -default_test!(ParseFail { - path: "src/test/parse-fail", - mode: "parse-fail", - suite: "parse-fail" -}); - default_test!(RunFail { path: "src/test/run-fail", mode: "run-fail", diff --git a/src/ci/docker/wasm32-unknown/Dockerfile b/src/ci/docker/wasm32-unknown/Dockerfile index 56eda5480715b..f2a29b0315100 100644 --- a/src/ci/docker/wasm32-unknown/Dockerfile +++ b/src/ci/docker/wasm32-unknown/Dockerfile @@ -36,7 +36,6 @@ ENV SCRIPT python2.7 /checkout/x.py test --target $TARGETS \ src/test/ui \ src/test/run-pass \ src/test/compile-fail \ - src/test/parse-fail \ src/test/mir-opt \ src/test/codegen-units \ src/libcore \ diff --git a/src/etc/generate-keyword-tests.py b/src/etc/generate-keyword-tests.py index e53d6c718c155..1d79f95a4d2bb 100755 --- a/src/etc/generate-keyword-tests.py +++ b/src/etc/generate-keyword-tests.py @@ -44,7 +44,7 @@ """ test_dir = os.path.abspath( - os.path.join(os.path.dirname(__file__), '../test/parse-fail') + os.path.join(os.path.dirname(__file__), '../test/ui/parser') ) for kw in sys.argv[1:]: diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 5c6d5816a472b..a4b8ab86f37f6 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -230,7 +230,7 @@ fn file_to_source_file(sess: &ParseSess, path: &Path, spanopt: Option) match sess.source_map().load_file(path) { Ok(source_file) => source_file, Err(e) => { - let msg = format!("couldn't read {:?}: {}", path.display(), e); + let msg = format!("couldn't read {}: {}", path.display(), e); match spanopt { Some(sp) => sess.span_diagnostic.span_fatal(sp, &msg).raise(), None => sess.span_diagnostic.fatal(&msg).raise() diff --git a/src/test/ui/parser/expected-comma-found-token.rs b/src/test/ui/on-unimplemented/expected-comma-found-token.rs similarity index 100% rename from src/test/ui/parser/expected-comma-found-token.rs rename to src/test/ui/on-unimplemented/expected-comma-found-token.rs diff --git a/src/test/ui/parser/expected-comma-found-token.stderr b/src/test/ui/on-unimplemented/expected-comma-found-token.stderr similarity index 100% rename from src/test/ui/parser/expected-comma-found-token.stderr rename to src/test/ui/on-unimplemented/expected-comma-found-token.stderr diff --git a/src/test/parse-fail/ascii-only-character-escape.rs b/src/test/ui/parser/ascii-only-character-escape.rs similarity index 100% rename from src/test/parse-fail/ascii-only-character-escape.rs rename to src/test/ui/parser/ascii-only-character-escape.rs diff --git a/src/test/ui/parser/ascii-only-character-escape.stderr b/src/test/ui/parser/ascii-only-character-escape.stderr new file mode 100644 index 0000000000000..e09db780880a0 --- /dev/null +++ b/src/test/ui/parser/ascii-only-character-escape.stderr @@ -0,0 +1,20 @@ +error: this form of character escape may only be used with characters in the range [/x00-/x7f] + --> $DIR/ascii-only-character-escape.rs:14:16 + | +LL | let x = "/x80"; //~ ERROR may only be used + | ^^ + +error: this form of character escape may only be used with characters in the range [/x00-/x7f] + --> $DIR/ascii-only-character-escape.rs:15:16 + | +LL | let y = "/xff"; //~ ERROR may only be used + | ^^ + +error: this form of character escape may only be used with characters in the range [/x00-/x7f] + --> $DIR/ascii-only-character-escape.rs:16:16 + | +LL | let z = "/xe2"; //~ ERROR may only be used + | ^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/parse-fail/assoc-oddities-1.rs b/src/test/ui/parser/assoc-oddities-1.rs similarity index 100% rename from src/test/parse-fail/assoc-oddities-1.rs rename to src/test/ui/parser/assoc-oddities-1.rs diff --git a/src/test/ui/parser/assoc-oddities-1.stderr b/src/test/ui/parser/assoc-oddities-1.stderr new file mode 100644 index 0000000000000..2d39546dca88f --- /dev/null +++ b/src/test/ui/parser/assoc-oddities-1.stderr @@ -0,0 +1,8 @@ +error: expected one of `.`, `;`, `?`, or `}`, found `[` + --> $DIR/assoc-oddities-1.rs:20:28 + | +LL | ..if c { a } else { b }[n]; //~ ERROR expected one of + | ^ expected one of `.`, `;`, `?`, or `}` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/assoc-oddities-2.rs b/src/test/ui/parser/assoc-oddities-2.rs similarity index 100% rename from src/test/parse-fail/assoc-oddities-2.rs rename to src/test/ui/parser/assoc-oddities-2.rs diff --git a/src/test/ui/parser/assoc-oddities-2.stderr b/src/test/ui/parser/assoc-oddities-2.stderr new file mode 100644 index 0000000000000..878ef68274736 --- /dev/null +++ b/src/test/ui/parser/assoc-oddities-2.stderr @@ -0,0 +1,8 @@ +error: expected one of `.`, `;`, `?`, or `}`, found `[` + --> $DIR/assoc-oddities-2.rs:15:29 + | +LL | x..if c { a } else { b }[n]; //~ ERROR expected one of + | ^ expected one of `.`, `;`, `?`, or `}` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/associated-types-project-from-hrtb-explicit.rs b/src/test/ui/parser/associated-types-project-from-hrtb-explicit.rs similarity index 100% rename from src/test/parse-fail/associated-types-project-from-hrtb-explicit.rs rename to src/test/ui/parser/associated-types-project-from-hrtb-explicit.rs diff --git a/src/test/ui/parser/associated-types-project-from-hrtb-explicit.stderr b/src/test/ui/parser/associated-types-project-from-hrtb-explicit.stderr new file mode 100644 index 0000000000000..59b378c208895 --- /dev/null +++ b/src/test/ui/parser/associated-types-project-from-hrtb-explicit.stderr @@ -0,0 +1,14 @@ +error: expected identifier, found keyword `for` + --> $DIR/associated-types-project-from-hrtb-explicit.rs:22:21 + | +LL | fn foo2(x: Foo<&'x isize>>::A) + | ^^^ expected identifier, found keyword + +error: expected one of `::` or `>`, found `Foo` + --> $DIR/associated-types-project-from-hrtb-explicit.rs:22:29 + | +LL | fn foo2(x: Foo<&'x isize>>::A) + | ^^^ expected one of `::` or `>` here + +error: aborting due to 2 previous errors + diff --git a/src/test/parse-fail/attr-bad-meta-2.rs b/src/test/ui/parser/attr-bad-meta-2.rs similarity index 94% rename from src/test/parse-fail/attr-bad-meta-2.rs rename to src/test/ui/parser/attr-bad-meta-2.rs index ce640a3f67cd2..121a0d8eba27b 100644 --- a/src/test/parse-fail/attr-bad-meta-2.rs +++ b/src/test/ui/parser/attr-bad-meta-2.rs @@ -8,5 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + #[path =] //~ ERROR unexpected token: `]` mod m {} diff --git a/src/test/ui/parser/attr-bad-meta-2.stderr b/src/test/ui/parser/attr-bad-meta-2.stderr new file mode 100644 index 0000000000000..b869331ca5a3c --- /dev/null +++ b/src/test/ui/parser/attr-bad-meta-2.stderr @@ -0,0 +1,8 @@ +error: unexpected token: `]` + --> $DIR/attr-bad-meta-2.rs:13:9 + | +LL | #[path =] //~ ERROR unexpected token: `]` + | ^ unexpected token after this + +error: aborting due to previous error + diff --git a/src/test/parse-fail/attr-bad-meta-3.rs b/src/test/ui/parser/attr-bad-meta-3.rs similarity index 94% rename from src/test/parse-fail/attr-bad-meta-3.rs rename to src/test/ui/parser/attr-bad-meta-3.rs index 92e2a59d25d87..e0558443a360a 100644 --- a/src/test/parse-fail/attr-bad-meta-3.rs +++ b/src/test/ui/parser/attr-bad-meta-3.rs @@ -8,5 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + #[path() token] //~ ERROR expected `]`, found `token` mod m {} diff --git a/src/test/ui/parser/attr-bad-meta-3.stderr b/src/test/ui/parser/attr-bad-meta-3.stderr new file mode 100644 index 0000000000000..bef2f423ab9a0 --- /dev/null +++ b/src/test/ui/parser/attr-bad-meta-3.stderr @@ -0,0 +1,8 @@ +error: expected `]`, found `token` + --> $DIR/attr-bad-meta-3.rs:13:10 + | +LL | #[path() token] //~ ERROR expected `]`, found `token` + | ^^^^^ expected `]` + +error: aborting due to previous error + diff --git a/src/test/parse-fail/attr-bad-meta.rs b/src/test/ui/parser/attr-bad-meta.rs similarity index 94% rename from src/test/parse-fail/attr-bad-meta.rs rename to src/test/ui/parser/attr-bad-meta.rs index 6f9d794dc2dc3..cf9c3f9a35f6c 100644 --- a/src/test/parse-fail/attr-bad-meta.rs +++ b/src/test/ui/parser/attr-bad-meta.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + #![feature(unrestricted_attribute_tokens)] #[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*` diff --git a/src/test/ui/parser/attr-bad-meta.stderr b/src/test/ui/parser/attr-bad-meta.stderr new file mode 100644 index 0000000000000..d19fe25bad80c --- /dev/null +++ b/src/test/ui/parser/attr-bad-meta.stderr @@ -0,0 +1,8 @@ +error: expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*` + --> $DIR/attr-bad-meta.rs:15:7 + | +LL | #[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*` + | ^ expected one of `(`, `::`, `=`, `[`, `]`, or `{` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/attr-before-eof.rs b/src/test/ui/parser/attr-before-eof.rs similarity index 100% rename from src/test/parse-fail/attr-before-eof.rs rename to src/test/ui/parser/attr-before-eof.rs diff --git a/src/test/ui/parser/attr-before-eof.stderr b/src/test/ui/parser/attr-before-eof.stderr new file mode 100644 index 0000000000000..e96b9c4cc3d1d --- /dev/null +++ b/src/test/ui/parser/attr-before-eof.stderr @@ -0,0 +1,8 @@ +error: expected item after attributes + --> $DIR/attr-before-eof.rs:13:16 + | +LL | #[derive(Debug)] //~ERROR expected item after attributes + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/attr-dangling-in-fn.rs b/src/test/ui/parser/attr-dangling-in-fn.rs similarity index 100% rename from src/test/parse-fail/attr-dangling-in-fn.rs rename to src/test/ui/parser/attr-dangling-in-fn.rs diff --git a/src/test/ui/parser/attr-dangling-in-fn.stderr b/src/test/ui/parser/attr-dangling-in-fn.stderr new file mode 100644 index 0000000000000..0f530a2d40205 --- /dev/null +++ b/src/test/ui/parser/attr-dangling-in-fn.stderr @@ -0,0 +1,8 @@ +error: expected statement after outer attribute + --> $DIR/attr-dangling-in-fn.rs:17:1 + | +LL | } + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/attr-dangling-in-mod.rs b/src/test/ui/parser/attr-dangling-in-mod.rs similarity index 100% rename from src/test/parse-fail/attr-dangling-in-mod.rs rename to src/test/ui/parser/attr-dangling-in-mod.rs diff --git a/src/test/ui/parser/attr-dangling-in-mod.stderr b/src/test/ui/parser/attr-dangling-in-mod.stderr new file mode 100644 index 0000000000000..1105e06f93c5b --- /dev/null +++ b/src/test/ui/parser/attr-dangling-in-mod.stderr @@ -0,0 +1,8 @@ +error: expected item after attributes + --> $DIR/attr-dangling-in-mod.rs:18:14 + | +LL | #[foo = "bar"] + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/attr.rs b/src/test/ui/parser/attr.rs similarity index 100% rename from src/test/parse-fail/attr.rs rename to src/test/ui/parser/attr.rs diff --git a/src/test/ui/parser/attr.stderr b/src/test/ui/parser/attr.stderr new file mode 100644 index 0000000000000..a977847679a2b --- /dev/null +++ b/src/test/ui/parser/attr.stderr @@ -0,0 +1,10 @@ +error: an inner attribute is not permitted in this context + --> $DIR/attr.rs:17:3 + | +LL | #![lang(foo)] //~ ERROR an inner attribute is not permitted in this context + | ^ + | + = 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. + +error: aborting due to previous error + diff --git a/src/test/parse-fail/attrs-after-extern-mod.rs b/src/test/ui/parser/attrs-after-extern-mod.rs similarity index 100% rename from src/test/parse-fail/attrs-after-extern-mod.rs rename to src/test/ui/parser/attrs-after-extern-mod.rs diff --git a/src/test/ui/parser/attrs-after-extern-mod.stderr b/src/test/ui/parser/attrs-after-extern-mod.stderr new file mode 100644 index 0000000000000..70a7afc9060fb --- /dev/null +++ b/src/test/ui/parser/attrs-after-extern-mod.stderr @@ -0,0 +1,8 @@ +error: expected item after attributes + --> $DIR/attrs-after-extern-mod.rs:22:19 + | +LL | #[cfg(stage37)] //~ ERROR expected item after attributes + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/bad-char-literals.rs b/src/test/ui/parser/bad-char-literals.rs similarity index 100% rename from src/test/parse-fail/bad-char-literals.rs rename to src/test/ui/parser/bad-char-literals.rs diff --git a/src/test/ui/parser/bad-char-literals.stderr b/src/test/ui/parser/bad-char-literals.stderr new file mode 100644 index 0000000000000..40f96655170c0 --- /dev/null +++ b/src/test/ui/parser/bad-char-literals.stderr @@ -0,0 +1,28 @@ +error: character constant must be escaped: ' + --> $DIR/bad-char-literals.rs:17:6 + | +LL | '''; + | ^ + +error: character constant must be escaped: /n + --> $DIR/bad-char-literals.rs:21:6 + | +LL | ' + | ______^ +LL | | '; + | |_ + +error: character constant must be escaped: /r + --> $DIR/bad-char-literals.rs:26:6 + | +LL | ' '; //~ ERROR: character constant must be escaped: /r + | ^ + +error: character constant must be escaped: /t + --> $DIR/bad-char-literals.rs:29:6 + | +LL | ' '; + | ^^^^ + +error: aborting due to 4 previous errors + diff --git a/src/test/parse-fail/bad-lit-suffixes.rs b/src/test/ui/parser/bad-lit-suffixes.rs similarity index 100% rename from src/test/parse-fail/bad-lit-suffixes.rs rename to src/test/ui/parser/bad-lit-suffixes.rs diff --git a/src/test/ui/parser/bad-lit-suffixes.stderr b/src/test/ui/parser/bad-lit-suffixes.stderr new file mode 100644 index 0000000000000..bc15c329526d4 --- /dev/null +++ b/src/test/ui/parser/bad-lit-suffixes.stderr @@ -0,0 +1,114 @@ +error: ABI spec with a suffix is invalid + --> $DIR/bad-lit-suffixes.rs:15:5 + | +LL | "C"suffix //~ ERROR ABI spec with a suffix is invalid + | ^^^^^^^^^ + +error: ABI spec with a suffix is invalid + --> $DIR/bad-lit-suffixes.rs:19:5 + | +LL | "C"suffix //~ ERROR ABI spec with a suffix is invalid + | ^^^^^^^^^ + +error: string literal with a suffix is invalid + --> $DIR/bad-lit-suffixes.rs:23:5 + | +LL | ""suffix; //~ ERROR string literal with a suffix is invalid + | ^^^^^^^^ + +error: byte string literal with a suffix is invalid + --> $DIR/bad-lit-suffixes.rs:24:5 + | +LL | b""suffix; //~ ERROR byte string literal with a suffix is invalid + | ^^^^^^^^^ + +error: string literal with a suffix is invalid + --> $DIR/bad-lit-suffixes.rs:25:5 + | +LL | r#""#suffix; //~ ERROR string literal with a suffix is invalid + | ^^^^^^^^^^^ + +error: byte string literal with a suffix is invalid + --> $DIR/bad-lit-suffixes.rs:26:5 + | +LL | br#""#suffix; //~ ERROR byte string literal with a suffix is invalid + | ^^^^^^^^^^^^ + +error: char literal with a suffix is invalid + --> $DIR/bad-lit-suffixes.rs:27:5 + | +LL | 'a'suffix; //~ ERROR char literal with a suffix is invalid + | ^^^^^^^^^ + +error: byte literal with a suffix is invalid + --> $DIR/bad-lit-suffixes.rs:28:5 + | +LL | b'a'suffix; //~ ERROR byte literal with a suffix is invalid + | ^^^^^^^^^^ + +error: invalid width `1024` for integer literal + --> $DIR/bad-lit-suffixes.rs:30:5 + | +LL | 1234u1024; //~ ERROR invalid width `1024` for integer literal + | ^^^^^^^^^ + | + = help: valid widths are 8, 16, 32, 64 and 128 + +error: invalid width `1024` for integer literal + --> $DIR/bad-lit-suffixes.rs:31:5 + | +LL | 1234i1024; //~ ERROR invalid width `1024` for integer literal + | ^^^^^^^^^ + | + = help: valid widths are 8, 16, 32, 64 and 128 + +error: invalid width `1024` for float literal + --> $DIR/bad-lit-suffixes.rs:32:5 + | +LL | 1234f1024; //~ ERROR invalid width `1024` for float literal + | ^^^^^^^^^ + | + = help: valid widths are 32 and 64 + +error: invalid width `1024` for float literal + --> $DIR/bad-lit-suffixes.rs:33:5 + | +LL | 1234.5f1024; //~ ERROR invalid width `1024` for float literal + | ^^^^^^^^^^^ + | + = help: valid widths are 32 and 64 + +error: invalid suffix `suffix` for numeric literal + --> $DIR/bad-lit-suffixes.rs:35:5 + | +LL | 1234suffix; //~ ERROR invalid suffix `suffix` for numeric literal + | ^^^^^^^^^^ + | + = help: the suffix must be one of the integral types (`u32`, `isize`, etc) + +error: invalid suffix `suffix` for numeric literal + --> $DIR/bad-lit-suffixes.rs:36:5 + | +LL | 0b101suffix; //~ ERROR invalid suffix `suffix` for numeric literal + | ^^^^^^^^^^^ + | + = help: the suffix must be one of the integral types (`u32`, `isize`, etc) + +error: invalid suffix `suffix` for float literal + --> $DIR/bad-lit-suffixes.rs:37:5 + | +LL | 1.0suffix; //~ ERROR invalid suffix `suffix` for float literal + | ^^^^^^^^^ + | + = help: valid suffixes are `f32` and `f64` + +error: invalid suffix `suffix` for float literal + --> $DIR/bad-lit-suffixes.rs:38:5 + | +LL | 1.0e10suffix; //~ ERROR invalid suffix `suffix` for float literal + | ^^^^^^^^^^^^ + | + = help: valid suffixes are `f32` and `f64` + +error: aborting due to 16 previous errors + diff --git a/src/test/parse-fail/bad-match.rs b/src/test/ui/parser/bad-match.rs similarity index 100% rename from src/test/parse-fail/bad-match.rs rename to src/test/ui/parser/bad-match.rs diff --git a/src/test/ui/parser/bad-match.stderr b/src/test/ui/parser/bad-match.stderr new file mode 100644 index 0000000000000..7927a3d61386e --- /dev/null +++ b/src/test/ui/parser/bad-match.stderr @@ -0,0 +1,8 @@ +error: expected one of `:`, `;`, `=`, or `@`, found `x` + --> $DIR/bad-match.rs:16:13 + | +LL | let isize x = 5; + | ^ expected one of `:`, `;`, `=`, or `@` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/bad-name.rs b/src/test/ui/parser/bad-name.rs similarity index 100% rename from src/test/parse-fail/bad-name.rs rename to src/test/ui/parser/bad-name.rs diff --git a/src/test/ui/parser/bad-name.stderr b/src/test/ui/parser/bad-name.stderr new file mode 100644 index 0000000000000..c4ab3e18c9b45 --- /dev/null +++ b/src/test/ui/parser/bad-name.stderr @@ -0,0 +1,8 @@ +error: expected one of `:`, `;`, `=`, or `@`, found `.` + --> $DIR/bad-name.rs:16:8 + | +LL | let x.y::.z foo; + | ^ expected one of `:`, `;`, `=`, or `@` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/bad-pointer-type.rs b/src/test/ui/parser/bad-pointer-type.rs similarity index 100% rename from src/test/parse-fail/bad-pointer-type.rs rename to src/test/ui/parser/bad-pointer-type.rs diff --git a/src/test/ui/parser/bad-pointer-type.stderr b/src/test/ui/parser/bad-pointer-type.stderr new file mode 100644 index 0000000000000..d41bbb3475b63 --- /dev/null +++ b/src/test/ui/parser/bad-pointer-type.stderr @@ -0,0 +1,8 @@ +error: expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate) + --> $DIR/bad-pointer-type.rs:13:11 + | +LL | fn foo(_: *()) { + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/bad-value-ident-false.rs b/src/test/ui/parser/bad-value-ident-false.rs similarity index 100% rename from src/test/parse-fail/bad-value-ident-false.rs rename to src/test/ui/parser/bad-value-ident-false.rs diff --git a/src/test/ui/parser/bad-value-ident-false.stderr b/src/test/ui/parser/bad-value-ident-false.stderr new file mode 100644 index 0000000000000..ac5fe784a9a0d --- /dev/null +++ b/src/test/ui/parser/bad-value-ident-false.stderr @@ -0,0 +1,8 @@ +error: expected identifier, found keyword `false` + --> $DIR/bad-value-ident-false.rs:13:4 + | +LL | fn false() { } //~ ERROR expected identifier, found keyword `false` + | ^^^^^ expected identifier, found keyword + +error: aborting due to previous error + diff --git a/src/test/parse-fail/bad-value-ident-true.rs b/src/test/ui/parser/bad-value-ident-true.rs similarity index 100% rename from src/test/parse-fail/bad-value-ident-true.rs rename to src/test/ui/parser/bad-value-ident-true.rs diff --git a/src/test/ui/parser/bad-value-ident-true.stderr b/src/test/ui/parser/bad-value-ident-true.stderr new file mode 100644 index 0000000000000..34d02374d57c8 --- /dev/null +++ b/src/test/ui/parser/bad-value-ident-true.stderr @@ -0,0 +1,8 @@ +error: expected identifier, found keyword `true` + --> $DIR/bad-value-ident-true.rs:13:4 + | +LL | fn true() { } //~ ERROR expected identifier, found keyword `true` + | ^^^^ expected identifier, found keyword + +error: aborting due to previous error + diff --git a/src/test/parse-fail/better-expected.rs b/src/test/ui/parser/better-expected.rs similarity index 100% rename from src/test/parse-fail/better-expected.rs rename to src/test/ui/parser/better-expected.rs diff --git a/src/test/ui/parser/better-expected.stderr b/src/test/ui/parser/better-expected.stderr new file mode 100644 index 0000000000000..028858c34e9e1 --- /dev/null +++ b/src/test/ui/parser/better-expected.stderr @@ -0,0 +1,10 @@ +error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3` + --> $DIR/better-expected.rs:14:19 + | +LL | let x: [isize 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3` + | - ^ expected one of 7 possible tokens here + | | + | while parsing the type for `x` + +error: aborting due to previous error + diff --git a/src/test/parse-fail/bind-struct-early-modifiers.rs b/src/test/ui/parser/bind-struct-early-modifiers.rs similarity index 100% rename from src/test/parse-fail/bind-struct-early-modifiers.rs rename to src/test/ui/parser/bind-struct-early-modifiers.rs diff --git a/src/test/ui/parser/bind-struct-early-modifiers.stderr b/src/test/ui/parser/bind-struct-early-modifiers.stderr new file mode 100644 index 0000000000000..14ff1b73767ba --- /dev/null +++ b/src/test/ui/parser/bind-struct-early-modifiers.stderr @@ -0,0 +1,8 @@ +error: expected `,` + --> $DIR/bind-struct-early-modifiers.rs:16:19 + | +LL | Foo { ref x: ref x } => {}, //~ ERROR expected `,` + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/bound-single-question-mark.rs b/src/test/ui/parser/bound-single-question-mark.rs similarity index 100% rename from src/test/parse-fail/bound-single-question-mark.rs rename to src/test/ui/parser/bound-single-question-mark.rs diff --git a/src/test/ui/parser/bound-single-question-mark.stderr b/src/test/ui/parser/bound-single-question-mark.stderr new file mode 100644 index 0000000000000..e3522cef8d44f --- /dev/null +++ b/src/test/ui/parser/bound-single-question-mark.stderr @@ -0,0 +1,8 @@ +error: expected identifier, found `>` + --> $DIR/bound-single-question-mark.rs:13:10 + | +LL | fn f() {} //~ ERROR expected identifier, found `>` + | ^ expected identifier + +error: aborting due to previous error + diff --git a/src/test/parse-fail/bounds-lifetime-1.rs b/src/test/ui/parser/bounds-lifetime-1.rs similarity index 100% rename from src/test/parse-fail/bounds-lifetime-1.rs rename to src/test/ui/parser/bounds-lifetime-1.rs diff --git a/src/test/ui/parser/bounds-lifetime-1.stderr b/src/test/ui/parser/bounds-lifetime-1.stderr new file mode 100644 index 0000000000000..910092fba4055 --- /dev/null +++ b/src/test/ui/parser/bounds-lifetime-1.stderr @@ -0,0 +1,8 @@ +error: expected one of `,`, `:`, or `>`, found `'b` + --> $DIR/bounds-lifetime-1.rs:13:17 + | +LL | type A = for<'a 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `'b` + | ^^ expected one of `,`, `:`, or `>` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/bounds-lifetime-2.rs b/src/test/ui/parser/bounds-lifetime-2.rs similarity index 100% rename from src/test/parse-fail/bounds-lifetime-2.rs rename to src/test/ui/parser/bounds-lifetime-2.rs diff --git a/src/test/ui/parser/bounds-lifetime-2.stderr b/src/test/ui/parser/bounds-lifetime-2.stderr new file mode 100644 index 0000000000000..b84f5e6990afb --- /dev/null +++ b/src/test/ui/parser/bounds-lifetime-2.stderr @@ -0,0 +1,8 @@ +error: expected one of `,`, `:`, or `>`, found `+` + --> $DIR/bounds-lifetime-2.rs:13:17 + | +LL | type A = for<'a + 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `+` + | ^ expected one of `,`, `:`, or `>` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/bounds-lifetime-where-1.rs b/src/test/ui/parser/bounds-lifetime-where-1.rs similarity index 100% rename from src/test/parse-fail/bounds-lifetime-where-1.rs rename to src/test/ui/parser/bounds-lifetime-where-1.rs diff --git a/src/test/ui/parser/bounds-lifetime-where-1.stderr b/src/test/ui/parser/bounds-lifetime-where-1.stderr new file mode 100644 index 0000000000000..5bcb8962e0f4e --- /dev/null +++ b/src/test/ui/parser/bounds-lifetime-where-1.stderr @@ -0,0 +1,8 @@ +error: expected `:`, found `;` + --> $DIR/bounds-lifetime-where-1.rs:13:16 + | +LL | type A where 'a; //~ ERROR expected `:`, found `;` + | ^ expected `:` + +error: aborting due to previous error + diff --git a/src/test/parse-fail/bounds-lifetime-where.rs b/src/test/ui/parser/bounds-lifetime-where.rs similarity index 100% rename from src/test/parse-fail/bounds-lifetime-where.rs rename to src/test/ui/parser/bounds-lifetime-where.rs diff --git a/src/test/ui/parser/bounds-lifetime-where.stderr b/src/test/ui/parser/bounds-lifetime-where.stderr new file mode 100644 index 0000000000000..ef4ba9499c37a --- /dev/null +++ b/src/test/ui/parser/bounds-lifetime-where.stderr @@ -0,0 +1,8 @@ +error: expected one of `=`, lifetime, or type, found `,` + --> $DIR/bounds-lifetime-where.rs:20:14 + | +LL | type A where , = u8; //~ ERROR expected one of `=`, lifetime, or type, found `,` + | ^ expected one of `=`, lifetime, or type here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/bounds-lifetime.rs b/src/test/ui/parser/bounds-lifetime.rs similarity index 100% rename from src/test/parse-fail/bounds-lifetime.rs rename to src/test/ui/parser/bounds-lifetime.rs diff --git a/src/test/ui/parser/bounds-lifetime.stderr b/src/test/ui/parser/bounds-lifetime.stderr new file mode 100644 index 0000000000000..2850af5193a3e --- /dev/null +++ b/src/test/ui/parser/bounds-lifetime.stderr @@ -0,0 +1,8 @@ +error: expected one of `>`, identifier, or lifetime, found `,` + --> $DIR/bounds-lifetime.rs:21:14 + | +LL | type A = for<,> fn(); //~ ERROR expected one of `>`, identifier, or lifetime, found `,` + | ^ expected one of `>`, identifier, or lifetime here + +error: aborting due to previous error + diff --git a/src/test/ui/token/bounds-obj-parens.rs b/src/test/ui/parser/bounds-obj-parens.rs similarity index 97% rename from src/test/ui/token/bounds-obj-parens.rs rename to src/test/ui/parser/bounds-obj-parens.rs index 9617df8fa21a9..7b47bbd951ede 100644 --- a/src/test/ui/token/bounds-obj-parens.rs +++ b/src/test/ui/parser/bounds-obj-parens.rs @@ -8,9 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-pass // compile-flags: -Z parse-only type A = Box<(Fn(D::Error) -> E) + 'static + Send + Sync>; // OK (but see #39318) - -FAIL -//~^ ERROR diff --git a/src/test/parse-fail/bounds-type-where.rs b/src/test/ui/parser/bounds-type-where.rs similarity index 100% rename from src/test/parse-fail/bounds-type-where.rs rename to src/test/ui/parser/bounds-type-where.rs diff --git a/src/test/ui/parser/bounds-type-where.stderr b/src/test/ui/parser/bounds-type-where.stderr new file mode 100644 index 0000000000000..b6a184f54fc07 --- /dev/null +++ b/src/test/ui/parser/bounds-type-where.stderr @@ -0,0 +1,8 @@ +error: expected one of `!`, `(`, `+`, `::`, `:`, `<`, `==`, or `=`, found `,` + --> $DIR/bounds-type-where.rs:20:15 + | +LL | type A where T, = u8; + | ^ expected one of 8 possible tokens here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/bounds-type.rs b/src/test/ui/parser/bounds-type.rs similarity index 100% rename from src/test/parse-fail/bounds-type.rs rename to src/test/ui/parser/bounds-type.rs diff --git a/src/test/ui/parser/bounds-type.stderr b/src/test/ui/parser/bounds-type.stderr new file mode 100644 index 0000000000000..c4c3d2ae0656a --- /dev/null +++ b/src/test/ui/parser/bounds-type.stderr @@ -0,0 +1,8 @@ +error: `?` may only modify trait bounds, not lifetime bounds + --> $DIR/bounds-type.rs:20:8 + | +LL | T: ?'a, //~ ERROR `?` may only modify trait bounds, not lifetime bounds + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/brace-after-qualified-path-in-match.rs b/src/test/ui/parser/brace-after-qualified-path-in-match.rs similarity index 100% rename from src/test/parse-fail/brace-after-qualified-path-in-match.rs rename to src/test/ui/parser/brace-after-qualified-path-in-match.rs diff --git a/src/test/ui/parser/brace-after-qualified-path-in-match.stderr b/src/test/ui/parser/brace-after-qualified-path-in-match.stderr new file mode 100644 index 0000000000000..c66b3ed75e8dc --- /dev/null +++ b/src/test/ui/parser/brace-after-qualified-path-in-match.stderr @@ -0,0 +1,8 @@ +error: unexpected `{` after qualified path + --> $DIR/brace-after-qualified-path-in-match.rs:15:27 + | +LL | ::Type{key: value} => (), + | ^ unexpected `{` after qualified path + +error: aborting due to previous error + diff --git a/src/test/parse-fail/byte-literals.rs b/src/test/ui/parser/byte-literals.rs similarity index 100% rename from src/test/parse-fail/byte-literals.rs rename to src/test/ui/parser/byte-literals.rs diff --git a/src/test/ui/parser/byte-literals.stderr b/src/test/ui/parser/byte-literals.stderr new file mode 100644 index 0000000000000..7b4f22134c453 --- /dev/null +++ b/src/test/ui/parser/byte-literals.stderr @@ -0,0 +1,44 @@ +error: unknown byte escape: f + --> $DIR/byte-literals.rs:16:21 + | +LL | static FOO: u8 = b'/f'; //~ ERROR unknown byte escape + | ^ + +error: unknown byte escape: f + --> $DIR/byte-literals.rs:19:8 + | +LL | b'/f'; //~ ERROR unknown byte escape + | ^ + +error: invalid character in numeric character escape: Z + --> $DIR/byte-literals.rs:20:10 + | +LL | b'/x0Z'; //~ ERROR invalid character in numeric character escape: Z + | ^ + +error: byte constant must be escaped: /t + --> $DIR/byte-literals.rs:21:7 + | +LL | b' '; //~ ERROR byte constant must be escaped + | ^^^^ + +error: byte constant must be escaped: ' + --> $DIR/byte-literals.rs:22:7 + | +LL | b'''; //~ ERROR byte constant must be escaped + | ^ + +error: byte constant must be ASCII. Use a /xHH escape for a non-ASCII byte + --> $DIR/byte-literals.rs:23:7 + | +LL | b'é'; //~ ERROR byte constant must be ASCII + | ^ + +error: unterminated byte constant: b'a + --> $DIR/byte-literals.rs:24:5 + | +LL | b'a //~ ERROR unterminated byte constant + | ^^^ + +error: aborting due to 7 previous errors + diff --git a/src/test/parse-fail/byte-string-literals.rs b/src/test/ui/parser/byte-string-literals.rs similarity index 100% rename from src/test/parse-fail/byte-string-literals.rs rename to src/test/ui/parser/byte-string-literals.rs diff --git a/src/test/ui/parser/byte-string-literals.stderr b/src/test/ui/parser/byte-string-literals.stderr new file mode 100644 index 0000000000000..856d1956c053a --- /dev/null +++ b/src/test/ui/parser/byte-string-literals.stderr @@ -0,0 +1,34 @@ +error: unknown byte escape: f + --> $DIR/byte-string-literals.rs:16:32 + | +LL | static FOO: &'static [u8] = b"/f"; //~ ERROR unknown byte escape + | ^ + +error: unknown byte escape: f + --> $DIR/byte-string-literals.rs:19:8 + | +LL | b"/f"; //~ ERROR unknown byte escape + | ^ + +error: invalid character in numeric character escape: Z + --> $DIR/byte-string-literals.rs:20:10 + | +LL | b"/x0Z"; //~ ERROR invalid character in numeric character escape: Z + | ^ + +error: byte constant must be ASCII. Use a /xHH escape for a non-ASCII byte + --> $DIR/byte-string-literals.rs:21:7 + | +LL | b"é"; //~ ERROR byte constant must be ASCII + | ^ + +error: unterminated double quote byte string + --> $DIR/byte-string-literals.rs:22:7 + | +LL | b"a //~ ERROR unterminated double quote byte string + | _______^ +LL | | } + | |__^ + +error: aborting due to 5 previous errors + diff --git a/src/test/parse-fail/circular_modules_hello.rs b/src/test/ui/parser/circular_modules_hello.rs similarity index 100% rename from src/test/parse-fail/circular_modules_hello.rs rename to src/test/ui/parser/circular_modules_hello.rs diff --git a/src/test/parse-fail/circular_modules_main.rs b/src/test/ui/parser/circular_modules_main.rs similarity index 100% rename from src/test/parse-fail/circular_modules_main.rs rename to src/test/ui/parser/circular_modules_main.rs diff --git a/src/test/ui/parser/circular_modules_main.stderr b/src/test/ui/parser/circular_modules_main.stderr new file mode 100644 index 0000000000000..48cb3976c6d08 --- /dev/null +++ b/src/test/ui/parser/circular_modules_main.stderr @@ -0,0 +1,8 @@ +error: circular modules: $DIR/circular_modules_hello.rs -> $DIR/circular_modules_main.rs -> $DIR/circular_modules_hello.rs + --> $DIR/circular_modules_main.rs:14:5 + | +LL | mod circular_modules_hello; //~ ERROR: circular modules + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/class-implements-bad-trait.rs b/src/test/ui/parser/class-implements-bad-trait.rs similarity index 100% rename from src/test/parse-fail/class-implements-bad-trait.rs rename to src/test/ui/parser/class-implements-bad-trait.rs diff --git a/src/test/ui/parser/class-implements-bad-trait.stderr b/src/test/ui/parser/class-implements-bad-trait.stderr new file mode 100644 index 0000000000000..d28750d188a48 --- /dev/null +++ b/src/test/ui/parser/class-implements-bad-trait.stderr @@ -0,0 +1,8 @@ +error: expected one of `!` or `::`, found `cat` + --> $DIR/class-implements-bad-trait.rs:14:7 + | +LL | class cat : nonexistent { + | ^^^ expected one of `!` or `::` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/closure-return-syntax.rs b/src/test/ui/parser/closure-return-syntax.rs similarity index 95% rename from src/test/parse-fail/closure-return-syntax.rs rename to src/test/ui/parser/closure-return-syntax.rs index 4c77edec56f13..29b6a70b6d7ee 100644 --- a/src/test/parse-fail/closure-return-syntax.rs +++ b/src/test/ui/parser/closure-return-syntax.rs @@ -11,6 +11,8 @@ // Test that we cannot parse a closure with an explicit return type // unless it uses braces. +// compile-flags: -Z parse-only + fn main() { let x = || -> i32 22; //~^ ERROR expected one of `!`, `(`, `+`, `::`, `<`, or `{`, found `22` diff --git a/src/test/ui/parser/closure-return-syntax.stderr b/src/test/ui/parser/closure-return-syntax.stderr new file mode 100644 index 0000000000000..1e505e5ac9b9a --- /dev/null +++ b/src/test/ui/parser/closure-return-syntax.stderr @@ -0,0 +1,8 @@ +error: expected one of `!`, `(`, `+`, `::`, `<`, or `{`, found `22` + --> $DIR/closure-return-syntax.rs:17:23 + | +LL | let x = || -> i32 22; + | ^^ expected one of `!`, `(`, `+`, `::`, `<`, or `{` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/column-offset-1-based.rs b/src/test/ui/parser/column-offset-1-based.rs similarity index 100% rename from src/test/parse-fail/column-offset-1-based.rs rename to src/test/ui/parser/column-offset-1-based.rs diff --git a/src/test/ui/parser/column-offset-1-based.stderr b/src/test/ui/parser/column-offset-1-based.stderr new file mode 100644 index 0000000000000..452e65603c9c9 --- /dev/null +++ b/src/test/ui/parser/column-offset-1-based.stderr @@ -0,0 +1,8 @@ +error: expected `[`, found `` + --> $DIR/column-offset-1-based.rs:13:1 + | +LL | # //~ ERROR 13:1: 13:2: expected `[`, found `` + | ^ expected `[` + +error: aborting due to previous error + diff --git a/src/test/parse-fail/default.rs b/src/test/ui/parser/default.rs similarity index 100% rename from src/test/parse-fail/default.rs rename to src/test/ui/parser/default.rs diff --git a/src/test/ui/parser/default.stderr b/src/test/ui/parser/default.stderr new file mode 100644 index 0000000000000..0a5c6e80df5ef --- /dev/null +++ b/src/test/ui/parser/default.stderr @@ -0,0 +1,8 @@ +error: expected one of `async`, `const`, `existential`, `extern`, `fn`, `type`, or `unsafe`, found `pub` + --> $DIR/default.rs:32:13 + | +LL | default pub fn foo() -> T { T::default() } //~ ERROR expected one of + | ^^^ expected one of 7 possible tokens here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/do-catch-suggests-try.rs b/src/test/ui/parser/do-catch-suggests-try.rs similarity index 100% rename from src/test/parse-fail/do-catch-suggests-try.rs rename to src/test/ui/parser/do-catch-suggests-try.rs diff --git a/src/test/ui/parser/do-catch-suggests-try.stderr b/src/test/ui/parser/do-catch-suggests-try.stderr new file mode 100644 index 0000000000000..c1ea802b8befd --- /dev/null +++ b/src/test/ui/parser/do-catch-suggests-try.stderr @@ -0,0 +1,10 @@ +error: found removed `do catch` syntax + --> $DIR/do-catch-suggests-try.rs:14:25 + | +LL | let _: Option<()> = do catch {}; + | ^^ + | + = help: Following RFC #2388, the new non-placeholder syntax is `try` + +error: aborting due to previous error + diff --git a/src/test/parse-fail/doc-after-struct-field.rs b/src/test/ui/parser/doc-after-struct-field.rs similarity index 93% rename from src/test/parse-fail/doc-after-struct-field.rs rename to src/test/ui/parser/doc-after-struct-field.rs index a2c60151ac72d..11feeae8d8181 100644 --- a/src/test/parse-fail/doc-after-struct-field.rs +++ b/src/test/ui/parser/doc-after-struct-field.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// compile-flags: -Z continue-parse-after-error +// compile-flags: -Z parse-only -Z continue-parse-after-error struct X { a: u8 /** document a */, diff --git a/src/test/ui/parser/doc-after-struct-field.stderr b/src/test/ui/parser/doc-after-struct-field.stderr new file mode 100644 index 0000000000000..1725000429287 --- /dev/null +++ b/src/test/ui/parser/doc-after-struct-field.stderr @@ -0,0 +1,19 @@ +error[E0585]: found a documentation comment that doesn't document anything + --> $DIR/doc-after-struct-field.rs:14:11 + | +LL | a: u8 /** document a */, + | ^^^^^^^^^^^^^^^^^ + | + = help: doc comments must come before what they document, maybe a comment was intended with `//`? + +error[E0585]: found a documentation comment that doesn't document anything + --> $DIR/doc-after-struct-field.rs:20:11 + | +LL | a: u8 /// document a + | ^^^^^^^^^^^^^^ + | + = help: doc comments must come before what they document, maybe a comment was intended with `//`? + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0585`. diff --git a/src/test/parse-fail/doc-before-attr.rs b/src/test/ui/parser/doc-before-attr.rs similarity index 100% rename from src/test/parse-fail/doc-before-attr.rs rename to src/test/ui/parser/doc-before-attr.rs diff --git a/src/test/ui/parser/doc-before-attr.stderr b/src/test/ui/parser/doc-before-attr.stderr new file mode 100644 index 0000000000000..f52bf60b26358 --- /dev/null +++ b/src/test/ui/parser/doc-before-attr.stderr @@ -0,0 +1,8 @@ +error: expected item after attributes + --> $DIR/doc-before-attr.rs:14:16 + | +LL | #[derive(Debug)] //~ERROR expected item after attributes + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/doc-before-eof.rs b/src/test/ui/parser/doc-before-eof.rs similarity index 100% rename from src/test/parse-fail/doc-before-eof.rs rename to src/test/ui/parser/doc-before-eof.rs diff --git a/src/test/ui/parser/doc-before-eof.stderr b/src/test/ui/parser/doc-before-eof.stderr new file mode 100644 index 0000000000000..9fd3db73577b7 --- /dev/null +++ b/src/test/ui/parser/doc-before-eof.stderr @@ -0,0 +1,8 @@ +error: expected item after doc comment + --> $DIR/doc-before-eof.rs:13:1 + | +LL | /// hi //~ERROR expected item after doc comment + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/doc-before-extern-rbrace.rs b/src/test/ui/parser/doc-before-extern-rbrace.rs similarity index 100% rename from src/test/parse-fail/doc-before-extern-rbrace.rs rename to src/test/ui/parser/doc-before-extern-rbrace.rs diff --git a/src/test/ui/parser/doc-before-extern-rbrace.stderr b/src/test/ui/parser/doc-before-extern-rbrace.stderr new file mode 100644 index 0000000000000..3936412cf9884 --- /dev/null +++ b/src/test/ui/parser/doc-before-extern-rbrace.stderr @@ -0,0 +1,8 @@ +error: expected item after doc comment + --> $DIR/doc-before-extern-rbrace.rs:14:5 + | +LL | /// hi + | ^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/doc-before-fn-rbrace.rs b/src/test/ui/parser/doc-before-fn-rbrace.rs similarity index 90% rename from src/test/parse-fail/doc-before-fn-rbrace.rs rename to src/test/ui/parser/doc-before-fn-rbrace.rs index bcf32612c8f4c..ad9a73626ac78 100644 --- a/src/test/parse-fail/doc-before-fn-rbrace.rs +++ b/src/test/ui/parser/doc-before-fn-rbrace.rs @@ -8,7 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// compile-flags: -Z continue-parse-after-error +// compile-flags: -Z parse-only -Z continue-parse-after-error + fn main() { /// document //~^ ERROR found a documentation comment that doesn't document anything diff --git a/src/test/ui/parser/doc-before-fn-rbrace.stderr b/src/test/ui/parser/doc-before-fn-rbrace.stderr new file mode 100644 index 0000000000000..e74817e1fd2b0 --- /dev/null +++ b/src/test/ui/parser/doc-before-fn-rbrace.stderr @@ -0,0 +1,11 @@ +error[E0585]: found a documentation comment that doesn't document anything + --> $DIR/doc-before-fn-rbrace.rs:14:5 + | +LL | /// document + | ^^^^^^^^^^^^ + | + = help: doc comments must come before what they document, maybe a comment was intended with `//`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0585`. diff --git a/src/test/parse-fail/doc-before-identifier.rs b/src/test/ui/parser/doc-before-identifier.rs similarity index 90% rename from src/test/parse-fail/doc-before-identifier.rs rename to src/test/ui/parser/doc-before-identifier.rs index 8f1fad91b1f99..2882364081a13 100644 --- a/src/test/parse-fail/doc-before-identifier.rs +++ b/src/test/ui/parser/doc-before-identifier.rs @@ -8,7 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// compile-flags: -Z continue-parse-after-error +// compile-flags: -Z parse-only -Z continue-parse-after-error + fn /// document foo() {} //~^^ ERROR expected identifier, found `/// document` diff --git a/src/test/ui/parser/doc-before-identifier.stderr b/src/test/ui/parser/doc-before-identifier.stderr new file mode 100644 index 0000000000000..f93ab634c28c9 --- /dev/null +++ b/src/test/ui/parser/doc-before-identifier.stderr @@ -0,0 +1,8 @@ +error: expected identifier, found `/// document` + --> $DIR/doc-before-identifier.rs:13:4 + | +LL | fn /// document + | ^^^^^^^^^^^^ expected identifier + +error: aborting due to previous error + diff --git a/src/test/parse-fail/doc-before-mod-rbrace.rs b/src/test/ui/parser/doc-before-mod-rbrace.rs similarity index 89% rename from src/test/parse-fail/doc-before-mod-rbrace.rs rename to src/test/ui/parser/doc-before-mod-rbrace.rs index d38d1876384a8..d18ebdc5b1e6b 100644 --- a/src/test/parse-fail/doc-before-mod-rbrace.rs +++ b/src/test/ui/parser/doc-before-mod-rbrace.rs @@ -8,7 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// compile-flags: -Z continue-parse-after-error +// compile-flags: -Z parse-only -Z continue-parse-after-error + mod Foo { /// document //~^ ERROR expected item after doc comment diff --git a/src/test/ui/parser/doc-before-mod-rbrace.stderr b/src/test/ui/parser/doc-before-mod-rbrace.stderr new file mode 100644 index 0000000000000..807530302af5e --- /dev/null +++ b/src/test/ui/parser/doc-before-mod-rbrace.stderr @@ -0,0 +1,8 @@ +error: expected item after doc comment + --> $DIR/doc-before-mod-rbrace.rs:14:5 + | +LL | /// document + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/doc-before-rbrace.rs b/src/test/ui/parser/doc-before-rbrace.rs similarity index 100% rename from src/test/parse-fail/doc-before-rbrace.rs rename to src/test/ui/parser/doc-before-rbrace.rs diff --git a/src/test/ui/parser/doc-before-rbrace.stderr b/src/test/ui/parser/doc-before-rbrace.stderr new file mode 100644 index 0000000000000..15e9c3dfd6257 --- /dev/null +++ b/src/test/ui/parser/doc-before-rbrace.stderr @@ -0,0 +1,11 @@ +error[E0585]: found a documentation comment that doesn't document anything + --> $DIR/doc-before-rbrace.rs:14:21 + | +LL | println!("Hi"); /// hi + | ^^^^^^ + | + = help: doc comments must come before what they document, maybe a comment was intended with `//`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0585`. diff --git a/src/test/parse-fail/doc-before-semi.rs b/src/test/ui/parser/doc-before-semi.rs similarity index 100% rename from src/test/parse-fail/doc-before-semi.rs rename to src/test/ui/parser/doc-before-semi.rs diff --git a/src/test/ui/parser/doc-before-semi.stderr b/src/test/ui/parser/doc-before-semi.stderr new file mode 100644 index 0000000000000..a174d6f7053f1 --- /dev/null +++ b/src/test/ui/parser/doc-before-semi.stderr @@ -0,0 +1,11 @@ +error[E0585]: found a documentation comment that doesn't document anything + --> $DIR/doc-before-semi.rs:14:5 + | +LL | /// hi + | ^^^^^^ + | + = help: doc comments must come before what they document, maybe a comment was intended with `//`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0585`. diff --git a/src/test/parse-fail/doc-before-struct-rbrace-1.rs b/src/test/ui/parser/doc-before-struct-rbrace-1.rs similarity index 91% rename from src/test/parse-fail/doc-before-struct-rbrace-1.rs rename to src/test/ui/parser/doc-before-struct-rbrace-1.rs index 6d9b4b05ad9fa..b0cae467863a8 100644 --- a/src/test/parse-fail/doc-before-struct-rbrace-1.rs +++ b/src/test/ui/parser/doc-before-struct-rbrace-1.rs @@ -8,7 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// compile-flags: -Z continue-parse-after-error +// compile-flags: -Z parse-only -Z continue-parse-after-error + struct X { a: u8, /// document diff --git a/src/test/ui/parser/doc-before-struct-rbrace-1.stderr b/src/test/ui/parser/doc-before-struct-rbrace-1.stderr new file mode 100644 index 0000000000000..9909bb250d10e --- /dev/null +++ b/src/test/ui/parser/doc-before-struct-rbrace-1.stderr @@ -0,0 +1,11 @@ +error[E0585]: found a documentation comment that doesn't document anything + --> $DIR/doc-before-struct-rbrace-1.rs:15:5 + | +LL | /// document + | ^^^^^^^^^^^^ + | + = help: doc comments must come before what they document, maybe a comment was intended with `//`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0585`. diff --git a/src/test/parse-fail/doc-before-struct-rbrace-2.rs b/src/test/ui/parser/doc-before-struct-rbrace-2.rs similarity index 91% rename from src/test/parse-fail/doc-before-struct-rbrace-2.rs rename to src/test/ui/parser/doc-before-struct-rbrace-2.rs index 63b2f96379916..cd5fd2d7a7f10 100644 --- a/src/test/parse-fail/doc-before-struct-rbrace-2.rs +++ b/src/test/ui/parser/doc-before-struct-rbrace-2.rs @@ -8,7 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// compile-flags: -Z continue-parse-after-error +// compile-flags: -Z parse-only -Z continue-parse-after-error + struct X { a: u8 /// document //~^ ERROR found a documentation comment that doesn't document anything diff --git a/src/test/ui/parser/doc-before-struct-rbrace-2.stderr b/src/test/ui/parser/doc-before-struct-rbrace-2.stderr new file mode 100644 index 0000000000000..b69720dd8671f --- /dev/null +++ b/src/test/ui/parser/doc-before-struct-rbrace-2.stderr @@ -0,0 +1,11 @@ +error[E0585]: found a documentation comment that doesn't document anything + --> $DIR/doc-before-struct-rbrace-2.rs:14:11 + | +LL | a: u8 /// document + | ^^^^^^^^^^^^ + | + = help: doc comments must come before what they document, maybe a comment was intended with `//`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0585`. diff --git a/src/test/parse-fail/duplicate-visibility.rs b/src/test/ui/parser/duplicate-visibility.rs similarity index 100% rename from src/test/parse-fail/duplicate-visibility.rs rename to src/test/ui/parser/duplicate-visibility.rs diff --git a/src/test/ui/parser/duplicate-visibility.stderr b/src/test/ui/parser/duplicate-visibility.stderr new file mode 100644 index 0000000000000..a0a5b66215e95 --- /dev/null +++ b/src/test/ui/parser/duplicate-visibility.stderr @@ -0,0 +1,8 @@ +error: expected one of `(`, `fn`, `static`, or `type`, found `pub` + --> $DIR/duplicate-visibility.rs:15:9 + | +LL | pub pub fn foo(); + | ^^^ expected one of `(`, `fn`, `static`, or `type` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/empty-impl-semicolon.rs b/src/test/ui/parser/empty-impl-semicolon.rs similarity index 100% rename from src/test/parse-fail/empty-impl-semicolon.rs rename to src/test/ui/parser/empty-impl-semicolon.rs diff --git a/src/test/ui/parser/empty-impl-semicolon.stderr b/src/test/ui/parser/empty-impl-semicolon.stderr new file mode 100644 index 0000000000000..fef4b88235597 --- /dev/null +++ b/src/test/ui/parser/empty-impl-semicolon.stderr @@ -0,0 +1,8 @@ +error: expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `;` + --> $DIR/empty-impl-semicolon.rs:13:9 + | +LL | impl Foo; //~ ERROR expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `;` + | ^ expected one of 8 possible tokens here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/extern-crate-unexpected-token.rs b/src/test/ui/parser/extern-crate-unexpected-token.rs similarity index 94% rename from src/test/parse-fail/extern-crate-unexpected-token.rs rename to src/test/ui/parser/extern-crate-unexpected-token.rs index 2518686575eb1..619b88a6ab8ab 100644 --- a/src/test/parse-fail/extern-crate-unexpected-token.rs +++ b/src/test/ui/parser/extern-crate-unexpected-token.rs @@ -8,4 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + extern crte foo; //~ ERROR expected one of `crate`, `fn`, or `{`, found `crte` diff --git a/src/test/ui/parser/extern-crate-unexpected-token.stderr b/src/test/ui/parser/extern-crate-unexpected-token.stderr new file mode 100644 index 0000000000000..c359a3704bf48 --- /dev/null +++ b/src/test/ui/parser/extern-crate-unexpected-token.stderr @@ -0,0 +1,8 @@ +error: expected one of `crate`, `fn`, or `{`, found `crte` + --> $DIR/extern-crate-unexpected-token.rs:13:8 + | +LL | extern crte foo; //~ ERROR expected one of `crate`, `fn`, or `{`, found `crte` + | ^^^^ expected one of `crate`, `fn`, or `{` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/extern-expected-fn-or-brace.rs b/src/test/ui/parser/extern-expected-fn-or-brace.rs similarity index 100% rename from src/test/parse-fail/extern-expected-fn-or-brace.rs rename to src/test/ui/parser/extern-expected-fn-or-brace.rs diff --git a/src/test/ui/parser/extern-expected-fn-or-brace.stderr b/src/test/ui/parser/extern-expected-fn-or-brace.stderr new file mode 100644 index 0000000000000..54ab5b87d4978 --- /dev/null +++ b/src/test/ui/parser/extern-expected-fn-or-brace.stderr @@ -0,0 +1,8 @@ +error: expected one of `fn` or `{`, found `mod` + --> $DIR/extern-expected-fn-or-brace.rs:16:12 + | +LL | extern "C" mod foo; //~ERROR expected one of `fn` or `{`, found `mod` + | ^^^ expected one of `fn` or `{` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/extern-foreign-crate.rs b/src/test/ui/parser/extern-foreign-crate.rs similarity index 100% rename from src/test/parse-fail/extern-foreign-crate.rs rename to src/test/ui/parser/extern-foreign-crate.rs diff --git a/src/test/ui/parser/extern-foreign-crate.stderr b/src/test/ui/parser/extern-foreign-crate.stderr new file mode 100644 index 0000000000000..93eb9fd8de3cf --- /dev/null +++ b/src/test/ui/parser/extern-foreign-crate.stderr @@ -0,0 +1,8 @@ +error: expected one of `;` or `as`, found `{` + --> $DIR/extern-foreign-crate.rs:16:18 + | +LL | extern crate foo {} //~ERROR expected one of `;` or `as`, found `{` + | ^ expected one of `;` or `as` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/extern-no-fn.rs b/src/test/ui/parser/extern-no-fn.rs similarity index 100% rename from src/test/parse-fail/extern-no-fn.rs rename to src/test/ui/parser/extern-no-fn.rs diff --git a/src/test/ui/parser/extern-no-fn.stderr b/src/test/ui/parser/extern-no-fn.stderr new file mode 100644 index 0000000000000..29a7691f82b85 --- /dev/null +++ b/src/test/ui/parser/extern-no-fn.stderr @@ -0,0 +1,10 @@ +error: missing `fn`, `type`, or `static` for extern-item declaration + --> $DIR/extern-no-fn.rs:13:9 + | +LL | extern { //~ ERROR missing `fn`, `type`, or `static` for extern-item declaration + | _________^ +LL | | f(); + | |____^ missing `fn`, `type`, or `static` + +error: aborting due to previous error + diff --git a/src/test/ui/parser/if-in-in.rs b/src/test/ui/parser/if-in-in.rs index 9bc9aaff298db..735d571938abf 100644 --- a/src/test/ui/parser/if-in-in.rs +++ b/src/test/ui/parser/if-in-in.rs @@ -1,3 +1,5 @@ +// compile-flags: -Z parse-only + fn main() { for i in in 1..2 { println!("{}", i); diff --git a/src/test/ui/parser/if-in-in.stderr b/src/test/ui/parser/if-in-in.stderr index 9926fcc0858e5..65da252fc128f 100644 --- a/src/test/ui/parser/if-in-in.stderr +++ b/src/test/ui/parser/if-in-in.stderr @@ -1,5 +1,5 @@ error: expected iterable, found keyword `in` - --> $DIR/if-in-in.rs:2:14 + --> $DIR/if-in-in.rs:4:14 | LL | for i in in 1..2 { | ---^^ diff --git a/src/test/ui/span/impl-parsing.rs b/src/test/ui/parser/impl-parsing.rs similarity index 100% rename from src/test/ui/span/impl-parsing.rs rename to src/test/ui/parser/impl-parsing.rs diff --git a/src/test/ui/span/impl-parsing.stderr b/src/test/ui/parser/impl-parsing.stderr similarity index 100% rename from src/test/ui/span/impl-parsing.stderr rename to src/test/ui/parser/impl-parsing.stderr diff --git a/src/test/parse-fail/impl-qpath.rs b/src/test/ui/parser/impl-qpath.rs similarity index 97% rename from src/test/parse-fail/impl-qpath.rs rename to src/test/ui/parser/impl-qpath.rs index 48dd888b2e530..5dced73c90d4b 100644 --- a/src/test/parse-fail/impl-qpath.rs +++ b/src/test/ui/parser/impl-qpath.rs @@ -8,11 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-pass // compile-flags: -Z parse-only impl <*const u8>::AssocTy {} // OK impl ::AssocTy {} // OK impl <'a + Trait>::AssocTy {} // OK impl <::AssocTy>::AssocTy {} // OK - -FAIL //~ ERROR diff --git a/src/test/parse-fail/import-from-path.rs b/src/test/ui/parser/import-from-path.rs similarity index 100% rename from src/test/parse-fail/import-from-path.rs rename to src/test/ui/parser/import-from-path.rs diff --git a/src/test/ui/parser/import-from-path.stderr b/src/test/ui/parser/import-from-path.stderr new file mode 100644 index 0000000000000..1628c120945c8 --- /dev/null +++ b/src/test/ui/parser/import-from-path.stderr @@ -0,0 +1,8 @@ +error: expected `;`, found `::` + --> $DIR/import-from-path.rs:14:15 + | +LL | use foo::{bar}::baz + | ^^ expected `;` + +error: aborting due to previous error + diff --git a/src/test/parse-fail/import-from-rename.rs b/src/test/ui/parser/import-from-rename.rs similarity index 100% rename from src/test/parse-fail/import-from-rename.rs rename to src/test/ui/parser/import-from-rename.rs diff --git a/src/test/ui/parser/import-from-rename.stderr b/src/test/ui/parser/import-from-rename.stderr new file mode 100644 index 0000000000000..6fdc7972a8856 --- /dev/null +++ b/src/test/ui/parser/import-from-rename.stderr @@ -0,0 +1,8 @@ +error: expected `;`, found `as` + --> $DIR/import-from-rename.rs:15:16 + | +LL | use foo::{bar} as baz; + | ^^ expected `;` + +error: aborting due to previous error + diff --git a/src/test/parse-fail/import-glob-path.rs b/src/test/ui/parser/import-glob-path.rs similarity index 100% rename from src/test/parse-fail/import-glob-path.rs rename to src/test/ui/parser/import-glob-path.rs diff --git a/src/test/ui/parser/import-glob-path.stderr b/src/test/ui/parser/import-glob-path.stderr new file mode 100644 index 0000000000000..af7d0ee0c027e --- /dev/null +++ b/src/test/ui/parser/import-glob-path.stderr @@ -0,0 +1,8 @@ +error: expected `;`, found `::` + --> $DIR/import-glob-path.rs:14:11 + | +LL | use foo::*::bar + | ^^ expected `;` + +error: aborting due to previous error + diff --git a/src/test/parse-fail/import-glob-rename.rs b/src/test/ui/parser/import-glob-rename.rs similarity index 100% rename from src/test/parse-fail/import-glob-rename.rs rename to src/test/ui/parser/import-glob-rename.rs diff --git a/src/test/ui/parser/import-glob-rename.stderr b/src/test/ui/parser/import-glob-rename.stderr new file mode 100644 index 0000000000000..c36a946fd6306 --- /dev/null +++ b/src/test/ui/parser/import-glob-rename.stderr @@ -0,0 +1,8 @@ +error: expected `;`, found `as` + --> $DIR/import-glob-rename.rs:15:12 + | +LL | use foo::* as baz; + | ^^ expected `;` + +error: aborting due to previous error + diff --git a/src/test/parse-fail/inner-attr-after-doc-comment.rs b/src/test/ui/parser/inner-attr-after-doc-comment.rs similarity index 100% rename from src/test/parse-fail/inner-attr-after-doc-comment.rs rename to src/test/ui/parser/inner-attr-after-doc-comment.rs diff --git a/src/test/ui/parser/inner-attr-after-doc-comment.stderr b/src/test/ui/parser/inner-attr-after-doc-comment.stderr new file mode 100644 index 0000000000000..af050e662a218 --- /dev/null +++ b/src/test/ui/parser/inner-attr-after-doc-comment.stderr @@ -0,0 +1,10 @@ +error: an inner attribute is not permitted following an outer doc comment + --> $DIR/inner-attr-after-doc-comment.rs:18:3 + | +LL | #![recursion_limit="100"] + | ^ + | + = 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. + +error: aborting due to previous error + diff --git a/src/test/parse-fail/inner-attr.rs b/src/test/ui/parser/inner-attr.rs similarity index 100% rename from src/test/parse-fail/inner-attr.rs rename to src/test/ui/parser/inner-attr.rs diff --git a/src/test/ui/parser/inner-attr.stderr b/src/test/ui/parser/inner-attr.stderr new file mode 100644 index 0000000000000..89fb5cfad5ef2 --- /dev/null +++ b/src/test/ui/parser/inner-attr.stderr @@ -0,0 +1,10 @@ +error: an inner attribute is not permitted following an outer attribute + --> $DIR/inner-attr.rs:15:3 + | +LL | #![recursion_limit="100"] //~ ERROR an inner attribute is not permitted following an outer attribute + | ^ + | + = 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. + +error: aborting due to previous error + diff --git a/src/test/parse-fail/int-literal-too-large-span.rs b/src/test/ui/parser/int-literal-too-large-span.rs similarity index 100% rename from src/test/parse-fail/int-literal-too-large-span.rs rename to src/test/ui/parser/int-literal-too-large-span.rs diff --git a/src/test/ui/parser/int-literal-too-large-span.stderr b/src/test/ui/parser/int-literal-too-large-span.stderr new file mode 100644 index 0000000000000..391cb52fd406d --- /dev/null +++ b/src/test/ui/parser/int-literal-too-large-span.stderr @@ -0,0 +1,8 @@ +error: int literal is too large + --> $DIR/int-literal-too-large-span.rs:16:5 + | +LL | 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/parser/inverted-parameters.rs b/src/test/ui/parser/inverted-parameters.rs index a100debbf1242..c08a309e11e26 100644 --- a/src/test/ui/parser/inverted-parameters.rs +++ b/src/test/ui/parser/inverted-parameters.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + struct S; impl S { diff --git a/src/test/ui/parser/inverted-parameters.stderr b/src/test/ui/parser/inverted-parameters.stderr index 3f4f0615bc8f7..63cd36f00c049 100644 --- a/src/test/ui/parser/inverted-parameters.stderr +++ b/src/test/ui/parser/inverted-parameters.stderr @@ -1,5 +1,5 @@ error: expected one of `:` or `@`, found `bar` - --> $DIR/inverted-parameters.rs:14:24 + --> $DIR/inverted-parameters.rs:16:24 | LL | fn foo(&self, &str bar) {} | -----^^^ @@ -8,7 +8,7 @@ LL | fn foo(&self, &str bar) {} | help: declare the type after the parameter binding: `: ` error: expected one of `:` or `@`, found `quux` - --> $DIR/inverted-parameters.rs:20:10 + --> $DIR/inverted-parameters.rs:22:10 | LL | fn baz(S quux, xyzzy: i32) {} | --^^^^ @@ -17,25 +17,25 @@ LL | fn baz(S quux, xyzzy: i32) {} | help: declare the type after the parameter binding: `: ` error: expected one of `:` or `@`, found `a` - --> $DIR/inverted-parameters.rs:25:12 + --> $DIR/inverted-parameters.rs:27:12 | LL | fn one(i32 a b) {} | ^ expected one of `:` or `@` here error: expected `:`, found `(` - --> $DIR/inverted-parameters.rs:28:23 + --> $DIR/inverted-parameters.rs:30:23 | LL | fn pattern((i32, i32) (a, b)) {} | ^ expected `:` error: expected one of `:` or `@`, found `)` - --> $DIR/inverted-parameters.rs:31:12 + --> $DIR/inverted-parameters.rs:33:12 | LL | fn fizz(i32) {} | ^ expected one of `:` or `@` here error: expected one of `:` or `@`, found `S` - --> $DIR/inverted-parameters.rs:34:23 + --> $DIR/inverted-parameters.rs:36:23 | LL | fn missing_colon(quux S) {} | -----^ diff --git a/src/test/parse-fail/issue-10392-2.rs b/src/test/ui/parser/issue-10392-2.rs similarity index 100% rename from src/test/parse-fail/issue-10392-2.rs rename to src/test/ui/parser/issue-10392-2.rs diff --git a/src/test/ui/parser/issue-10392-2.stderr b/src/test/ui/parser/issue-10392-2.stderr new file mode 100644 index 0000000000000..41548ed4a2f87 --- /dev/null +++ b/src/test/ui/parser/issue-10392-2.stderr @@ -0,0 +1,12 @@ +error: expected `}`, found `,` + --> $DIR/issue-10392-2.rs:18:15 + | +LL | let A { .., } = a(); //~ ERROR: expected `}` + | --^ + | | | + | | expected `}` + | | help: remove this comma + | `..` must be at the end and cannot have a trailing comma + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-10392.rs b/src/test/ui/parser/issue-10392.rs similarity index 100% rename from src/test/parse-fail/issue-10392.rs rename to src/test/ui/parser/issue-10392.rs diff --git a/src/test/ui/parser/issue-10392.stderr b/src/test/ui/parser/issue-10392.stderr new file mode 100644 index 0000000000000..0401fe05cf891 --- /dev/null +++ b/src/test/ui/parser/issue-10392.stderr @@ -0,0 +1,8 @@ +error: expected identifier, found `,` + --> $DIR/issue-10392.rs:18:13 + | +LL | let A { , } = a(); //~ ERROR: expected ident + | ^ expected identifier + +error: aborting due to previous error + diff --git a/src/test/ui/issue-10636-1.rs b/src/test/ui/parser/issue-10636-1.rs similarity index 100% rename from src/test/ui/issue-10636-1.rs rename to src/test/ui/parser/issue-10636-1.rs diff --git a/src/test/ui/issue-10636-1.stderr b/src/test/ui/parser/issue-10636-1.stderr similarity index 100% rename from src/test/ui/issue-10636-1.stderr rename to src/test/ui/parser/issue-10636-1.stderr diff --git a/src/test/ui/token/issue-10636-2.rs b/src/test/ui/parser/issue-10636-2.rs similarity index 96% rename from src/test/ui/token/issue-10636-2.rs rename to src/test/ui/parser/issue-10636-2.rs index 711803754408f..c96834fe4cf35 100644 --- a/src/test/ui/token/issue-10636-2.rs +++ b/src/test/ui/parser/issue-10636-2.rs @@ -11,6 +11,8 @@ // FIXME(31528) we emit a bunch of silly errors here due to continuing past the // first one. This would be easy-ish to address by better recovery in tokenisation. +// compile-flags: -Z parse-only + pub fn trace_option(option: Option) { option.map(|some| 42; //~^ ERROR: expected one of diff --git a/src/test/ui/token/issue-10636-2.stderr b/src/test/ui/parser/issue-10636-2.stderr similarity index 87% rename from src/test/ui/token/issue-10636-2.stderr rename to src/test/ui/parser/issue-10636-2.stderr index 9800b0c5e3f05..8f721a3b5dd43 100644 --- a/src/test/ui/token/issue-10636-2.stderr +++ b/src/test/ui/parser/issue-10636-2.stderr @@ -1,5 +1,5 @@ error: incorrect close delimiter: `}` - --> $DIR/issue-10636-2.rs:18:1 + --> $DIR/issue-10636-2.rs:20:1 | LL | pub fn trace_option(option: Option) { | - close delimiter possibly meant for this @@ -10,13 +10,13 @@ LL | } //~ ERROR: incorrect close delimiter | ^ incorrect close delimiter error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;` - --> $DIR/issue-10636-2.rs:15:25 + --> $DIR/issue-10636-2.rs:17:25 | LL | option.map(|some| 42; | ^ expected one of `)`, `,`, `.`, `?`, or an operator here error: expected expression, found `)` - --> $DIR/issue-10636-2.rs:18:1 + --> $DIR/issue-10636-2.rs:20:1 | LL | } //~ ERROR: incorrect close delimiter | ^ expected expression diff --git a/src/test/parse-fail/issue-14303-enum.rs b/src/test/ui/parser/issue-14303-enum.rs similarity index 100% rename from src/test/parse-fail/issue-14303-enum.rs rename to src/test/ui/parser/issue-14303-enum.rs diff --git a/src/test/ui/parser/issue-14303-enum.stderr b/src/test/ui/parser/issue-14303-enum.stderr new file mode 100644 index 0000000000000..7d546cb2180e3 --- /dev/null +++ b/src/test/ui/parser/issue-14303-enum.stderr @@ -0,0 +1,8 @@ +error: lifetime parameters must be declared prior to type parameters + --> $DIR/issue-14303-enum.rs:13:15 + | +LL | enum X<'a, T, 'b> { + | ^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-14303-fn-def.rs b/src/test/ui/parser/issue-14303-fn-def.rs similarity index 100% rename from src/test/parse-fail/issue-14303-fn-def.rs rename to src/test/ui/parser/issue-14303-fn-def.rs diff --git a/src/test/ui/parser/issue-14303-fn-def.stderr b/src/test/ui/parser/issue-14303-fn-def.stderr new file mode 100644 index 0000000000000..c7b57f36376b5 --- /dev/null +++ b/src/test/ui/parser/issue-14303-fn-def.stderr @@ -0,0 +1,8 @@ +error: lifetime parameters must be declared prior to type parameters + --> $DIR/issue-14303-fn-def.rs:13:15 + | +LL | fn foo<'a, T, 'b>(x: &'a T) {} + | ^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-14303-fncall.rs b/src/test/ui/parser/issue-14303-fncall.rs similarity index 100% rename from src/test/parse-fail/issue-14303-fncall.rs rename to src/test/ui/parser/issue-14303-fncall.rs diff --git a/src/test/ui/parser/issue-14303-fncall.stderr b/src/test/ui/parser/issue-14303-fncall.stderr new file mode 100644 index 0000000000000..cca23c7027961 --- /dev/null +++ b/src/test/ui/parser/issue-14303-fncall.stderr @@ -0,0 +1,8 @@ +error: lifetime parameters must be declared prior to type parameters + --> $DIR/issue-14303-fncall.rs:16:31 + | +LL | .collect::>() + | ^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-14303-impl.rs b/src/test/ui/parser/issue-14303-impl.rs similarity index 100% rename from src/test/parse-fail/issue-14303-impl.rs rename to src/test/ui/parser/issue-14303-impl.rs diff --git a/src/test/ui/parser/issue-14303-impl.stderr b/src/test/ui/parser/issue-14303-impl.stderr new file mode 100644 index 0000000000000..0b7016eb7f71d --- /dev/null +++ b/src/test/ui/parser/issue-14303-impl.stderr @@ -0,0 +1,8 @@ +error: lifetime parameters must be declared prior to type parameters + --> $DIR/issue-14303-impl.rs:15:13 + | +LL | impl<'a, T, 'b> X {} + | ^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-14303-path.rs b/src/test/ui/parser/issue-14303-path.rs similarity index 100% rename from src/test/parse-fail/issue-14303-path.rs rename to src/test/ui/parser/issue-14303-path.rs diff --git a/src/test/ui/parser/issue-14303-path.stderr b/src/test/ui/parser/issue-14303-path.stderr new file mode 100644 index 0000000000000..f0a45998d17df --- /dev/null +++ b/src/test/ui/parser/issue-14303-path.stderr @@ -0,0 +1,8 @@ +error: lifetime parameters must be declared prior to type parameters + --> $DIR/issue-14303-path.rs:13:37 + | +LL | fn bar<'a, T>(x: mymodule::X<'a, T, 'b, 'c>) {} + | ^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-14303-struct.rs b/src/test/ui/parser/issue-14303-struct.rs similarity index 100% rename from src/test/parse-fail/issue-14303-struct.rs rename to src/test/ui/parser/issue-14303-struct.rs diff --git a/src/test/ui/parser/issue-14303-struct.stderr b/src/test/ui/parser/issue-14303-struct.stderr new file mode 100644 index 0000000000000..4a4b678919495 --- /dev/null +++ b/src/test/ui/parser/issue-14303-struct.stderr @@ -0,0 +1,8 @@ +error: lifetime parameters must be declared prior to type parameters + --> $DIR/issue-14303-struct.rs:13:17 + | +LL | struct X<'a, T, 'b> { + | ^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-14303-trait.rs b/src/test/ui/parser/issue-14303-trait.rs similarity index 100% rename from src/test/parse-fail/issue-14303-trait.rs rename to src/test/ui/parser/issue-14303-trait.rs diff --git a/src/test/ui/parser/issue-14303-trait.stderr b/src/test/ui/parser/issue-14303-trait.stderr new file mode 100644 index 0000000000000..ab5cc5655bbe1 --- /dev/null +++ b/src/test/ui/parser/issue-14303-trait.stderr @@ -0,0 +1,8 @@ +error: lifetime parameters must be declared prior to type parameters + --> $DIR/issue-14303-trait.rs:13:18 + | +LL | trait Foo<'a, T, 'b> {} + | ^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-15914.rs b/src/test/ui/parser/issue-15914.rs similarity index 100% rename from src/test/parse-fail/issue-15914.rs rename to src/test/ui/parser/issue-15914.rs diff --git a/src/test/ui/parser/issue-15914.stderr b/src/test/ui/parser/issue-15914.stderr new file mode 100644 index 0000000000000..fbf0ea13c73a9 --- /dev/null +++ b/src/test/ui/parser/issue-15914.stderr @@ -0,0 +1,8 @@ +error: expected identifier, found `(` + --> $DIR/issue-15914.rs:15:9 + | +LL | (); //~ ERROR expected identifier, found `(` + | ^ expected identifier + +error: aborting due to previous error + diff --git a/src/test/ui/token/issue-15980.rs b/src/test/ui/parser/issue-15980.rs similarity index 91% rename from src/test/ui/token/issue-15980.rs rename to src/test/ui/parser/issue-15980.rs index e1b134c820318..2f11805481d2d 100644 --- a/src/test/ui/token/issue-15980.rs +++ b/src/test/ui/parser/issue-15980.rs @@ -8,12 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + use std::io; fn main(){ let x: io::IoResult<()> = Ok(()); - //~^ ERROR cannot find type `IoResult` in module `io` - //~| NOTE did you mean `Result`? match x { Err(ref e) if e.kind == io::EndOfFile { //~^ NOTE while parsing this struct diff --git a/src/test/ui/token/issue-15980.stderr b/src/test/ui/parser/issue-15980.stderr similarity index 69% rename from src/test/ui/token/issue-15980.stderr rename to src/test/ui/parser/issue-15980.stderr index d52368bf96a75..1395803e12120 100644 --- a/src/test/ui/token/issue-15980.stderr +++ b/src/test/ui/parser/issue-15980.stderr @@ -16,12 +16,5 @@ LL | //~^ NOTE expected one of `.`, `=>`, `?`, or an operator here LL | _ => {} | ^ unexpected token -error[E0412]: cannot find type `IoResult` in module `io` - --> $DIR/issue-15980.rs:14:16 - | -LL | let x: io::IoResult<()> = Ok(()); - | ^^^^^^^^ did you mean `Result`? - -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0412`. diff --git a/src/test/parse-fail/issue-1655.rs b/src/test/ui/parser/issue-1655.rs similarity index 100% rename from src/test/parse-fail/issue-1655.rs rename to src/test/ui/parser/issue-1655.rs diff --git a/src/test/ui/parser/issue-1655.stderr b/src/test/ui/parser/issue-1655.stderr new file mode 100644 index 0000000000000..890400acccfad --- /dev/null +++ b/src/test/ui/parser/issue-1655.stderr @@ -0,0 +1,8 @@ +error: expected `[`, found `vec` + --> $DIR/issue-1655.rs:15:6 + | +LL | #vec[doc( + | ^^^ expected `[` + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-17383.rs b/src/test/ui/parser/issue-17383.rs similarity index 100% rename from src/test/parse-fail/issue-17383.rs rename to src/test/ui/parser/issue-17383.rs diff --git a/src/test/ui/parser/issue-17383.stderr b/src/test/ui/parser/issue-17383.stderr new file mode 100644 index 0000000000000..321989e5fab34 --- /dev/null +++ b/src/test/ui/parser/issue-17383.stderr @@ -0,0 +1,8 @@ +error: discriminator values can only be used with a field-less enum + --> $DIR/issue-17383.rs:15:9 + | +LL | b'a' //~ ERROR discriminator values can only be used with a field-less enum + | ^^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-17718-const-mut.rs b/src/test/ui/parser/issue-17718-const-mut.rs similarity index 100% rename from src/test/parse-fail/issue-17718-const-mut.rs rename to src/test/ui/parser/issue-17718-const-mut.rs diff --git a/src/test/ui/parser/issue-17718-const-mut.stderr b/src/test/ui/parser/issue-17718-const-mut.stderr new file mode 100644 index 0000000000000..b294a8572fbc6 --- /dev/null +++ b/src/test/ui/parser/issue-17718-const-mut.stderr @@ -0,0 +1,10 @@ +error: const globals cannot be mutable + --> $DIR/issue-17718-const-mut.rs:14:1 + | +LL | mut //~ ERROR: const globals cannot be mutable + | ^^^ + | + = help: did you mean to declare a static? + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-17904-2.rs b/src/test/ui/parser/issue-17904-2.rs similarity index 100% rename from src/test/parse-fail/issue-17904-2.rs rename to src/test/ui/parser/issue-17904-2.rs diff --git a/src/test/ui/parser/issue-17904-2.stderr b/src/test/ui/parser/issue-17904-2.stderr new file mode 100644 index 0000000000000..65ddadb011d0f --- /dev/null +++ b/src/test/ui/parser/issue-17904-2.stderr @@ -0,0 +1,8 @@ +error: expected item, found `where` + --> $DIR/issue-17904-2.rs:13:24 + | +LL | struct Bar { x: T } where T: Copy //~ ERROR expected item, found `where` + | ^^^^^ expected item + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-17904.rs b/src/test/ui/parser/issue-17904.rs similarity index 100% rename from src/test/parse-fail/issue-17904.rs rename to src/test/ui/parser/issue-17904.rs diff --git a/src/test/ui/parser/issue-17904.stderr b/src/test/ui/parser/issue-17904.stderr new file mode 100644 index 0000000000000..c783d97478c39 --- /dev/null +++ b/src/test/ui/parser/issue-17904.stderr @@ -0,0 +1,8 @@ +error: expected one of `:`, `==`, or `=`, found `;` + --> $DIR/issue-17904.rs:16:33 + | +LL | struct Foo where T: Copy, (T); //~ ERROR expected one of `:`, `==`, or `=`, found `;` + | ^ expected one of `:`, `==`, or `=` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-1802-1.rs b/src/test/ui/parser/issue-1802-1.rs similarity index 100% rename from src/test/parse-fail/issue-1802-1.rs rename to src/test/ui/parser/issue-1802-1.rs diff --git a/src/test/ui/parser/issue-1802-1.stderr b/src/test/ui/parser/issue-1802-1.stderr new file mode 100644 index 0000000000000..b4ce85e784c44 --- /dev/null +++ b/src/test/ui/parser/issue-1802-1.stderr @@ -0,0 +1,8 @@ +error: no valid digits found for number + --> $DIR/issue-1802-1.rs:15:16 + | +LL | log(error, 0b); + | ^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-1802-2.rs b/src/test/ui/parser/issue-1802-2.rs similarity index 100% rename from src/test/parse-fail/issue-1802-2.rs rename to src/test/ui/parser/issue-1802-2.rs diff --git a/src/test/ui/parser/issue-1802-2.stderr b/src/test/ui/parser/issue-1802-2.stderr new file mode 100644 index 0000000000000..d8e68529a6d2a --- /dev/null +++ b/src/test/ui/parser/issue-1802-2.stderr @@ -0,0 +1,8 @@ +error: no valid digits found for number + --> $DIR/issue-1802-2.rs:15:16 + | +LL | log(error, 0b_usize); + | ^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-19096.rs b/src/test/ui/parser/issue-19096.rs similarity index 100% rename from src/test/parse-fail/issue-19096.rs rename to src/test/ui/parser/issue-19096.rs diff --git a/src/test/ui/parser/issue-19096.stderr b/src/test/ui/parser/issue-19096.stderr new file mode 100644 index 0000000000000..0e99f4e125cab --- /dev/null +++ b/src/test/ui/parser/issue-19096.stderr @@ -0,0 +1,8 @@ +error: expected one of `.`, `;`, `?`, `}`, or an operator, found `::` + --> $DIR/issue-19096.rs:15:8 + | +LL | t.0::; //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `::` + | ^^ expected one of `.`, `;`, `?`, `}`, or an operator here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-19398.rs b/src/test/ui/parser/issue-19398.rs similarity index 100% rename from src/test/parse-fail/issue-19398.rs rename to src/test/ui/parser/issue-19398.rs diff --git a/src/test/ui/parser/issue-19398.stderr b/src/test/ui/parser/issue-19398.stderr new file mode 100644 index 0000000000000..08957f2d38342 --- /dev/null +++ b/src/test/ui/parser/issue-19398.stderr @@ -0,0 +1,8 @@ +error: expected `fn`, found `unsafe` + --> $DIR/issue-19398.rs:14:19 + | +LL | extern "Rust" unsafe fn foo(); //~ ERROR expected `fn`, found `unsafe` + | ^^^^^^ expected `fn` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-20711-2.rs b/src/test/ui/parser/issue-20711-2.rs similarity index 100% rename from src/test/parse-fail/issue-20711-2.rs rename to src/test/ui/parser/issue-20711-2.rs diff --git a/src/test/ui/parser/issue-20711-2.stderr b/src/test/ui/parser/issue-20711-2.stderr new file mode 100644 index 0000000000000..ce6d6cbdc0614 --- /dev/null +++ b/src/test/ui/parser/issue-20711-2.stderr @@ -0,0 +1,10 @@ +error: expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, or `unsafe`, found `}` + --> $DIR/issue-20711-2.rs:20:1 + | +LL | #[stable(feature = "rust1", since = "1.0.0")] + | - expected one of 10 possible tokens here +LL | } //~ ERROR expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, or + | ^ unexpected token + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-20711.rs b/src/test/ui/parser/issue-20711.rs similarity index 100% rename from src/test/parse-fail/issue-20711.rs rename to src/test/ui/parser/issue-20711.rs diff --git a/src/test/ui/parser/issue-20711.stderr b/src/test/ui/parser/issue-20711.stderr new file mode 100644 index 0000000000000..b5b5636157771 --- /dev/null +++ b/src/test/ui/parser/issue-20711.stderr @@ -0,0 +1,10 @@ +error: expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, or `unsafe`, found `}` + --> $DIR/issue-20711.rs:18:1 + | +LL | #[stable(feature = "rust1", since = "1.0.0")] + | - expected one of 10 possible tokens here +LL | } //~ ERROR expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, or + | ^ unexpected token + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-21153.rs b/src/test/ui/parser/issue-21153.rs similarity index 100% rename from src/test/parse-fail/issue-21153.rs rename to src/test/ui/parser/issue-21153.rs diff --git a/src/test/ui/parser/issue-21153.stderr b/src/test/ui/parser/issue-21153.stderr new file mode 100644 index 0000000000000..47e05f1b36053 --- /dev/null +++ b/src/test/ui/parser/issue-21153.stderr @@ -0,0 +1,10 @@ +error: missing `fn`, `type`, or `const` for trait-item declaration + --> $DIR/issue-21153.rs:13:29 + | +LL | trait MyTrait: Iterator { //~ ERROR missing `fn`, `type`, or `const` + | _____________________________^ +LL | | Item = T; + | |____^ missing `fn`, `type`, or `const` + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-22647.rs b/src/test/ui/parser/issue-22647.rs similarity index 95% rename from src/test/parse-fail/issue-22647.rs rename to src/test/ui/parser/issue-22647.rs index 1ace57edba3d8..0f77ddd70cfc8 100644 --- a/src/test/parse-fail/issue-22647.rs +++ b/src/test/ui/parser/issue-22647.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + fn main() { let caller = |f: F| //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<` where F: Fn() -> i32 diff --git a/src/test/ui/parser/issue-22647.stderr b/src/test/ui/parser/issue-22647.stderr new file mode 100644 index 0000000000000..fbf078e425b92 --- /dev/null +++ b/src/test/ui/parser/issue-22647.stderr @@ -0,0 +1,8 @@ +error: expected one of `:`, `;`, `=`, or `@`, found `<` + --> $DIR/issue-22647.rs:14:15 + | +LL | let caller = |f: F| //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<` + | ^ expected one of `:`, `;`, `=`, or `@` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-22712.rs b/src/test/ui/parser/issue-22712.rs similarity index 94% rename from src/test/parse-fail/issue-22712.rs rename to src/test/ui/parser/issue-22712.rs index ed936cdd9a934..026af652c5e96 100644 --- a/src/test/parse-fail/issue-22712.rs +++ b/src/test/ui/parser/issue-22712.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + struct Foo { buffer: B } diff --git a/src/test/ui/parser/issue-22712.stderr b/src/test/ui/parser/issue-22712.stderr new file mode 100644 index 0000000000000..8651005ea687d --- /dev/null +++ b/src/test/ui/parser/issue-22712.stderr @@ -0,0 +1,8 @@ +error: expected one of `:`, `;`, `=`, or `@`, found `<` + --> $DIR/issue-22712.rs:18:12 + | +LL | let Foo> //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<` + | ^ expected one of `:`, `;`, `=`, or `@` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-2354-1.rs b/src/test/ui/parser/issue-2354-1.rs similarity index 100% rename from src/test/parse-fail/issue-2354-1.rs rename to src/test/ui/parser/issue-2354-1.rs diff --git a/src/test/ui/parser/issue-2354-1.stderr b/src/test/ui/parser/issue-2354-1.stderr new file mode 100644 index 0000000000000..bcec78a3d9b84 --- /dev/null +++ b/src/test/ui/parser/issue-2354-1.stderr @@ -0,0 +1,8 @@ +error: unexpected close delimiter: `}` + --> $DIR/issue-2354-1.rs:13:24 + | +LL | static foo: isize = 2; } //~ ERROR unexpected close delimiter: + | ^ unexpected close delimiter + +error: aborting due to previous error + diff --git a/src/test/ui/issue-2354.rs b/src/test/ui/parser/issue-2354.rs similarity index 100% rename from src/test/ui/issue-2354.rs rename to src/test/ui/parser/issue-2354.rs diff --git a/src/test/ui/issue-2354.stderr b/src/test/ui/parser/issue-2354.stderr similarity index 100% rename from src/test/ui/issue-2354.stderr rename to src/test/ui/parser/issue-2354.stderr diff --git a/src/test/parse-fail/issue-23620-invalid-escapes.rs b/src/test/ui/parser/issue-23620-invalid-escapes.rs similarity index 100% rename from src/test/parse-fail/issue-23620-invalid-escapes.rs rename to src/test/ui/parser/issue-23620-invalid-escapes.rs diff --git a/src/test/ui/parser/issue-23620-invalid-escapes.stderr b/src/test/ui/parser/issue-23620-invalid-escapes.stderr new file mode 100644 index 0000000000000..a46bcb07200cd --- /dev/null +++ b/src/test/ui/parser/issue-23620-invalid-escapes.stderr @@ -0,0 +1,122 @@ +error: unicode escape sequences cannot be used as a byte or in a byte string + --> $DIR/issue-23620-invalid-escapes.rs:14:15 + | +LL | let _ = b"/u{a66e}"; + | ^^^^^^^^ + +error: unicode escape sequences cannot be used as a byte or in a byte string + --> $DIR/issue-23620-invalid-escapes.rs:17:15 + | +LL | let _ = b'/u{a66e}'; + | ^^^^^^^^ + +error: incorrect unicode escape sequence + --> $DIR/issue-23620-invalid-escapes.rs:20:15 + | +LL | let _ = b'/u'; + | ^^ + | +help: format of unicode escape sequences is `/u{…}` + --> $DIR/issue-23620-invalid-escapes.rs:20:15 + | +LL | let _ = b'/u'; + | ^^ + +error: unicode escape sequences cannot be used as a byte or in a byte string + --> $DIR/issue-23620-invalid-escapes.rs:20:15 + | +LL | let _ = b'/u'; + | ^^ + +error: numeric character escape is too short + --> $DIR/issue-23620-invalid-escapes.rs:24:17 + | +LL | let _ = b'/x5'; + | ^ + +error: invalid character in numeric character escape: x + --> $DIR/issue-23620-invalid-escapes.rs:27:17 + | +LL | let _ = b'/xxy'; + | ^ + +error: invalid character in numeric character escape: y + --> $DIR/issue-23620-invalid-escapes.rs:27:18 + | +LL | let _ = b'/xxy'; + | ^ + +error: numeric character escape is too short + --> $DIR/issue-23620-invalid-escapes.rs:31:16 + | +LL | let _ = '/x5'; + | ^ + +error: invalid character in numeric character escape: x + --> $DIR/issue-23620-invalid-escapes.rs:34:16 + | +LL | let _ = '/xxy'; + | ^ + +error: invalid character in numeric character escape: y + --> $DIR/issue-23620-invalid-escapes.rs:34:17 + | +LL | let _ = '/xxy'; + | ^ + +error: unicode escape sequences cannot be used as a byte or in a byte string + --> $DIR/issue-23620-invalid-escapes.rs:38:15 + | +LL | let _ = b"/u{a4a4} /xf /u"; + | ^^^^^^^^ + +error: invalid character in numeric character escape: + --> $DIR/issue-23620-invalid-escapes.rs:38:27 + | +LL | let _ = b"/u{a4a4} /xf /u"; + | ^ + +error: incorrect unicode escape sequence + --> $DIR/issue-23620-invalid-escapes.rs:38:28 + | +LL | let _ = b"/u{a4a4} /xf /u"; + | ^^ + | +help: format of unicode escape sequences is `/u{…}` + --> $DIR/issue-23620-invalid-escapes.rs:38:28 + | +LL | let _ = b"/u{a4a4} /xf /u"; + | ^^ + +error: unicode escape sequences cannot be used as a byte or in a byte string + --> $DIR/issue-23620-invalid-escapes.rs:38:28 + | +LL | let _ = b"/u{a4a4} /xf /u"; + | ^^ + +error: invalid character in numeric character escape: + --> $DIR/issue-23620-invalid-escapes.rs:44:17 + | +LL | let _ = "/xf /u"; + | ^ + +error: this form of character escape may only be used with characters in the range [/x00-/x7f] + --> $DIR/issue-23620-invalid-escapes.rs:44:16 + | +LL | let _ = "/xf /u"; + | ^^ + +error: incorrect unicode escape sequence + --> $DIR/issue-23620-invalid-escapes.rs:44:18 + | +LL | let _ = "/xf /u"; + | ^^ + | +help: format of unicode escape sequences is `/u{…}` + --> $DIR/issue-23620-invalid-escapes.rs:44:18 + | +LL | let _ = "/xf /u"; + | ^^ + +error: aborting due to 17 previous errors + diff --git a/src/test/parse-fail/issue-24197.rs b/src/test/ui/parser/issue-24197.rs similarity index 94% rename from src/test/parse-fail/issue-24197.rs rename to src/test/ui/parser/issue-24197.rs index 37d6218261234..8e098655a52bd 100644 --- a/src/test/parse-fail/issue-24197.rs +++ b/src/test/ui/parser/issue-24197.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + fn main() { let buf[0] = 0; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[` } diff --git a/src/test/ui/parser/issue-24197.stderr b/src/test/ui/parser/issue-24197.stderr new file mode 100644 index 0000000000000..567c4f1f21b0f --- /dev/null +++ b/src/test/ui/parser/issue-24197.stderr @@ -0,0 +1,8 @@ +error: expected one of `:`, `;`, `=`, or `@`, found `[` + --> $DIR/issue-24197.rs:14:12 + | +LL | let buf[0] = 0; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[` + | ^ expected one of `:`, `;`, `=`, or `@` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-24375.rs b/src/test/ui/parser/issue-24375.rs similarity index 95% rename from src/test/parse-fail/issue-24375.rs rename to src/test/ui/parser/issue-24375.rs index 8723423325c19..aca50fdaf108e 100644 --- a/src/test/parse-fail/issue-24375.rs +++ b/src/test/ui/parser/issue-24375.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + static tmp : [&'static str; 2] = ["hello", "he"]; fn main() { diff --git a/src/test/ui/parser/issue-24375.stderr b/src/test/ui/parser/issue-24375.stderr new file mode 100644 index 0000000000000..0a9be6f4d2a6d --- /dev/null +++ b/src/test/ui/parser/issue-24375.stderr @@ -0,0 +1,8 @@ +error: expected one of `=>`, `@`, `if`, or `|`, found `[` + --> $DIR/issue-24375.rs:18:12 + | +LL | tmp[0] => {} //~ ERROR expected one of `=>`, `@`, `if`, or `|`, found `[` + | ^ expected one of `=>`, `@`, `if`, or `|` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-24780.rs b/src/test/ui/parser/issue-24780.rs similarity index 100% rename from src/test/parse-fail/issue-24780.rs rename to src/test/ui/parser/issue-24780.rs diff --git a/src/test/ui/parser/issue-24780.stderr b/src/test/ui/parser/issue-24780.stderr new file mode 100644 index 0000000000000..01f110e3d2462 --- /dev/null +++ b/src/test/ui/parser/issue-24780.stderr @@ -0,0 +1,8 @@ +error: expected one of `!`, `+`, `::`, `where`, or `{`, found `>` + --> $DIR/issue-24780.rs:17:23 + | +LL | fn foo() -> Vec> { + | ^ expected one of `!`, `+`, `::`, `where`, or `{` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-27255.rs b/src/test/ui/parser/issue-27255.rs similarity index 100% rename from src/test/parse-fail/issue-27255.rs rename to src/test/ui/parser/issue-27255.rs diff --git a/src/test/ui/parser/issue-27255.stderr b/src/test/ui/parser/issue-27255.stderr new file mode 100644 index 0000000000000..9caa6087420d0 --- /dev/null +++ b/src/test/ui/parser/issue-27255.stderr @@ -0,0 +1,8 @@ +error: missing `for` in a trait impl + --> $DIR/issue-27255.rs:13:7 + | +LL | impl A .. {} //~ ERROR + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-30318.rs b/src/test/ui/parser/issue-30318.rs similarity index 100% rename from src/test/parse-fail/issue-30318.rs rename to src/test/ui/parser/issue-30318.rs diff --git a/src/test/ui/parser/issue-30318.stderr b/src/test/ui/parser/issue-30318.stderr new file mode 100644 index 0000000000000..778a58463f74c --- /dev/null +++ b/src/test/ui/parser/issue-30318.stderr @@ -0,0 +1,10 @@ +error: expected outer doc comment + --> $DIR/issue-30318.rs:15:1 + | +LL | //! Misplaced comment... + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: inner doc comments like this (starting with `//!` or `/*!`) can only appear before items + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-3036.rs b/src/test/ui/parser/issue-3036.rs similarity index 100% rename from src/test/parse-fail/issue-3036.rs rename to src/test/ui/parser/issue-3036.rs diff --git a/src/test/ui/parser/issue-3036.stderr b/src/test/ui/parser/issue-3036.stderr new file mode 100644 index 0000000000000..e0e398381b71d --- /dev/null +++ b/src/test/ui/parser/issue-3036.stderr @@ -0,0 +1,10 @@ +error: expected one of `.`, `;`, `?`, or an operator, found `}` + --> $DIR/issue-3036.rs:18:1 + | +LL | let x = 3 + | - expected one of `.`, `;`, `?`, or an operator here +LL | } //~ ERROR: expected one of `.`, `;`, `?`, or an operator, found `}` + | ^ unexpected token + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-32214.rs b/src/test/ui/parser/issue-32214.rs similarity index 100% rename from src/test/parse-fail/issue-32214.rs rename to src/test/ui/parser/issue-32214.rs diff --git a/src/test/ui/parser/issue-32214.stderr b/src/test/ui/parser/issue-32214.stderr new file mode 100644 index 0000000000000..cce6cf6ede2e2 --- /dev/null +++ b/src/test/ui/parser/issue-32214.stderr @@ -0,0 +1,8 @@ +error: type parameters must be declared prior to associated type bindings + --> $DIR/issue-32214.rs:13:37 + | +LL | pub fn test >() {} + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-32446.rs b/src/test/ui/parser/issue-32446.rs similarity index 100% rename from src/test/parse-fail/issue-32446.rs rename to src/test/ui/parser/issue-32446.rs diff --git a/src/test/ui/parser/issue-32446.stderr b/src/test/ui/parser/issue-32446.stderr new file mode 100644 index 0000000000000..608a9a6e6e01d --- /dev/null +++ b/src/test/ui/parser/issue-32446.stderr @@ -0,0 +1,8 @@ +error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `...` + --> $DIR/issue-32446.rs:16:11 + | +LL | trait T { ... } //~ ERROR + | ^^^ expected one of 7 possible tokens here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-32501.rs b/src/test/ui/parser/issue-32501.rs similarity index 100% rename from src/test/parse-fail/issue-32501.rs rename to src/test/ui/parser/issue-32501.rs diff --git a/src/test/ui/parser/issue-32501.stderr b/src/test/ui/parser/issue-32501.stderr new file mode 100644 index 0000000000000..6836509ebba51 --- /dev/null +++ b/src/test/ui/parser/issue-32501.stderr @@ -0,0 +1,8 @@ +error: expected identifier, found reserved identifier `_` + --> $DIR/issue-32501.rs:19:13 + | +LL | let mut _ = 0; //~ ERROR expected identifier, found reserved identifier `_` + | ^ expected identifier, found reserved identifier + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-32505.rs b/src/test/ui/parser/issue-32505.rs similarity index 100% rename from src/test/parse-fail/issue-32505.rs rename to src/test/ui/parser/issue-32505.rs diff --git a/src/test/ui/parser/issue-32505.stderr b/src/test/ui/parser/issue-32505.stderr new file mode 100644 index 0000000000000..e89c907a3b7da --- /dev/null +++ b/src/test/ui/parser/issue-32505.stderr @@ -0,0 +1,8 @@ +error: expected expression, found `)` + --> $DIR/issue-32505.rs:14:12 + | +LL | foo(|_|) //~ ERROR expected expression, found `)` + | ^ expected expression + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-33262.rs b/src/test/ui/parser/issue-33262.rs similarity index 100% rename from src/test/parse-fail/issue-33262.rs rename to src/test/ui/parser/issue-33262.rs diff --git a/src/test/ui/parser/issue-33262.stderr b/src/test/ui/parser/issue-33262.stderr new file mode 100644 index 0000000000000..184dacdaca4b3 --- /dev/null +++ b/src/test/ui/parser/issue-33262.stderr @@ -0,0 +1,8 @@ +error: expected type, found `{` + --> $DIR/issue-33262.rs:16:22 + | +LL | for i in 0..a as { } + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-33413.rs b/src/test/ui/parser/issue-33413.rs similarity index 100% rename from src/test/parse-fail/issue-33413.rs rename to src/test/ui/parser/issue-33413.rs diff --git a/src/test/ui/parser/issue-33413.stderr b/src/test/ui/parser/issue-33413.stderr new file mode 100644 index 0000000000000..189ace74b9c6a --- /dev/null +++ b/src/test/ui/parser/issue-33413.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found `*` + --> $DIR/issue-33413.rs:14:10 + | +LL | fn f(*, a: u8) -> u8 {} //~ ERROR expected pattern, found `*` + | ^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-33455.rs b/src/test/ui/parser/issue-33455.rs similarity index 94% rename from src/test/parse-fail/issue-33455.rs rename to src/test/ui/parser/issue-33455.rs index 96070332f06df..6a9d03cdd91ad 100644 --- a/src/test/parse-fail/issue-33455.rs +++ b/src/test/ui/parser/issue-33455.rs @@ -8,4 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + use foo.bar; //~ ERROR expected one of `::`, `;`, or `as`, found `.` diff --git a/src/test/ui/parser/issue-33455.stderr b/src/test/ui/parser/issue-33455.stderr new file mode 100644 index 0000000000000..cc9bb2d7c93f9 --- /dev/null +++ b/src/test/ui/parser/issue-33455.stderr @@ -0,0 +1,8 @@ +error: expected one of `::`, `;`, or `as`, found `.` + --> $DIR/issue-33455.rs:13:8 + | +LL | use foo.bar; //~ ERROR expected one of `::`, `;`, or `as`, found `.` + | ^ expected one of `::`, `;`, or `as` here + +error: aborting due to previous error + diff --git a/src/test/ui/token/issue-41155.rs b/src/test/ui/parser/issue-41155.rs similarity index 92% rename from src/test/ui/token/issue-41155.rs rename to src/test/ui/parser/issue-41155.rs index 7bd8506af90b9..3d234dc378afb 100644 --- a/src/test/ui/token/issue-41155.rs +++ b/src/test/ui/parser/issue-41155.rs @@ -8,7 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -impl S { //~ ERROR cannot find type +// compile-flags: -Z parse-only + +impl S { pub } //~ ERROR expected one of diff --git a/src/test/ui/parser/issue-41155.stderr b/src/test/ui/parser/issue-41155.stderr new file mode 100644 index 0000000000000..34b78fca3bd81 --- /dev/null +++ b/src/test/ui/parser/issue-41155.stderr @@ -0,0 +1,10 @@ +error: expected one of `(`, `async`, `const`, `default`, `existential`, `extern`, `fn`, `type`, or `unsafe`, found `}` + --> $DIR/issue-41155.rs:15:1 + | +LL | pub + | - expected one of 9 possible tokens here +LL | } //~ ERROR expected one of + | ^ unexpected token + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-43692.rs b/src/test/ui/parser/issue-43692.rs similarity index 100% rename from src/test/parse-fail/issue-43692.rs rename to src/test/ui/parser/issue-43692.rs diff --git a/src/test/ui/parser/issue-43692.stderr b/src/test/ui/parser/issue-43692.stderr new file mode 100644 index 0000000000000..c5ea50be48780 --- /dev/null +++ b/src/test/ui/parser/issue-43692.stderr @@ -0,0 +1,8 @@ +error: invalid start of unicode escape + --> $DIR/issue-43692.rs:14:9 + | +LL | '/u{_10FFFF}'; //~ ERROR invalid start of unicode escape + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-5544-a.rs b/src/test/ui/parser/issue-5544-a.rs similarity index 100% rename from src/test/parse-fail/issue-5544-a.rs rename to src/test/ui/parser/issue-5544-a.rs diff --git a/src/test/ui/parser/issue-5544-a.stderr b/src/test/ui/parser/issue-5544-a.stderr new file mode 100644 index 0000000000000..7fd3bc9d6eacf --- /dev/null +++ b/src/test/ui/parser/issue-5544-a.stderr @@ -0,0 +1,8 @@ +error: int literal is too large + --> $DIR/issue-5544-a.rs:14:19 + | +LL | let __isize = 340282366920938463463374607431768211456; // 2^128 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-5544-b.rs b/src/test/ui/parser/issue-5544-b.rs similarity index 100% rename from src/test/parse-fail/issue-5544-b.rs rename to src/test/ui/parser/issue-5544-b.rs diff --git a/src/test/ui/parser/issue-5544-b.stderr b/src/test/ui/parser/issue-5544-b.stderr new file mode 100644 index 0000000000000..338b39b85b112 --- /dev/null +++ b/src/test/ui/parser/issue-5544-b.stderr @@ -0,0 +1,8 @@ +error: int literal is too large + --> $DIR/issue-5544-b.rs:14:19 + | +LL | let __isize = 0xffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ff; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-5806.rs b/src/test/ui/parser/issue-5806.rs similarity index 71% rename from src/test/parse-fail/issue-5806.rs rename to src/test/ui/parser/issue-5806.rs index f6606a58ecaf1..3622d59a51479 100644 --- a/src/test/parse-fail/issue-5806.rs +++ b/src/test/ui/parser/issue-5806.rs @@ -8,15 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-windows -// ignore-freebsd -// ignore-openbsd -// ignore-netbsd -// ignore-bitrig - // compile-flags: -Z parse-only +// normalize-stderr-test: "parser:.*\(" -> "parser: $$ACCESS_DENIED_MSG (" +// normalize-stderr-test: "os error \d+" -> "os error $$ACCESS_DENIED_CODE" -#[path = "../compile-fail"] -mod foo; //~ ERROR: a directory +#[path = "../parser"] +mod foo; //~ ERROR couldn't read fn main() {} diff --git a/src/test/ui/parser/issue-5806.stderr b/src/test/ui/parser/issue-5806.stderr new file mode 100644 index 0000000000000..63beed2873f7c --- /dev/null +++ b/src/test/ui/parser/issue-5806.stderr @@ -0,0 +1,8 @@ +error: couldn't read $DIR/../parser: $ACCESS_DENIED_MSG (os error $ACCESS_DENIED_CODE) + --> $DIR/issue-5806.rs:16:5 + | +LL | mod foo; //~ ERROR couldn't read + | ^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-6610.rs b/src/test/ui/parser/issue-6610.rs similarity index 100% rename from src/test/parse-fail/issue-6610.rs rename to src/test/ui/parser/issue-6610.rs diff --git a/src/test/ui/parser/issue-6610.stderr b/src/test/ui/parser/issue-6610.stderr new file mode 100644 index 0000000000000..d6013b32c967f --- /dev/null +++ b/src/test/ui/parser/issue-6610.stderr @@ -0,0 +1,8 @@ +error: expected `;` or `{`, found `}` + --> $DIR/issue-6610.rs:13:20 + | +LL | trait Foo { fn a() } //~ ERROR expected `;` or `{`, found `}` + | ^ expected `;` or `{` + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-8537.rs b/src/test/ui/parser/issue-8537.rs similarity index 100% rename from src/test/parse-fail/issue-8537.rs rename to src/test/ui/parser/issue-8537.rs diff --git a/src/test/ui/parser/issue-8537.stderr b/src/test/ui/parser/issue-8537.stderr new file mode 100644 index 0000000000000..0013f9722203e --- /dev/null +++ b/src/test/ui/parser/issue-8537.stderr @@ -0,0 +1,11 @@ +error[E0703]: invalid ABI: found `invalid-ab_isize` + --> $DIR/issue-8537.rs:14:3 + | +LL | "invalid-ab_isize" //~ ERROR invalid ABI + | ^^^^^^^^^^^^^^^^^^ invalid ABI + | + = help: valid ABIs: cdecl, stdcall, fastcall, vectorcall, thiscall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, x86-interrupt, amdgpu-kernel, Rust, C, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0703`. diff --git a/src/test/parse-fail/keyword-abstract.rs b/src/test/ui/parser/keyword-abstract.rs similarity index 100% rename from src/test/parse-fail/keyword-abstract.rs rename to src/test/ui/parser/keyword-abstract.rs diff --git a/src/test/ui/parser/keyword-abstract.stderr b/src/test/ui/parser/keyword-abstract.stderr new file mode 100644 index 0000000000000..1d3ed0d9b3ec1 --- /dev/null +++ b/src/test/ui/parser/keyword-abstract.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found reserved keyword `abstract` + --> $DIR/keyword-abstract.rs:14:9 + | +LL | let abstract = (); //~ ERROR expected pattern, found reserved keyword `abstract` + | ^^^^^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-as-as-identifier.rs b/src/test/ui/parser/keyword-as-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-as-as-identifier.rs rename to src/test/ui/parser/keyword-as-as-identifier.rs diff --git a/src/test/ui/parser/keyword-as-as-identifier.stderr b/src/test/ui/parser/keyword-as-as-identifier.stderr new file mode 100644 index 0000000000000..a6295c2fca134 --- /dev/null +++ b/src/test/ui/parser/keyword-as-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `as` + --> $DIR/keyword-as-as-identifier.rs:16:9 + | +LL | let as = "foo"; //~ error: expected pattern, found keyword `as` + | ^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-box-as-identifier.rs b/src/test/ui/parser/keyword-box-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-box-as-identifier.rs rename to src/test/ui/parser/keyword-box-as-identifier.rs diff --git a/src/test/ui/parser/keyword-box-as-identifier.stderr b/src/test/ui/parser/keyword-box-as-identifier.stderr new file mode 100644 index 0000000000000..4e9984c287198 --- /dev/null +++ b/src/test/ui/parser/keyword-box-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found `=` + --> $DIR/keyword-box-as-identifier.rs:14:13 + | +LL | let box = "foo"; //~ error: expected pattern, found `=` + | ^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-break-as-identifier.rs b/src/test/ui/parser/keyword-break-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-break-as-identifier.rs rename to src/test/ui/parser/keyword-break-as-identifier.rs diff --git a/src/test/ui/parser/keyword-break-as-identifier.stderr b/src/test/ui/parser/keyword-break-as-identifier.stderr new file mode 100644 index 0000000000000..9e2d2c9caacca --- /dev/null +++ b/src/test/ui/parser/keyword-break-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `break` + --> $DIR/keyword-break-as-identifier.rs:16:9 + | +LL | let break = "foo"; //~ error: expected pattern, found keyword `break` + | ^^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-const-as-identifier.rs b/src/test/ui/parser/keyword-const-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-const-as-identifier.rs rename to src/test/ui/parser/keyword-const-as-identifier.rs diff --git a/src/test/ui/parser/keyword-const-as-identifier.stderr b/src/test/ui/parser/keyword-const-as-identifier.stderr new file mode 100644 index 0000000000000..d662fefda7089 --- /dev/null +++ b/src/test/ui/parser/keyword-const-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `const` + --> $DIR/keyword-const-as-identifier.rs:16:9 + | +LL | let const = "foo"; //~ error: expected pattern, found keyword `const` + | ^^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-continue-as-identifier.rs b/src/test/ui/parser/keyword-continue-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-continue-as-identifier.rs rename to src/test/ui/parser/keyword-continue-as-identifier.rs diff --git a/src/test/ui/parser/keyword-continue-as-identifier.stderr b/src/test/ui/parser/keyword-continue-as-identifier.stderr new file mode 100644 index 0000000000000..52409c1f6bb3b --- /dev/null +++ b/src/test/ui/parser/keyword-continue-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `continue` + --> $DIR/keyword-continue-as-identifier.rs:16:9 + | +LL | let continue = "foo"; //~ error: expected pattern, found keyword `continue` + | ^^^^^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-else-as-identifier.rs b/src/test/ui/parser/keyword-else-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-else-as-identifier.rs rename to src/test/ui/parser/keyword-else-as-identifier.rs diff --git a/src/test/ui/parser/keyword-else-as-identifier.stderr b/src/test/ui/parser/keyword-else-as-identifier.stderr new file mode 100644 index 0000000000000..ab075a52141e4 --- /dev/null +++ b/src/test/ui/parser/keyword-else-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `else` + --> $DIR/keyword-else-as-identifier.rs:16:9 + | +LL | let else = "foo"; //~ error: expected pattern, found keyword `else` + | ^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-enum-as-identifier.rs b/src/test/ui/parser/keyword-enum-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-enum-as-identifier.rs rename to src/test/ui/parser/keyword-enum-as-identifier.rs diff --git a/src/test/ui/parser/keyword-enum-as-identifier.stderr b/src/test/ui/parser/keyword-enum-as-identifier.stderr new file mode 100644 index 0000000000000..f8370134741e0 --- /dev/null +++ b/src/test/ui/parser/keyword-enum-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `enum` + --> $DIR/keyword-enum-as-identifier.rs:16:9 + | +LL | let enum = "foo"; //~ error: expected pattern, found keyword `enum` + | ^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-final.rs b/src/test/ui/parser/keyword-final.rs similarity index 100% rename from src/test/parse-fail/keyword-final.rs rename to src/test/ui/parser/keyword-final.rs diff --git a/src/test/ui/parser/keyword-final.stderr b/src/test/ui/parser/keyword-final.stderr new file mode 100644 index 0000000000000..8ace453f36238 --- /dev/null +++ b/src/test/ui/parser/keyword-final.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found reserved keyword `final` + --> $DIR/keyword-final.rs:14:9 + | +LL | let final = (); //~ ERROR expected pattern, found reserved keyword `final` + | ^^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-fn-as-identifier.rs b/src/test/ui/parser/keyword-fn-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-fn-as-identifier.rs rename to src/test/ui/parser/keyword-fn-as-identifier.rs diff --git a/src/test/ui/parser/keyword-fn-as-identifier.stderr b/src/test/ui/parser/keyword-fn-as-identifier.stderr new file mode 100644 index 0000000000000..bf63775fc9bf5 --- /dev/null +++ b/src/test/ui/parser/keyword-fn-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `fn` + --> $DIR/keyword-fn-as-identifier.rs:16:9 + | +LL | let fn = "foo"; //~ error: expected pattern, found keyword `fn` + | ^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-for-as-identifier.rs b/src/test/ui/parser/keyword-for-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-for-as-identifier.rs rename to src/test/ui/parser/keyword-for-as-identifier.rs diff --git a/src/test/ui/parser/keyword-for-as-identifier.stderr b/src/test/ui/parser/keyword-for-as-identifier.stderr new file mode 100644 index 0000000000000..ed28f77a252bc --- /dev/null +++ b/src/test/ui/parser/keyword-for-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `for` + --> $DIR/keyword-for-as-identifier.rs:16:9 + | +LL | let for = "foo"; //~ error: expected pattern, found keyword `for` + | ^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-if-as-identifier.rs b/src/test/ui/parser/keyword-if-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-if-as-identifier.rs rename to src/test/ui/parser/keyword-if-as-identifier.rs diff --git a/src/test/ui/parser/keyword-if-as-identifier.stderr b/src/test/ui/parser/keyword-if-as-identifier.stderr new file mode 100644 index 0000000000000..bfb7ab78bcfe1 --- /dev/null +++ b/src/test/ui/parser/keyword-if-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `if` + --> $DIR/keyword-if-as-identifier.rs:16:9 + | +LL | let if = "foo"; //~ error: expected pattern, found keyword `if` + | ^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-impl-as-identifier.rs b/src/test/ui/parser/keyword-impl-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-impl-as-identifier.rs rename to src/test/ui/parser/keyword-impl-as-identifier.rs diff --git a/src/test/ui/parser/keyword-impl-as-identifier.stderr b/src/test/ui/parser/keyword-impl-as-identifier.stderr new file mode 100644 index 0000000000000..43f7072981e6a --- /dev/null +++ b/src/test/ui/parser/keyword-impl-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `impl` + --> $DIR/keyword-impl-as-identifier.rs:16:9 + | +LL | let impl = "foo"; //~ error: expected pattern, found keyword `impl` + | ^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-in-as-identifier.rs b/src/test/ui/parser/keyword-in-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-in-as-identifier.rs rename to src/test/ui/parser/keyword-in-as-identifier.rs diff --git a/src/test/ui/parser/keyword-in-as-identifier.stderr b/src/test/ui/parser/keyword-in-as-identifier.stderr new file mode 100644 index 0000000000000..29bb5f4b724d7 --- /dev/null +++ b/src/test/ui/parser/keyword-in-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `in` + --> $DIR/keyword-in-as-identifier.rs:16:9 + | +LL | let in = "foo"; //~ error: expected pattern, found keyword `in` + | ^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-let-as-identifier.rs b/src/test/ui/parser/keyword-let-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-let-as-identifier.rs rename to src/test/ui/parser/keyword-let-as-identifier.rs diff --git a/src/test/ui/parser/keyword-let-as-identifier.stderr b/src/test/ui/parser/keyword-let-as-identifier.stderr new file mode 100644 index 0000000000000..7a28aee465711 --- /dev/null +++ b/src/test/ui/parser/keyword-let-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `let` + --> $DIR/keyword-let-as-identifier.rs:16:9 + | +LL | let let = "foo"; //~ error: expected pattern, found keyword `let` + | ^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-loop-as-identifier.rs b/src/test/ui/parser/keyword-loop-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-loop-as-identifier.rs rename to src/test/ui/parser/keyword-loop-as-identifier.rs diff --git a/src/test/ui/parser/keyword-loop-as-identifier.stderr b/src/test/ui/parser/keyword-loop-as-identifier.stderr new file mode 100644 index 0000000000000..1dafe466d7907 --- /dev/null +++ b/src/test/ui/parser/keyword-loop-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `loop` + --> $DIR/keyword-loop-as-identifier.rs:16:9 + | +LL | let loop = "foo"; //~ error: expected pattern, found keyword `loop` + | ^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-match-as-identifier.rs b/src/test/ui/parser/keyword-match-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-match-as-identifier.rs rename to src/test/ui/parser/keyword-match-as-identifier.rs diff --git a/src/test/ui/parser/keyword-match-as-identifier.stderr b/src/test/ui/parser/keyword-match-as-identifier.stderr new file mode 100644 index 0000000000000..b3b542f1a1d36 --- /dev/null +++ b/src/test/ui/parser/keyword-match-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `match` + --> $DIR/keyword-match-as-identifier.rs:16:9 + | +LL | let match = "foo"; //~ error: expected pattern, found keyword `match` + | ^^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-mod-as-identifier.rs b/src/test/ui/parser/keyword-mod-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-mod-as-identifier.rs rename to src/test/ui/parser/keyword-mod-as-identifier.rs diff --git a/src/test/ui/parser/keyword-mod-as-identifier.stderr b/src/test/ui/parser/keyword-mod-as-identifier.stderr new file mode 100644 index 0000000000000..113f7084b31cd --- /dev/null +++ b/src/test/ui/parser/keyword-mod-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `mod` + --> $DIR/keyword-mod-as-identifier.rs:16:9 + | +LL | let mod = "foo"; //~ error: expected pattern, found keyword `mod` + | ^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-move-as-identifier.rs b/src/test/ui/parser/keyword-move-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-move-as-identifier.rs rename to src/test/ui/parser/keyword-move-as-identifier.rs diff --git a/src/test/ui/parser/keyword-move-as-identifier.stderr b/src/test/ui/parser/keyword-move-as-identifier.stderr new file mode 100644 index 0000000000000..21b66fbc1e1d8 --- /dev/null +++ b/src/test/ui/parser/keyword-move-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `move` + --> $DIR/keyword-move-as-identifier.rs:16:9 + | +LL | let move = "foo"; //~ error: expected pattern, found keyword `move` + | ^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-mut-as-identifier.rs b/src/test/ui/parser/keyword-mut-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-mut-as-identifier.rs rename to src/test/ui/parser/keyword-mut-as-identifier.rs diff --git a/src/test/ui/parser/keyword-mut-as-identifier.stderr b/src/test/ui/parser/keyword-mut-as-identifier.stderr new file mode 100644 index 0000000000000..bb153cf0e6c1c --- /dev/null +++ b/src/test/ui/parser/keyword-mut-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected identifier, found `=` + --> $DIR/keyword-mut-as-identifier.rs:14:13 + | +LL | let mut = "foo"; //~ error: expected identifier, found `=` + | ^ expected identifier + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-override.rs b/src/test/ui/parser/keyword-override.rs similarity index 100% rename from src/test/parse-fail/keyword-override.rs rename to src/test/ui/parser/keyword-override.rs diff --git a/src/test/ui/parser/keyword-override.stderr b/src/test/ui/parser/keyword-override.stderr new file mode 100644 index 0000000000000..ce1d4f2771615 --- /dev/null +++ b/src/test/ui/parser/keyword-override.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found reserved keyword `override` + --> $DIR/keyword-override.rs:14:9 + | +LL | let override = (); //~ ERROR expected pattern, found reserved keyword `override` + | ^^^^^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-pub-as-identifier.rs b/src/test/ui/parser/keyword-pub-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-pub-as-identifier.rs rename to src/test/ui/parser/keyword-pub-as-identifier.rs diff --git a/src/test/ui/parser/keyword-pub-as-identifier.stderr b/src/test/ui/parser/keyword-pub-as-identifier.stderr new file mode 100644 index 0000000000000..b52982d144d40 --- /dev/null +++ b/src/test/ui/parser/keyword-pub-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `pub` + --> $DIR/keyword-pub-as-identifier.rs:16:9 + | +LL | let pub = "foo"; //~ error: expected pattern, found keyword `pub` + | ^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-ref-as-identifier.rs b/src/test/ui/parser/keyword-ref-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-ref-as-identifier.rs rename to src/test/ui/parser/keyword-ref-as-identifier.rs diff --git a/src/test/ui/parser/keyword-ref-as-identifier.stderr b/src/test/ui/parser/keyword-ref-as-identifier.stderr new file mode 100644 index 0000000000000..34063c88d33b1 --- /dev/null +++ b/src/test/ui/parser/keyword-ref-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected identifier, found `=` + --> $DIR/keyword-ref-as-identifier.rs:14:13 + | +LL | let ref = "foo"; //~ error: expected identifier, found `=` + | ^ expected identifier + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-return-as-identifier.rs b/src/test/ui/parser/keyword-return-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-return-as-identifier.rs rename to src/test/ui/parser/keyword-return-as-identifier.rs diff --git a/src/test/ui/parser/keyword-return-as-identifier.stderr b/src/test/ui/parser/keyword-return-as-identifier.stderr new file mode 100644 index 0000000000000..8d8b2aabbdcd5 --- /dev/null +++ b/src/test/ui/parser/keyword-return-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `return` + --> $DIR/keyword-return-as-identifier.rs:16:9 + | +LL | let return = "foo"; //~ error: expected pattern, found keyword `return` + | ^^^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-static-as-identifier.rs b/src/test/ui/parser/keyword-static-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-static-as-identifier.rs rename to src/test/ui/parser/keyword-static-as-identifier.rs diff --git a/src/test/ui/parser/keyword-static-as-identifier.stderr b/src/test/ui/parser/keyword-static-as-identifier.stderr new file mode 100644 index 0000000000000..4c1a0d1a0b0fa --- /dev/null +++ b/src/test/ui/parser/keyword-static-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `static` + --> $DIR/keyword-static-as-identifier.rs:16:9 + | +LL | let static = "foo"; //~ error: expected pattern, found keyword `static` + | ^^^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-struct-as-identifier.rs b/src/test/ui/parser/keyword-struct-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-struct-as-identifier.rs rename to src/test/ui/parser/keyword-struct-as-identifier.rs diff --git a/src/test/ui/parser/keyword-struct-as-identifier.stderr b/src/test/ui/parser/keyword-struct-as-identifier.stderr new file mode 100644 index 0000000000000..76179ce7ea7ac --- /dev/null +++ b/src/test/ui/parser/keyword-struct-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `struct` + --> $DIR/keyword-struct-as-identifier.rs:16:9 + | +LL | let struct = "foo"; //~ error: expected pattern, found keyword `struct` + | ^^^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-trait-as-identifier.rs b/src/test/ui/parser/keyword-trait-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-trait-as-identifier.rs rename to src/test/ui/parser/keyword-trait-as-identifier.rs diff --git a/src/test/ui/parser/keyword-trait-as-identifier.stderr b/src/test/ui/parser/keyword-trait-as-identifier.stderr new file mode 100644 index 0000000000000..084b785f8674a --- /dev/null +++ b/src/test/ui/parser/keyword-trait-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `trait` + --> $DIR/keyword-trait-as-identifier.rs:16:9 + | +LL | let trait = "foo"; //~ error: expected pattern, found keyword `trait` + | ^^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-try-as-identifier-edition2018.rs b/src/test/ui/parser/keyword-try-as-identifier-edition2018.rs similarity index 100% rename from src/test/parse-fail/keyword-try-as-identifier-edition2018.rs rename to src/test/ui/parser/keyword-try-as-identifier-edition2018.rs diff --git a/src/test/ui/parser/keyword-try-as-identifier-edition2018.stderr b/src/test/ui/parser/keyword-try-as-identifier-edition2018.stderr new file mode 100644 index 0000000000000..9306f95d85565 --- /dev/null +++ b/src/test/ui/parser/keyword-try-as-identifier-edition2018.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found reserved keyword `try` + --> $DIR/keyword-try-as-identifier-edition2018.rs:14:9 + | +LL | let try = "foo"; //~ error: expected pattern, found reserved keyword `try` + | ^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-type-as-identifier.rs b/src/test/ui/parser/keyword-type-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-type-as-identifier.rs rename to src/test/ui/parser/keyword-type-as-identifier.rs diff --git a/src/test/ui/parser/keyword-type-as-identifier.stderr b/src/test/ui/parser/keyword-type-as-identifier.stderr new file mode 100644 index 0000000000000..03e0bd7dfa9bf --- /dev/null +++ b/src/test/ui/parser/keyword-type-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `type` + --> $DIR/keyword-type-as-identifier.rs:16:9 + | +LL | let type = "foo"; //~ error: expected pattern, found keyword `type` + | ^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-typeof.rs b/src/test/ui/parser/keyword-typeof.rs similarity index 100% rename from src/test/parse-fail/keyword-typeof.rs rename to src/test/ui/parser/keyword-typeof.rs diff --git a/src/test/ui/parser/keyword-typeof.stderr b/src/test/ui/parser/keyword-typeof.stderr new file mode 100644 index 0000000000000..1c0cd0cca0dc2 --- /dev/null +++ b/src/test/ui/parser/keyword-typeof.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found reserved keyword `typeof` + --> $DIR/keyword-typeof.rs:14:9 + | +LL | let typeof = (); //~ ERROR expected pattern, found reserved keyword `typeof` + | ^^^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-unsafe-as-identifier.rs b/src/test/ui/parser/keyword-unsafe-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-unsafe-as-identifier.rs rename to src/test/ui/parser/keyword-unsafe-as-identifier.rs diff --git a/src/test/ui/parser/keyword-unsafe-as-identifier.stderr b/src/test/ui/parser/keyword-unsafe-as-identifier.stderr new file mode 100644 index 0000000000000..360bd21fa5f62 --- /dev/null +++ b/src/test/ui/parser/keyword-unsafe-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `unsafe` + --> $DIR/keyword-unsafe-as-identifier.rs:16:9 + | +LL | let unsafe = "foo"; //~ error: expected pattern, found keyword `unsafe` + | ^^^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-use-as-identifier.rs b/src/test/ui/parser/keyword-use-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-use-as-identifier.rs rename to src/test/ui/parser/keyword-use-as-identifier.rs diff --git a/src/test/ui/parser/keyword-use-as-identifier.stderr b/src/test/ui/parser/keyword-use-as-identifier.stderr new file mode 100644 index 0000000000000..bff297881078b --- /dev/null +++ b/src/test/ui/parser/keyword-use-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `use` + --> $DIR/keyword-use-as-identifier.rs:16:9 + | +LL | let use = "foo"; //~ error: expected pattern, found keyword `use` + | ^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-where-as-identifier.rs b/src/test/ui/parser/keyword-where-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-where-as-identifier.rs rename to src/test/ui/parser/keyword-where-as-identifier.rs diff --git a/src/test/ui/parser/keyword-where-as-identifier.stderr b/src/test/ui/parser/keyword-where-as-identifier.stderr new file mode 100644 index 0000000000000..38fe936befefa --- /dev/null +++ b/src/test/ui/parser/keyword-where-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `where` + --> $DIR/keyword-where-as-identifier.rs:16:9 + | +LL | let where = "foo"; //~ error: expected pattern, found keyword `where` + | ^^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword-while-as-identifier.rs b/src/test/ui/parser/keyword-while-as-identifier.rs similarity index 100% rename from src/test/parse-fail/keyword-while-as-identifier.rs rename to src/test/ui/parser/keyword-while-as-identifier.rs diff --git a/src/test/ui/parser/keyword-while-as-identifier.stderr b/src/test/ui/parser/keyword-while-as-identifier.stderr new file mode 100644 index 0000000000000..c9dab8c5170ce --- /dev/null +++ b/src/test/ui/parser/keyword-while-as-identifier.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found keyword `while` + --> $DIR/keyword-while-as-identifier.rs:16:9 + | +LL | let while = "foo"; //~ error: expected pattern, found keyword `while` + | ^^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keyword.rs b/src/test/ui/parser/keyword.rs similarity index 100% rename from src/test/parse-fail/keyword.rs rename to src/test/ui/parser/keyword.rs diff --git a/src/test/ui/parser/keyword.stderr b/src/test/ui/parser/keyword.stderr new file mode 100644 index 0000000000000..a3fc16777326d --- /dev/null +++ b/src/test/ui/parser/keyword.stderr @@ -0,0 +1,8 @@ +error: expected identifier, found keyword `break` + --> $DIR/keyword.rs:13:9 + | +LL | pub mod break { + | ^^^^^ expected identifier, found keyword + +error: aborting due to previous error + diff --git a/src/test/parse-fail/keywords-followed-by-double-colon.rs b/src/test/ui/parser/keywords-followed-by-double-colon.rs similarity index 100% rename from src/test/parse-fail/keywords-followed-by-double-colon.rs rename to src/test/ui/parser/keywords-followed-by-double-colon.rs diff --git a/src/test/ui/parser/keywords-followed-by-double-colon.stderr b/src/test/ui/parser/keywords-followed-by-double-colon.stderr new file mode 100644 index 0000000000000..049658571e86e --- /dev/null +++ b/src/test/ui/parser/keywords-followed-by-double-colon.stderr @@ -0,0 +1,14 @@ +error: expected identifier, found `::` + --> $DIR/keywords-followed-by-double-colon.rs:14:11 + | +LL | struct::foo(); + | ^^ expected identifier + +error: expected expression, found keyword `mut` + --> $DIR/keywords-followed-by-double-colon.rs:18:5 + | +LL | mut::baz(); + | ^^^ expected expression + +error: aborting due to 2 previous errors + diff --git a/src/test/parse-fail/lex-bad-binary-literal.rs b/src/test/ui/parser/lex-bad-binary-literal.rs similarity index 100% rename from src/test/parse-fail/lex-bad-binary-literal.rs rename to src/test/ui/parser/lex-bad-binary-literal.rs diff --git a/src/test/ui/parser/lex-bad-binary-literal.stderr b/src/test/ui/parser/lex-bad-binary-literal.stderr new file mode 100644 index 0000000000000..2c23d8c3d6109 --- /dev/null +++ b/src/test/ui/parser/lex-bad-binary-literal.stderr @@ -0,0 +1,56 @@ +error: invalid digit for a base 2 literal + --> $DIR/lex-bad-binary-literal.rs:14:8 + | +LL | 0b121; //~ ERROR invalid digit for a base 2 literal + | ^ + +error: invalid digit for a base 2 literal + --> $DIR/lex-bad-binary-literal.rs:15:12 + | +LL | 0b10_10301; //~ ERROR invalid digit for a base 2 literal + | ^ + +error: invalid digit for a base 2 literal + --> $DIR/lex-bad-binary-literal.rs:16:7 + | +LL | 0b30; //~ ERROR invalid digit for a base 2 literal + | ^ + +error: invalid digit for a base 2 literal + --> $DIR/lex-bad-binary-literal.rs:17:7 + | +LL | 0b41; //~ ERROR invalid digit for a base 2 literal + | ^ + +error: invalid digit for a base 2 literal + --> $DIR/lex-bad-binary-literal.rs:18:7 + | +LL | 0b5; //~ ERROR invalid digit for a base 2 literal + | ^ + +error: invalid digit for a base 2 literal + --> $DIR/lex-bad-binary-literal.rs:19:7 + | +LL | 0b6; //~ ERROR invalid digit for a base 2 literal + | ^ + +error: invalid digit for a base 2 literal + --> $DIR/lex-bad-binary-literal.rs:20:7 + | +LL | 0b7; //~ ERROR invalid digit for a base 2 literal + | ^ + +error: invalid digit for a base 2 literal + --> $DIR/lex-bad-binary-literal.rs:21:7 + | +LL | 0b8; //~ ERROR invalid digit for a base 2 literal + | ^ + +error: invalid digit for a base 2 literal + --> $DIR/lex-bad-binary-literal.rs:22:7 + | +LL | 0b9; //~ ERROR invalid digit for a base 2 literal + | ^ + +error: aborting due to 9 previous errors + diff --git a/src/test/parse-fail/lex-bad-char-literals-1.rs b/src/test/ui/parser/lex-bad-char-literals-1.rs similarity index 100% rename from src/test/parse-fail/lex-bad-char-literals-1.rs rename to src/test/ui/parser/lex-bad-char-literals-1.rs diff --git a/src/test/ui/parser/lex-bad-char-literals-1.stderr b/src/test/ui/parser/lex-bad-char-literals-1.stderr new file mode 100644 index 0000000000000..081eb2e9fed70 --- /dev/null +++ b/src/test/ui/parser/lex-bad-char-literals-1.stderr @@ -0,0 +1,26 @@ +error: numeric character escape is too short + --> $DIR/lex-bad-char-literals-1.rs:13:8 + | +LL | '/x1' //~ ERROR: numeric character escape is too short + | ^ + +error: numeric character escape is too short + --> $DIR/lex-bad-char-literals-1.rs:17:8 + | +LL | "/x1" //~ ERROR: numeric character escape is too short + | ^ + +error: unknown character escape: /u{25cf} + --> $DIR/lex-bad-char-literals-1.rs:21:7 + | +LL | '/●' //~ ERROR: unknown character escape + | ^ + +error: unknown character escape: /u{25cf} + --> $DIR/lex-bad-char-literals-1.rs:25:7 + | +LL | "/●" //~ ERROR: unknown character escape + | ^ + +error: aborting due to 4 previous errors + diff --git a/src/test/parse-fail/lex-bad-char-literals-2.rs b/src/test/ui/parser/lex-bad-char-literals-2.rs similarity index 100% rename from src/test/parse-fail/lex-bad-char-literals-2.rs rename to src/test/ui/parser/lex-bad-char-literals-2.rs diff --git a/src/test/ui/parser/lex-bad-char-literals-2.stderr b/src/test/ui/parser/lex-bad-char-literals-2.stderr new file mode 100644 index 0000000000000..ed129f5d427d1 --- /dev/null +++ b/src/test/ui/parser/lex-bad-char-literals-2.stderr @@ -0,0 +1,8 @@ +error: character literal may only contain one codepoint: 'nope' + --> $DIR/lex-bad-char-literals-2.rs:15:5 + | +LL | 'nope' //~ ERROR: character literal may only contain one codepoint: 'nope' + | ^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/lex-bad-char-literals-3.rs b/src/test/ui/parser/lex-bad-char-literals-3.rs similarity index 100% rename from src/test/parse-fail/lex-bad-char-literals-3.rs rename to src/test/ui/parser/lex-bad-char-literals-3.rs diff --git a/src/test/ui/parser/lex-bad-char-literals-3.stderr b/src/test/ui/parser/lex-bad-char-literals-3.stderr new file mode 100644 index 0000000000000..f257b5b82680e --- /dev/null +++ b/src/test/ui/parser/lex-bad-char-literals-3.stderr @@ -0,0 +1,12 @@ +error: character literal may only contain one codepoint + --> $DIR/lex-bad-char-literals-3.rs:15:5 + | +LL | '●●' //~ ERROR: character literal may only contain one codepoint + | ^^^^ +help: if you meant to write a `str` literal, use double quotes + | +LL | "●●" //~ ERROR: character literal may only contain one codepoint + | ^^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/lex-bad-char-literals-4.rs b/src/test/ui/parser/lex-bad-char-literals-4.rs similarity index 100% rename from src/test/parse-fail/lex-bad-char-literals-4.rs rename to src/test/ui/parser/lex-bad-char-literals-4.rs diff --git a/src/test/ui/parser/lex-bad-char-literals-4.stderr b/src/test/ui/parser/lex-bad-char-literals-4.stderr new file mode 100644 index 0000000000000..495becd07d16a --- /dev/null +++ b/src/test/ui/parser/lex-bad-char-literals-4.stderr @@ -0,0 +1,8 @@ +error: character literal may only contain one codepoint: '● + --> $DIR/lex-bad-char-literals-4.rs:15:5 + | +LL | '● //~ ERROR: character literal may only contain one codepoint: '● + | ^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/lex-bad-char-literals-5.rs b/src/test/ui/parser/lex-bad-char-literals-5.rs similarity index 100% rename from src/test/parse-fail/lex-bad-char-literals-5.rs rename to src/test/ui/parser/lex-bad-char-literals-5.rs diff --git a/src/test/ui/parser/lex-bad-char-literals-5.stderr b/src/test/ui/parser/lex-bad-char-literals-5.stderr new file mode 100644 index 0000000000000..145361eb58a89 --- /dev/null +++ b/src/test/ui/parser/lex-bad-char-literals-5.stderr @@ -0,0 +1,12 @@ +error: character literal may only contain one codepoint + --> $DIR/lex-bad-char-literals-5.rs:15:5 + | +LL | '/x10/x10' //~ ERROR: character literal may only contain one codepoint + | ^^^^^^^^^^ +help: if you meant to write a `str` literal, use double quotes + | +LL | "/x10/x10" //~ ERROR: character literal may only contain one codepoint + | ^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/lex-bad-numeric-literals.rs b/src/test/ui/parser/lex-bad-numeric-literals.rs similarity index 100% rename from src/test/parse-fail/lex-bad-numeric-literals.rs rename to src/test/ui/parser/lex-bad-numeric-literals.rs diff --git a/src/test/ui/parser/lex-bad-numeric-literals.stderr b/src/test/ui/parser/lex-bad-numeric-literals.stderr new file mode 100644 index 0000000000000..3d87b5b7037d7 --- /dev/null +++ b/src/test/ui/parser/lex-bad-numeric-literals.stderr @@ -0,0 +1,140 @@ +error: octal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:14:5 + | +LL | 0o1.0; //~ ERROR: octal float literal is not supported + | ^^^^^ + +error: octal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:16:5 + | +LL | 0o3.0f32; //~ ERROR: octal float literal is not supported + | ^^^^^ + +error: octal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:17:5 + | +LL | 0o4e4; //~ ERROR: octal float literal is not supported + | ^^^^^ + +error: octal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:18:5 + | +LL | 0o5.0e5; //~ ERROR: octal float literal is not supported + | ^^^^^^^ + +error: octal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:19:5 + | +LL | 0o6e6f32; //~ ERROR: octal float literal is not supported + | ^^^^^ + +error: octal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:20:5 + | +LL | 0o7.0e7f64; //~ ERROR: octal float literal is not supported + | ^^^^^^^ + +error: hexadecimal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:21:5 + | +LL | 0x8.0e+9; //~ ERROR: hexadecimal float literal is not supported + | ^^^^^^^^ + +error: hexadecimal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:22:5 + | +LL | 0x9.0e-9; //~ ERROR: hexadecimal float literal is not supported + | ^^^^^^^^ + +error: no valid digits found for number + --> $DIR/lex-bad-numeric-literals.rs:23:5 + | +LL | 0o; //~ ERROR: no valid digits + | ^^ + +error: expected at least one digit in exponent + --> $DIR/lex-bad-numeric-literals.rs:24:8 + | +LL | 1e+; //~ ERROR: expected at least one digit in exponent + | ^ + +error: hexadecimal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:25:5 + | +LL | 0x539.0; //~ ERROR: hexadecimal float literal is not supported + | ^^^^^^^ + +error: no valid digits found for number + --> $DIR/lex-bad-numeric-literals.rs:28:5 + | +LL | 0x; //~ ERROR: no valid digits + | ^^ + +error: no valid digits found for number + --> $DIR/lex-bad-numeric-literals.rs:29:5 + | +LL | 0xu32; //~ ERROR: no valid digits + | ^^ + +error: no valid digits found for number + --> $DIR/lex-bad-numeric-literals.rs:30:5 + | +LL | 0ou32; //~ ERROR: no valid digits + | ^^ + +error: no valid digits found for number + --> $DIR/lex-bad-numeric-literals.rs:31:5 + | +LL | 0bu32; //~ ERROR: no valid digits + | ^^ + +error: no valid digits found for number + --> $DIR/lex-bad-numeric-literals.rs:32:5 + | +LL | 0b; //~ ERROR: no valid digits + | ^^ + +error: octal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:34:5 + | +LL | 0o123.456; //~ ERROR: octal float literal is not supported + | ^^^^^^^^^ + +error: binary float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:36:5 + | +LL | 0b111.101; //~ ERROR: binary float literal is not supported + | ^^^^^^^^^ + +error: octal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:15:5 + | +LL | 0o2f32; //~ ERROR: octal float literal is not supported + | ^^^^^^ + +error: int literal is too large + --> $DIR/lex-bad-numeric-literals.rs:26:5 + | +LL | 9900000000000000000000000000999999999999999999999999999999; //~ ERROR: int literal is too large + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: int literal is too large + --> $DIR/lex-bad-numeric-literals.rs:27:5 + | +LL | 9900000000000000000000000000999999999999999999999999999999; //~ ERROR: int literal is too large + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: octal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:33:5 + | +LL | 0o123f64; //~ ERROR: octal float literal is not supported + | ^^^^^^^^ + +error: binary float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:35:5 + | +LL | 0b101f64; //~ ERROR: binary float literal is not supported + | ^^^^^^^^ + +error: aborting due to 23 previous errors + diff --git a/src/test/parse-fail/lex-bad-octal-literal.rs b/src/test/ui/parser/lex-bad-octal-literal.rs similarity index 100% rename from src/test/parse-fail/lex-bad-octal-literal.rs rename to src/test/ui/parser/lex-bad-octal-literal.rs diff --git a/src/test/ui/parser/lex-bad-octal-literal.stderr b/src/test/ui/parser/lex-bad-octal-literal.stderr new file mode 100644 index 0000000000000..342309fdd1ca0 --- /dev/null +++ b/src/test/ui/parser/lex-bad-octal-literal.stderr @@ -0,0 +1,14 @@ +error: invalid digit for a base 8 literal + --> $DIR/lex-bad-octal-literal.rs:14:8 + | +LL | 0o18; //~ ERROR invalid digit for a base 8 literal + | ^ + +error: invalid digit for a base 8 literal + --> $DIR/lex-bad-octal-literal.rs:15:12 + | +LL | 0o1234_9_5670; //~ ERROR invalid digit for a base 8 literal + | ^ + +error: aborting due to 2 previous errors + diff --git a/src/test/parse-fail/lex-bad-token.rs b/src/test/ui/parser/lex-bad-token.rs similarity index 100% rename from src/test/parse-fail/lex-bad-token.rs rename to src/test/ui/parser/lex-bad-token.rs diff --git a/src/test/ui/parser/lex-bad-token.stderr b/src/test/ui/parser/lex-bad-token.stderr new file mode 100644 index 0000000000000..6e2cd9995ca18 --- /dev/null +++ b/src/test/ui/parser/lex-bad-token.stderr @@ -0,0 +1,8 @@ +error: unknown start of token: /u{25cf} + --> $DIR/lex-bad-token.rs:13:1 + | +LL | ● //~ ERROR: unknown start of token + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/lex-bare-cr-string-literal-doc-comment.rs b/src/test/ui/parser/lex-bare-cr-string-literal-doc-comment.rs similarity index 100% rename from src/test/parse-fail/lex-bare-cr-string-literal-doc-comment.rs rename to src/test/ui/parser/lex-bare-cr-string-literal-doc-comment.rs diff --git a/src/test/ui/parser/lex-bare-cr-string-literal-doc-comment.stderr b/src/test/ui/parser/lex-bare-cr-string-literal-doc-comment.stderr new file mode 100644 index 0000000000000..799836759e65a --- /dev/null +++ b/src/test/ui/parser/lex-bare-cr-string-literal-doc-comment.stderr @@ -0,0 +1,50 @@ +error: bare CR not allowed in doc-comment + --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:15:32 + | +LL | /// doc comment with bare CR: ' ' + | ^ + +error: bare CR not allowed in block doc-comment + --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:19:38 + | +LL | /** block doc comment with bare CR: ' ' */ + | ^ + +error: bare CR not allowed in doc-comment + --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:24:36 + | +LL | //! doc comment with bare CR: ' ' + | ^ + +error: bare CR not allowed in block doc-comment + --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:27:42 + | +LL | /*! block doc comment with bare CR: ' ' */ + | ^ + +error: bare CR not allowed in string, use /r instead + --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:31:18 + | +LL | let _s = "foo bar"; //~ ERROR: bare CR not allowed in string + | ^ + +error: bare CR not allowed in raw string, use /r instead + --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:34:14 + | +LL | let _s = r"bar foo"; //~ ERROR: bare CR not allowed in raw string + | ^^^^^ + +error: unknown character escape: /r + --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:37:19 + | +LL | let _s = "foo/ bar"; //~ ERROR: unknown character escape: /r + | ^ + | +help: this is an isolated carriage return; consider checking your editor and version control settings + --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:37:19 + | +LL | let _s = "foo/ bar"; //~ ERROR: unknown character escape: /r + | ^ + +error: aborting due to 7 previous errors + diff --git a/src/test/parse-fail/lex-stray-backslash.rs b/src/test/ui/parser/lex-stray-backslash.rs similarity index 100% rename from src/test/parse-fail/lex-stray-backslash.rs rename to src/test/ui/parser/lex-stray-backslash.rs diff --git a/src/test/ui/parser/lex-stray-backslash.stderr b/src/test/ui/parser/lex-stray-backslash.stderr new file mode 100644 index 0000000000000..d4ccb6f145957 --- /dev/null +++ b/src/test/ui/parser/lex-stray-backslash.stderr @@ -0,0 +1,8 @@ +error: unknown start of token: / + --> $DIR/lex-stray-backslash.rs:13:1 + | +LL | / //~ ERROR: unknown start of token: / + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/lifetime-in-pattern.rs b/src/test/ui/parser/lifetime-in-pattern.rs similarity index 94% rename from src/test/parse-fail/lifetime-in-pattern.rs rename to src/test/ui/parser/lifetime-in-pattern.rs index 8802497ae1bfd..ccabcdf2d7506 100644 --- a/src/test/parse-fail/lifetime-in-pattern.rs +++ b/src/test/ui/parser/lifetime-in-pattern.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + fn test(&'a str) { //~^ ERROR unexpected lifetime `'a` in pattern } diff --git a/src/test/ui/parser/lifetime-in-pattern.stderr b/src/test/ui/parser/lifetime-in-pattern.stderr new file mode 100644 index 0000000000000..86cc3c5b0cbe9 --- /dev/null +++ b/src/test/ui/parser/lifetime-in-pattern.stderr @@ -0,0 +1,8 @@ +error: unexpected lifetime `'a` in pattern + --> $DIR/lifetime-in-pattern.rs:13:10 + | +LL | fn test(&'a str) { + | ^^ unexpected lifetime + +error: aborting due to previous error + diff --git a/src/test/parse-fail/lifetime-semicolon.rs b/src/test/ui/parser/lifetime-semicolon.rs similarity index 100% rename from src/test/parse-fail/lifetime-semicolon.rs rename to src/test/ui/parser/lifetime-semicolon.rs diff --git a/src/test/ui/parser/lifetime-semicolon.stderr b/src/test/ui/parser/lifetime-semicolon.stderr new file mode 100644 index 0000000000000..2ce6d5d6cf348 --- /dev/null +++ b/src/test/ui/parser/lifetime-semicolon.stderr @@ -0,0 +1,8 @@ +error: expected one of `,` or `>`, found `;` + --> $DIR/lifetime-semicolon.rs:17:30 + | +LL | fn foo<'a, 'b>(x: &mut Foo<'a; 'b>) {} + | ^ expected one of `,` or `>` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/macro-bad-delimiter-ident.rs b/src/test/ui/parser/macro-bad-delimiter-ident.rs similarity index 100% rename from src/test/parse-fail/macro-bad-delimiter-ident.rs rename to src/test/ui/parser/macro-bad-delimiter-ident.rs diff --git a/src/test/ui/parser/macro-bad-delimiter-ident.stderr b/src/test/ui/parser/macro-bad-delimiter-ident.stderr new file mode 100644 index 0000000000000..e1ae9892f74fe --- /dev/null +++ b/src/test/ui/parser/macro-bad-delimiter-ident.stderr @@ -0,0 +1,8 @@ +error: expected `(` or `{`, found `<` + --> $DIR/macro-bad-delimiter-ident.rs:14:14 + | +LL | foo! bar < //~ ERROR expected `(` or `{`, found `<` + | ^ expected `(` or `{` + +error: aborting due to previous error + diff --git a/src/test/parse-fail/macro-keyword.rs b/src/test/ui/parser/macro-keyword.rs similarity index 100% rename from src/test/parse-fail/macro-keyword.rs rename to src/test/ui/parser/macro-keyword.rs diff --git a/src/test/ui/parser/macro-keyword.stderr b/src/test/ui/parser/macro-keyword.stderr new file mode 100644 index 0000000000000..a558262353549 --- /dev/null +++ b/src/test/ui/parser/macro-keyword.stderr @@ -0,0 +1,8 @@ +error: expected identifier, found reserved keyword `macro` + --> $DIR/macro-keyword.rs:13:4 + | +LL | fn macro() { //~ ERROR expected identifier, found reserved keyword `macro` + | ^^^^^ expected identifier, found reserved keyword + +error: aborting due to previous error + diff --git a/src/test/parse-fail/macro-mismatched-delim-brace-paren.rs b/src/test/ui/parser/macro-mismatched-delim-brace-paren.rs similarity index 100% rename from src/test/parse-fail/macro-mismatched-delim-brace-paren.rs rename to src/test/ui/parser/macro-mismatched-delim-brace-paren.rs diff --git a/src/test/ui/parser/macro-mismatched-delim-brace-paren.stderr b/src/test/ui/parser/macro-mismatched-delim-brace-paren.stderr new file mode 100644 index 0000000000000..69bd40fbb24f6 --- /dev/null +++ b/src/test/ui/parser/macro-mismatched-delim-brace-paren.stderr @@ -0,0 +1,11 @@ +error: incorrect close delimiter: `)` + --> $DIR/macro-mismatched-delim-brace-paren.rs:16:5 + | +LL | foo! { + | - un-closed delimiter +LL | bar, "baz", 1, 2.0 +LL | ) //~ ERROR incorrect close delimiter + | ^ incorrect close delimiter + +error: aborting due to previous error + diff --git a/src/test/parse-fail/macro-mismatched-delim-paren-brace.rs b/src/test/ui/parser/macro-mismatched-delim-paren-brace.rs similarity index 100% rename from src/test/parse-fail/macro-mismatched-delim-paren-brace.rs rename to src/test/ui/parser/macro-mismatched-delim-paren-brace.rs diff --git a/src/test/ui/parser/macro-mismatched-delim-paren-brace.stderr b/src/test/ui/parser/macro-mismatched-delim-paren-brace.stderr new file mode 100644 index 0000000000000..6fe7926f4e1df --- /dev/null +++ b/src/test/ui/parser/macro-mismatched-delim-paren-brace.stderr @@ -0,0 +1,17 @@ +error: incorrect close delimiter: `}` + --> $DIR/macro-mismatched-delim-paren-brace.rs:16:5 + | +LL | foo! ( + | - un-closed delimiter +LL | bar, "baz", 1, 2.0 +LL | } //~ ERROR incorrect close delimiter + | ^ incorrect close delimiter + +error: unexpected close delimiter: `}` + --> $DIR/macro-mismatched-delim-paren-brace.rs:17:1 + | +LL | } //~ ERROR unexpected close delimiter: `}` + | ^ unexpected close delimiter + +error: aborting due to 2 previous errors + diff --git a/src/test/parse-fail/issue-33569.rs b/src/test/ui/parser/macro/issue-33569.rs similarity index 95% rename from src/test/parse-fail/issue-33569.rs rename to src/test/ui/parser/macro/issue-33569.rs index 15d491719a6d5..a0b959ecea521 100644 --- a/src/test/parse-fail/issue-33569.rs +++ b/src/test/ui/parser/macro/issue-33569.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// compile-flags: -Z no-analysis - macro_rules! foo { { $+ } => { //~ ERROR expected identifier, found `+` //~^ ERROR missing fragment specifier diff --git a/src/test/ui/parser/macro/issue-33569.stderr b/src/test/ui/parser/macro/issue-33569.stderr new file mode 100644 index 0000000000000..4dab8fc73f3e3 --- /dev/null +++ b/src/test/ui/parser/macro/issue-33569.stderr @@ -0,0 +1,20 @@ +error: expected identifier, found `+` + --> $DIR/issue-33569.rs:12:8 + | +LL | { $+ } => { //~ ERROR expected identifier, found `+` + | ^ + +error: expected `*` or `+` + --> $DIR/issue-33569.rs:14:13 + | +LL | $(x)(y) //~ ERROR expected `*` or `+` + | ^^^ + +error: missing fragment specifier + --> $DIR/issue-33569.rs:12:8 + | +LL | { $+ } => { //~ ERROR expected identifier, found `+` + | ^ + +error: aborting due to 3 previous errors + diff --git a/src/test/parse-fail/issue-37113.rs b/src/test/ui/parser/macro/issue-37113.rs similarity index 100% rename from src/test/parse-fail/issue-37113.rs rename to src/test/ui/parser/macro/issue-37113.rs diff --git a/src/test/ui/parser/macro/issue-37113.stderr b/src/test/ui/parser/macro/issue-37113.stderr new file mode 100644 index 0000000000000..1e8f017e1db76 --- /dev/null +++ b/src/test/ui/parser/macro/issue-37113.stderr @@ -0,0 +1,11 @@ +error: expected identifier, found `String` + --> $DIR/issue-37113.rs:14:16 + | +LL | $( $t, )* //~ ERROR expected identifier, found `String` + | ^^ expected identifier +... +LL | test_macro!(String,); + | --------------------- in this macro invocation + +error: aborting due to previous error + diff --git a/src/test/parse-fail/issue-37234.rs b/src/test/ui/parser/macro/issue-37234.rs similarity index 100% rename from src/test/parse-fail/issue-37234.rs rename to src/test/ui/parser/macro/issue-37234.rs diff --git a/src/test/ui/parser/macro/issue-37234.stderr b/src/test/ui/parser/macro/issue-37234.stderr new file mode 100644 index 0000000000000..28dd71316aaac --- /dev/null +++ b/src/test/ui/parser/macro/issue-37234.stderr @@ -0,0 +1,11 @@ +error: expected one of `.`, `;`, `?`, or an operator, found `""` + --> $DIR/issue-37234.rs:13:19 + | +LL | let x = 5 ""; //~ ERROR found `""` + | ^^ expected one of `.`, `;`, `?`, or an operator here +... +LL | failed!(); + | ---------- in this macro invocation + +error: aborting due to previous error + diff --git a/src/test/parse-fail/macro-doc-comments-1.rs b/src/test/ui/parser/macro/macro-doc-comments-1.rs similarity index 100% rename from src/test/parse-fail/macro-doc-comments-1.rs rename to src/test/ui/parser/macro/macro-doc-comments-1.rs diff --git a/src/test/ui/parser/macro/macro-doc-comments-1.stderr b/src/test/ui/parser/macro/macro-doc-comments-1.stderr new file mode 100644 index 0000000000000..a7fdd28b0cab8 --- /dev/null +++ b/src/test/ui/parser/macro/macro-doc-comments-1.stderr @@ -0,0 +1,8 @@ +error: no rules expected the token `!` + --> $DIR/macro-doc-comments-1.rs:16:5 + | +LL | //! Inner + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/macro-doc-comments-2.rs b/src/test/ui/parser/macro/macro-doc-comments-2.rs similarity index 100% rename from src/test/parse-fail/macro-doc-comments-2.rs rename to src/test/ui/parser/macro/macro-doc-comments-2.rs diff --git a/src/test/ui/parser/macro/macro-doc-comments-2.stderr b/src/test/ui/parser/macro/macro-doc-comments-2.stderr new file mode 100644 index 0000000000000..bae9823b9b2fa --- /dev/null +++ b/src/test/ui/parser/macro/macro-doc-comments-2.stderr @@ -0,0 +1,8 @@ +error: no rules expected the token `[` + --> $DIR/macro-doc-comments-2.rs:16:5 + | +LL | /// Outer + | ^ + +error: aborting due to previous error + diff --git a/src/test/ui/token/macro-incomplete-parse.rs b/src/test/ui/parser/macro/macro-incomplete-parse.rs similarity index 100% rename from src/test/ui/token/macro-incomplete-parse.rs rename to src/test/ui/parser/macro/macro-incomplete-parse.rs diff --git a/src/test/ui/token/macro-incomplete-parse.stderr b/src/test/ui/parser/macro/macro-incomplete-parse.stderr similarity index 100% rename from src/test/ui/token/macro-incomplete-parse.stderr rename to src/test/ui/parser/macro/macro-incomplete-parse.stderr diff --git a/src/test/parse-fail/macro-repeat.rs b/src/test/ui/parser/macro/macro-repeat.rs similarity index 100% rename from src/test/parse-fail/macro-repeat.rs rename to src/test/ui/parser/macro/macro-repeat.rs diff --git a/src/test/ui/parser/macro/macro-repeat.stderr b/src/test/ui/parser/macro/macro-repeat.stderr new file mode 100644 index 0000000000000..7c7a2fb12c313 --- /dev/null +++ b/src/test/ui/parser/macro/macro-repeat.stderr @@ -0,0 +1,8 @@ +error: variable 'v' is still repeating at this depth + --> $DIR/macro-repeat.rs:13:9 + | +LL | $v //~ ERROR still repeating at this depth + | ^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/pub-item-macro.rs b/src/test/ui/parser/macro/pub-item-macro.rs similarity index 100% rename from src/test/parse-fail/pub-item-macro.rs rename to src/test/ui/parser/macro/pub-item-macro.rs diff --git a/src/test/ui/parser/macro/pub-item-macro.stderr b/src/test/ui/parser/macro/pub-item-macro.stderr new file mode 100644 index 0000000000000..f55ba469ab435 --- /dev/null +++ b/src/test/ui/parser/macro/pub-item-macro.stderr @@ -0,0 +1,13 @@ +error: can't qualify macro invocation with `pub` + --> $DIR/pub-item-macro.rs:18:5 + | +LL | pub priv_x!(); //~ ERROR can't qualify macro invocation with `pub` + | ^^^ +... +LL | pub_x!(); + | --------- in this macro invocation + | + = help: try adjusting the macro to put `pub` inside the invocation + +error: aborting due to previous error + diff --git a/src/test/parse-fail/trait-non-item-macros.rs b/src/test/ui/parser/macro/trait-non-item-macros.rs similarity index 100% rename from src/test/parse-fail/trait-non-item-macros.rs rename to src/test/ui/parser/macro/trait-non-item-macros.rs diff --git a/src/test/ui/parser/macro/trait-non-item-macros.stderr b/src/test/ui/parser/macro/trait-non-item-macros.stderr new file mode 100644 index 0000000000000..2f4fdbfbc2b6e --- /dev/null +++ b/src/test/ui/parser/macro/trait-non-item-macros.stderr @@ -0,0 +1,11 @@ +error: expected one of `async`, `const`, `extern`, `fn`, `type`, or `unsafe`, found `2` + --> $DIR/trait-non-item-macros.rs:12:19 + | +LL | ($a:expr) => ($a) + | ^^ unexpected token +... +LL | bah!(2); + | -------- in this macro invocation + +error: aborting due to previous error + diff --git a/src/test/parse-fail/trait-object-macro-matcher.rs b/src/test/ui/parser/macro/trait-object-macro-matcher.rs similarity index 100% rename from src/test/parse-fail/trait-object-macro-matcher.rs rename to src/test/ui/parser/macro/trait-object-macro-matcher.rs diff --git a/src/test/ui/parser/macro/trait-object-macro-matcher.stderr b/src/test/ui/parser/macro/trait-object-macro-matcher.stderr new file mode 100644 index 0000000000000..ab536dc585497 --- /dev/null +++ b/src/test/ui/parser/macro/trait-object-macro-matcher.stderr @@ -0,0 +1,8 @@ +error: expected type, found `'static` + --> $DIR/trait-object-macro-matcher.rs:19:8 + | +LL | m!('static); //~ ERROR expected type, found `'static` + | ^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/macros-no-semicolon-items.rs b/src/test/ui/parser/macros-no-semicolon-items.rs similarity index 100% rename from src/test/parse-fail/macros-no-semicolon-items.rs rename to src/test/ui/parser/macros-no-semicolon-items.rs diff --git a/src/test/ui/parser/macros-no-semicolon-items.stderr b/src/test/ui/parser/macros-no-semicolon-items.stderr new file mode 100644 index 0000000000000..1d935f693f16e --- /dev/null +++ b/src/test/ui/parser/macros-no-semicolon-items.stderr @@ -0,0 +1,8 @@ +error: macros that expand to items must either be surrounded with braces or followed by a semicolon + --> $DIR/macros-no-semicolon-items.rs:13:17 + | +LL | macro_rules! foo() //~ ERROR semicolon + | ^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/macros-no-semicolon.rs b/src/test/ui/parser/macros-no-semicolon.rs similarity index 100% rename from src/test/parse-fail/macros-no-semicolon.rs rename to src/test/ui/parser/macros-no-semicolon.rs diff --git a/src/test/ui/parser/macros-no-semicolon.stderr b/src/test/ui/parser/macros-no-semicolon.stderr new file mode 100644 index 0000000000000..9ea9e739a0a0a --- /dev/null +++ b/src/test/ui/parser/macros-no-semicolon.stderr @@ -0,0 +1,10 @@ +error: expected one of `.`, `;`, `?`, `}`, or an operator, found `assert_eq` + --> $DIR/macros-no-semicolon.rs:15:5 + | +LL | assert_eq!(1, 2) + | - expected one of `.`, `;`, `?`, `}`, or an operator here +LL | assert_eq!(3, 4) //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `assert_eq` + | ^^^^^^^^^ unexpected token + +error: aborting due to previous error + diff --git a/src/test/parse-fail/match-arrows-block-then-binop.rs b/src/test/ui/parser/match-arrows-block-then-binop.rs similarity index 100% rename from src/test/parse-fail/match-arrows-block-then-binop.rs rename to src/test/ui/parser/match-arrows-block-then-binop.rs diff --git a/src/test/ui/parser/match-arrows-block-then-binop.stderr b/src/test/ui/parser/match-arrows-block-then-binop.stderr new file mode 100644 index 0000000000000..9293fd14c493a --- /dev/null +++ b/src/test/ui/parser/match-arrows-block-then-binop.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found `+` + --> $DIR/match-arrows-block-then-binop.rs:17:9 + | +LL | } + 5 //~ ERROR expected pattern, found `+` + | ^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/ui/did_you_mean/match-refactor-to-expr.rs b/src/test/ui/parser/match-refactor-to-expr.rs similarity index 100% rename from src/test/ui/did_you_mean/match-refactor-to-expr.rs rename to src/test/ui/parser/match-refactor-to-expr.rs diff --git a/src/test/ui/did_you_mean/match-refactor-to-expr.stderr b/src/test/ui/parser/match-refactor-to-expr.stderr similarity index 100% rename from src/test/ui/did_you_mean/match-refactor-to-expr.stderr rename to src/test/ui/parser/match-refactor-to-expr.stderr diff --git a/src/test/parse-fail/match-vec-invalid.rs b/src/test/ui/parser/match-vec-invalid.rs similarity index 100% rename from src/test/parse-fail/match-vec-invalid.rs rename to src/test/ui/parser/match-vec-invalid.rs diff --git a/src/test/ui/parser/match-vec-invalid.stderr b/src/test/ui/parser/match-vec-invalid.stderr new file mode 100644 index 0000000000000..9050223c644f8 --- /dev/null +++ b/src/test/ui/parser/match-vec-invalid.stderr @@ -0,0 +1,8 @@ +error: expected one of `,` or `@`, found `..` + --> $DIR/match-vec-invalid.rs:16:25 + | +LL | [1, tail.., tail..] => {}, //~ ERROR: expected one of `,` or `@`, found `..` + | ^^ expected one of `,` or `@` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/mod_file_not_exist.rs b/src/test/ui/parser/mod_file_not_exist.rs similarity index 99% rename from src/test/parse-fail/mod_file_not_exist.rs rename to src/test/ui/parser/mod_file_not_exist.rs index 4bc6e706d4284..59b2ebe9f863b 100644 --- a/src/test/parse-fail/mod_file_not_exist.rs +++ b/src/test/ui/parser/mod_file_not_exist.rs @@ -9,7 +9,6 @@ // except according to those terms. // ignore-windows - // compile-flags: -Z parse-only mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file` diff --git a/src/test/ui/parser/mod_file_not_exist.stderr b/src/test/ui/parser/mod_file_not_exist.stderr new file mode 100644 index 0000000000000..a745fc2847bae --- /dev/null +++ b/src/test/ui/parser/mod_file_not_exist.stderr @@ -0,0 +1,11 @@ +error[E0583]: file not found for module `not_a_real_file` + --> $DIR/mod_file_not_exist.rs:14:5 + | +LL | mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file` + | ^^^^^^^^^^^^^^^ + | + = help: name the file either not_a_real_file.rs or not_a_real_file/mod.rs inside the directory "$DIR" + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0583`. diff --git a/src/test/parse-fail/mod_file_not_exist_windows.rs b/src/test/ui/parser/mod_file_not_exist_windows.rs similarity index 74% rename from src/test/parse-fail/mod_file_not_exist_windows.rs rename to src/test/ui/parser/mod_file_not_exist_windows.rs index 5cf821749e945..6ee6792a8a208 100644 --- a/src/test/parse-fail/mod_file_not_exist_windows.rs +++ b/src/test/ui/parser/mod_file_not_exist_windows.rs @@ -8,21 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-android -// ignore-bitrig -// ignore-cloudabi -// ignore-dragonfly -// ignore-emscripten -// ignore-freebsd -// ignore-gnu -// ignore-haiku -// ignore-ios -// ignore-linux -// ignore-macos -// ignore-netbsd -// ignore-openbsd -// ignore-solaris - +// only-windows // compile-flags: -Z parse-only mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file` diff --git a/src/test/ui/parser/mod_file_not_exist_windows.stderr b/src/test/ui/parser/mod_file_not_exist_windows.stderr new file mode 100644 index 0000000000000..695038f8e4dba --- /dev/null +++ b/src/test/ui/parser/mod_file_not_exist_windows.stderr @@ -0,0 +1,11 @@ +error[E0583]: file not found for module `not_a_real_file` + --> $DIR/mod_file_not_exist_windows.rs:14:5 + | +LL | mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file` + | ^^^^^^^^^^^^^^^ + | + = help: name the file either not_a_real_file.rs or not_a_real_file/mod.rs inside the directory "$DIR" + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0583`. diff --git a/src/test/parse-fail/mod_file_with_path_attr.rs b/src/test/ui/parser/mod_file_with_path_attr.rs similarity index 85% rename from src/test/parse-fail/mod_file_with_path_attr.rs rename to src/test/ui/parser/mod_file_with_path_attr.rs index 993232e70ab3b..03aa8edc22924 100644 --- a/src/test/parse-fail/mod_file_with_path_attr.rs +++ b/src/test/ui/parser/mod_file_with_path_attr.rs @@ -9,6 +9,7 @@ // except according to those terms. // compile-flags: -Z parse-only +// normalize-stderr-test: "not_a_real_file.rs:.*\(" -> "not_a_real_file.rs: $$FILE_NOT_FOUND_MSG (" #[path = "not_a_real_file.rs"] mod m; //~ ERROR not_a_real_file.rs diff --git a/src/test/ui/parser/mod_file_with_path_attr.stderr b/src/test/ui/parser/mod_file_with_path_attr.stderr new file mode 100644 index 0000000000000..f4247b60f684d --- /dev/null +++ b/src/test/ui/parser/mod_file_with_path_attr.stderr @@ -0,0 +1,8 @@ +error: couldn't read $DIR/not_a_real_file.rs: $FILE_NOT_FOUND_MSG (os error 2) + --> $DIR/mod_file_with_path_attr.rs:15:5 + | +LL | mod m; //~ ERROR not_a_real_file.rs + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/multiline-comment-line-tracking.rs b/src/test/ui/parser/multiline-comment-line-tracking.rs similarity index 81% rename from src/test/parse-fail/multiline-comment-line-tracking.rs rename to src/test/ui/parser/multiline-comment-line-tracking.rs index 11abe6727455d..44ed0a3706cd7 100644 --- a/src/test/parse-fail/multiline-comment-line-tracking.rs +++ b/src/test/ui/parser/multiline-comment-line-tracking.rs @@ -8,12 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:18:3 +// compile-flags: -Z parse-only +// error-pattern:19:3 /* 1 * 2 * 3 */ fn main() { - %; // parse error on line 18, but is reported on line 6 instead. + %; // parse error on line 19, but is reported on line 6 instead. } diff --git a/src/test/ui/parser/multiline-comment-line-tracking.stderr b/src/test/ui/parser/multiline-comment-line-tracking.stderr new file mode 100644 index 0000000000000..2dba2b1cb7e62 --- /dev/null +++ b/src/test/ui/parser/multiline-comment-line-tracking.stderr @@ -0,0 +1,8 @@ +error: expected expression, found `%` + --> $DIR/multiline-comment-line-tracking.rs:19:3 + | +LL | %; // parse error on line 19, but is reported on line 6 instead. + | ^ expected expression + +error: aborting due to previous error + diff --git a/src/test/parse-fail/multitrait.rs b/src/test/ui/parser/multitrait.rs similarity index 100% rename from src/test/parse-fail/multitrait.rs rename to src/test/ui/parser/multitrait.rs diff --git a/src/test/ui/parser/multitrait.stderr b/src/test/ui/parser/multitrait.stderr new file mode 100644 index 0000000000000..2ccf49d03152c --- /dev/null +++ b/src/test/ui/parser/multitrait.stderr @@ -0,0 +1,8 @@ +error: expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `,` + --> $DIR/multitrait.rs:17:9 + | +LL | impl Cmp, ToString for S { + | ^ expected one of 8 possible tokens here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/mut-patterns.rs b/src/test/ui/parser/mut-patterns.rs similarity index 100% rename from src/test/parse-fail/mut-patterns.rs rename to src/test/ui/parser/mut-patterns.rs diff --git a/src/test/ui/parser/mut-patterns.stderr b/src/test/ui/parser/mut-patterns.stderr new file mode 100644 index 0000000000000..afe24595de473 --- /dev/null +++ b/src/test/ui/parser/mut-patterns.stderr @@ -0,0 +1,8 @@ +error: expected one of `:`, `;`, `=`, or `@`, found `{` + --> $DIR/mut-patterns.rs:17:17 + | +LL | let mut Foo { x: x } = Foo { x: 3 }; //~ ERROR: expected one of `:`, `;`, `=`, or `@`, found `{` + | ^ expected one of `:`, `;`, `=`, or `@` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/new-unicode-escapes-1.rs b/src/test/ui/parser/new-unicode-escapes-1.rs similarity index 100% rename from src/test/parse-fail/new-unicode-escapes-1.rs rename to src/test/ui/parser/new-unicode-escapes-1.rs diff --git a/src/test/ui/parser/new-unicode-escapes-1.stderr b/src/test/ui/parser/new-unicode-escapes-1.stderr new file mode 100644 index 0000000000000..4467b394c932b --- /dev/null +++ b/src/test/ui/parser/new-unicode-escapes-1.stderr @@ -0,0 +1,8 @@ +error: unterminated unicode escape (needed a `}`) + --> $DIR/new-unicode-escapes-1.rs:14:21 + | +LL | let s = "/u{2603"; //~ ERROR unterminated unicode escape (needed a `}`) + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/new-unicode-escapes-2.rs b/src/test/ui/parser/new-unicode-escapes-2.rs similarity index 100% rename from src/test/parse-fail/new-unicode-escapes-2.rs rename to src/test/ui/parser/new-unicode-escapes-2.rs diff --git a/src/test/ui/parser/new-unicode-escapes-2.stderr b/src/test/ui/parser/new-unicode-escapes-2.stderr new file mode 100644 index 0000000000000..54123be421448 --- /dev/null +++ b/src/test/ui/parser/new-unicode-escapes-2.stderr @@ -0,0 +1,8 @@ +error: overlong unicode escape (must have at most 6 hex digits) + --> $DIR/new-unicode-escapes-2.rs:14:17 + | +LL | let s = "/u{260311111111}"; //~ ERROR overlong unicode escape (must have at most 6 hex digits) + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/new-unicode-escapes-3.rs b/src/test/ui/parser/new-unicode-escapes-3.rs similarity index 100% rename from src/test/parse-fail/new-unicode-escapes-3.rs rename to src/test/ui/parser/new-unicode-escapes-3.rs diff --git a/src/test/ui/parser/new-unicode-escapes-3.stderr b/src/test/ui/parser/new-unicode-escapes-3.stderr new file mode 100644 index 0000000000000..65196f91b08d0 --- /dev/null +++ b/src/test/ui/parser/new-unicode-escapes-3.stderr @@ -0,0 +1,18 @@ +error: invalid unicode character escape + --> $DIR/new-unicode-escapes-3.rs:14:14 + | +LL | let s1 = "/u{d805}"; //~ ERROR invalid unicode character escape + | ^^^^^^^^^^ + | + = help: unicode escape must not be a surrogate + +error: invalid unicode character escape + --> $DIR/new-unicode-escapes-3.rs:15:14 + | +LL | let s2 = "/u{ffffff}"; //~ ERROR invalid unicode character escape + | ^^^^^^^^^^^^ + | + = help: unicode escape must be at most 10FFFF + +error: aborting due to 2 previous errors + diff --git a/src/test/parse-fail/new-unicode-escapes-4.rs b/src/test/ui/parser/new-unicode-escapes-4.rs similarity index 100% rename from src/test/parse-fail/new-unicode-escapes-4.rs rename to src/test/ui/parser/new-unicode-escapes-4.rs diff --git a/src/test/ui/parser/new-unicode-escapes-4.stderr b/src/test/ui/parser/new-unicode-escapes-4.stderr new file mode 100644 index 0000000000000..309a77e7df03c --- /dev/null +++ b/src/test/ui/parser/new-unicode-escapes-4.stderr @@ -0,0 +1,8 @@ +error: invalid character in unicode escape: l + --> $DIR/new-unicode-escapes-4.rs:14:17 + | +LL | let s = "/u{lol}"; + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/no-binary-float-literal.rs b/src/test/ui/parser/no-binary-float-literal.rs similarity index 100% rename from src/test/parse-fail/no-binary-float-literal.rs rename to src/test/ui/parser/no-binary-float-literal.rs diff --git a/src/test/ui/parser/no-binary-float-literal.stderr b/src/test/ui/parser/no-binary-float-literal.stderr new file mode 100644 index 0000000000000..db3c3791daf54 --- /dev/null +++ b/src/test/ui/parser/no-binary-float-literal.stderr @@ -0,0 +1,8 @@ +error: binary float literal is not supported + --> $DIR/no-binary-float-literal.rs:17:5 + | +LL | 0b101.010; + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/no-hex-float-literal.rs b/src/test/ui/parser/no-hex-float-literal.rs similarity index 100% rename from src/test/parse-fail/no-hex-float-literal.rs rename to src/test/ui/parser/no-hex-float-literal.rs diff --git a/src/test/ui/parser/no-hex-float-literal.stderr b/src/test/ui/parser/no-hex-float-literal.stderr new file mode 100644 index 0000000000000..dba019baff87f --- /dev/null +++ b/src/test/ui/parser/no-hex-float-literal.stderr @@ -0,0 +1,8 @@ +error: hexadecimal float literal is not supported + --> $DIR/no-hex-float-literal.rs:17:5 + | +LL | 0x567.89; + | ^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/no-unsafe-self.rs b/src/test/ui/parser/no-unsafe-self.rs similarity index 100% rename from src/test/parse-fail/no-unsafe-self.rs rename to src/test/ui/parser/no-unsafe-self.rs diff --git a/src/test/ui/parser/no-unsafe-self.stderr b/src/test/ui/parser/no-unsafe-self.stderr new file mode 100644 index 0000000000000..7fe66bffd8627 --- /dev/null +++ b/src/test/ui/parser/no-unsafe-self.stderr @@ -0,0 +1,38 @@ +error: cannot pass `self` by raw pointer + --> $DIR/no-unsafe-self.rs:14:17 + | +LL | fn foo(*mut self); //~ ERROR cannot pass `self` by raw pointer + | ^^^^ + +error: cannot pass `self` by raw pointer + --> $DIR/no-unsafe-self.rs:15:19 + | +LL | fn baz(*const self); //~ ERROR cannot pass `self` by raw pointer + | ^^^^ + +error: cannot pass `self` by raw pointer + --> $DIR/no-unsafe-self.rs:16:13 + | +LL | fn bar(*self); //~ ERROR cannot pass `self` by raw pointer + | ^^^^ + +error: cannot pass `self` by raw pointer + --> $DIR/no-unsafe-self.rs:21:17 + | +LL | fn foo(*mut self) { } //~ ERROR cannot pass `self` by raw pointer + | ^^^^ + +error: cannot pass `self` by raw pointer + --> $DIR/no-unsafe-self.rs:22:19 + | +LL | fn baz(*const self) { } //~ ERROR cannot pass `self` by raw pointer + | ^^^^ + +error: cannot pass `self` by raw pointer + --> $DIR/no-unsafe-self.rs:23:13 + | +LL | fn bar(*self) { } //~ ERROR cannot pass `self` by raw pointer + | ^^^^ + +error: aborting due to 6 previous errors + diff --git a/src/test/parse-fail/not-a-pred.rs b/src/test/ui/parser/not-a-pred.rs similarity index 100% rename from src/test/parse-fail/not-a-pred.rs rename to src/test/ui/parser/not-a-pred.rs diff --git a/src/test/ui/parser/not-a-pred.stderr b/src/test/ui/parser/not-a-pred.stderr new file mode 100644 index 0000000000000..1555804373778 --- /dev/null +++ b/src/test/ui/parser/not-a-pred.stderr @@ -0,0 +1,8 @@ +error: expected one of `->`, `where`, or `{`, found `:` + --> $DIR/not-a-pred.rs:15:26 + | +LL | fn f(a: isize, b: isize) : lt(a, b) { } + | ^ expected one of `->`, `where`, or `{` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/omitted-arg-in-item-fn.rs b/src/test/ui/parser/omitted-arg-in-item-fn.rs similarity index 100% rename from src/test/parse-fail/omitted-arg-in-item-fn.rs rename to src/test/ui/parser/omitted-arg-in-item-fn.rs diff --git a/src/test/ui/parser/omitted-arg-in-item-fn.stderr b/src/test/ui/parser/omitted-arg-in-item-fn.stderr new file mode 100644 index 0000000000000..4e051b6206f27 --- /dev/null +++ b/src/test/ui/parser/omitted-arg-in-item-fn.stderr @@ -0,0 +1,8 @@ +error: expected one of `:` or `@`, found `)` + --> $DIR/omitted-arg-in-item-fn.rs:13:9 + | +LL | fn foo(x) { //~ ERROR expected one of `:` or `@`, found `)` + | ^ expected one of `:` or `@` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/paamayim-nekudotayim.rs b/src/test/ui/parser/paamayim-nekudotayim.rs similarity index 100% rename from src/test/parse-fail/paamayim-nekudotayim.rs rename to src/test/ui/parser/paamayim-nekudotayim.rs diff --git a/src/test/ui/parser/paamayim-nekudotayim.stderr b/src/test/ui/parser/paamayim-nekudotayim.stderr new file mode 100644 index 0000000000000..68912f52dc105 --- /dev/null +++ b/src/test/ui/parser/paamayim-nekudotayim.stderr @@ -0,0 +1,8 @@ +error: expected identifier, found `;` + --> $DIR/paamayim-nekudotayim.rs:16:7 + | +LL | ::; //~ ERROR expected identifier, found `;` + | ^ expected identifier + +error: aborting due to previous error + diff --git a/src/test/parse-fail/paren-after-qualified-path-in-match.rs b/src/test/ui/parser/paren-after-qualified-path-in-match.rs similarity index 100% rename from src/test/parse-fail/paren-after-qualified-path-in-match.rs rename to src/test/ui/parser/paren-after-qualified-path-in-match.rs diff --git a/src/test/ui/parser/paren-after-qualified-path-in-match.stderr b/src/test/ui/parser/paren-after-qualified-path-in-match.stderr new file mode 100644 index 0000000000000..df3a5011fd874 --- /dev/null +++ b/src/test/ui/parser/paren-after-qualified-path-in-match.stderr @@ -0,0 +1,8 @@ +error: unexpected `(` after qualified path + --> $DIR/paren-after-qualified-path-in-match.rs:15:27 + | +LL | ::Type(2) => (), + | ^ unexpected `(` after qualified path + +error: aborting due to previous error + diff --git a/src/test/parse-fail/pat-lt-bracket-1.rs b/src/test/ui/parser/pat-lt-bracket-1.rs similarity index 94% rename from src/test/parse-fail/pat-lt-bracket-1.rs rename to src/test/ui/parser/pat-lt-bracket-1.rs index 6d3d120778830..fc1957571b1cb 100644 --- a/src/test/parse-fail/pat-lt-bracket-1.rs +++ b/src/test/ui/parser/pat-lt-bracket-1.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + fn main() { match 42 { x < 7 => (), diff --git a/src/test/ui/parser/pat-lt-bracket-1.stderr b/src/test/ui/parser/pat-lt-bracket-1.stderr new file mode 100644 index 0000000000000..5ab5ce2649a52 --- /dev/null +++ b/src/test/ui/parser/pat-lt-bracket-1.stderr @@ -0,0 +1,8 @@ +error: expected one of `=>`, `@`, `if`, or `|`, found `<` + --> $DIR/pat-lt-bracket-1.rs:15:7 + | +LL | x < 7 => (), + | ^ expected one of `=>`, `@`, `if`, or `|` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/pat-lt-bracket-2.rs b/src/test/ui/parser/pat-lt-bracket-2.rs similarity index 94% rename from src/test/parse-fail/pat-lt-bracket-2.rs rename to src/test/ui/parser/pat-lt-bracket-2.rs index 6a0653041d45b..a88e83847110e 100644 --- a/src/test/parse-fail/pat-lt-bracket-2.rs +++ b/src/test/ui/parser/pat-lt-bracket-2.rs @@ -8,5 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + fn a(B<) {} //~^ error: expected one of `:` or `@`, found `<` diff --git a/src/test/ui/parser/pat-lt-bracket-2.stderr b/src/test/ui/parser/pat-lt-bracket-2.stderr new file mode 100644 index 0000000000000..d0d815045e0e2 --- /dev/null +++ b/src/test/ui/parser/pat-lt-bracket-2.stderr @@ -0,0 +1,8 @@ +error: expected one of `:` or `@`, found `<` + --> $DIR/pat-lt-bracket-2.rs:13:7 + | +LL | fn a(B<) {} + | ^ expected one of `:` or `@` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/pat-lt-bracket-3.rs b/src/test/ui/parser/pat-lt-bracket-3.rs similarity index 95% rename from src/test/parse-fail/pat-lt-bracket-3.rs rename to src/test/ui/parser/pat-lt-bracket-3.rs index 8ea2bcf900c97..1a3f7aa818290 100644 --- a/src/test/parse-fail/pat-lt-bracket-3.rs +++ b/src/test/ui/parser/pat-lt-bracket-3.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + struct Foo(T, T); impl Foo { diff --git a/src/test/ui/parser/pat-lt-bracket-3.stderr b/src/test/ui/parser/pat-lt-bracket-3.stderr new file mode 100644 index 0000000000000..1be61b1a12b99 --- /dev/null +++ b/src/test/ui/parser/pat-lt-bracket-3.stderr @@ -0,0 +1,8 @@ +error: expected one of `=>`, `@`, `if`, or `|`, found `<` + --> $DIR/pat-lt-bracket-3.rs:18:16 + | +LL | Foo(x, y) => { + | ^ expected one of `=>`, `@`, `if`, or `|` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/pat-lt-bracket-4.rs b/src/test/ui/parser/pat-lt-bracket-4.rs similarity index 100% rename from src/test/parse-fail/pat-lt-bracket-4.rs rename to src/test/ui/parser/pat-lt-bracket-4.rs diff --git a/src/test/ui/parser/pat-lt-bracket-4.stderr b/src/test/ui/parser/pat-lt-bracket-4.stderr new file mode 100644 index 0000000000000..4a0dec1b5c6da --- /dev/null +++ b/src/test/ui/parser/pat-lt-bracket-4.stderr @@ -0,0 +1,8 @@ +error: expected one of `=>`, `@`, `if`, or `|`, found `<` + --> $DIR/pat-lt-bracket-4.rs:20:12 + | +LL | Foo::A(value) => value, //~ error: expected one of `=>`, `@`, `if`, or `|`, found `<` + | ^ expected one of `=>`, `@`, `if`, or `|` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/pat-lt-bracket-5.rs b/src/test/ui/parser/pat-lt-bracket-5.rs similarity index 94% rename from src/test/parse-fail/pat-lt-bracket-5.rs rename to src/test/ui/parser/pat-lt-bracket-5.rs index 421d7a05befff..160b985dc6e9f 100644 --- a/src/test/parse-fail/pat-lt-bracket-5.rs +++ b/src/test/ui/parser/pat-lt-bracket-5.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + fn main() { let v[0] = v[1]; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[` } diff --git a/src/test/ui/parser/pat-lt-bracket-5.stderr b/src/test/ui/parser/pat-lt-bracket-5.stderr new file mode 100644 index 0000000000000..6174ed63007fd --- /dev/null +++ b/src/test/ui/parser/pat-lt-bracket-5.stderr @@ -0,0 +1,8 @@ +error: expected one of `:`, `;`, `=`, or `@`, found `[` + --> $DIR/pat-lt-bracket-5.rs:14:10 + | +LL | let v[0] = v[1]; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[` + | ^ expected one of `:`, `;`, `=`, or `@` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/pat-lt-bracket-6.rs b/src/test/ui/parser/pat-lt-bracket-6.rs similarity index 94% rename from src/test/parse-fail/pat-lt-bracket-6.rs rename to src/test/ui/parser/pat-lt-bracket-6.rs index fb78e558a951a..eaea9f4acd791 100644 --- a/src/test/parse-fail/pat-lt-bracket-6.rs +++ b/src/test/ui/parser/pat-lt-bracket-6.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + fn main() { let Test(&desc[..]) = x; //~ ERROR: expected one of `)`, `,`, or `@`, found `[` } diff --git a/src/test/ui/parser/pat-lt-bracket-6.stderr b/src/test/ui/parser/pat-lt-bracket-6.stderr new file mode 100644 index 0000000000000..9666f18fac5bf --- /dev/null +++ b/src/test/ui/parser/pat-lt-bracket-6.stderr @@ -0,0 +1,8 @@ +error: expected one of `)`, `,`, or `@`, found `[` + --> $DIR/pat-lt-bracket-6.rs:14:19 + | +LL | let Test(&desc[..]) = x; //~ ERROR: expected one of `)`, `,`, or `@`, found `[` + | ^ expected one of `)`, `,`, or `@` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/pat-lt-bracket-7.rs b/src/test/ui/parser/pat-lt-bracket-7.rs similarity index 94% rename from src/test/parse-fail/pat-lt-bracket-7.rs rename to src/test/ui/parser/pat-lt-bracket-7.rs index d75589d8889e3..ac1c1f7ee1f63 100644 --- a/src/test/parse-fail/pat-lt-bracket-7.rs +++ b/src/test/ui/parser/pat-lt-bracket-7.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + fn main() { for thing(x[]) in foo {} //~ ERROR: expected one of `)`, `,`, or `@`, found `[` } diff --git a/src/test/ui/parser/pat-lt-bracket-7.stderr b/src/test/ui/parser/pat-lt-bracket-7.stderr new file mode 100644 index 0000000000000..09a398fb2b0b8 --- /dev/null +++ b/src/test/ui/parser/pat-lt-bracket-7.stderr @@ -0,0 +1,8 @@ +error: expected one of `)`, `,`, or `@`, found `[` + --> $DIR/pat-lt-bracket-7.rs:14:16 + | +LL | for thing(x[]) in foo {} //~ ERROR: expected one of `)`, `,`, or `@`, found `[` + | ^ expected one of `)`, `,`, or `@` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/pat-ranges-1.rs b/src/test/ui/parser/pat-ranges-1.rs similarity index 94% rename from src/test/parse-fail/pat-ranges-1.rs rename to src/test/ui/parser/pat-ranges-1.rs index 857a3924aec01..7aa0287101806 100644 --- a/src/test/parse-fail/pat-ranges-1.rs +++ b/src/test/ui/parser/pat-ranges-1.rs @@ -10,6 +10,8 @@ // Parsing of range patterns +// compile-flags: -Z parse-only + fn main() { let macropus!() ..= 11 = 12; //~ error: expected one of `:`, `;`, or `=`, found `..=` } diff --git a/src/test/ui/parser/pat-ranges-1.stderr b/src/test/ui/parser/pat-ranges-1.stderr new file mode 100644 index 0000000000000..61d1bf258fe59 --- /dev/null +++ b/src/test/ui/parser/pat-ranges-1.stderr @@ -0,0 +1,8 @@ +error: expected one of `:`, `;`, or `=`, found `..=` + --> $DIR/pat-ranges-1.rs:16:21 + | +LL | let macropus!() ..= 11 = 12; //~ error: expected one of `:`, `;`, or `=`, found `..=` + | ^^^ expected one of `:`, `;`, or `=` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/pat-ranges-2.rs b/src/test/ui/parser/pat-ranges-2.rs similarity index 94% rename from src/test/parse-fail/pat-ranges-2.rs rename to src/test/ui/parser/pat-ranges-2.rs index 64c749333cf4a..123aa0d5088ec 100644 --- a/src/test/parse-fail/pat-ranges-2.rs +++ b/src/test/ui/parser/pat-ranges-2.rs @@ -10,6 +10,8 @@ // Parsing of range patterns +// compile-flags: -Z parse-only + fn main() { let 10 ..= makropulos!() = 12; //~ error: expected one of `::`, `:`, `;`, or `=`, found `!` } diff --git a/src/test/ui/parser/pat-ranges-2.stderr b/src/test/ui/parser/pat-ranges-2.stderr new file mode 100644 index 0000000000000..29f641f2be444 --- /dev/null +++ b/src/test/ui/parser/pat-ranges-2.stderr @@ -0,0 +1,8 @@ +error: expected one of `::`, `:`, `;`, or `=`, found `!` + --> $DIR/pat-ranges-2.rs:16:26 + | +LL | let 10 ..= makropulos!() = 12; //~ error: expected one of `::`, `:`, `;`, or `=`, found `!` + | ^ expected one of `::`, `:`, `;`, or `=` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/pat-ranges-3.rs b/src/test/ui/parser/pat-ranges-3.rs similarity index 94% rename from src/test/parse-fail/pat-ranges-3.rs rename to src/test/ui/parser/pat-ranges-3.rs index 1327a9fab3661..6384b6062195b 100644 --- a/src/test/parse-fail/pat-ranges-3.rs +++ b/src/test/ui/parser/pat-ranges-3.rs @@ -10,6 +10,8 @@ // Parsing of range patterns +// compile-flags: -Z parse-only + fn main() { let 10 ..= 10 + 3 = 12; //~ expected one of `:`, `;`, or `=`, found `+` } diff --git a/src/test/ui/parser/pat-ranges-3.stderr b/src/test/ui/parser/pat-ranges-3.stderr new file mode 100644 index 0000000000000..c78c43cddbf3a --- /dev/null +++ b/src/test/ui/parser/pat-ranges-3.stderr @@ -0,0 +1,8 @@ +error: expected one of `:`, `;`, or `=`, found `+` + --> $DIR/pat-ranges-3.rs:16:19 + | +LL | let 10 ..= 10 + 3 = 12; //~ expected one of `:`, `;`, or `=`, found `+` + | ^ expected one of `:`, `;`, or `=` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/pat-ranges-4.rs b/src/test/ui/parser/pat-ranges-4.rs similarity index 94% rename from src/test/parse-fail/pat-ranges-4.rs rename to src/test/ui/parser/pat-ranges-4.rs index c159c7702502d..023e5b4079767 100644 --- a/src/test/parse-fail/pat-ranges-4.rs +++ b/src/test/ui/parser/pat-ranges-4.rs @@ -10,6 +10,8 @@ // Parsing of range patterns +// compile-flags: -Z parse-only + fn main() { let 10 - 3 ..= 10 = 8; //~^ error: expected one of `...`, `..=`, `..`, `:`, `;`, or `=`, found `-` diff --git a/src/test/ui/parser/pat-ranges-4.stderr b/src/test/ui/parser/pat-ranges-4.stderr new file mode 100644 index 0000000000000..40b7fc8f7532a --- /dev/null +++ b/src/test/ui/parser/pat-ranges-4.stderr @@ -0,0 +1,8 @@ +error: expected one of `...`, `..=`, `..`, `:`, `;`, or `=`, found `-` + --> $DIR/pat-ranges-4.rs:16:12 + | +LL | let 10 - 3 ..= 10 = 8; + | ^ expected one of `...`, `..=`, `..`, `:`, `;`, or `=` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/pat-ref-enum.rs b/src/test/ui/parser/pat-ref-enum.rs similarity index 100% rename from src/test/parse-fail/pat-ref-enum.rs rename to src/test/ui/parser/pat-ref-enum.rs diff --git a/src/test/ui/parser/pat-ref-enum.stderr b/src/test/ui/parser/pat-ref-enum.stderr new file mode 100644 index 0000000000000..5e39b6d8fa9a0 --- /dev/null +++ b/src/test/ui/parser/pat-ref-enum.stderr @@ -0,0 +1,8 @@ +error: expected identifier, found enum pattern + --> $DIR/pat-ref-enum.rs:15:11 + | +LL | ref Some(i) => {} //~ ERROR expected identifier, found enum pattern + | ^^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/pat-tuple-1.rs b/src/test/ui/parser/pat-tuple-1.rs similarity index 100% rename from src/test/parse-fail/pat-tuple-1.rs rename to src/test/ui/parser/pat-tuple-1.rs diff --git a/src/test/ui/parser/pat-tuple-1.stderr b/src/test/ui/parser/pat-tuple-1.stderr new file mode 100644 index 0000000000000..eb970e6e22077 --- /dev/null +++ b/src/test/ui/parser/pat-tuple-1.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found `,` + --> $DIR/pat-tuple-1.rs:15:10 + | +LL | (, ..) => {} //~ ERROR expected pattern, found `,` + | ^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/pat-tuple-2.rs b/src/test/ui/parser/pat-tuple-2.rs similarity index 100% rename from src/test/parse-fail/pat-tuple-2.rs rename to src/test/ui/parser/pat-tuple-2.rs diff --git a/src/test/ui/parser/pat-tuple-2.stderr b/src/test/ui/parser/pat-tuple-2.stderr new file mode 100644 index 0000000000000..cedc98ace6463 --- /dev/null +++ b/src/test/ui/parser/pat-tuple-2.stderr @@ -0,0 +1,8 @@ +error: trailing comma is not permitted after `..` + --> $DIR/pat-tuple-2.rs:15:17 + | +LL | (pat, ..,) => {} //~ ERROR trailing comma is not permitted after `..` + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/pat-tuple-3.rs b/src/test/ui/parser/pat-tuple-3.rs similarity index 100% rename from src/test/parse-fail/pat-tuple-3.rs rename to src/test/ui/parser/pat-tuple-3.rs diff --git a/src/test/ui/parser/pat-tuple-3.stderr b/src/test/ui/parser/pat-tuple-3.stderr new file mode 100644 index 0000000000000..28662f74142bf --- /dev/null +++ b/src/test/ui/parser/pat-tuple-3.stderr @@ -0,0 +1,8 @@ +error: `..` can only be used once per tuple or tuple struct pattern + --> $DIR/pat-tuple-3.rs:15:19 + | +LL | (.., pat, ..) => {} //~ ERROR `..` can only be used once per tuple or tuple struct pattern + | ^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/pat-tuple-4.rs b/src/test/ui/parser/pat-tuple-4.rs similarity index 100% rename from src/test/parse-fail/pat-tuple-4.rs rename to src/test/ui/parser/pat-tuple-4.rs diff --git a/src/test/ui/parser/pat-tuple-4.stderr b/src/test/ui/parser/pat-tuple-4.stderr new file mode 100644 index 0000000000000..586baddc36342 --- /dev/null +++ b/src/test/ui/parser/pat-tuple-4.stderr @@ -0,0 +1,8 @@ +error: expected one of `)` or `,`, found `pat` + --> $DIR/pat-tuple-4.rs:15:13 + | +LL | (.. pat) => {} //~ ERROR expected one of `)` or `,`, found `pat` + | ^^^ expected one of `)` or `,` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/pat-tuple-5.rs b/src/test/ui/parser/pat-tuple-5.rs similarity index 100% rename from src/test/parse-fail/pat-tuple-5.rs rename to src/test/ui/parser/pat-tuple-5.rs diff --git a/src/test/ui/parser/pat-tuple-5.stderr b/src/test/ui/parser/pat-tuple-5.stderr new file mode 100644 index 0000000000000..1e192cfe598ad --- /dev/null +++ b/src/test/ui/parser/pat-tuple-5.stderr @@ -0,0 +1,8 @@ +error: unexpected token: `)` + --> $DIR/pat-tuple-5.rs:15:14 + | +LL | (pat ..) => {} //~ ERROR unexpected token: `)` + | ^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/pub-method-macro.rs b/src/test/ui/parser/pub-method-macro.rs similarity index 96% rename from src/test/parse-fail/pub-method-macro.rs rename to src/test/ui/parser/pub-method-macro.rs index 83db24b8c01ef..817a9465ef3db 100644 --- a/src/test/parse-fail/pub-method-macro.rs +++ b/src/test/ui/parser/pub-method-macro.rs @@ -10,6 +10,8 @@ // Issue #18317 +// compile-flags: -Z parse-only + mod bleh { macro_rules! defn { ($n:ident) => ( diff --git a/src/test/ui/parser/pub-method-macro.stderr b/src/test/ui/parser/pub-method-macro.stderr new file mode 100644 index 0000000000000..91151ce727917 --- /dev/null +++ b/src/test/ui/parser/pub-method-macro.stderr @@ -0,0 +1,10 @@ +error: can't qualify macro invocation with `pub` + --> $DIR/pub-method-macro.rs:29:9 + | +LL | pub defn!(f); //~ ERROR can't qualify macro invocation with `pub` + | ^^^ + | + = help: try adjusting the macro to put `pub` inside the invocation + +error: aborting due to previous error + diff --git a/src/test/parse-fail/range-3.rs b/src/test/ui/parser/range-3.rs similarity index 100% rename from src/test/parse-fail/range-3.rs rename to src/test/ui/parser/range-3.rs diff --git a/src/test/ui/parser/range-3.stderr b/src/test/ui/parser/range-3.stderr new file mode 100644 index 0000000000000..b8185862b3a91 --- /dev/null +++ b/src/test/ui/parser/range-3.stderr @@ -0,0 +1,8 @@ +error: expected one of `.`, `;`, `?`, or an operator, found `..` + --> $DIR/range-3.rs:16:17 + | +LL | let r = 1..2..3; + | ^^ expected one of `.`, `;`, `?`, or an operator here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/range-4.rs b/src/test/ui/parser/range-4.rs similarity index 100% rename from src/test/parse-fail/range-4.rs rename to src/test/ui/parser/range-4.rs diff --git a/src/test/ui/parser/range-4.stderr b/src/test/ui/parser/range-4.stderr new file mode 100644 index 0000000000000..b5013f2e00336 --- /dev/null +++ b/src/test/ui/parser/range-4.stderr @@ -0,0 +1,8 @@ +error: expected one of `.`, `;`, `?`, or an operator, found `..` + --> $DIR/range-4.rs:16:16 + | +LL | let r = ..1..2; + | ^^ expected one of `.`, `;`, `?`, or an operator here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/range_inclusive.rs b/src/test/ui/parser/range_inclusive.rs similarity index 95% rename from src/test/parse-fail/range_inclusive.rs rename to src/test/ui/parser/range_inclusive.rs index 2aa7d6d6cd793..0d344cf644439 100644 --- a/src/test/parse-fail/range_inclusive.rs +++ b/src/test/ui/parser/range_inclusive.rs @@ -10,8 +10,9 @@ // Make sure that inclusive ranges with no end point don't parse. +// compile-flags: -Z parse-only + pub fn main() { for _ in 1..= {} //~ERROR inclusive range with no end //~^HELP bounded at the end } - diff --git a/src/test/ui/parser/range_inclusive.stderr b/src/test/ui/parser/range_inclusive.stderr new file mode 100644 index 0000000000000..90b7c089103b1 --- /dev/null +++ b/src/test/ui/parser/range_inclusive.stderr @@ -0,0 +1,11 @@ +error[E0586]: inclusive range with no end + --> $DIR/range_inclusive.rs:16:19 + | +LL | for _ in 1..= {} //~ERROR inclusive range with no end + | ^ + | + = help: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0586`. diff --git a/src/test/parse-fail/range_inclusive_dotdotdot.rs b/src/test/ui/parser/range_inclusive_dotdotdot.rs similarity index 100% rename from src/test/parse-fail/range_inclusive_dotdotdot.rs rename to src/test/ui/parser/range_inclusive_dotdotdot.rs diff --git a/src/test/ui/parser/range_inclusive_dotdotdot.stderr b/src/test/ui/parser/range_inclusive_dotdotdot.stderr new file mode 100644 index 0000000000000..7e1df24fc0640 --- /dev/null +++ b/src/test/ui/parser/range_inclusive_dotdotdot.stderr @@ -0,0 +1,58 @@ +error: unexpected token: `...` + --> $DIR/range_inclusive_dotdotdot.rs:18:12 + | +LL | return ...1; //~ERROR unexpected token: `...` + | ^^^ +help: use `..` for an exclusive range + | +LL | return ..1; //~ERROR unexpected token: `...` + | ^^ +help: or `..=` for an inclusive range + | +LL | return ..=1; //~ERROR unexpected token: `...` + | ^^^ + +error: unexpected token: `...` + --> $DIR/range_inclusive_dotdotdot.rs:24:13 + | +LL | let x = ...0; //~ERROR unexpected token: `...` + | ^^^ +help: use `..` for an exclusive range + | +LL | let x = ..0; //~ERROR unexpected token: `...` + | ^^ +help: or `..=` for an inclusive range + | +LL | let x = ..=0; //~ERROR unexpected token: `...` + | ^^^ + +error: unexpected token: `...` + --> $DIR/range_inclusive_dotdotdot.rs:28:14 + | +LL | let x = 5...5; //~ERROR unexpected token: `...` + | ^^^ +help: use `..` for an exclusive range + | +LL | let x = 5..5; //~ERROR unexpected token: `...` + | ^^ +help: or `..=` for an inclusive range + | +LL | let x = 5..=5; //~ERROR unexpected token: `...` + | ^^^ + +error: unexpected token: `...` + --> $DIR/range_inclusive_dotdotdot.rs:32:15 + | +LL | for _ in 0...1 {} //~ERROR unexpected token: `...` + | ^^^ +help: use `..` for an exclusive range + | +LL | for _ in 0..1 {} //~ERROR unexpected token: `...` + | ^^ +help: or `..=` for an inclusive range + | +LL | for _ in 0..=1 {} //~ERROR unexpected token: `...` + | ^^^ + +error: aborting due to 4 previous errors + diff --git a/src/test/parse-fail/raw-byte-string-eof.rs b/src/test/ui/parser/raw-byte-string-eof.rs similarity index 100% rename from src/test/parse-fail/raw-byte-string-eof.rs rename to src/test/ui/parser/raw-byte-string-eof.rs diff --git a/src/test/ui/parser/raw-byte-string-eof.stderr b/src/test/ui/parser/raw-byte-string-eof.stderr new file mode 100644 index 0000000000000..4c8a3bfa644c2 --- /dev/null +++ b/src/test/ui/parser/raw-byte-string-eof.stderr @@ -0,0 +1,10 @@ +error: unterminated raw string + --> $DIR/raw-byte-string-eof.rs:15:6 + | +LL | br##"a"#; //~ unterminated raw string + | ^ unterminated raw string + | + = note: this raw string should be terminated with `"##` + +error: aborting due to previous error + diff --git a/src/test/parse-fail/raw-byte-string-literals.rs b/src/test/ui/parser/raw-byte-string-literals.rs similarity index 100% rename from src/test/parse-fail/raw-byte-string-literals.rs rename to src/test/ui/parser/raw-byte-string-literals.rs diff --git a/src/test/ui/parser/raw-byte-string-literals.stderr b/src/test/ui/parser/raw-byte-string-literals.stderr new file mode 100644 index 0000000000000..b5a379fc37823 --- /dev/null +++ b/src/test/ui/parser/raw-byte-string-literals.stderr @@ -0,0 +1,14 @@ +error: raw byte string must be ASCII: /u{e9} + --> $DIR/raw-byte-string-literals.rs:15:8 + | +LL | br"é"; //~ ERROR raw byte string must be ASCII + | ^ + +error: found invalid character; only `#` is allowed in raw string delimitation: ~ + --> $DIR/raw-byte-string-literals.rs:16:6 + | +LL | br##~"a"~##; //~ ERROR only `#` is allowed in raw string delimitation + | ^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/parse-fail/raw-str-delim.rs b/src/test/ui/parser/raw-str-delim.rs similarity index 100% rename from src/test/parse-fail/raw-str-delim.rs rename to src/test/ui/parser/raw-str-delim.rs diff --git a/src/test/ui/parser/raw-str-delim.stderr b/src/test/ui/parser/raw-str-delim.stderr new file mode 100644 index 0000000000000..307550081d5a4 --- /dev/null +++ b/src/test/ui/parser/raw-str-delim.stderr @@ -0,0 +1,8 @@ +error: found invalid character; only `#` is allowed in raw string delimitation: ~ + --> $DIR/raw-str-delim.rs:14:5 + | +LL | r#~"#"~# //~ ERROR found invalid character; only `#` is allowed in raw string delimitation + | ^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/raw-str-unbalanced.rs b/src/test/ui/parser/raw-str-unbalanced.rs similarity index 100% rename from src/test/parse-fail/raw-str-unbalanced.rs rename to src/test/ui/parser/raw-str-unbalanced.rs diff --git a/src/test/ui/parser/raw-str-unbalanced.stderr b/src/test/ui/parser/raw-str-unbalanced.stderr new file mode 100644 index 0000000000000..666faaabc10c5 --- /dev/null +++ b/src/test/ui/parser/raw-str-unbalanced.stderr @@ -0,0 +1,8 @@ +error: expected one of `.`, `;`, `?`, or an operator, found `#` + --> $DIR/raw-str-unbalanced.rs:15:9 + | +LL | "## //~ ERROR expected one of `.`, `;`, `?`, or an operator, found `#` + | ^ expected one of `.`, `;`, `?`, or an operator here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/raw-str-unterminated.rs b/src/test/ui/parser/raw-str-unterminated.rs similarity index 100% rename from src/test/parse-fail/raw-str-unterminated.rs rename to src/test/ui/parser/raw-str-unterminated.rs diff --git a/src/test/ui/parser/raw-str-unterminated.stderr b/src/test/ui/parser/raw-str-unterminated.stderr new file mode 100644 index 0000000000000..a7d1ad227d2ce --- /dev/null +++ b/src/test/ui/parser/raw-str-unterminated.stderr @@ -0,0 +1,10 @@ +error: unterminated raw string + --> $DIR/raw-str-unterminated.rs:14:5 + | +LL | r#" string literal goes on + | ^ unterminated raw string + | + = note: this raw string should be terminated with `"#` + +error: aborting due to previous error + diff --git a/src/test/ui/raw/raw-literal-keywords.rs b/src/test/ui/parser/raw/raw-literal-keywords.rs similarity index 100% rename from src/test/ui/raw/raw-literal-keywords.rs rename to src/test/ui/parser/raw/raw-literal-keywords.rs diff --git a/src/test/ui/raw/raw-literal-keywords.stderr b/src/test/ui/parser/raw/raw-literal-keywords.stderr similarity index 100% rename from src/test/ui/raw/raw-literal-keywords.stderr rename to src/test/ui/parser/raw/raw-literal-keywords.stderr diff --git a/src/test/ui/raw/raw-literal-self.rs b/src/test/ui/parser/raw/raw-literal-self.rs similarity index 100% rename from src/test/ui/raw/raw-literal-self.rs rename to src/test/ui/parser/raw/raw-literal-self.rs diff --git a/src/test/ui/raw/raw-literal-self.stderr b/src/test/ui/parser/raw/raw-literal-self.stderr similarity index 100% rename from src/test/ui/raw/raw-literal-self.stderr rename to src/test/ui/parser/raw/raw-literal-self.stderr diff --git a/src/test/ui/raw/raw-literal-underscore.rs b/src/test/ui/parser/raw/raw-literal-underscore.rs similarity index 100% rename from src/test/ui/raw/raw-literal-underscore.rs rename to src/test/ui/parser/raw/raw-literal-underscore.rs diff --git a/src/test/ui/raw/raw-literal-underscore.stderr b/src/test/ui/parser/raw/raw-literal-underscore.stderr similarity index 100% rename from src/test/ui/raw/raw-literal-underscore.stderr rename to src/test/ui/parser/raw/raw-literal-underscore.stderr diff --git a/src/test/ui/raw/raw_string.rs b/src/test/ui/parser/raw/raw_string.rs similarity index 94% rename from src/test/ui/raw/raw_string.rs rename to src/test/ui/parser/raw/raw_string.rs index f1eb91d44fda0..de80abfbe499c 100644 --- a/src/test/ui/raw/raw_string.rs +++ b/src/test/ui/parser/raw/raw_string.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + fn main() { let x = r##"lol"#; //~^ ERROR unterminated raw string diff --git a/src/test/ui/raw/raw_string.stderr b/src/test/ui/parser/raw/raw_string.stderr similarity index 87% rename from src/test/ui/raw/raw_string.stderr rename to src/test/ui/parser/raw/raw_string.stderr index ddf1cfe406f7c..9e46d1955a06b 100644 --- a/src/test/ui/raw/raw_string.stderr +++ b/src/test/ui/parser/raw/raw_string.stderr @@ -1,5 +1,5 @@ error: unterminated raw string - --> $DIR/raw_string.rs:12:13 + --> $DIR/raw_string.rs:14:13 | LL | let x = r##"lol"#; | ^ unterminated raw string diff --git a/src/test/parse-fail/recover-enum.rs b/src/test/ui/parser/recover-enum.rs similarity index 100% rename from src/test/parse-fail/recover-enum.rs rename to src/test/ui/parser/recover-enum.rs diff --git a/src/test/ui/parser/recover-enum.stderr b/src/test/ui/parser/recover-enum.stderr new file mode 100644 index 0000000000000..1d157c1900584 --- /dev/null +++ b/src/test/ui/parser/recover-enum.stderr @@ -0,0 +1,10 @@ +error: expected one of `(`, `,`, `=`, `{`, or `}`, found `Bad` + --> $DIR/recover-enum.rs:16:9 + | +LL | Very + | - expected one of `(`, `,`, `=`, `{`, or `}` here +LL | Bad //~ ERROR found `Bad` + | ^^^ unexpected token + +error: aborting due to previous error + diff --git a/src/test/parse-fail/recover-enum2.rs b/src/test/ui/parser/recover-enum2.rs similarity index 100% rename from src/test/parse-fail/recover-enum2.rs rename to src/test/ui/parser/recover-enum2.rs diff --git a/src/test/ui/parser/recover-enum2.stderr b/src/test/ui/parser/recover-enum2.stderr new file mode 100644 index 0000000000000..802f0004564f9 --- /dev/null +++ b/src/test/ui/parser/recover-enum2.stderr @@ -0,0 +1,26 @@ +error: expected type, found `{` + --> $DIR/recover-enum2.rs:18:18 + | +LL | abc: {}, //~ ERROR: expected type, found `{` + | ^ + +error: expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `{` + --> $DIR/recover-enum2.rs:37:22 + | +LL | Nope(i32 {}) //~ ERROR: found `{` + | ^ expected one of 7 possible tokens here + +error: expected one of `!`, `&&`, `&`, `(`, `)`, `*`, `+`, `,`, `::`, `<`, `?`, `[`, `_`, `crate`, `dyn`, `extern`, `fn`, `for`, `impl`, `pub`, `unsafe`, `}`, or lifetime, found `{` + --> $DIR/recover-enum2.rs:37:22 + | +LL | Nope(i32 {}) //~ ERROR: found `{` + | ^ expected one of 23 possible tokens here + +error: expected expression, found reserved identifier `_` + --> $DIR/recover-enum2.rs:42:22 + | +LL | let bad_syntax = _; //~ ERROR: expected expression, found reserved identifier `_` + | ^ expected expression + +error: aborting due to 4 previous errors + diff --git a/src/test/parse-fail/recover-struct.rs b/src/test/ui/parser/recover-struct.rs similarity index 100% rename from src/test/parse-fail/recover-struct.rs rename to src/test/ui/parser/recover-struct.rs diff --git a/src/test/ui/parser/recover-struct.stderr b/src/test/ui/parser/recover-struct.stderr new file mode 100644 index 0000000000000..715c9e5f709cb --- /dev/null +++ b/src/test/ui/parser/recover-struct.stderr @@ -0,0 +1,10 @@ +error: expected `:`, found `Bad` + --> $DIR/recover-struct.rs:16:9 + | +LL | Very + | - expected `:` +LL | Bad //~ ERROR found `Bad` + | ^^^ unexpected token + +error: aborting due to previous error + diff --git a/src/test/parse-fail/regions-out-of-scope-slice.rs b/src/test/ui/parser/regions-out-of-scope-slice.rs similarity index 84% rename from src/test/parse-fail/regions-out-of-scope-slice.rs rename to src/test/ui/parser/regions-out-of-scope-slice.rs index c4601b4de1713..0ff0f9bbf87ca 100644 --- a/src/test/parse-fail/regions-out-of-scope-slice.rs +++ b/src/test/ui/parser/regions-out-of-scope-slice.rs @@ -8,17 +8,17 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// compile-flags: -Z parse-only +// blk region isn't supported in the front-end -// ignore-test blk region isn't supported in the front-end +// compile-flags: -Z parse-only fn foo(cond: bool) { // Here we will infer a type that uses the // region of the if stmt then block, but in the scope: - let mut x; //~ ERROR foo + let mut x; if cond { - x = &'blk [1,2,3]; + x = &'blk [1,2,3]; //~ ERROR expected `:`, found `[` } } diff --git a/src/test/ui/parser/regions-out-of-scope-slice.stderr b/src/test/ui/parser/regions-out-of-scope-slice.stderr new file mode 100644 index 0000000000000..2eabc59882ac7 --- /dev/null +++ b/src/test/ui/parser/regions-out-of-scope-slice.stderr @@ -0,0 +1,8 @@ +error: expected `:`, found `[` + --> $DIR/regions-out-of-scope-slice.rs:21:19 + | +LL | x = &'blk [1,2,3]; //~ ERROR expected `:`, found `[` + | ^ expected `:` + +error: aborting due to previous error + diff --git a/src/test/parse-fail/removed-syntax-closure-lifetime.rs b/src/test/ui/parser/removed-syntax-closure-lifetime.rs similarity index 100% rename from src/test/parse-fail/removed-syntax-closure-lifetime.rs rename to src/test/ui/parser/removed-syntax-closure-lifetime.rs diff --git a/src/test/ui/parser/removed-syntax-closure-lifetime.stderr b/src/test/ui/parser/removed-syntax-closure-lifetime.stderr new file mode 100644 index 0000000000000..97219d5bba90c --- /dev/null +++ b/src/test/ui/parser/removed-syntax-closure-lifetime.stderr @@ -0,0 +1,8 @@ +error: expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `/` + --> $DIR/removed-syntax-closure-lifetime.rs:13:22 + | +LL | type closure = Box; + | ^ expected one of 7 possible tokens here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/removed-syntax-enum-newtype.rs b/src/test/ui/parser/removed-syntax-enum-newtype.rs similarity index 100% rename from src/test/parse-fail/removed-syntax-enum-newtype.rs rename to src/test/ui/parser/removed-syntax-enum-newtype.rs diff --git a/src/test/ui/parser/removed-syntax-enum-newtype.stderr b/src/test/ui/parser/removed-syntax-enum-newtype.stderr new file mode 100644 index 0000000000000..97ba0ff8d580a --- /dev/null +++ b/src/test/ui/parser/removed-syntax-enum-newtype.stderr @@ -0,0 +1,8 @@ +error: expected one of `<`, `where`, or `{`, found `=` + --> $DIR/removed-syntax-enum-newtype.rs:13:8 + | +LL | enum e = isize; //~ ERROR expected one of `<`, `where`, or `{`, found `=` + | ^ expected one of `<`, `where`, or `{` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/removed-syntax-extern-const.rs b/src/test/ui/parser/removed-syntax-extern-const.rs similarity index 100% rename from src/test/parse-fail/removed-syntax-extern-const.rs rename to src/test/ui/parser/removed-syntax-extern-const.rs diff --git a/src/test/ui/parser/removed-syntax-extern-const.stderr b/src/test/ui/parser/removed-syntax-extern-const.stderr new file mode 100644 index 0000000000000..b40684ccc7cec --- /dev/null +++ b/src/test/ui/parser/removed-syntax-extern-const.stderr @@ -0,0 +1,8 @@ +error: extern items cannot be `const` + --> $DIR/removed-syntax-extern-const.rs:14:5 + | +LL | const i: isize; + | ^^^^^ help: try using a static value: `static` + +error: aborting due to previous error + diff --git a/src/test/parse-fail/removed-syntax-field-let.rs b/src/test/ui/parser/removed-syntax-field-let.rs similarity index 100% rename from src/test/parse-fail/removed-syntax-field-let.rs rename to src/test/ui/parser/removed-syntax-field-let.rs diff --git a/src/test/ui/parser/removed-syntax-field-let.stderr b/src/test/ui/parser/removed-syntax-field-let.stderr new file mode 100644 index 0000000000000..8782a37b35acc --- /dev/null +++ b/src/test/ui/parser/removed-syntax-field-let.stderr @@ -0,0 +1,14 @@ +error: expected identifier, found keyword `let` + --> $DIR/removed-syntax-field-let.rs:14:5 + | +LL | let foo: (), + | ^^^ expected identifier, found keyword + +error: expected `:`, found `foo` + --> $DIR/removed-syntax-field-let.rs:14:9 + | +LL | let foo: (), + | ^^^ expected `:` + +error: aborting due to 2 previous errors + diff --git a/src/test/parse-fail/removed-syntax-field-semicolon.rs b/src/test/ui/parser/removed-syntax-field-semicolon.rs similarity index 100% rename from src/test/parse-fail/removed-syntax-field-semicolon.rs rename to src/test/ui/parser/removed-syntax-field-semicolon.rs diff --git a/src/test/ui/parser/removed-syntax-field-semicolon.stderr b/src/test/ui/parser/removed-syntax-field-semicolon.stderr new file mode 100644 index 0000000000000..3800697221e88 --- /dev/null +++ b/src/test/ui/parser/removed-syntax-field-semicolon.stderr @@ -0,0 +1,8 @@ +error: expected `,`, or `}`, found `;` + --> $DIR/removed-syntax-field-semicolon.rs:14:12 + | +LL | bar: (); + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/removed-syntax-fixed-vec.rs b/src/test/ui/parser/removed-syntax-fixed-vec.rs similarity index 100% rename from src/test/parse-fail/removed-syntax-fixed-vec.rs rename to src/test/ui/parser/removed-syntax-fixed-vec.rs diff --git a/src/test/ui/parser/removed-syntax-fixed-vec.stderr b/src/test/ui/parser/removed-syntax-fixed-vec.stderr new file mode 100644 index 0000000000000..737faf79a0171 --- /dev/null +++ b/src/test/ui/parser/removed-syntax-fixed-vec.stderr @@ -0,0 +1,8 @@ +error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `*` + --> $DIR/removed-syntax-fixed-vec.rs:13:17 + | +LL | type v = [isize * 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `*` + | ^ expected one of 7 possible tokens here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/removed-syntax-fn-sigil.rs b/src/test/ui/parser/removed-syntax-fn-sigil.rs similarity index 100% rename from src/test/parse-fail/removed-syntax-fn-sigil.rs rename to src/test/ui/parser/removed-syntax-fn-sigil.rs diff --git a/src/test/ui/parser/removed-syntax-fn-sigil.stderr b/src/test/ui/parser/removed-syntax-fn-sigil.stderr new file mode 100644 index 0000000000000..587be63041db4 --- /dev/null +++ b/src/test/ui/parser/removed-syntax-fn-sigil.stderr @@ -0,0 +1,10 @@ +error: expected `(`, found `~` + --> $DIR/removed-syntax-fn-sigil.rs:14:14 + | +LL | let x: fn~() = || (); //~ ERROR expected `(`, found `~` + | - ^ expected `(` + | | + | while parsing the type for `x` + +error: aborting due to previous error + diff --git a/src/test/parse-fail/removed-syntax-mode.rs b/src/test/ui/parser/removed-syntax-mode.rs similarity index 100% rename from src/test/parse-fail/removed-syntax-mode.rs rename to src/test/ui/parser/removed-syntax-mode.rs diff --git a/src/test/ui/parser/removed-syntax-mode.stderr b/src/test/ui/parser/removed-syntax-mode.stderr new file mode 100644 index 0000000000000..7a274553d5766 --- /dev/null +++ b/src/test/ui/parser/removed-syntax-mode.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found `+` + --> $DIR/removed-syntax-mode.rs:13:6 + | +LL | fn f(+x: isize) {} //~ ERROR expected pattern, found `+` + | ^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/parse-fail/removed-syntax-mut-vec-expr.rs b/src/test/ui/parser/removed-syntax-mut-vec-expr.rs similarity index 100% rename from src/test/parse-fail/removed-syntax-mut-vec-expr.rs rename to src/test/ui/parser/removed-syntax-mut-vec-expr.rs diff --git a/src/test/ui/parser/removed-syntax-mut-vec-expr.stderr b/src/test/ui/parser/removed-syntax-mut-vec-expr.stderr new file mode 100644 index 0000000000000..253ecf41edd83 --- /dev/null +++ b/src/test/ui/parser/removed-syntax-mut-vec-expr.stderr @@ -0,0 +1,8 @@ +error: expected expression, found keyword `mut` + --> $DIR/removed-syntax-mut-vec-expr.rs:14:14 + | +LL | let v = [mut 1, 2, 3, 4]; //~ ERROR expected expression, found keyword `mut` + | ^^^ expected expression + +error: aborting due to previous error + diff --git a/src/test/parse-fail/removed-syntax-mut-vec-ty.rs b/src/test/ui/parser/removed-syntax-mut-vec-ty.rs similarity index 100% rename from src/test/parse-fail/removed-syntax-mut-vec-ty.rs rename to src/test/ui/parser/removed-syntax-mut-vec-ty.rs diff --git a/src/test/ui/parser/removed-syntax-mut-vec-ty.stderr b/src/test/ui/parser/removed-syntax-mut-vec-ty.stderr new file mode 100644 index 0000000000000..d6b47accb978c --- /dev/null +++ b/src/test/ui/parser/removed-syntax-mut-vec-ty.stderr @@ -0,0 +1,8 @@ +error: expected type, found keyword `mut` + --> $DIR/removed-syntax-mut-vec-ty.rs:13:11 + | +LL | type v = [mut isize]; //~ ERROR expected type, found keyword `mut` + | ^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/removed-syntax-ptr-lifetime.rs b/src/test/ui/parser/removed-syntax-ptr-lifetime.rs similarity index 100% rename from src/test/parse-fail/removed-syntax-ptr-lifetime.rs rename to src/test/ui/parser/removed-syntax-ptr-lifetime.rs diff --git a/src/test/ui/parser/removed-syntax-ptr-lifetime.stderr b/src/test/ui/parser/removed-syntax-ptr-lifetime.stderr new file mode 100644 index 0000000000000..2538e5473ee3d --- /dev/null +++ b/src/test/ui/parser/removed-syntax-ptr-lifetime.stderr @@ -0,0 +1,8 @@ +error: expected one of `!`, `(`, `::`, `;`, or `<`, found `/` + --> $DIR/removed-syntax-ptr-lifetime.rs:13:22 + | +LL | type bptr = &lifetime/isize; //~ ERROR expected one of `!`, `(`, `::`, `;`, or `<`, found `/` + | ^ expected one of `!`, `(`, `::`, `;`, or `<` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/removed-syntax-record.rs b/src/test/ui/parser/removed-syntax-record.rs similarity index 100% rename from src/test/parse-fail/removed-syntax-record.rs rename to src/test/ui/parser/removed-syntax-record.rs diff --git a/src/test/ui/parser/removed-syntax-record.stderr b/src/test/ui/parser/removed-syntax-record.stderr new file mode 100644 index 0000000000000..99d4ef44f9a86 --- /dev/null +++ b/src/test/ui/parser/removed-syntax-record.stderr @@ -0,0 +1,8 @@ +error: expected type, found `{` + --> $DIR/removed-syntax-record.rs:13:10 + | +LL | type t = { f: () }; //~ ERROR expected type, found `{` + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/removed-syntax-static-fn.rs b/src/test/ui/parser/removed-syntax-static-fn.rs similarity index 100% rename from src/test/parse-fail/removed-syntax-static-fn.rs rename to src/test/ui/parser/removed-syntax-static-fn.rs diff --git a/src/test/ui/parser/removed-syntax-static-fn.stderr b/src/test/ui/parser/removed-syntax-static-fn.stderr new file mode 100644 index 0000000000000..dd3b0e00101a4 --- /dev/null +++ b/src/test/ui/parser/removed-syntax-static-fn.stderr @@ -0,0 +1,10 @@ +error: expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, `unsafe`, or `}`, found `static` + --> $DIR/removed-syntax-static-fn.rs:17:5 + | +LL | impl S { + | - expected one of 11 possible tokens here +LL | static fn f() {} + | ^^^^^^ unexpected token + +error: aborting due to previous error + diff --git a/src/test/parse-fail/removed-syntax-uniq-mut-expr.rs b/src/test/ui/parser/removed-syntax-uniq-mut-expr.rs similarity index 100% rename from src/test/parse-fail/removed-syntax-uniq-mut-expr.rs rename to src/test/ui/parser/removed-syntax-uniq-mut-expr.rs diff --git a/src/test/ui/parser/removed-syntax-uniq-mut-expr.stderr b/src/test/ui/parser/removed-syntax-uniq-mut-expr.stderr new file mode 100644 index 0000000000000..54e6a517343a9 --- /dev/null +++ b/src/test/ui/parser/removed-syntax-uniq-mut-expr.stderr @@ -0,0 +1,8 @@ +error: expected expression, found keyword `mut` + --> $DIR/removed-syntax-uniq-mut-expr.rs:14:21 + | +LL | let a_box = box mut 42; //~ ERROR expected expression, found keyword `mut` + | ^^^ expected expression + +error: aborting due to previous error + diff --git a/src/test/parse-fail/removed-syntax-uniq-mut-ty.rs b/src/test/ui/parser/removed-syntax-uniq-mut-ty.rs similarity index 100% rename from src/test/parse-fail/removed-syntax-uniq-mut-ty.rs rename to src/test/ui/parser/removed-syntax-uniq-mut-ty.rs diff --git a/src/test/ui/parser/removed-syntax-uniq-mut-ty.stderr b/src/test/ui/parser/removed-syntax-uniq-mut-ty.stderr new file mode 100644 index 0000000000000..e9660f3e1c2c3 --- /dev/null +++ b/src/test/ui/parser/removed-syntax-uniq-mut-ty.stderr @@ -0,0 +1,8 @@ +error: expected one of `>`, lifetime, or type, found `mut` + --> $DIR/removed-syntax-uniq-mut-ty.rs:13:20 + | +LL | type mut_box = Box; //~ ERROR expected one of `>`, lifetime, or type, found `mut` + | ^^^ expected one of `>`, lifetime, or type here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/removed-syntax-with-1.rs b/src/test/ui/parser/removed-syntax-with-1.rs similarity index 100% rename from src/test/parse-fail/removed-syntax-with-1.rs rename to src/test/ui/parser/removed-syntax-with-1.rs diff --git a/src/test/ui/parser/removed-syntax-with-1.stderr b/src/test/ui/parser/removed-syntax-with-1.stderr new file mode 100644 index 0000000000000..37baf742ed888 --- /dev/null +++ b/src/test/ui/parser/removed-syntax-with-1.stderr @@ -0,0 +1,8 @@ +error: expected one of `,`, `.`, `?`, `}`, or an operator, found `with` + --> $DIR/removed-syntax-with-1.rs:20:25 + | +LL | let b = S { foo: () with a }; + | ^^^^ expected one of `,`, `.`, `?`, `}`, or an operator here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/removed-syntax-with-2.rs b/src/test/ui/parser/removed-syntax-with-2.rs similarity index 100% rename from src/test/parse-fail/removed-syntax-with-2.rs rename to src/test/ui/parser/removed-syntax-with-2.rs diff --git a/src/test/ui/parser/removed-syntax-with-2.stderr b/src/test/ui/parser/removed-syntax-with-2.stderr new file mode 100644 index 0000000000000..6999196c1b753 --- /dev/null +++ b/src/test/ui/parser/removed-syntax-with-2.stderr @@ -0,0 +1,8 @@ +error: expected one of `,` or `}`, found `a` + --> $DIR/removed-syntax-with-2.rs:20:31 + | +LL | let b = S { foo: (), with a }; + | ^ expected one of `,` or `}` here + +error: aborting due to previous error + diff --git a/src/test/parse-fail/require-parens-for-chained-comparison.rs b/src/test/ui/parser/require-parens-for-chained-comparison.rs similarity index 100% rename from src/test/parse-fail/require-parens-for-chained-comparison.rs rename to src/test/ui/parser/require-parens-for-chained-comparison.rs diff --git a/src/test/ui/parser/require-parens-for-chained-comparison.stderr b/src/test/ui/parser/require-parens-for-chained-comparison.stderr new file mode 100644 index 0000000000000..8facdab428527 --- /dev/null +++ b/src/test/ui/parser/require-parens-for-chained-comparison.stderr @@ -0,0 +1,23 @@ +error: chained comparison operators require parentheses + --> $DIR/require-parens-for-chained-comparison.rs:16:11 + | +LL | false == false == false; + | ^^^^^^^^^^^^^^^^^ + +error: chained comparison operators require parentheses + --> $DIR/require-parens-for-chained-comparison.rs:19:11 + | +LL | false == 0 < 2; + | ^^^^^^^^ + +error: chained comparison operators require parentheses + --> $DIR/require-parens-for-chained-comparison.rs:22:6 + | +LL | f(); + | ^^^^ + | + = help: use `::<...>` instead of `<...>` if you meant to specify type arguments + = help: or use `(...)` if you meant to specify fn arguments + +error: aborting due to 3 previous errors + diff --git a/src/test/parse-fail/struct-field-numeric-shorthand.rs b/src/test/ui/parser/struct-field-numeric-shorthand.rs similarity index 100% rename from src/test/parse-fail/struct-field-numeric-shorthand.rs rename to src/test/ui/parser/struct-field-numeric-shorthand.rs diff --git a/src/test/ui/parser/struct-field-numeric-shorthand.stderr b/src/test/ui/parser/struct-field-numeric-shorthand.stderr new file mode 100644 index 0000000000000..e909a9ece6077 --- /dev/null +++ b/src/test/ui/parser/struct-field-numeric-shorthand.stderr @@ -0,0 +1,10 @@ +error: expected identifier, found `0` + --> $DIR/struct-field-numeric-shorthand.rs:16:19 + | +LL | let _ = Rgb { 0, 1, 2 }; //~ ERROR expected identifier, found `0` + | --- ^ expected identifier + | | + | while parsing this struct + +error: aborting due to previous error + diff --git a/src/test/parse-fail/struct-literal-in-for.rs b/src/test/ui/parser/struct-literal-in-for.rs similarity index 100% rename from src/test/parse-fail/struct-literal-in-for.rs rename to src/test/ui/parser/struct-literal-in-for.rs diff --git a/src/test/ui/parser/struct-literal-in-for.stderr b/src/test/ui/parser/struct-literal-in-for.stderr new file mode 100644 index 0000000000000..4a074eef88903 --- /dev/null +++ b/src/test/ui/parser/struct-literal-in-for.stderr @@ -0,0 +1,14 @@ +error: expected type, found `3` + --> $DIR/struct-literal-in-for.rs:25:12 + | +LL | x: 3 //~ ERROR expected type, found `3` + | ^ expecting a type here because of type ascription + +error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{` + --> $DIR/struct-literal-in-for.rs:26:12 + | +LL | }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{` + | ^ expected one of `.`, `;`, `?`, `}`, or an operator here + +error: aborting due to 2 previous errors + diff --git a/src/test/parse-fail/struct-literal-in-if.rs b/src/test/ui/parser/struct-literal-in-if.rs similarity index 100% rename from src/test/parse-fail/struct-literal-in-if.rs rename to src/test/ui/parser/struct-literal-in-if.rs diff --git a/src/test/ui/parser/struct-literal-in-if.stderr b/src/test/ui/parser/struct-literal-in-if.stderr new file mode 100644 index 0000000000000..02659ffb5aaec --- /dev/null +++ b/src/test/ui/parser/struct-literal-in-if.stderr @@ -0,0 +1,14 @@ +error: expected type, found `3` + --> $DIR/struct-literal-in-if.rs:25:12 + | +LL | x: 3 //~ ERROR expected type, found `3` + | ^ expecting a type here because of type ascription + +error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{` + --> $DIR/struct-literal-in-if.rs:26:12 + | +LL | }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{` + | ^ expected one of `.`, `;`, `?`, `}`, or an operator here + +error: aborting due to 2 previous errors + diff --git a/src/test/parse-fail/struct-literal-in-match-discriminant.rs b/src/test/ui/parser/struct-literal-in-match-discriminant.rs similarity index 100% rename from src/test/parse-fail/struct-literal-in-match-discriminant.rs rename to src/test/ui/parser/struct-literal-in-match-discriminant.rs diff --git a/src/test/ui/parser/struct-literal-in-match-discriminant.stderr b/src/test/ui/parser/struct-literal-in-match-discriminant.stderr new file mode 100644 index 0000000000000..9b8eecd389e70 --- /dev/null +++ b/src/test/ui/parser/struct-literal-in-match-discriminant.stderr @@ -0,0 +1,14 @@ +error: expected one of `=>`, `@`, `if`, or `|`, found `:` + --> $DIR/struct-literal-in-match-discriminant.rs:19:10 + | +LL | x: 3 //~ ERROR expected one of `=>`, `@`, `if`, or `|`, found `:` + | ^ expected one of `=>`, `@`, `if`, or `|` here + +error: expected one of `.`, `;`, `?`, `}`, or an operator, found `=>` + --> $DIR/struct-literal-in-match-discriminant.rs:23:11 + | +LL | } => {} //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `=>` + | ^^ expected one of `.`, `;`, `?`, `}`, or an operator here + +error: aborting due to 2 previous errors + diff --git a/src/test/parse-fail/struct-literal-in-while.rs b/src/test/ui/parser/struct-literal-in-while.rs similarity index 100% rename from src/test/parse-fail/struct-literal-in-while.rs rename to src/test/ui/parser/struct-literal-in-while.rs diff --git a/src/test/ui/parser/struct-literal-in-while.stderr b/src/test/ui/parser/struct-literal-in-while.stderr new file mode 100644 index 0000000000000..6ecc14cd08182 --- /dev/null +++ b/src/test/ui/parser/struct-literal-in-while.stderr @@ -0,0 +1,14 @@ +error: expected type, found `3` + --> $DIR/struct-literal-in-while.rs:25:12 + | +LL | x: 3 //~ ERROR expected type, found `3` + | ^ expecting a type here because of type ascription + +error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{` + --> $DIR/struct-literal-in-while.rs:26:12 + | +LL | }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{` + | ^ expected one of `.`, `;`, `?`, `}`, or an operator here + +error: aborting due to 2 previous errors + diff --git a/src/test/parse-fail/struct-literal-restrictions-in-lamda.rs b/src/test/ui/parser/struct-literal-restrictions-in-lamda.rs similarity index 100% rename from src/test/parse-fail/struct-literal-restrictions-in-lamda.rs rename to src/test/ui/parser/struct-literal-restrictions-in-lamda.rs diff --git a/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr b/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr new file mode 100644 index 0000000000000..1341a2b241d57 --- /dev/null +++ b/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr @@ -0,0 +1,14 @@ +error: expected type, found `3` + --> $DIR/struct-literal-restrictions-in-lamda.rs:25:12 + | +LL | x: 3 //~ ERROR expected type, found `3` + | ^ expecting a type here because of type ascription + +error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{` + --> $DIR/struct-literal-restrictions-in-lamda.rs:26:12 + | +LL | }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{` + | ^ expected one of `.`, `;`, `?`, `}`, or an operator here + +error: aborting due to 2 previous errors + diff --git a/src/test/parse-fail/tag-variant-disr-non-nullary.rs b/src/test/ui/parser/tag-variant-disr-non-nullary.rs similarity index 100% rename from src/test/parse-fail/tag-variant-disr-non-nullary.rs rename to src/test/ui/parser/tag-variant-disr-non-nullary.rs diff --git a/src/test/ui/parser/tag-variant-disr-non-nullary.stderr b/src/test/ui/parser/tag-variant-disr-non-nullary.stderr new file mode 100644 index 0000000000000..990ddca05d97a --- /dev/null +++ b/src/test/ui/parser/tag-variant-disr-non-nullary.stderr @@ -0,0 +1,8 @@ +error: discriminator values can only be used with a field-less enum + --> $DIR/tag-variant-disr-non-nullary.rs:20:13 + | +LL | white = 0xffffff, + | ^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/trailing-carriage-return-in-string.rs b/src/test/ui/parser/trailing-carriage-return-in-string.rs similarity index 100% rename from src/test/parse-fail/trailing-carriage-return-in-string.rs rename to src/test/ui/parser/trailing-carriage-return-in-string.rs diff --git a/src/test/ui/parser/trailing-carriage-return-in-string.stderr b/src/test/ui/parser/trailing-carriage-return-in-string.stderr new file mode 100644 index 0000000000000..4e6d38dd7af26 --- /dev/null +++ b/src/test/ui/parser/trailing-carriage-return-in-string.stderr @@ -0,0 +1,14 @@ +error: unknown character escape: /r + --> $DIR/trailing-carriage-return-in-string.rs:21:25 + | +LL | let bad = "This is / a test"; + | ^ + | +help: this is an isolated carriage return; consider checking your editor and version control settings + --> $DIR/trailing-carriage-return-in-string.rs:21:25 + | +LL | let bad = "This is / a test"; + | ^ + +error: aborting due to previous error + diff --git a/src/test/ui/token/trailing-plus-in-bounds.rs b/src/test/ui/parser/trailing-plus-in-bounds.rs similarity index 97% rename from src/test/ui/token/trailing-plus-in-bounds.rs rename to src/test/ui/parser/trailing-plus-in-bounds.rs index 72cae6abc2dbe..b0dda815f8303 100644 --- a/src/test/ui/token/trailing-plus-in-bounds.rs +++ b/src/test/ui/parser/trailing-plus-in-bounds.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-pass // compile-flags: -Z parse-only -Z continue-parse-after-error use std::fmt::Debug; @@ -15,6 +16,3 @@ use std::fmt::Debug; fn main() { let x: Box = box 3 as Box; // Trailing `+` is OK } - -FAIL -//~^ ERROR diff --git a/src/test/parse-fail/trait-bounds-not-on-impl.rs b/src/test/ui/parser/trait-bounds-not-on-impl.rs similarity index 100% rename from src/test/parse-fail/trait-bounds-not-on-impl.rs rename to src/test/ui/parser/trait-bounds-not-on-impl.rs diff --git a/src/test/ui/parser/trait-bounds-not-on-impl.stderr b/src/test/ui/parser/trait-bounds-not-on-impl.stderr new file mode 100644 index 0000000000000..68bb090e45f22 --- /dev/null +++ b/src/test/ui/parser/trait-bounds-not-on-impl.stderr @@ -0,0 +1,8 @@ +error: expected a trait, found type + --> $DIR/trait-bounds-not-on-impl.rs:18:6 + | +LL | impl Foo + Owned for Bar { //~ ERROR expected a trait, found type + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/trait-object-bad-parens.rs b/src/test/ui/parser/trait-object-bad-parens.rs similarity index 100% rename from src/test/parse-fail/trait-object-bad-parens.rs rename to src/test/ui/parser/trait-object-bad-parens.rs diff --git a/src/test/ui/parser/trait-object-bad-parens.stderr b/src/test/ui/parser/trait-object-bad-parens.stderr new file mode 100644 index 0000000000000..a1c483c3eca57 --- /dev/null +++ b/src/test/ui/parser/trait-object-bad-parens.stderr @@ -0,0 +1,27 @@ +error[E0178]: expected a path on the left-hand side of `+`, not `((Copy))` + --> $DIR/trait-object-bad-parens.rs:14:16 + | +LL | let _: Box<((Copy)) + Copy>; + | ^^^^^^^^^^^^^^^ expected a path + +error[E0178]: expected a path on the left-hand side of `+`, not `(Copy + Copy)` + --> $DIR/trait-object-bad-parens.rs:16:16 + | +LL | let _: Box<(Copy + Copy) + Copy>; + | ^^^^^^^^^^^^^^^^^^^^ expected a path + +error[E0178]: expected a path on the left-hand side of `+`, not `(Copy)` + --> $DIR/trait-object-bad-parens.rs:18:16 + | +LL | let _: Box<(Copy +) + Copy>; + | ^^^^^^^^^^^^^^^ expected a path + +error[E0178]: expected a path on the left-hand side of `+`, not `(dyn Copy)` + --> $DIR/trait-object-bad-parens.rs:20:16 + | +LL | let _: Box<(dyn Copy) + Copy>; + | ^^^^^^^^^^^^^^^^^ expected a path + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0178`. diff --git a/src/test/parse-fail/trait-object-lifetime-parens.rs b/src/test/ui/parser/trait-object-lifetime-parens.rs similarity index 100% rename from src/test/parse-fail/trait-object-lifetime-parens.rs rename to src/test/ui/parser/trait-object-lifetime-parens.rs diff --git a/src/test/ui/parser/trait-object-lifetime-parens.stderr b/src/test/ui/parser/trait-object-lifetime-parens.stderr new file mode 100644 index 0000000000000..7c7921bd38d2e --- /dev/null +++ b/src/test/ui/parser/trait-object-lifetime-parens.stderr @@ -0,0 +1,22 @@ +error: parenthesized lifetime bounds are not supported + --> $DIR/trait-object-lifetime-parens.rs:13:19 + | +LL | fn f() {} //~ ERROR parenthesized lifetime bounds are not supported + | ^ + +error: parenthesized lifetime bounds are not supported + --> $DIR/trait-object-lifetime-parens.rs:16:26 + | +LL | let _: Box; //~ ERROR parenthesized lifetime bounds are not supported + | ^ + +error: expected type, found `'a` + --> $DIR/trait-object-lifetime-parens.rs:17:17 + | +LL | let _: Box<('a) + Copy>; //~ ERROR expected type, found `'a` + | - ^^ + | | + | while parsing the type for `_` + +error: aborting due to 3 previous errors + diff --git a/src/test/parse-fail/trait-object-polytrait-priority.rs b/src/test/ui/parser/trait-object-polytrait-priority.rs similarity index 95% rename from src/test/parse-fail/trait-object-polytrait-priority.rs rename to src/test/ui/parser/trait-object-polytrait-priority.rs index b5fc06ddaac05..646ef48766592 100644 --- a/src/test/parse-fail/trait-object-polytrait-priority.rs +++ b/src/test/ui/parser/trait-object-polytrait-priority.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + trait Trait<'a> {} fn main() { diff --git a/src/test/ui/parser/trait-object-polytrait-priority.stderr b/src/test/ui/parser/trait-object-polytrait-priority.stderr new file mode 100644 index 0000000000000..4ceff81885a39 --- /dev/null +++ b/src/test/ui/parser/trait-object-polytrait-priority.stderr @@ -0,0 +1,9 @@ +error[E0178]: expected a path on the left-hand side of `+`, not `&for<'a> Trait<'a>` + --> $DIR/trait-object-polytrait-priority.rs:16:12 + | +LL | let _: &for<'a> Trait<'a> + 'static; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try adding parentheses: `&(for<'a> Trait<'a> + 'static)` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0178`. diff --git a/src/test/parse-fail/trait-object-trait-parens.rs b/src/test/ui/parser/trait-object-trait-parens.rs similarity index 97% rename from src/test/parse-fail/trait-object-trait-parens.rs rename to src/test/ui/parser/trait-object-trait-parens.rs index dc44f4f3fb135..1feb0c84532a8 100644 --- a/src/test/parse-fail/trait-object-trait-parens.rs +++ b/src/test/ui/parser/trait-object-trait-parens.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-pass // compile-flags: -Z parse-only fn f Trait<'a>)>() {} @@ -17,5 +18,3 @@ fn main() { let _: Box<(?Sized) + (for<'a> Trait<'a>) + (Copy)>; let _: Box<(for<'a> Trait<'a>) + (Copy) + (?Sized)>; } - -FAIL //~ ERROR diff --git a/src/test/parse-fail/trait-plusequal-splitting.rs b/src/test/ui/parser/trait-plusequal-splitting.rs similarity index 95% rename from src/test/parse-fail/trait-plusequal-splitting.rs rename to src/test/ui/parser/trait-plusequal-splitting.rs index cbb955fe61d03..32174d6254a96 100644 --- a/src/test/parse-fail/trait-plusequal-splitting.rs +++ b/src/test/ui/parser/trait-plusequal-splitting.rs @@ -8,13 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// compile-flags: -Z parse-only // Fixes issue where `+` in generics weren't parsed if they were part of a `+=`. +// compile-pass +// compile-flags: -Z parse-only + struct Whitespace { t: T } struct TokenSplit { t: T } -fn main() { -} - -FAIL //~ ERROR +fn main() {} diff --git a/src/test/parse-fail/trait-pub-assoc-const.rs b/src/test/ui/parser/trait-pub-assoc-const.rs similarity index 94% rename from src/test/parse-fail/trait-pub-assoc-const.rs rename to src/test/ui/parser/trait-pub-assoc-const.rs index cce6b5c4cbf75..0a412092017a9 100644 --- a/src/test/parse-fail/trait-pub-assoc-const.rs +++ b/src/test/ui/parser/trait-pub-assoc-const.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + trait Foo { pub const Foo: u32; //~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found diff --git a/src/test/ui/parser/trait-pub-assoc-const.stderr b/src/test/ui/parser/trait-pub-assoc-const.stderr new file mode 100644 index 0000000000000..9e82d348453bb --- /dev/null +++ b/src/test/ui/parser/trait-pub-assoc-const.stderr @@ -0,0 +1,10 @@ +error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `pub` + --> $DIR/trait-pub-assoc-const.rs:14:5 + | +LL | trait Foo { + | - expected one of 7 possible tokens here +LL | pub const Foo: u32; + | ^^^ unexpected token + +error: aborting due to previous error + diff --git a/src/test/parse-fail/trait-pub-assoc-ty.rs b/src/test/ui/parser/trait-pub-assoc-ty.rs similarity index 94% rename from src/test/parse-fail/trait-pub-assoc-ty.rs rename to src/test/ui/parser/trait-pub-assoc-ty.rs index d6a4e5e021d38..940743d3ffa70 100644 --- a/src/test/parse-fail/trait-pub-assoc-ty.rs +++ b/src/test/ui/parser/trait-pub-assoc-ty.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + trait Foo { pub type Foo; //~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found diff --git a/src/test/ui/parser/trait-pub-assoc-ty.stderr b/src/test/ui/parser/trait-pub-assoc-ty.stderr new file mode 100644 index 0000000000000..47ae68353ac32 --- /dev/null +++ b/src/test/ui/parser/trait-pub-assoc-ty.stderr @@ -0,0 +1,10 @@ +error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `pub` + --> $DIR/trait-pub-assoc-ty.rs:14:5 + | +LL | trait Foo { + | - expected one of 7 possible tokens here +LL | pub type Foo; + | ^^^ unexpected token + +error: aborting due to previous error + diff --git a/src/test/parse-fail/trait-pub-method.rs b/src/test/ui/parser/trait-pub-method.rs similarity index 94% rename from src/test/parse-fail/trait-pub-method.rs rename to src/test/ui/parser/trait-pub-method.rs index 286cb4dbff7e1..f9c064a105cf7 100644 --- a/src/test/parse-fail/trait-pub-method.rs +++ b/src/test/ui/parser/trait-pub-method.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + trait Foo { pub fn foo(); //~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found diff --git a/src/test/ui/parser/trait-pub-method.stderr b/src/test/ui/parser/trait-pub-method.stderr new file mode 100644 index 0000000000000..49bcb64aa7d6f --- /dev/null +++ b/src/test/ui/parser/trait-pub-method.stderr @@ -0,0 +1,10 @@ +error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `pub` + --> $DIR/trait-pub-method.rs:14:5 + | +LL | trait Foo { + | - expected one of 7 possible tokens here +LL | pub fn foo(); + | ^^^ unexpected token + +error: aborting due to previous error + diff --git a/src/test/parse-fail/type-parameters-in-field-exprs.rs b/src/test/ui/parser/type-parameters-in-field-exprs.rs similarity index 100% rename from src/test/parse-fail/type-parameters-in-field-exprs.rs rename to src/test/ui/parser/type-parameters-in-field-exprs.rs diff --git a/src/test/ui/parser/type-parameters-in-field-exprs.stderr b/src/test/ui/parser/type-parameters-in-field-exprs.stderr new file mode 100644 index 0000000000000..f8b63b49be3f7 --- /dev/null +++ b/src/test/ui/parser/type-parameters-in-field-exprs.stderr @@ -0,0 +1,20 @@ +error: field expressions may not have generic arguments + --> $DIR/type-parameters-in-field-exprs.rs:23:8 + | +LL | f.x::; + | ^^^^^^^^^ + +error: field expressions may not have generic arguments + --> $DIR/type-parameters-in-field-exprs.rs:25:8 + | +LL | f.x::<>; + | ^^^^ + +error: field expressions may not have generic arguments + --> $DIR/type-parameters-in-field-exprs.rs:27:8 + | +LL | f.x::(); + | ^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/parse-fail/unbalanced-doublequote.rs b/src/test/ui/parser/unbalanced-doublequote.rs similarity index 100% rename from src/test/parse-fail/unbalanced-doublequote.rs rename to src/test/ui/parser/unbalanced-doublequote.rs diff --git a/src/test/ui/parser/unbalanced-doublequote.stderr b/src/test/ui/parser/unbalanced-doublequote.stderr new file mode 100644 index 0000000000000..e12eceeb24b28 --- /dev/null +++ b/src/test/ui/parser/unbalanced-doublequote.stderr @@ -0,0 +1,9 @@ +error: unterminated double quote string + --> $DIR/unbalanced-doublequote.rs:18:5 + | +LL | / " +LL | | } + | |__^ + +error: aborting due to previous error + diff --git a/src/test/ui/parser/unclosed-braces.rs b/src/test/ui/parser/unclosed-braces.rs index 802133ae6b98b..82f2ffd4dc082 100644 --- a/src/test/ui/parser/unclosed-braces.rs +++ b/src/test/ui/parser/unclosed-braces.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + struct S { x: [usize; 3], } diff --git a/src/test/ui/parser/unclosed-braces.stderr b/src/test/ui/parser/unclosed-braces.stderr index 4f865bc9b39cb..3fdfdc0a80902 100644 --- a/src/test/ui/parser/unclosed-braces.stderr +++ b/src/test/ui/parser/unclosed-braces.stderr @@ -1,5 +1,5 @@ error: this file contains an un-closed delimiter - --> $DIR/unclosed-braces.rs:32:53 + --> $DIR/unclosed-braces.rs:34:53 | LL | fn main() { | - un-closed delimiter diff --git a/src/test/parse-fail/underscore-suffix-for-float.rs b/src/test/ui/parser/underscore-suffix-for-float.rs similarity index 85% rename from src/test/parse-fail/underscore-suffix-for-float.rs rename to src/test/ui/parser/underscore-suffix-for-float.rs index 8327217e6f286..bb1cf5949b903 100644 --- a/src/test/parse-fail/underscore-suffix-for-float.rs +++ b/src/test/ui/parser/underscore-suffix-for-float.rs @@ -8,7 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + fn main() { let a = 42._; //~ ERROR expected identifier, found reserved identifier `_` - //~^ ERROR `{integer}` is a primitive type and therefore doesn't have fields } diff --git a/src/test/ui/parser/underscore-suffix-for-float.stderr b/src/test/ui/parser/underscore-suffix-for-float.stderr new file mode 100644 index 0000000000000..18e6dac26087f --- /dev/null +++ b/src/test/ui/parser/underscore-suffix-for-float.stderr @@ -0,0 +1,8 @@ +error: expected identifier, found reserved identifier `_` + --> $DIR/underscore-suffix-for-float.rs:14:16 + | +LL | let a = 42._; //~ ERROR expected identifier, found reserved identifier `_` + | ^ expected identifier, found reserved identifier + +error: aborting due to previous error + diff --git a/src/test/parse-fail/underscore-suffix-for-string.rs b/src/test/ui/parser/underscore-suffix-for-string.rs similarity index 92% rename from src/test/parse-fail/underscore-suffix-for-string.rs rename to src/test/ui/parser/underscore-suffix-for-string.rs index 05de5f8e1941b..3ef29a3692ec7 100644 --- a/src/test/parse-fail/underscore-suffix-for-string.rs +++ b/src/test/ui/parser/underscore-suffix-for-string.rs @@ -8,13 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-pass +// compile-flags: -Z parse-only + fn main() { let _ = "Foo"_; //~^ WARNING underscore literal suffix is not allowed //~| WARNING this was previously accepted //~| NOTE issue #42326 } - -FAIL -//~^ ERROR -//~| NOTE diff --git a/src/test/ui/parser/underscore-suffix-for-string.stderr b/src/test/ui/parser/underscore-suffix-for-string.stderr new file mode 100644 index 0000000000000..bbce7097354b3 --- /dev/null +++ b/src/test/ui/parser/underscore-suffix-for-string.stderr @@ -0,0 +1,9 @@ +warning: underscore literal suffix is not allowed + --> $DIR/underscore-suffix-for-string.rs:15:18 + | +LL | let _ = "Foo"_; + | ^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42326 + diff --git a/src/test/parse-fail/unicode-chars.rs b/src/test/ui/parser/unicode-chars.rs similarity index 100% rename from src/test/parse-fail/unicode-chars.rs rename to src/test/ui/parser/unicode-chars.rs diff --git a/src/test/ui/parser/unicode-chars.stderr b/src/test/ui/parser/unicode-chars.stderr new file mode 100644 index 0000000000000..5c30a5040f0de --- /dev/null +++ b/src/test/ui/parser/unicode-chars.stderr @@ -0,0 +1,12 @@ +error: unknown start of token: /u{37e} + --> $DIR/unicode-chars.rs:14:14 + | +LL | let y = 0; + | ^ +help: Unicode character ';' (Greek Question Mark) looks like ';' (Semicolon), but it is not + | +LL | let y = 0; + | ^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/unsized.rs b/src/test/ui/parser/unsized.rs similarity index 100% rename from src/test/parse-fail/unsized.rs rename to src/test/ui/parser/unsized.rs diff --git a/src/test/ui/parser/unsized.stderr b/src/test/ui/parser/unsized.stderr new file mode 100644 index 0000000000000..89de7ee875856 --- /dev/null +++ b/src/test/ui/parser/unsized.stderr @@ -0,0 +1,8 @@ +error: expected `where`, `{`, `(`, or `;` after struct name, found `for` + --> $DIR/unsized.rs:15:11 + | +LL | struct S1 for type; //~ ERROR expected `where`, `{`, `(`, or `;` after struct name, found `for` + | ^^^ expected `where`, `{`, `(`, or `;` after struct name + +error: aborting due to previous error + diff --git a/src/test/parse-fail/unsized2.rs b/src/test/ui/parser/unsized2.rs similarity index 100% rename from src/test/parse-fail/unsized2.rs rename to src/test/ui/parser/unsized2.rs diff --git a/src/test/ui/parser/unsized2.stderr b/src/test/ui/parser/unsized2.stderr new file mode 100644 index 0000000000000..323b8fd9ea89a --- /dev/null +++ b/src/test/ui/parser/unsized2.stderr @@ -0,0 +1,8 @@ +error: expected expression, found keyword `type` + --> $DIR/unsized2.rs:18:7 + | +LL | f(); //~ ERROR expected expression, found keyword `type` + | ^^^^ expected expression + +error: aborting due to previous error + diff --git a/src/test/parse-fail/use-as-where-use-ends-with-mod-sep.rs b/src/test/ui/parser/use-as-where-use-ends-with-mod-sep.rs similarity index 100% rename from src/test/parse-fail/use-as-where-use-ends-with-mod-sep.rs rename to src/test/ui/parser/use-as-where-use-ends-with-mod-sep.rs diff --git a/src/test/ui/parser/use-as-where-use-ends-with-mod-sep.stderr b/src/test/ui/parser/use-as-where-use-ends-with-mod-sep.stderr new file mode 100644 index 0000000000000..e7452f403b2f4 --- /dev/null +++ b/src/test/ui/parser/use-as-where-use-ends-with-mod-sep.stderr @@ -0,0 +1,14 @@ +error: expected identifier, found keyword `as` + --> $DIR/use-as-where-use-ends-with-mod-sep.rs:13:16 + | +LL | use std::any:: as foo; //~ ERROR expected identifier, found keyword `as` + | ^^ expected identifier, found keyword + +error: expected one of `::`, `;`, or `as`, found `foo` + --> $DIR/use-as-where-use-ends-with-mod-sep.rs:13:19 + | +LL | use std::any:: as foo; //~ ERROR expected identifier, found keyword `as` + | ^^^ expected one of `::`, `;`, or `as` here + +error: aborting due to 2 previous errors + diff --git a/src/test/parse-fail/use-ends-with-mod-sep.rs b/src/test/ui/parser/use-ends-with-mod-sep.rs similarity index 100% rename from src/test/parse-fail/use-ends-with-mod-sep.rs rename to src/test/ui/parser/use-ends-with-mod-sep.rs diff --git a/src/test/ui/parser/use-ends-with-mod-sep.stderr b/src/test/ui/parser/use-ends-with-mod-sep.stderr new file mode 100644 index 0000000000000..c463f746a58b2 --- /dev/null +++ b/src/test/ui/parser/use-ends-with-mod-sep.stderr @@ -0,0 +1,8 @@ +error: expected identifier, found `;` + --> $DIR/use-ends-with-mod-sep.rs:13:15 + | +LL | use std::any::; //~ ERROR expected identifier, found `;` + | ^ expected identifier + +error: aborting due to previous error + diff --git a/src/test/parse-fail/variadic-ffi-3.rs b/src/test/ui/parser/variadic-ffi-3.rs similarity index 100% rename from src/test/parse-fail/variadic-ffi-3.rs rename to src/test/ui/parser/variadic-ffi-3.rs diff --git a/src/test/ui/parser/variadic-ffi-3.stderr b/src/test/ui/parser/variadic-ffi-3.stderr new file mode 100644 index 0000000000000..93f19253f0077 --- /dev/null +++ b/src/test/ui/parser/variadic-ffi-3.stderr @@ -0,0 +1,8 @@ +error: only foreign functions are allowed to be variadic + --> $DIR/variadic-ffi-3.rs:13:18 + | +LL | fn foo(x: isize, ...) { + | ^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/variadic-ffi-4.rs b/src/test/ui/parser/variadic-ffi-4.rs similarity index 100% rename from src/test/parse-fail/variadic-ffi-4.rs rename to src/test/ui/parser/variadic-ffi-4.rs diff --git a/src/test/ui/parser/variadic-ffi-4.stderr b/src/test/ui/parser/variadic-ffi-4.stderr new file mode 100644 index 0000000000000..228c0d6ef1447 --- /dev/null +++ b/src/test/ui/parser/variadic-ffi-4.stderr @@ -0,0 +1,8 @@ +error: only foreign functions are allowed to be variadic + --> $DIR/variadic-ffi-4.rs:13:29 + | +LL | extern "C" fn foo(x: isize, ...) { + | ^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/virtual-structs.rs b/src/test/ui/parser/virtual-structs.rs similarity index 100% rename from src/test/parse-fail/virtual-structs.rs rename to src/test/ui/parser/virtual-structs.rs diff --git a/src/test/ui/parser/virtual-structs.stderr b/src/test/ui/parser/virtual-structs.stderr new file mode 100644 index 0000000000000..6af9922a698c4 --- /dev/null +++ b/src/test/ui/parser/virtual-structs.stderr @@ -0,0 +1,8 @@ +error: expected item, found `virtual` + --> $DIR/virtual-structs.rs:15:1 + | +LL | virtual struct SuperStruct { //~ ERROR expected item, found `virtual` + | ^^^^^^^ expected item + +error: aborting due to previous error + diff --git a/src/test/parse-fail/where-clauses-no-bounds-or-predicates.rs b/src/test/ui/parser/where-clauses-no-bounds-or-predicates.rs similarity index 100% rename from src/test/parse-fail/where-clauses-no-bounds-or-predicates.rs rename to src/test/ui/parser/where-clauses-no-bounds-or-predicates.rs diff --git a/src/test/ui/parser/where-clauses-no-bounds-or-predicates.stderr b/src/test/ui/parser/where-clauses-no-bounds-or-predicates.stderr new file mode 100644 index 0000000000000..1dda2d3e7fd4c --- /dev/null +++ b/src/test/ui/parser/where-clauses-no-bounds-or-predicates.stderr @@ -0,0 +1,8 @@ +error: expected `:`, found `{` + --> $DIR/where-clauses-no-bounds-or-predicates.rs:23:23 + | +LL | fn foo<'a>() where 'a {} + | ^ expected `:` + +error: aborting due to previous error + diff --git a/src/test/parse-fail/where_with_bound.rs b/src/test/ui/parser/where_with_bound.rs similarity index 100% rename from src/test/parse-fail/where_with_bound.rs rename to src/test/ui/parser/where_with_bound.rs diff --git a/src/test/ui/parser/where_with_bound.stderr b/src/test/ui/parser/where_with_bound.stderr new file mode 100644 index 0000000000000..7cf16fbcef4a3 --- /dev/null +++ b/src/test/ui/parser/where_with_bound.stderr @@ -0,0 +1,8 @@ +error: generic parameters on `where` clauses are reserved for future use + --> $DIR/where_with_bound.rs:13:19 + | +LL | fn foo() where ::Item: ToString, T: Iterator { } + | ^^^ + +error: aborting due to previous error + diff --git a/src/test/parse-fail/wrong-escape-of-curly-braces.rs b/src/test/ui/parser/wrong-escape-of-curly-braces.rs similarity index 96% rename from src/test/parse-fail/wrong-escape-of-curly-braces.rs rename to src/test/ui/parser/wrong-escape-of-curly-braces.rs index d86bf726cbd6e..e501f5ef1fd62 100644 --- a/src/test/parse-fail/wrong-escape-of-curly-braces.rs +++ b/src/test/ui/parser/wrong-escape-of-curly-braces.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + fn f() { let ok = "{{everything fine}}"; let bad = "\{it is wrong\}"; diff --git a/src/test/ui/parser/wrong-escape-of-curly-braces.stderr b/src/test/ui/parser/wrong-escape-of-curly-braces.stderr new file mode 100644 index 0000000000000..cbb5c4ff3ecdd --- /dev/null +++ b/src/test/ui/parser/wrong-escape-of-curly-braces.stderr @@ -0,0 +1,26 @@ +error: unknown character escape: { + --> $DIR/wrong-escape-of-curly-braces.rs:15:17 + | +LL | let bad = "/{it is wrong/}"; + | ^ + | +help: if used in a formatting string, curly braces are escaped with `{{` and `}}` + --> $DIR/wrong-escape-of-curly-braces.rs:15:17 + | +LL | let bad = "/{it is wrong/}"; + | ^ + +error: unknown character escape: } + --> $DIR/wrong-escape-of-curly-braces.rs:15:30 + | +LL | let bad = "/{it is wrong/}"; + | ^ + | +help: if used in a formatting string, curly braces are escaped with `{{` and `}}` + --> $DIR/wrong-escape-of-curly-braces.rs:15:30 + | +LL | let bad = "/{it is wrong/}"; + | ^ + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/token/bounds-obj-parens.stderr b/src/test/ui/token/bounds-obj-parens.stderr deleted file mode 100644 index 67dcbc4541941..0000000000000 --- a/src/test/ui/token/bounds-obj-parens.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: expected one of `!` or `::`, found `` - --> $DIR/bounds-obj-parens.rs:15:1 - | -LL | FAIL - | ^^^^ expected one of `!` or `::` here - -error: aborting due to previous error - diff --git a/src/test/ui/token/issue-41155.stderr b/src/test/ui/token/issue-41155.stderr deleted file mode 100644 index 5c1aae29c2fdf..0000000000000 --- a/src/test/ui/token/issue-41155.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error: expected one of `(`, `async`, `const`, `default`, `existential`, `extern`, `fn`, `type`, or `unsafe`, found `}` - --> $DIR/issue-41155.rs:13:1 - | -LL | pub - | - expected one of 9 possible tokens here -LL | } //~ ERROR expected one of - | ^ unexpected token - -error[E0412]: cannot find type `S` in this scope - --> $DIR/issue-41155.rs:11:6 - | -LL | impl S { //~ ERROR cannot find type - | ^ not found in this scope - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0412`. diff --git a/src/test/ui/token/trailing-plus-in-bounds.stderr b/src/test/ui/token/trailing-plus-in-bounds.stderr deleted file mode 100644 index 1719b1d5e08a3..0000000000000 --- a/src/test/ui/token/trailing-plus-in-bounds.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: expected one of `!` or `::`, found `` - --> $DIR/trailing-plus-in-bounds.rs:19:1 - | -LL | FAIL - | ^^^^ expected one of `!` or `::` here - -error: aborting due to previous error - diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index fab2ea7ba6c36..a8e25596621ca 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -19,7 +19,6 @@ use util::PathBufExt; #[derive(Clone, Copy, PartialEq, Debug)] pub enum Mode { CompileFail, - ParseFail, RunFail, /// This now behaves like a `ui` test that has an implict `// run-pass`. RunPass, @@ -56,7 +55,6 @@ impl FromStr for Mode { fn from_str(s: &str) -> Result { match s { "compile-fail" => Ok(CompileFail), - "parse-fail" => Ok(ParseFail), "run-fail" => Ok(RunFail), "run-pass" => Ok(RunPass), "run-pass-valgrind" => Ok(RunPassValgrind), @@ -80,7 +78,6 @@ impl fmt::Display for Mode { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let s = match *self { CompileFail => "compile-fail", - ParseFail => "parse-fail", RunFail => "run-fail", RunPass => "run-pass", RunPassValgrind => "run-pass-valgrind", diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs index c931d3c0e30b7..ca30a4dd95d0e 100644 --- a/src/tools/compiletest/src/main.rs +++ b/src/tools/compiletest/src/main.rs @@ -139,7 +139,7 @@ pub fn parse_config(args: Vec) -> Config { "", "mode", "which sort of compile tests to run", - "(compile-fail|parse-fail|run-fail|run-pass|\ + "(compile-fail|run-fail|run-pass|\ run-pass-valgrind|pretty|debug-info|incremental|mir-opt)", ) .optflag("", "ignored", "run tests marked as ignored") diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 8c3b1bb4df333..a80bbd401ab43 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -12,7 +12,7 @@ use common::CompareMode; use common::{expected_output_path, UI_EXTENSIONS, UI_FIXED, UI_STDERR, UI_STDOUT}; use common::{output_base_dir, output_base_name, output_testname_unique}; use common::{Codegen, CodegenUnits, DebugInfoBoth, DebugInfoGdb, DebugInfoLldb, Rustdoc}; -use common::{CompileFail, ParseFail, Pretty, RunFail, RunPass, RunPassValgrind}; +use common::{CompileFail, Pretty, RunFail, RunPass, RunPassValgrind}; use common::{Config, TestPaths}; use common::{Incremental, MirOpt, RunMake, Ui}; use diff; @@ -265,7 +265,7 @@ impl<'test> TestCx<'test> { /// revisions, exactly once, with revision == None). fn run_revision(&self) { match self.config.mode { - CompileFail | ParseFail => self.run_cfail_test(), + CompileFail => self.run_cfail_test(), RunFail => self.run_rfail_test(), RunPassValgrind => self.run_valgrind_test(), Pretty => self.run_pretty_test(), @@ -296,7 +296,7 @@ impl<'test> TestCx<'test> { fn should_compile_successfully(&self) -> bool { match self.config.mode { - ParseFail | CompileFail => self.props.compile_pass, + CompileFail => self.props.compile_pass, RunPass => true, Ui => self.props.compile_pass, Incremental => { @@ -1741,7 +1741,7 @@ impl<'test> TestCx<'test> { } match self.config.mode { - CompileFail | ParseFail | Incremental => { + CompileFail | Incremental => { // If we are extracting and matching errors in the new // fashion, then you want JSON mode. Old-skool error // patterns still match the raw compiler output.