diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index aa4e44df2ef9401d53109f404a74bc6baf3ca8cb..71a89cd6d76b432a4e14071d83b9b3d8a26204c0 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -379,7 +379,6 @@ fn get_step_descriptions(kind: Kind) -> Vec { 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 6e6f772a7f351b3dd49b48c72ed75c4e44c536f5..fe04a91011ee530b4b5bcefc65008fb41596a973 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -773,12 +773,6 @@ fn run(self, builder: &Builder) { 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 56eda5480715bc1b5517f4d916f5b27b7718ad34..f2a29b0315100cda4328c588c01646e2c0de718d 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 e53d6c718c155c4f90ed2d5539145e473781ae80..1d79f95a4d2bbadb4f41f150ea75605100a3410c 100755 --- a/src/etc/generate-keyword-tests.py +++ b/src/etc/generate-keyword-tests.py @@ -44,7 +44,7 @@ fn main() { """ 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 5c6d5816a472b045acbdedef6395fbd5e94f065f..a4b8ab86f37f689c0571797d7718c7e75cedf1ab 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/parse-fail/multiline-comment-line-tracking.rs b/src/test/parse-fail/multiline-comment-line-tracking.rs deleted file mode 100644 index 11abe6727455df6e90409ecd13d417cbdf62f85c..0000000000000000000000000000000000000000 --- a/src/test/parse-fail/multiline-comment-line-tracking.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// error-pattern:18:3 - -/* 1 - * 2 - * 3 - */ -fn main() { - %; // parse error on line 18, but is reported on line 6 instead. -} 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 0000000000000000000000000000000000000000..e09db780880a0637c848eb74202e7407d0f99c77 --- /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 0000000000000000000000000000000000000000..2d39546dca88f16ca19352f378908793526c808e --- /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 0000000000000000000000000000000000000000..878ef68274736593bb1e15f67c410a0051cc8d0d --- /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 0000000000000000000000000000000000000000..59b378c208895f5a48c90625a233bda96852ffa5 --- /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 ce640a3f67cd22bb639e47b6eb14dd544547ff83..121a0d8eba27b547cc649df934e4bc1e415a6f15 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 0000000000000000000000000000000000000000..b869331ca5a3cd0f0ea25f8371e7ff31b46a1f33 --- /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 92e2a59d25d87f29e4900c52c0965407954a77bb..e0558443a360aba26b0ed3a9022256b15e843810 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 0000000000000000000000000000000000000000..bef2f423ab9a00ec2fd2cb5e77ae35d9873bffdc --- /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 6f9d794dc2dc302d36eb0f298e1af0652f338344..cf9c3f9a35f6c4121a876efd587bbc1adf3c1833 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 0000000000000000000000000000000000000000..d19fe25bad80c7c5fec2db2a1b680817e22a85b3 --- /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 0000000000000000000000000000000000000000..e96b9c4cc3d1d243d4c0ad6af1c07f7e479b6396 --- /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 0000000000000000000000000000000000000000..0f530a2d402050d10f84b81ff9235bfb42674b7c --- /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 0000000000000000000000000000000000000000..1105e06f93c5bae5278de777a196078348262cd5 --- /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 0000000000000000000000000000000000000000..a977847679a2b3d2af9fae5b777dbccc2f240372 --- /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 0000000000000000000000000000000000000000..70a7afc9060fb3127f3259db11d9a515e9a3f5b2 --- /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 0000000000000000000000000000000000000000..40f96655170c0b0435aa4b0d5ee267c18847287f --- /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 0000000000000000000000000000000000000000..bc15c329526d4a8edf3ce5296cc6c247014a99a1 --- /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 0000000000000000000000000000000000000000..7927a3d61386e18ea21eb7a156f6ca957747cb69 --- /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 0000000000000000000000000000000000000000..c4ab3e18c9b455a628df89d132a24feca58d67a1 --- /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 0000000000000000000000000000000000000000..d41bbb3475b63404a9654987f0d1ca49b8567b67 --- /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 0000000000000000000000000000000000000000..ac5fe784a9a0d8d6476ce21c7d90736913ad7d31 --- /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 0000000000000000000000000000000000000000..34d02374d57c8fc7bc2df7a2aea56b787faf5752 --- /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 0000000000000000000000000000000000000000..028858c34e9e1fb142cc1f327de0cbc68abe7d9e --- /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 0000000000000000000000000000000000000000..14ff1b73767bab265d80618b0522b7733fdd4f82 --- /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 0000000000000000000000000000000000000000..e3522cef8d44f416c0d593ad0a8c68ca7775cf6b --- /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 0000000000000000000000000000000000000000..910092fba40556a87d7717e61a427357ef92d43c --- /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 0000000000000000000000000000000000000000..b84f5e6990afbc90fb4f986d41b194c98f22f21a --- /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 0000000000000000000000000000000000000000..5bcb8962e0f4e1161aca470ab2d983b5ca3f74ff --- /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 0000000000000000000000000000000000000000..ef4ba9499c37afe392ee801a440b42e8a04948ef --- /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 0000000000000000000000000000000000000000..2850af5193a3eae6e0b59cdd3f736bb1cc37f7c0 --- /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 9617df8fa21a9c1a3d1a9c5556d771d341baddda..7b47bbd951edee86b0393fff2dae9c861b6acd20 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 0000000000000000000000000000000000000000..b6a184f54fc07be9b9f0cff8e8beb462d6de12c5 --- /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 0000000000000000000000000000000000000000..c4c3d2ae0656a785ad517ad20dc27048747de42c --- /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 0000000000000000000000000000000000000000..c66b3ed75e8dce362cbf7504258e0562513f59ab --- /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 0000000000000000000000000000000000000000..7b4f22134c453a746b87528529ffc9cd7a6df40a --- /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 0000000000000000000000000000000000000000..856d1956c053ac9179f461be5af2f64f11142488 --- /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 0000000000000000000000000000000000000000..48cb3976c6d0894cf499a50cede933445c6bde8b --- /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 0000000000000000000000000000000000000000..d28750d188a480c96e861e1ae02878542a5b07b2 --- /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 4c77edec56f136e647f93086f350d1d7ed7d1398..29b6a70b6d7ee0db6975c56bde9fcf300d3dbb74 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 0000000000000000000000000000000000000000..1e505e5ac9b9af8658a9f4f04cb8796b7f02be36 --- /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 0000000000000000000000000000000000000000..452e65603c9c94f401eca77e0318ef8d9e042bb6 --- /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 0000000000000000000000000000000000000000..0a5c6e80df5efa53ec761e4a9262a58b9c616114 --- /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 0000000000000000000000000000000000000000..c1ea802b8befd2af572c1cffbe4b080c6c6d5db4 --- /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 a2c60151ac72d549958b938b81e429581bc1bd26..11feeae8d818189243bbba3b74becc36f8d21378 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 0000000000000000000000000000000000000000..1725000429287af625c3e1ccf765593310644226 --- /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 0000000000000000000000000000000000000000..f52bf60b26358eeb596fcf93fb6579bbdae489d3 --- /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 0000000000000000000000000000000000000000..9fd3db73577b78e858675d534c6cbc44db8222eb --- /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 0000000000000000000000000000000000000000..3936412cf9884620baeb8d841a61daac0a560f92 --- /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 bcf32612c8f4c0829420596c36d66e177276cabe..ad9a73626ac786daa48967f030e2558be11e3687 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 0000000000000000000000000000000000000000..e74817e1fd2b0cc6ae70a2599012eb84fd86e594 --- /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 8f1fad91b1f99e2cfdd8865d252902aeb27c8152..2882364081a1301cb4c1edfd0fc93cbeee325aa2 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 0000000000000000000000000000000000000000..f93ab634c28c91cb6aa26c109fab76e76b15349a --- /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 d38d1876384a88f440f045afd23123c356899216..d18ebdc5b1e6b2d68564765a8b93e7fd221eb06e 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 0000000000000000000000000000000000000000..807530302af5ec3ae35835ecb78db90b702fa083 --- /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 0000000000000000000000000000000000000000..15e9c3dfd625717d4a188e4f3fee822fc4837ce1 --- /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 0000000000000000000000000000000000000000..a174d6f7053f1334b1d7165b5c83fb73dea72e93 --- /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 6d9b4b05ad9fa6a69b1fa0ff213975fe962660c4..b0cae467863a875eab776854dd1c21c80b60026d 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 0000000000000000000000000000000000000000..9909bb250d10e8f9c24f2b8bb4ce3c3d87638f5d --- /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 63b2f963799166622a191aac6d5795391bab2c28..cd5fd2d7a7f10d89422dd615fdb2e485ace4d6ce 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 0000000000000000000000000000000000000000..b69720dd8671f75fa1d3c1bc5192aa5982d79c23 --- /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 0000000000000000000000000000000000000000..a0a5b66215e95b89329c402e518995129d287cd1 --- /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 0000000000000000000000000000000000000000..fef4b882355970f8c14dc56b217a9867d4e51fca --- /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 2518686575eb155b47f4dc6b8efce30c60bebb62..619b88a6ab8ab89f531cc66aaf52d826fd9db5a7 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 0000000000000000000000000000000000000000..c359a3704bf48fc1ce6f2cc4f234706284e1831e --- /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 0000000000000000000000000000000000000000..54ab5b87d497850d99cd94f61f705c3812548bc7 --- /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 0000000000000000000000000000000000000000..93eb9fd8de3cfdc1aa533389b696d194b8befcbc --- /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 0000000000000000000000000000000000000000..29a7691f82b852570da5608068ebaa1c2f643d84 --- /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 9bc9aaff298db1c81542ef4e4a587356149cfa8c..735d571938abf61c7723108f7877c6c05285b11f 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 9926fcc0858e546b13e349f0dbe19cf262ae2f11..65da252fc128f852591e6192a39f8a2be8072e10 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 48dd888b2e530d92b93c8716e72b963005724e14..5dced73c90d4b8bb64e92f81c0f4c6de5b07eee2 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 0000000000000000000000000000000000000000..1628c120945c86e3510f0b6077ffeb5a0a3b4a2b --- /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 0000000000000000000000000000000000000000..6fdc7972a8856647bad1c7c2baeeb0ec8bd01252 --- /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 0000000000000000000000000000000000000000..af7d0ee0c027e4e86c2d36d3dc89cbe2844bbf36 --- /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 0000000000000000000000000000000000000000..c36a946fd63067a98b5978b99694c6683c628f50 --- /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 0000000000000000000000000000000000000000..af050e662a2185d77fd4383f84f0536034c117be --- /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 0000000000000000000000000000000000000000..89fb5cfad5ef2bfe6d70e564b1f7299cae17a3fa --- /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 0000000000000000000000000000000000000000..391cb52fd406d3d3ea54c60c1363644b7c1858d1 --- /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 a100debbf1242a898e2487ec3f3cb54eb7e15681..c08a309e11e26edc99773bbe4f7b7352335df857 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 3f4f0615bc8f78425d3e8aa4fab6309536c04f5f..63cd36f00c0492be4166a8a333c40d87b05604b7 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 0000000000000000000000000000000000000000..41548ed4a2f8745c1262aa722222aafb5bef6eec --- /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 0000000000000000000000000000000000000000..0401fe05cf8911761c69a14d5d0520641a9ab918 --- /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 711803754408f50a757d4d51534221e99256c98b..c96834fe4cf352dc890f605e169f52be3dea9ff0 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 9800b0c5e3f05bf10af16c5cffbee4c75edfb439..8f721a3b5dd438d21f953141f0027892a6b160cd 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 0000000000000000000000000000000000000000..7d546cb2180e3ab441f6943a8bf2608f3ac6aa73 --- /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 0000000000000000000000000000000000000000..c7b57f36376b54ee4b8c9b5a41dca0ab1e35b0d4 --- /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 0000000000000000000000000000000000000000..cca23c7027961e98abf47488bf9f6c4157e99386 --- /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 0000000000000000000000000000000000000000..0b7016eb7f71d1334a2c6568fcb0990a7903ddb8 --- /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 0000000000000000000000000000000000000000..f0a45998d17dfab07a68238f918212f6360b1d96 --- /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 0000000000000000000000000000000000000000..4a4b6789194952749d89ebd8710eb174a99c651d --- /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 0000000000000000000000000000000000000000..ab5cc5655bbe13f5b94aa0bb8a8221ccc471c88e --- /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 0000000000000000000000000000000000000000..fbf0ea13c73a924929af73fda91c9a4793eebb53 --- /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 e1b134c8203184872bcd36dc22f33c7ce19bba71..2f11805481d2d25c815d80a7a413fd58e0a278da 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 d52368bf96a75f7c268e5271850221b7aea77279..1395803e12120a1f0c1045c7c690bc23e621a883 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 0000000000000000000000000000000000000000..890400acccfad9324ea5fa5d65773c97650aa389 --- /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 0000000000000000000000000000000000000000..321989e5fab34d85218b5b7b238cc0b6fbfdc2d6 --- /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 0000000000000000000000000000000000000000..b294a8572fbc68fef3854bad8eb375e49cbbe726 --- /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 0000000000000000000000000000000000000000..65ddadb011d0f0c769276b546d3a9124ab455115 --- /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 0000000000000000000000000000000000000000..c783d97478c39f704b2f780972b78fd096d65112 --- /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 0000000000000000000000000000000000000000..b4ce85e784c44309a7d7b298a623f7bda1dc382a --- /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 0000000000000000000000000000000000000000..d8e68529a6d2a5dc626b69c7bed00e157c926151 --- /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 0000000000000000000000000000000000000000..0e99f4e125cab64bb4fde61c532fe30c76d9d3e8 --- /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 0000000000000000000000000000000000000000..08957f2d383428a3a4708856d25c6f159e1639d3 --- /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 0000000000000000000000000000000000000000..ce6d6cbdc06142bf1ea91348459035c22c02092a --- /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 0000000000000000000000000000000000000000..b5b5636157771c6afed651821d066547f24194c0 --- /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 0000000000000000000000000000000000000000..47e05f1b3605344b0ec071f11328882bbd07f646 --- /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 1ace57edba3d8152d5d7732f9ccace943e529747..0f77ddd70cfc87f34bae5b374f5416916cfee4ca 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 0000000000000000000000000000000000000000..fbf078e425b9298875b801ead522fc95a0e10efb --- /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 ed936cdd9a934c486c90a15c0adf81f09207c633..026af652c5e96c0d2ff034d427064bf47e3e1489 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 0000000000000000000000000000000000000000..8651005ea687d5b57390d0a5b94a0148231d05b8 --- /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 0000000000000000000000000000000000000000..bcec78a3d9b849e33f4aa07c7cc465b47f309de9 --- /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 0000000000000000000000000000000000000000..a46bcb07200cd6764d22f23d23dfffa566c31a8e --- /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 37d62182612346c422fcf86c4d30fcae9b73b958..8e098655a52bd1608d4bd6e83af788b89267482a 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 0000000000000000000000000000000000000000..567c4f1f21b0ff07d0f1b9560d0d7d6be4c3229c --- /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 8723423325c198ae4ed997cb352e0a285da2087e..aca50fdaf108e2e7bffedf9ed3cec4d1a34a23e0 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 0000000000000000000000000000000000000000..0a9be6f4d2a6dd70e396ca7868a20528a8628176 --- /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 0000000000000000000000000000000000000000..01f110e3d2462d31a05b6b3211dfdb627339b400 --- /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 0000000000000000000000000000000000000000..9caa6087420d037b33bab585afc956e5985ee467 --- /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 0000000000000000000000000000000000000000..778a58463f74c10f5fcc35ae0c9fedb0684a87db --- /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 0000000000000000000000000000000000000000..e0e398381b71ddae81f646161e9bcb0b480dae16 --- /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 0000000000000000000000000000000000000000..cce6cf6ede2e22be31637b7a8691f8289e0e96c7 --- /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 0000000000000000000000000000000000000000..608a9a6e6e01d087dfef5323cb4a1efd4aec9bf1 --- /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 0000000000000000000000000000000000000000..6836509ebba51cc22a3fe18bbed0b241ddb62744 --- /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 0000000000000000000000000000000000000000..e89c907a3b7da1fa545e828bdddb870a421cb3f9 --- /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 0000000000000000000000000000000000000000..184dacdaca4b3baed874cbdb3b21e344aad6be62 --- /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 0000000000000000000000000000000000000000..189ace74b9c6aca1979e4fc39f892ce4bfe998ce --- /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 96070332f06df4b94a4daec87b18d85ae1874770..6a9d03cdd91ad0919c8375ef0af217fe9ed9c5a1 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 0000000000000000000000000000000000000000..cc9bb2d7c93f90056ad5c76c48ccd066d5c04292 --- /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 7bd8506af90b96057ff3d8534cea7c4a55bbdead..3d234dc378afb74c7e25320b280caa20e653e6f0 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 0000000000000000000000000000000000000000..34b78fca3bd81f86d1f45b7697b19efda4aa8141 --- /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 0000000000000000000000000000000000000000..c5ea50be48780388151fd72627fd0d949f65e9d1 --- /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 0000000000000000000000000000000000000000..7fd3bc9d6eacf115bd88913784c4d79f6ae03b75 --- /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 0000000000000000000000000000000000000000..338b39b85b112a02cacef324227cf07ceed5406d --- /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 f6606a58ecaf190d58f809febd95ba10d6b77f85..3622d59a51479a8a3c5f44527dbb42ef7606fc5a 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 0000000000000000000000000000000000000000..63beed2873f7c334600cd69f8f8af26bc2d9bfb3 --- /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 0000000000000000000000000000000000000000..d6013b32c967f6041ab3553410758b0b721d6a69 --- /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 0000000000000000000000000000000000000000..0013f9722203eda68708b57c4ef2b18b222577d9 --- /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 0000000000000000000000000000000000000000..1d3ed0d9b3ec14b375b9596d0b6c70f89bb3671b --- /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 0000000000000000000000000000000000000000..a6295c2fca134dc92228061ac6d569b2e3b804df --- /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 0000000000000000000000000000000000000000..4e9984c287198952c79522d298b92cd60bf64c09 --- /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 0000000000000000000000000000000000000000..9e2d2c9caaccabfea500e9cff03b6d69d79dc78a --- /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 0000000000000000000000000000000000000000..d662fefda7089190ef09ac153bbef86b4835b272 --- /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 0000000000000000000000000000000000000000..52409c1f6bb3b7e1cbcc8fb4d6edc0d4f3a332b9 --- /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 0000000000000000000000000000000000000000..ab075a52141e44def1524c3157ace75284803dc9 --- /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 0000000000000000000000000000000000000000..f8370134741e0db1fa13c58e9cd586b2559584bd --- /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 0000000000000000000000000000000000000000..8ace453f36238748f49bab72df9b8884aa5c4098 --- /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 0000000000000000000000000000000000000000..bf63775fc9bf588899e615b4fcb60508fc2c8711 --- /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 0000000000000000000000000000000000000000..ed28f77a252bc6b7bf1d62d908c0a1b006466688 --- /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 0000000000000000000000000000000000000000..bfb7ab78bcfe159770923e66a039233332a4eed0 --- /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 0000000000000000000000000000000000000000..43f7072981e6a1e534a9cf12b748ae3bbe567ad9 --- /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 0000000000000000000000000000000000000000..29bb5f4b724d75f8fa54e5fd9694c746688612f5 --- /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 0000000000000000000000000000000000000000..7a28aee465711885ae1b2d229160594863994aeb --- /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 0000000000000000000000000000000000000000..1dafe466d79077d45f82bf128b6c239c3daf59d2 --- /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 0000000000000000000000000000000000000000..b3b542f1a1d36ca5899fb1883ca34579caa4d886 --- /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 0000000000000000000000000000000000000000..113f7084b31cde61cf6ca704c586309cd9b8df5f --- /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 0000000000000000000000000000000000000000..21b66fbc1e1d8d9fe58e0e28d332a839e11cd614 --- /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 0000000000000000000000000000000000000000..bb153cf0e6c1cc4efcf38fa0650f6dc2ab6e8a3a --- /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 0000000000000000000000000000000000000000..ce1d4f27716153e1c9430d0c6788a3e8c0c325de --- /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 0000000000000000000000000000000000000000..b52982d144d402eecb2a7f9d43a1c4d53c2efc51 --- /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 0000000000000000000000000000000000000000..34063c88d33b194b5a660dbf38e1ae1dad8dd288 --- /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 0000000000000000000000000000000000000000..8d8b2aabbdcd55d4ad1d635e924c46ff8a6adbc8 --- /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 0000000000000000000000000000000000000000..4c1a0d1a0b0fa0070b9c14ea0da925e904341698 --- /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 0000000000000000000000000000000000000000..76179ce7ea7ac32e22ff6072471dbee67bec6c9a --- /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 0000000000000000000000000000000000000000..084b785f8674adc9b02e6629e0e5317088867b70 --- /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 0000000000000000000000000000000000000000..9306f95d85565d0ab43d7da4acf783a34debfe2c --- /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 0000000000000000000000000000000000000000..03e0bd7dfa9bf53781a132448db18e978fd7a996 --- /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 0000000000000000000000000000000000000000..1c0cd0cca0dc27182a82b5c0b13a593eb47f527b --- /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 0000000000000000000000000000000000000000..360bd21fa5f624555ba83dc2b06943f4018c6fde --- /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 0000000000000000000000000000000000000000..bff297881078bcfed604135766969aebecc7acf5 --- /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 0000000000000000000000000000000000000000..38fe936befefa861d28d23473dfccd7a1f3ecad8 --- /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 0000000000000000000000000000000000000000..c9dab8c5170ce8643b46f8b0aebf32da0264c976 --- /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 0000000000000000000000000000000000000000..a3fc16777326dcd9821175c15a697aff6ae43d7c --- /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 0000000000000000000000000000000000000000..049658571e86ee13b5773d6f9f6967fc7f162890 --- /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 0000000000000000000000000000000000000000..2c23d8c3d6109b994095abc35ead53730a31873c --- /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 0000000000000000000000000000000000000000..081eb2e9fed7042b5c4dd69f63e374663e548002 --- /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 0000000000000000000000000000000000000000..ed129f5d427d15c9f5b41a1a87998d9241a357e4 --- /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 0000000000000000000000000000000000000000..f257b5b82680e3161a1cc0d75c2b73f7e7207bd3 --- /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 0000000000000000000000000000000000000000..495becd07d16a00d69081f576d04974a22208d75 --- /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 0000000000000000000000000000000000000000..145361eb58a89828e07670e4fe5beccf0a0a8b43 --- /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 0000000000000000000000000000000000000000..3d87b5b7037d7e61f5b0d97e1f4201b446f72d4e --- /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 0000000000000000000000000000000000000000..342309fdd1ca07d1ada875a436c6fde60e03aba7 --- /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 0000000000000000000000000000000000000000..6e2cd9995ca183035312f8372bf3835f48eb8269 --- /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 0000000000000000000000000000000000000000..799836759e65ae06b408907da4c7e397b54984b3 --- /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 0000000000000000000000000000000000000000..d4ccb6f14595734a8db8857dc9709d9c4f440744 --- /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 8802497ae1bfd83e3d0f7e8df53b11cd8b37fd12..ccabcdf2d7506db6de2184a9933dad599badd227 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 0000000000000000000000000000000000000000..86cc3c5b0cbe9df622dd772ab1facca808bf5014 --- /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 0000000000000000000000000000000000000000..2ce6d5d6cf3489d1857860c705283da2b82754bc --- /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 0000000000000000000000000000000000000000..e1ae9892f74fe0acb7623ef76e0287e1a077de11 --- /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 0000000000000000000000000000000000000000..a558262353549bbde67ec7e92b739b3a63b7adeb --- /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 0000000000000000000000000000000000000000..69bd40fbb24f64ae30d7a18529e49c08e3fbafcd --- /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 0000000000000000000000000000000000000000..6fe7926f4e1dfc29f4e4ef64a88f4cabed2bd182 --- /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 15d491719a6d58dd8edf2350edd32d3309d98fee..a0b959ecea5213f241f9725b4c61a9ea8353e88a 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 0000000000000000000000000000000000000000..4dab8fc73f3e331c30edce0e6c684e2a84aecfdd --- /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 0000000000000000000000000000000000000000..1e8f017e1db76f3a5b801d94c534dd057e298bac --- /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 0000000000000000000000000000000000000000..28dd71316aaac578814b925842bd49611ab20ea6 --- /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 0000000000000000000000000000000000000000..a7fdd28b0cab89164a09c9f2a45a9ca48aac3c77 --- /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 0000000000000000000000000000000000000000..bae9823b9b2fa0e44d8c6c3a758b29ae966b5359 --- /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 0000000000000000000000000000000000000000..7c7a2fb12c313bdf87c957ad7a72b84326e40a4b --- /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 0000000000000000000000000000000000000000..f55ba469ab4353e936b83d6ab7f189f9ff4d1230 --- /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 0000000000000000000000000000000000000000..2f4fdbfbc2b6e52d35d42727db8d43e535560839 --- /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 0000000000000000000000000000000000000000..ab536dc5854973ae5a1c50a51c71cfcb62f1af5c --- /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 0000000000000000000000000000000000000000..1d935f693f16eab12af29464e689b4c3a5a268e4 --- /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 0000000000000000000000000000000000000000..9ea9e739a0a0a1b673bc555f431a9446e5539703 --- /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 0000000000000000000000000000000000000000..9293fd14c493a379dfbc40afa8776c21bc56927c --- /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 0000000000000000000000000000000000000000..9050223c644f84cc6aa726740368dfbd7bd90823 --- /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 4bc6e706d4284861a4b2f9ca2473db98f1896fe5..59b2ebe9f863bab6f920f850d5d850276b106f4d 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 0000000000000000000000000000000000000000..a745fc2847baeab91e58767190bf409148a69d79 --- /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 5cf821749e945f243d04c1774edf69a7eddcbc2b..6ee6792a8a2088490f11fa56c68a0ef6c3eb8bff 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 0000000000000000000000000000000000000000..695038f8e4dba2c26c6a959cdf4c0a3adb10c11b --- /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 993232e70ab3bb18665422752837d3548ecf2e70..03aa8edc22924a7ea6c32e162223267eb5c3f9ca 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 0000000000000000000000000000000000000000..f4247b60f684d1098e62aa774cd6f93e05665b16 --- /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/ui/parser/multiline-comment-line-tracking.rs b/src/test/ui/parser/multiline-comment-line-tracking.rs new file mode 100644 index 0000000000000000000000000000000000000000..44ed0a3706cd74cd705ff79710e928e33bc13249 --- /dev/null +++ b/src/test/ui/parser/multiline-comment-line-tracking.rs @@ -0,0 +1,20 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -Z parse-only +// error-pattern:19:3 + +/* 1 + * 2 + * 3 + */ +fn main() { + %; // 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 0000000000000000000000000000000000000000..2dba2b1cb7e625faf1b5f23e2fc3beefc3d7c82f --- /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 0000000000000000000000000000000000000000..2ccf49d03152cf319b293954e0383d9752d88b3a --- /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 0000000000000000000000000000000000000000..afe24595de4735a37adcb8b0c49c5ce0b2e32eab --- /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 0000000000000000000000000000000000000000..4467b394c932be58f0c491b418ff2b679cc42d8d --- /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 0000000000000000000000000000000000000000..54123be421448e905f0393563b8801691a7f3774 --- /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 0000000000000000000000000000000000000000..65196f91b08d0bfd591855387df95917e0354b91 --- /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 0000000000000000000000000000000000000000..309a77e7df03cf2edf149345259ded3183afe110 --- /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 0000000000000000000000000000000000000000..db3c3791daf54a2ceb24c504720d49cf9f3d6e54 --- /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 0000000000000000000000000000000000000000..dba019baff87ffb66331699a5e090ef820e1a1d8 --- /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 0000000000000000000000000000000000000000..7fe66bffd8627b4f65c9a4e804beade785f811b0 --- /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 0000000000000000000000000000000000000000..15558043737784ab6bdb9cc0fb739b86f1c801aa --- /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 0000000000000000000000000000000000000000..4e051b6206f275bfe2a19338c6ff5a0e8d4642d6 --- /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 0000000000000000000000000000000000000000..68912f52dc10528edde12a10126cb3477844ab21 --- /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 0000000000000000000000000000000000000000..df3a5011fd8744340345f7309823ec98395e428e --- /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 6d3d1207788303f7036e206441060274724d0707..fc1957571b1cb824d1a36ff30afce34486dc3b27 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 0000000000000000000000000000000000000000..5ab5ce2649a52843e023991051d7c40c623fa6b8 --- /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 6a0653041d45b194d344a7cb6ab9d34dfae78c5c..a88e83847110e9f65f8ed8d59e81b147b144d3ca 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 0000000000000000000000000000000000000000..d0d815045e0e275ded094b293cd7dd58f6304881 --- /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 8ea2bcf900c97066e7f4f798328b45bd57343acd..1a3f7aa8182902b2f0d78679417d5415b8e14764 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 0000000000000000000000000000000000000000..1be61b1a12b99b11f2220f80c1aed8f079577435 --- /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 0000000000000000000000000000000000000000..4a0dec1b5c6da30b164f755b17aef7c112d2a54b --- /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 421d7a05befff11c43f317256056a8d1d2e0809b..160b985dc6e9f2ad2ceb9184b5d08f88ea747188 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 0000000000000000000000000000000000000000..6174ed63007fdba8e3d44d4b8839415603a01b3a --- /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 fb78e558a951a7c6cbac3968b5f0a3dfaeb9f669..eaea9f4acd791a4dcd2c4dacbe9d2abb7ee0b208 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 0000000000000000000000000000000000000000..9666f18fac5bf9fe39f8209e480e41201d2ef38a --- /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 d75589d8889e3381613a6f55a755dac09fb896c2..ac1c1f7ee1f634e91332e69692d922dcd4fc1563 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 0000000000000000000000000000000000000000..09a398fb2b0b8cfcfb4ddef7465ecf37e19286df --- /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 857a3924aec01e8c69dade08869a98d8b2ed28d5..7aa0287101806e8420f05a2428cf5808bbc65371 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 0000000000000000000000000000000000000000..61d1bf258fe59abbe3b110b84e5bd73ebe71eac8 --- /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 64c749333cf4acc68307f2aa17b9b3e386e5d56f..123aa0d5088ec0df3ff5207ee559f3b77b75dfc1 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 0000000000000000000000000000000000000000..29f641f2be44475d2d68e1b2d3b6411614a8f86c --- /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 1327a9fab366180ca80f2ca6f1215de0b2087796..6384b6062195bc0c4e9114ac10508ff07877fa91 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 0000000000000000000000000000000000000000..c78c43cddbf3af9b5d6bf3ef1e9d25aee75579b2 --- /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 c159c7702502d5127cd2370641894ca38b9ceacf..023e5b407976743bb0a32d255fed054f66592bdf 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 0000000000000000000000000000000000000000..40b7fc8f7532a92b89cb8b431b9582f407266793 --- /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 0000000000000000000000000000000000000000..5e39b6d8fa9a0988d82244f66cd3857ba4284bfb --- /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 0000000000000000000000000000000000000000..eb970e6e220775dc8aeaaf6427e2b035c4f6e409 --- /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 0000000000000000000000000000000000000000..cedc98ace64635d2a62693639f1abb087ee4c6d0 --- /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 0000000000000000000000000000000000000000..28662f74142bfb14aae81d9c853de8f345f6b233 --- /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 0000000000000000000000000000000000000000..586baddc36342d5b00e99682cd53b2ca45fc03cb --- /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 0000000000000000000000000000000000000000..1e192cfe598add57bc61f6f40d460e82cd5774a6 --- /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 83db24b8c01ef2258bac77f91c18e7e2e46ec3b6..817a9465ef3dbdfe681df3a34f05620d5bf7d83f 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 0000000000000000000000000000000000000000..91151ce727917e0431a2f8e5a51a243bbdaa05fb --- /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 0000000000000000000000000000000000000000..b8185862b3a91c019cc774d196a1e608f440d240 --- /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 0000000000000000000000000000000000000000..b5013f2e0033685ac619279d95e19c7a4a2929cb --- /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 2aa7d6d6cd7937d2d4a7c2f8ff921135ccceb6de..0d344cf6444394179485d7c4f6727f723ddbeb16 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 0000000000000000000000000000000000000000..90b7c089103b1c323fc9e6f1c93b2a4fe1006941 --- /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 0000000000000000000000000000000000000000..7e1df24fc06402004a698e00e88ad589a156563d --- /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 0000000000000000000000000000000000000000..4c8a3bfa644c238e0214719a761cd9540693a1a6 --- /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 0000000000000000000000000000000000000000..b5a379fc378232f11eb506eb2bcea59491786699 --- /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 0000000000000000000000000000000000000000..307550081d5a4f75ef39ddd9670f049b1ff9d683 --- /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 0000000000000000000000000000000000000000..666faaabc10c5f7808c808c33b7be6fcf44d668c --- /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 0000000000000000000000000000000000000000..a7d1ad227d2ce3f9701dfda73fe8b51abd57121d --- /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 f1eb91d44fda0f7ef530566e89235dc180e1e6f2..de80abfbe499ca2fdea6dbf25e6e69f0c9229b1c 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 ddf1cfe406f7c3033e22c1951eadf21adc5fa9cd..9e46d1955a06b0b1f7ebc48ef518a64a0df96d50 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 0000000000000000000000000000000000000000..1d157c190058461f1050ab159b12b721d6428383 --- /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 0000000000000000000000000000000000000000..802f0004564f9c49cd6be18c4891530f88b1063b --- /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 0000000000000000000000000000000000000000..715c9e5f709cb01b9a02ae0b562caab94646bbac --- /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 c4601b4de1713f914076f5c7679b55cfce52ff04..0ff0f9bbf87ca3b8c07c17af702f56ad7f1ac0a7 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 0000000000000000000000000000000000000000..2eabc59882ac792da86a9d9d1bde2aa9b7f5e9d2 --- /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 0000000000000000000000000000000000000000..97219d5bba90cd5377a461a4214adca9e6a1fbd6 --- /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 0000000000000000000000000000000000000000..97ba0ff8d580ab758af86b5a553ebcf50468bfbc --- /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 0000000000000000000000000000000000000000..b40684ccc7cec220e0983b21e9de8ed5d8e81825 --- /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 0000000000000000000000000000000000000000..8782a37b35accc6156dfd98f2e4a04d0624f8187 --- /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 0000000000000000000000000000000000000000..3800697221e88d0a3c99b4f6e00bc6bb323ae5db --- /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 0000000000000000000000000000000000000000..737faf79a0171902761f7db4c047f8474703d0c2 --- /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 0000000000000000000000000000000000000000..587be63041db49d487e2a005e079156860c1e684 --- /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 0000000000000000000000000000000000000000..7a274553d57660fbcbff9207146fddc81b4fcf3e --- /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 0000000000000000000000000000000000000000..253ecf41edd83fd125d0b7206f5d0477bd23aea2 --- /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 0000000000000000000000000000000000000000..d6b47accb978c82443ac3f4c70a46d7a3312faaa --- /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 0000000000000000000000000000000000000000..2538e5473ee3d824f21416801df4a12fc428729d --- /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 0000000000000000000000000000000000000000..99d4ef44f9a863abc807d13a91faf4cb43015b49 --- /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 0000000000000000000000000000000000000000..dd3b0e00101a4adc8750f713813fba10caa5cfad --- /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 0000000000000000000000000000000000000000..54e6a517343a9583999727d3005734bae0e7406b --- /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 0000000000000000000000000000000000000000..e9660f3e1c2c337b7a0bdd5a568643ea6a40a54a --- /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 0000000000000000000000000000000000000000..37baf742ed8881074c5225a56c26ef0a861b73b4 --- /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 0000000000000000000000000000000000000000..6999196c1b7537751a84ccb59969f5bcd3c90b06 --- /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 0000000000000000000000000000000000000000..8facdab42852715a0d26f51a59ff59b2e063969a --- /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 0000000000000000000000000000000000000000..e909a9ece6077d3388893c4fe274f0130eacbb6c --- /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 0000000000000000000000000000000000000000..4a074eef889036e36e81309e9e1935f34b9d9253 --- /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 0000000000000000000000000000000000000000..02659ffb5aaecc100f02f292de2a4d89d052147e --- /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 0000000000000000000000000000000000000000..9b8eecd389e70fcf21833fd1b12ccbbd2d238aac --- /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 0000000000000000000000000000000000000000..6ecc14cd08182a94b97732ebeb5f4482cb554efb --- /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 0000000000000000000000000000000000000000..1341a2b241d57224680efad4f9958631b79e3637 --- /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 0000000000000000000000000000000000000000..990ddca05d97a368ba8a40b70b263abdf736db45 --- /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 0000000000000000000000000000000000000000..4e6d38dd7af264e4b9cb235601b33e893e12998a --- /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 72cae6abc2dbeb929ead5bac346d78df3a83b5d9..b0dda815f83036e5f867292343cdb6b429c8c9de 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 @@ 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 0000000000000000000000000000000000000000..68bb090e45f227567656684a304b76b11c3f1169 --- /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 0000000000000000000000000000000000000000..a1c483c3eca57c6b490926f024634d04ca07fcfd --- /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 0000000000000000000000000000000000000000..7c7921bd38d2e712abfdd717c8cb5cffbd5c561a --- /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 b5fc06ddaac05b7b8713f0261d100afad681eaa1..646ef48766592d5dc74ae99c7910560897d35bd9 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 0000000000000000000000000000000000000000..4ceff81885a39882165270a93d474afce860d7c7 --- /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 dc44f4f3fb1353db6bd3acad024a71655ffc528c..1feb0c84532a87a1d65fa985f305043e99beac63 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 cbb955fe61d03836b3fd0b1c5a6668a879154182..32174d6254a96aa4a2b7b1cb0c7f69675df6aee0 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 cce6b5c4cbf750cb0cc69fb70fcf47d62649e18d..0a412092017a9cba5bd7c8d978daa84d526db613 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 0000000000000000000000000000000000000000..9e82d348453bbb09c520ef67cb5a7c26de50b976 --- /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 d6a4e5e021d3876704f01db5ebabd855581f0128..940743d3ffa701eda7b249ae4a28d2e5f253e670 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 0000000000000000000000000000000000000000..47ae68353ac32205181888ecd28bfc0c52fbe65d --- /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 286cb4dbff7e183992d1925834307900bdb4e2af..f9c064a105cf747a62504cc77188ad423b959009 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 0000000000000000000000000000000000000000..49bcb64aa7d6f328dcfd081c970c0e5e50df9d98 --- /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 0000000000000000000000000000000000000000..f8b63b49be3f7da87bdb4f6877c84618c44ee905 --- /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 0000000000000000000000000000000000000000..e12eceeb24b28ef40e00b4dcdeb4e2edadcf381a --- /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 802133ae6b98b8658424ef728a4536077c88162b..82f2ffd4dc082c7dabe49e0f952902ea0ccc7786 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 4f865bc9b39cbee5724407a1c2579299b9fa568e..3fdfdc0a809024ca1d0ab3cb05729bee390fb5a7 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 8327217e6f286bb3cf4c98b33669c05a8d5f50c1..bb1cf5949b903aeafd4472ffdb6e1535ca8eb82c 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 0000000000000000000000000000000000000000..18e6dac26087fd81a300cf206bf0a12dbb59b78f --- /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 05de5f8e1941b7dc7ce80d4ab6f0b7b68c4f3266..3ef29a3692ec714e8070dc7ffbc22126c9272ae0 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 0000000000000000000000000000000000000000..bbce7097354b3b97d34d1462dc7f3026d4d24904 --- /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 0000000000000000000000000000000000000000..5c30a5040f0de384afd16ce8ee6937104a5e35d6 --- /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 0000000000000000000000000000000000000000..89de7ee875856dbf1cde19d567565649f8eb3e5a --- /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 0000000000000000000000000000000000000000..323b8fd9ea89a815c6a2a9fb9be5a742161fa52a --- /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 0000000000000000000000000000000000000000..e7452f403b2f42d076f5cbf25bc6580c4266cb00 --- /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 0000000000000000000000000000000000000000..c463f746a58b28bcc5040e1a6603de1b3e8193fb --- /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 0000000000000000000000000000000000000000..93f19253f0077ab5582b34f7f0bbacf4097b0a0e --- /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 0000000000000000000000000000000000000000..228c0d6ef14475b676fe28c6fb6a34eaf8f68de6 --- /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 0000000000000000000000000000000000000000..6af9922a698c433bffb4144ae6fc95ba84ce7821 --- /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 0000000000000000000000000000000000000000..1dda2d3e7fd4c5f3e86d07e7e9e5cb0645de4bb0 --- /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 0000000000000000000000000000000000000000..7cf16fbcef4a37c77d1bbfd0cea03be03a3a2c8c --- /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 d86bf726cbd6eb80a0e7242166274418ce6af86c..e501f5ef1fd62b78f2d92c7a93f3890e55cdcdbb 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 0000000000000000000000000000000000000000..cbb5c4ff3ecdd6cf6b7e9c53821ecfe9f9b25dbf --- /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 67dcbc45419411ebc58149c480fd5d369f31a7d6..0000000000000000000000000000000000000000 --- 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 5c1aae29c2fdf5075280a6d6251724a4036b997a..0000000000000000000000000000000000000000 --- 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 1719b1d5e08a34b1b776fb38b9332eb063a93495..0000000000000000000000000000000000000000 --- 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 fab2ea7ba6c36d58e4501af5615e6b35f2b5d9cf..a8e25596621ca3bb66d29ea9bdbe2d82204d5803 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -19,7 +19,6 @@ #[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 c931d3c0e30b7ab8146e960971ecd2627d5099ff..ca30a4dd95d0e1137b88dd7cdbdb9cd9824c446b 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 8c3b1bb4df333a6fbbddf38e563cd648b48dc309..a80bbd401ab43c70fcc305fea79db444e755069e 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -12,7 +12,7 @@ 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 @@ fn should_run_successfully(&self) -> bool { 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 @@ fn make_compile_args(&self, input_file: &Path, output_file: TargetLocation) -> C } 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.