about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-10-21 00:38:23 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-10-21 14:06:29 +0300
commit7977250fb4c4c939132c28efd5dc58213535c454 (patch)
tree801272812a21def9d3db8b6484a56c704178a1f1 /src
parent64c0efab85ba0fa131a33e4d5bd8189fa1159a75 (diff)
downloadrust-7977250fb4c4c939132c28efd5dc58213535c454.tar.gz
rust-7977250fb4c4c939132c28efd5dc58213535c454.zip
Make sure all ui/parse tests have `-Z parse-only`
Except those testing parsing during macro expansion
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/on-unimplemented/expected-comma-found-token.rs (renamed from src/test/ui/parser/expected-comma-found-token.rs)0
-rw-r--r--src/test/ui/on-unimplemented/expected-comma-found-token.stderr (renamed from src/test/ui/parser/expected-comma-found-token.stderr)0
-rw-r--r--src/test/ui/parser/attr-bad-meta-2.rs2
-rw-r--r--src/test/ui/parser/attr-bad-meta-2.stderr2
-rw-r--r--src/test/ui/parser/attr-bad-meta-3.rs2
-rw-r--r--src/test/ui/parser/attr-bad-meta-3.stderr2
-rw-r--r--src/test/ui/parser/attr-bad-meta.rs2
-rw-r--r--src/test/ui/parser/attr-bad-meta.stderr2
-rw-r--r--src/test/ui/parser/closure-return-syntax.rs2
-rw-r--r--src/test/ui/parser/closure-return-syntax.stderr2
-rw-r--r--src/test/ui/parser/doc-after-struct-field.rs2
-rw-r--r--src/test/ui/parser/doc-before-fn-rbrace.rs3
-rw-r--r--src/test/ui/parser/doc-before-fn-rbrace.stderr2
-rw-r--r--src/test/ui/parser/doc-before-identifier.rs3
-rw-r--r--src/test/ui/parser/doc-before-identifier.stderr2
-rw-r--r--src/test/ui/parser/doc-before-mod-rbrace.rs3
-rw-r--r--src/test/ui/parser/doc-before-mod-rbrace.stderr9
-rw-r--r--src/test/ui/parser/doc-before-struct-rbrace-1.rs3
-rw-r--r--src/test/ui/parser/doc-before-struct-rbrace-1.stderr2
-rw-r--r--src/test/ui/parser/doc-before-struct-rbrace-2.rs3
-rw-r--r--src/test/ui/parser/doc-before-struct-rbrace-2.stderr2
-rw-r--r--src/test/ui/parser/extern-crate-unexpected-token.rs2
-rw-r--r--src/test/ui/parser/extern-crate-unexpected-token.stderr2
-rw-r--r--src/test/ui/parser/if-in-in.rs2
-rw-r--r--src/test/ui/parser/if-in-in.stderr2
-rw-r--r--src/test/ui/parser/inverted-parameters.rs2
-rw-r--r--src/test/ui/parser/inverted-parameters.stderr12
-rw-r--r--src/test/ui/parser/issue-10636-2.rs2
-rw-r--r--src/test/ui/parser/issue-10636-2.stderr6
-rw-r--r--src/test/ui/parser/issue-15980.rs4
-rw-r--r--src/test/ui/parser/issue-15980.stderr9
-rw-r--r--src/test/ui/parser/issue-22647.rs2
-rw-r--r--src/test/ui/parser/issue-22647.stderr2
-rw-r--r--src/test/ui/parser/issue-22712.rs2
-rw-r--r--src/test/ui/parser/issue-22712.stderr2
-rw-r--r--src/test/ui/parser/issue-24197.rs2
-rw-r--r--src/test/ui/parser/issue-24197.stderr2
-rw-r--r--src/test/ui/parser/issue-24375.rs2
-rw-r--r--src/test/ui/parser/issue-24375.stderr2
-rw-r--r--src/test/ui/parser/issue-33455.rs2
-rw-r--r--src/test/ui/parser/issue-33455.stderr2
-rw-r--r--src/test/ui/parser/issue-41155.rs4
-rw-r--r--src/test/ui/parser/issue-41155.stderr11
-rw-r--r--src/test/ui/parser/lifetime-in-pattern.rs2
-rw-r--r--src/test/ui/parser/lifetime-in-pattern.stderr2
-rw-r--r--src/test/ui/parser/macro/issue-33569.rs (renamed from src/test/ui/parser/issue-33569.rs)2
-rw-r--r--src/test/ui/parser/macro/issue-33569.stderr (renamed from src/test/ui/parser/issue-33569.stderr)6
-rw-r--r--src/test/ui/parser/macro/issue-37113.rs (renamed from src/test/ui/parser/issue-37113.rs)0
-rw-r--r--src/test/ui/parser/macro/issue-37113.stderr (renamed from src/test/ui/parser/issue-37113.stderr)0
-rw-r--r--src/test/ui/parser/macro/issue-37234.rs (renamed from src/test/ui/parser/issue-37234.rs)0
-rw-r--r--src/test/ui/parser/macro/issue-37234.stderr (renamed from src/test/ui/parser/issue-37234.stderr)0
-rw-r--r--src/test/ui/parser/macro/macro-doc-comments-1.rs (renamed from src/test/ui/parser/macro-doc-comments-1.rs)0
-rw-r--r--src/test/ui/parser/macro/macro-doc-comments-1.stderr (renamed from src/test/ui/parser/macro-doc-comments-1.stderr)0
-rw-r--r--src/test/ui/parser/macro/macro-doc-comments-2.rs (renamed from src/test/ui/parser/macro-doc-comments-2.rs)0
-rw-r--r--src/test/ui/parser/macro/macro-doc-comments-2.stderr (renamed from src/test/ui/parser/macro-doc-comments-2.stderr)0
-rw-r--r--src/test/ui/parser/macro/macro-incomplete-parse.rs (renamed from src/test/ui/parser/macro-incomplete-parse.rs)0
-rw-r--r--src/test/ui/parser/macro/macro-incomplete-parse.stderr (renamed from src/test/ui/parser/macro-incomplete-parse.stderr)0
-rw-r--r--src/test/ui/parser/macro/macro-repeat.rs (renamed from src/test/ui/parser/macro-repeat.rs)0
-rw-r--r--src/test/ui/parser/macro/macro-repeat.stderr (renamed from src/test/ui/parser/macro-repeat.stderr)0
-rw-r--r--src/test/ui/parser/macro/pub-item-macro.rs (renamed from src/test/ui/parser/pub-item-macro.rs)0
-rw-r--r--src/test/ui/parser/macro/pub-item-macro.stderr (renamed from src/test/ui/parser/pub-item-macro.stderr)0
-rw-r--r--src/test/ui/parser/macro/trait-non-item-macros.rs (renamed from src/test/ui/parser/trait-non-item-macros.rs)0
-rw-r--r--src/test/ui/parser/macro/trait-non-item-macros.stderr (renamed from src/test/ui/parser/trait-non-item-macros.stderr)0
-rw-r--r--src/test/ui/parser/macro/trait-object-macro-matcher.rs (renamed from src/test/ui/parser/trait-object-macro-matcher.rs)0
-rw-r--r--src/test/ui/parser/macro/trait-object-macro-matcher.stderr (renamed from src/test/ui/parser/trait-object-macro-matcher.stderr)0
-rw-r--r--src/test/ui/parser/multiline-comment-line-tracking.rs5
-rw-r--r--src/test/ui/parser/multiline-comment-line-tracking.stderr4
-rw-r--r--src/test/ui/parser/pat-lt-bracket-1.rs2
-rw-r--r--src/test/ui/parser/pat-lt-bracket-1.stderr2
-rw-r--r--src/test/ui/parser/pat-lt-bracket-2.rs2
-rw-r--r--src/test/ui/parser/pat-lt-bracket-2.stderr9
-rw-r--r--src/test/ui/parser/pat-lt-bracket-3.rs2
-rw-r--r--src/test/ui/parser/pat-lt-bracket-3.stderr9
-rw-r--r--src/test/ui/parser/pat-lt-bracket-5.rs2
-rw-r--r--src/test/ui/parser/pat-lt-bracket-5.stderr2
-rw-r--r--src/test/ui/parser/pat-lt-bracket-6.rs2
-rw-r--r--src/test/ui/parser/pat-lt-bracket-6.stderr2
-rw-r--r--src/test/ui/parser/pat-lt-bracket-7.rs2
-rw-r--r--src/test/ui/parser/pat-lt-bracket-7.stderr2
-rw-r--r--src/test/ui/parser/pat-ranges-1.rs2
-rw-r--r--src/test/ui/parser/pat-ranges-1.stderr2
-rw-r--r--src/test/ui/parser/pat-ranges-2.rs2
-rw-r--r--src/test/ui/parser/pat-ranges-2.stderr2
-rw-r--r--src/test/ui/parser/pat-ranges-3.rs2
-rw-r--r--src/test/ui/parser/pat-ranges-3.stderr2
-rw-r--r--src/test/ui/parser/pat-ranges-4.rs2
-rw-r--r--src/test/ui/parser/pat-ranges-4.stderr2
-rw-r--r--src/test/ui/parser/pub-method-macro.rs2
-rw-r--r--src/test/ui/parser/pub-method-macro.stderr2
-rw-r--r--src/test/ui/parser/range_inclusive.rs3
-rw-r--r--src/test/ui/parser/range_inclusive.stderr2
-rw-r--r--src/test/ui/parser/raw/raw_string.rs2
-rw-r--r--src/test/ui/parser/raw/raw_string.stderr2
-rw-r--r--src/test/ui/parser/trait-object-polytrait-priority.rs2
-rw-r--r--src/test/ui/parser/trait-object-polytrait-priority.stderr2
-rw-r--r--src/test/ui/parser/trait-pub-assoc-const.rs2
-rw-r--r--src/test/ui/parser/trait-pub-assoc-const.stderr2
-rw-r--r--src/test/ui/parser/trait-pub-assoc-ty.rs2
-rw-r--r--src/test/ui/parser/trait-pub-assoc-ty.stderr2
-rw-r--r--src/test/ui/parser/trait-pub-method.rs2
-rw-r--r--src/test/ui/parser/trait-pub-method.stderr2
-rw-r--r--src/test/ui/parser/unclosed-braces.rs2
-rw-r--r--src/test/ui/parser/unclosed-braces.stderr2
-rw-r--r--src/test/ui/parser/underscore-suffix-for-float.rs3
-rw-r--r--src/test/ui/parser/underscore-suffix-for-float.stderr11
-rw-r--r--src/test/ui/parser/underscore-suffix-for-string.rs1
-rw-r--r--src/test/ui/parser/underscore-suffix-for-string.stderr2
-rw-r--r--src/test/ui/parser/wrong-escape-of-curly-braces.rs2
-rw-r--r--src/test/ui/parser/wrong-escape-of-curly-braces.stderr15
109 files changed, 151 insertions, 119 deletions
diff --git a/src/test/ui/parser/expected-comma-found-token.rs b/src/test/ui/on-unimplemented/expected-comma-found-token.rs
index f7a632dfaa1..f7a632dfaa1 100644
--- a/src/test/ui/parser/expected-comma-found-token.rs
+++ b/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
index 9a564bb872e..9a564bb872e 100644
--- a/src/test/ui/parser/expected-comma-found-token.stderr
+++ b/src/test/ui/on-unimplemented/expected-comma-found-token.stderr
diff --git a/src/test/ui/parser/attr-bad-meta-2.rs b/src/test/ui/parser/attr-bad-meta-2.rs
index ce640a3f67c..121a0d8eba2 100644
--- a/src/test/ui/parser/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
index 3366936530e..b869331ca5a 100644
--- a/src/test/ui/parser/attr-bad-meta-2.stderr
+++ b/src/test/ui/parser/attr-bad-meta-2.stderr
@@ -1,5 +1,5 @@
 error: unexpected token: `]`
-  --> $DIR/attr-bad-meta-2.rs:11:9
+  --> $DIR/attr-bad-meta-2.rs:13:9
    |
 LL | #[path =] //~ ERROR unexpected token: `]`
    |         ^ unexpected token after this
diff --git a/src/test/ui/parser/attr-bad-meta-3.rs b/src/test/ui/parser/attr-bad-meta-3.rs
index 92e2a59d25d..e0558443a36 100644
--- a/src/test/ui/parser/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
index 059e14871a7..bef2f423ab9 100644
--- a/src/test/ui/parser/attr-bad-meta-3.stderr
+++ b/src/test/ui/parser/attr-bad-meta-3.stderr
@@ -1,5 +1,5 @@
 error: expected `]`, found `token`
-  --> $DIR/attr-bad-meta-3.rs:11:10
+  --> $DIR/attr-bad-meta-3.rs:13:10
    |
 LL | #[path() token] //~ ERROR expected `]`, found `token`
    |          ^^^^^ expected `]`
diff --git a/src/test/ui/parser/attr-bad-meta.rs b/src/test/ui/parser/attr-bad-meta.rs
index 6f9d794dc2d..cf9c3f9a35f 100644
--- a/src/test/ui/parser/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
index c99d822f486..d19fe25bad8 100644
--- a/src/test/ui/parser/attr-bad-meta.stderr
+++ b/src/test/ui/parser/attr-bad-meta.stderr
@@ -1,5 +1,5 @@
 error: expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`
-  --> $DIR/attr-bad-meta.rs:13:7
+  --> $DIR/attr-bad-meta.rs:15:7
    |
 LL | #[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`
    |       ^ expected one of `(`, `::`, `=`, `[`, `]`, or `{` here
diff --git a/src/test/ui/parser/closure-return-syntax.rs b/src/test/ui/parser/closure-return-syntax.rs
index 4c77edec56f..29b6a70b6d7 100644
--- a/src/test/ui/parser/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
index 2b375d6ec01..1e505e5ac9b 100644
--- a/src/test/ui/parser/closure-return-syntax.stderr
+++ b/src/test/ui/parser/closure-return-syntax.stderr
@@ -1,5 +1,5 @@
 error: expected one of `!`, `(`, `+`, `::`, `<`, or `{`, found `22`
-  --> $DIR/closure-return-syntax.rs:15:23
+  --> $DIR/closure-return-syntax.rs:17:23
    |
 LL |     let x = || -> i32 22;
    |                       ^^ expected one of `!`, `(`, `+`, `::`, `<`, or `{` here
diff --git a/src/test/ui/parser/doc-after-struct-field.rs b/src/test/ui/parser/doc-after-struct-field.rs
index a2c60151ac7..11feeae8d81 100644
--- a/src/test/ui/parser/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-before-fn-rbrace.rs b/src/test/ui/parser/doc-before-fn-rbrace.rs
index bcf32612c8f..ad9a73626ac 100644
--- a/src/test/ui/parser/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
index c6b22a9caa5..e74817e1fd2 100644
--- a/src/test/ui/parser/doc-before-fn-rbrace.stderr
+++ b/src/test/ui/parser/doc-before-fn-rbrace.stderr
@@ -1,5 +1,5 @@
 error[E0585]: found a documentation comment that doesn't document anything
-  --> $DIR/doc-before-fn-rbrace.rs:13:5
+  --> $DIR/doc-before-fn-rbrace.rs:14:5
    |
 LL |     /// document
    |     ^^^^^^^^^^^^
diff --git a/src/test/ui/parser/doc-before-identifier.rs b/src/test/ui/parser/doc-before-identifier.rs
index 8f1fad91b1f..2882364081a 100644
--- a/src/test/ui/parser/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
index b153bbab99c..f93ab634c28 100644
--- a/src/test/ui/parser/doc-before-identifier.stderr
+++ b/src/test/ui/parser/doc-before-identifier.stderr
@@ -1,5 +1,5 @@
 error: expected identifier, found `/// document`
-  --> $DIR/doc-before-identifier.rs:12:4
+  --> $DIR/doc-before-identifier.rs:13:4
    |
 LL | fn /// document
    |    ^^^^^^^^^^^^ expected identifier
diff --git a/src/test/ui/parser/doc-before-mod-rbrace.rs b/src/test/ui/parser/doc-before-mod-rbrace.rs
index d38d1876384..d18ebdc5b1e 100644
--- a/src/test/ui/parser/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
index cc7765707f2..807530302af 100644
--- a/src/test/ui/parser/doc-before-mod-rbrace.stderr
+++ b/src/test/ui/parser/doc-before-mod-rbrace.stderr
@@ -1,13 +1,8 @@
 error: expected item after doc comment
-  --> $DIR/doc-before-mod-rbrace.rs:13:5
+  --> $DIR/doc-before-mod-rbrace.rs:14:5
    |
 LL |     /// document
    |     ^^^^^^^^^^^^
 
-error[E0601]: `main` function not found in crate `doc_before_mod_rbrace`
-   |
-   = note: consider adding a `main` function to `$DIR/doc-before-mod-rbrace.rs`
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0601`.
diff --git a/src/test/ui/parser/doc-before-struct-rbrace-1.rs b/src/test/ui/parser/doc-before-struct-rbrace-1.rs
index 6d9b4b05ad9..b0cae467863 100644
--- a/src/test/ui/parser/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
index 5abf8ffe4ad..9909bb250d1 100644
--- a/src/test/ui/parser/doc-before-struct-rbrace-1.stderr
+++ b/src/test/ui/parser/doc-before-struct-rbrace-1.stderr
@@ -1,5 +1,5 @@
 error[E0585]: found a documentation comment that doesn't document anything
-  --> $DIR/doc-before-struct-rbrace-1.rs:14:5
+  --> $DIR/doc-before-struct-rbrace-1.rs:15:5
    |
 LL |     /// document
    |     ^^^^^^^^^^^^
diff --git a/src/test/ui/parser/doc-before-struct-rbrace-2.rs b/src/test/ui/parser/doc-before-struct-rbrace-2.rs
index 63b2f963799..cd5fd2d7a7f 100644
--- a/src/test/ui/parser/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
index 76e8746235f..b69720dd867 100644
--- a/src/test/ui/parser/doc-before-struct-rbrace-2.stderr
+++ b/src/test/ui/parser/doc-before-struct-rbrace-2.stderr
@@ -1,5 +1,5 @@
 error[E0585]: found a documentation comment that doesn't document anything
-  --> $DIR/doc-before-struct-rbrace-2.rs:13:11
+  --> $DIR/doc-before-struct-rbrace-2.rs:14:11
    |
 LL |     a: u8 /// document
    |           ^^^^^^^^^^^^
diff --git a/src/test/ui/parser/extern-crate-unexpected-token.rs b/src/test/ui/parser/extern-crate-unexpected-token.rs
index 2518686575e..619b88a6ab8 100644
--- a/src/test/ui/parser/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
index 04c46e4e3a0..c359a3704bf 100644
--- a/src/test/ui/parser/extern-crate-unexpected-token.stderr
+++ b/src/test/ui/parser/extern-crate-unexpected-token.stderr
@@ -1,5 +1,5 @@
 error: expected one of `crate`, `fn`, or `{`, found `crte`
-  --> $DIR/extern-crate-unexpected-token.rs:11:8
+  --> $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
diff --git a/src/test/ui/parser/if-in-in.rs b/src/test/ui/parser/if-in-in.rs
index 9bc9aaff298..735d571938a 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 9926fcc0858..65da252fc12 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/parser/inverted-parameters.rs b/src/test/ui/parser/inverted-parameters.rs
index a100debbf12..c08a309e11e 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 3f4f0615bc8..63cd36f00c0 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: `<identifier>: <type>`
 
 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: `<identifier>: <type>`
 
 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/ui/parser/issue-10636-2.rs b/src/test/ui/parser/issue-10636-2.rs
index 71180375440..c96834fe4cf 100644
--- a/src/test/ui/parser/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<isize>) {
     option.map(|some| 42;
                           //~^ ERROR: expected one of
diff --git a/src/test/ui/parser/issue-10636-2.stderr b/src/test/ui/parser/issue-10636-2.stderr
index 9800b0c5e3f..8f721a3b5dd 100644
--- a/src/test/ui/parser/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<isize>) {
    |                                            - 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/ui/parser/issue-15980.rs b/src/test/ui/parser/issue-15980.rs
index e1b134c8203..2f11805481d 100644
--- a/src/test/ui/parser/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/parser/issue-15980.stderr b/src/test/ui/parser/issue-15980.stderr
index d52368bf96a..1395803e121 100644
--- a/src/test/ui/parser/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/ui/parser/issue-22647.rs b/src/test/ui/parser/issue-22647.rs
index 1ace57edba3..0f77ddd70cf 100644
--- a/src/test/ui/parser/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: 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
index 8f28d8b1288..fbf078e425b 100644
--- a/src/test/ui/parser/issue-22647.stderr
+++ b/src/test/ui/parser/issue-22647.stderr
@@ -1,5 +1,5 @@
 error: expected one of `:`, `;`, `=`, or `@`, found `<`
-  --> $DIR/issue-22647.rs:12:15
+  --> $DIR/issue-22647.rs:14:15
    |
 LL |     let caller<F> = |f: F|  //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<`
    |               ^ expected one of `:`, `;`, `=`, or `@` here
diff --git a/src/test/ui/parser/issue-22712.rs b/src/test/ui/parser/issue-22712.rs
index ed936cdd9a9..026af652c5e 100644
--- a/src/test/ui/parser/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<B> {
     buffer: B
 }
diff --git a/src/test/ui/parser/issue-22712.stderr b/src/test/ui/parser/issue-22712.stderr
index 21b67c75321..8651005ea68 100644
--- a/src/test/ui/parser/issue-22712.stderr
+++ b/src/test/ui/parser/issue-22712.stderr
@@ -1,5 +1,5 @@
 error: expected one of `:`, `;`, `=`, or `@`, found `<`
-  --> $DIR/issue-22712.rs:16:12
+  --> $DIR/issue-22712.rs:18:12
    |
 LL |     let Foo<Vec<u8>>  //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<`
    |            ^ expected one of `:`, `;`, `=`, or `@` here
diff --git a/src/test/ui/parser/issue-24197.rs b/src/test/ui/parser/issue-24197.rs
index 37d62182612..8e098655a52 100644
--- a/src/test/ui/parser/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
index af382a20ac6..567c4f1f21b 100644
--- a/src/test/ui/parser/issue-24197.stderr
+++ b/src/test/ui/parser/issue-24197.stderr
@@ -1,5 +1,5 @@
 error: expected one of `:`, `;`, `=`, or `@`, found `[`
-  --> $DIR/issue-24197.rs:12:12
+  --> $DIR/issue-24197.rs:14:12
    |
 LL |     let buf[0] = 0; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[`
    |            ^ expected one of `:`, `;`, `=`, or `@` here
diff --git a/src/test/ui/parser/issue-24375.rs b/src/test/ui/parser/issue-24375.rs
index 8723423325c..aca50fdaf10 100644
--- a/src/test/ui/parser/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
index 7d82e13626a..0a9be6f4d2a 100644
--- a/src/test/ui/parser/issue-24375.stderr
+++ b/src/test/ui/parser/issue-24375.stderr
@@ -1,5 +1,5 @@
 error: expected one of `=>`, `@`, `if`, or `|`, found `[`
-  --> $DIR/issue-24375.rs:16:12
+  --> $DIR/issue-24375.rs:18:12
    |
 LL |         tmp[0] => {} //~ ERROR expected one of `=>`, `@`, `if`, or `|`, found `[`
    |            ^ expected one of `=>`, `@`, `if`, or `|` here
diff --git a/src/test/ui/parser/issue-33455.rs b/src/test/ui/parser/issue-33455.rs
index 96070332f06..6a9d03cdd91 100644
--- a/src/test/ui/parser/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
index 7f85464510f..cc9bb2d7c93 100644
--- a/src/test/ui/parser/issue-33455.stderr
+++ b/src/test/ui/parser/issue-33455.stderr
@@ -1,5 +1,5 @@
 error: expected one of `::`, `;`, or `as`, found `.`
-  --> $DIR/issue-33455.rs:11:8
+  --> $DIR/issue-33455.rs:13:8
    |
 LL | use foo.bar; //~ ERROR expected one of `::`, `;`, or `as`, found `.`
    |        ^ expected one of `::`, `;`, or `as` here
diff --git a/src/test/ui/parser/issue-41155.rs b/src/test/ui/parser/issue-41155.rs
index 7bd8506af90..3d234dc378a 100644
--- a/src/test/ui/parser/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
index 5c1aae29c2f..34b78fca3bd 100644
--- a/src/test/ui/parser/issue-41155.stderr
+++ b/src/test/ui/parser/issue-41155.stderr
@@ -1,17 +1,10 @@
 error: expected one of `(`, `async`, `const`, `default`, `existential`, `extern`, `fn`, `type`, or `unsafe`, found `}`
-  --> $DIR/issue-41155.rs:13:1
+  --> $DIR/issue-41155.rs:15: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
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0412`.
diff --git a/src/test/ui/parser/lifetime-in-pattern.rs b/src/test/ui/parser/lifetime-in-pattern.rs
index 8802497ae1b..ccabcdf2d75 100644
--- a/src/test/ui/parser/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
index 648dfcc57d5..86cc3c5b0cb 100644
--- a/src/test/ui/parser/lifetime-in-pattern.stderr
+++ b/src/test/ui/parser/lifetime-in-pattern.stderr
@@ -1,5 +1,5 @@
 error: unexpected lifetime `'a` in pattern
-  --> $DIR/lifetime-in-pattern.rs:11:10
+  --> $DIR/lifetime-in-pattern.rs:13:10
    |
 LL | fn test(&'a str) {
    |          ^^ unexpected lifetime
diff --git a/src/test/ui/parser/issue-33569.rs b/src/test/ui/parser/macro/issue-33569.rs
index 15d491719a6..a0b959ecea5 100644
--- a/src/test/ui/parser/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/issue-33569.stderr b/src/test/ui/parser/macro/issue-33569.stderr
index 1bcd3f55a70..4dab8fc73f3 100644
--- a/src/test/ui/parser/issue-33569.stderr
+++ b/src/test/ui/parser/macro/issue-33569.stderr
@@ -1,17 +1,17 @@
 error: expected identifier, found `+`
-  --> $DIR/issue-33569.rs:14:8
+  --> $DIR/issue-33569.rs:12:8
    |
 LL |     { $+ } => { //~ ERROR expected identifier, found `+`
    |        ^
 
 error: expected `*` or `+`
-  --> $DIR/issue-33569.rs:16:13
+  --> $DIR/issue-33569.rs:14:13
    |
 LL |         $(x)(y) //~ ERROR expected `*` or `+`
    |             ^^^
 
 error: missing fragment specifier
-  --> $DIR/issue-33569.rs:14:8
+  --> $DIR/issue-33569.rs:12:8
    |
 LL |     { $+ } => { //~ ERROR expected identifier, found `+`
    |        ^
diff --git a/src/test/ui/parser/issue-37113.rs b/src/test/ui/parser/macro/issue-37113.rs
index 14c6f3944bb..14c6f3944bb 100644
--- a/src/test/ui/parser/issue-37113.rs
+++ b/src/test/ui/parser/macro/issue-37113.rs
diff --git a/src/test/ui/parser/issue-37113.stderr b/src/test/ui/parser/macro/issue-37113.stderr
index 1e8f017e1db..1e8f017e1db 100644
--- a/src/test/ui/parser/issue-37113.stderr
+++ b/src/test/ui/parser/macro/issue-37113.stderr
diff --git a/src/test/ui/parser/issue-37234.rs b/src/test/ui/parser/macro/issue-37234.rs
index 93a1468bf7b..93a1468bf7b 100644
--- a/src/test/ui/parser/issue-37234.rs
+++ b/src/test/ui/parser/macro/issue-37234.rs
diff --git a/src/test/ui/parser/issue-37234.stderr b/src/test/ui/parser/macro/issue-37234.stderr
index 28dd71316aa..28dd71316aa 100644
--- a/src/test/ui/parser/issue-37234.stderr
+++ b/src/test/ui/parser/macro/issue-37234.stderr
diff --git a/src/test/ui/parser/macro-doc-comments-1.rs b/src/test/ui/parser/macro/macro-doc-comments-1.rs
index 03bcef4fa5e..03bcef4fa5e 100644
--- a/src/test/ui/parser/macro-doc-comments-1.rs
+++ b/src/test/ui/parser/macro/macro-doc-comments-1.rs
diff --git a/src/test/ui/parser/macro-doc-comments-1.stderr b/src/test/ui/parser/macro/macro-doc-comments-1.stderr
index a7fdd28b0ca..a7fdd28b0ca 100644
--- a/src/test/ui/parser/macro-doc-comments-1.stderr
+++ b/src/test/ui/parser/macro/macro-doc-comments-1.stderr
diff --git a/src/test/ui/parser/macro-doc-comments-2.rs b/src/test/ui/parser/macro/macro-doc-comments-2.rs
index a1b112c29b6..a1b112c29b6 100644
--- a/src/test/ui/parser/macro-doc-comments-2.rs
+++ b/src/test/ui/parser/macro/macro-doc-comments-2.rs
diff --git a/src/test/ui/parser/macro-doc-comments-2.stderr b/src/test/ui/parser/macro/macro-doc-comments-2.stderr
index bae9823b9b2..bae9823b9b2 100644
--- a/src/test/ui/parser/macro-doc-comments-2.stderr
+++ b/src/test/ui/parser/macro/macro-doc-comments-2.stderr
diff --git a/src/test/ui/parser/macro-incomplete-parse.rs b/src/test/ui/parser/macro/macro-incomplete-parse.rs
index 9b8fdaf9a25..9b8fdaf9a25 100644
--- a/src/test/ui/parser/macro-incomplete-parse.rs
+++ b/src/test/ui/parser/macro/macro-incomplete-parse.rs
diff --git a/src/test/ui/parser/macro-incomplete-parse.stderr b/src/test/ui/parser/macro/macro-incomplete-parse.stderr
index 198730dc07a..198730dc07a 100644
--- a/src/test/ui/parser/macro-incomplete-parse.stderr
+++ b/src/test/ui/parser/macro/macro-incomplete-parse.stderr
diff --git a/src/test/ui/parser/macro-repeat.rs b/src/test/ui/parser/macro/macro-repeat.rs
index 3abadd885ac..3abadd885ac 100644
--- a/src/test/ui/parser/macro-repeat.rs
+++ b/src/test/ui/parser/macro/macro-repeat.rs
diff --git a/src/test/ui/parser/macro-repeat.stderr b/src/test/ui/parser/macro/macro-repeat.stderr
index 7c7a2fb12c3..7c7a2fb12c3 100644
--- a/src/test/ui/parser/macro-repeat.stderr
+++ b/src/test/ui/parser/macro/macro-repeat.stderr
diff --git a/src/test/ui/parser/pub-item-macro.rs b/src/test/ui/parser/macro/pub-item-macro.rs
index 8809e9a257d..8809e9a257d 100644
--- a/src/test/ui/parser/pub-item-macro.rs
+++ b/src/test/ui/parser/macro/pub-item-macro.rs
diff --git a/src/test/ui/parser/pub-item-macro.stderr b/src/test/ui/parser/macro/pub-item-macro.stderr
index f55ba469ab4..f55ba469ab4 100644
--- a/src/test/ui/parser/pub-item-macro.stderr
+++ b/src/test/ui/parser/macro/pub-item-macro.stderr
diff --git a/src/test/ui/parser/trait-non-item-macros.rs b/src/test/ui/parser/macro/trait-non-item-macros.rs
index 9f94d5d41fd..9f94d5d41fd 100644
--- a/src/test/ui/parser/trait-non-item-macros.rs
+++ b/src/test/ui/parser/macro/trait-non-item-macros.rs
diff --git a/src/test/ui/parser/trait-non-item-macros.stderr b/src/test/ui/parser/macro/trait-non-item-macros.stderr
index 2f4fdbfbc2b..2f4fdbfbc2b 100644
--- a/src/test/ui/parser/trait-non-item-macros.stderr
+++ b/src/test/ui/parser/macro/trait-non-item-macros.stderr
diff --git a/src/test/ui/parser/trait-object-macro-matcher.rs b/src/test/ui/parser/macro/trait-object-macro-matcher.rs
index 3a5bce509f1..3a5bce509f1 100644
--- a/src/test/ui/parser/trait-object-macro-matcher.rs
+++ b/src/test/ui/parser/macro/trait-object-macro-matcher.rs
diff --git a/src/test/ui/parser/trait-object-macro-matcher.stderr b/src/test/ui/parser/macro/trait-object-macro-matcher.stderr
index ab536dc5854..ab536dc5854 100644
--- a/src/test/ui/parser/trait-object-macro-matcher.stderr
+++ b/src/test/ui/parser/macro/trait-object-macro-matcher.stderr
diff --git a/src/test/ui/parser/multiline-comment-line-tracking.rs b/src/test/ui/parser/multiline-comment-line-tracking.rs
index 11abe672745..44ed0a3706c 100644
--- a/src/test/ui/parser/multiline-comment-line-tracking.rs
+++ b/src/test/ui/parser/multiline-comment-line-tracking.rs
@@ -8,12 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// error-pattern:18:3
+// compile-flags: -Z parse-only
+// error-pattern:19:3
 
 /* 1
  * 2
  * 3
  */
 fn main() {
-  %; // parse error on line 18, but is reported on line 6 instead.
+  %; // parse error on line 19, but is reported on line 6 instead.
 }
diff --git a/src/test/ui/parser/multiline-comment-line-tracking.stderr b/src/test/ui/parser/multiline-comment-line-tracking.stderr
index 75f6aefb26c..2dba2b1cb7e 100644
--- a/src/test/ui/parser/multiline-comment-line-tracking.stderr
+++ b/src/test/ui/parser/multiline-comment-line-tracking.stderr
@@ -1,7 +1,7 @@
 error: expected expression, found `%`
-  --> $DIR/multiline-comment-line-tracking.rs:18:3
+  --> $DIR/multiline-comment-line-tracking.rs:19:3
    |
-LL |   %; // parse error on line 18, but is reported on line 6 instead.
+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/ui/parser/pat-lt-bracket-1.rs b/src/test/ui/parser/pat-lt-bracket-1.rs
index 6d3d1207788..fc1957571b1 100644
--- a/src/test/ui/parser/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
index 0b1402d1d56..5ab5ce2649a 100644
--- a/src/test/ui/parser/pat-lt-bracket-1.stderr
+++ b/src/test/ui/parser/pat-lt-bracket-1.stderr
@@ -1,5 +1,5 @@
 error: expected one of `=>`, `@`, `if`, or `|`, found `<`
-  --> $DIR/pat-lt-bracket-1.rs:13:7
+  --> $DIR/pat-lt-bracket-1.rs:15:7
    |
 LL |     x < 7 => (),
    |       ^ expected one of `=>`, `@`, `if`, or `|` here
diff --git a/src/test/ui/parser/pat-lt-bracket-2.rs b/src/test/ui/parser/pat-lt-bracket-2.rs
index 6a0653041d4..a88e8384711 100644
--- a/src/test/ui/parser/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
index 341990dd891..d0d815045e0 100644
--- a/src/test/ui/parser/pat-lt-bracket-2.stderr
+++ b/src/test/ui/parser/pat-lt-bracket-2.stderr
@@ -1,13 +1,8 @@
 error: expected one of `:` or `@`, found `<`
-  --> $DIR/pat-lt-bracket-2.rs:11:7
+  --> $DIR/pat-lt-bracket-2.rs:13:7
    |
 LL | fn a(B<) {}
    |       ^ expected one of `:` or `@` here
 
-error[E0601]: `main` function not found in crate `pat_lt_bracket_2`
-   |
-   = note: consider adding a `main` function to `$DIR/pat-lt-bracket-2.rs`
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0601`.
diff --git a/src/test/ui/parser/pat-lt-bracket-3.rs b/src/test/ui/parser/pat-lt-bracket-3.rs
index 8ea2bcf900c..1a3f7aa8182 100644
--- a/src/test/ui/parser/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, T);
 
 impl<T> Foo<T> {
diff --git a/src/test/ui/parser/pat-lt-bracket-3.stderr b/src/test/ui/parser/pat-lt-bracket-3.stderr
index 2cc2800f36b..1be61b1a12b 100644
--- a/src/test/ui/parser/pat-lt-bracket-3.stderr
+++ b/src/test/ui/parser/pat-lt-bracket-3.stderr
@@ -1,13 +1,8 @@
 error: expected one of `=>`, `@`, `if`, or `|`, found `<`
-  --> $DIR/pat-lt-bracket-3.rs:16:16
+  --> $DIR/pat-lt-bracket-3.rs:18:16
    |
 LL |             Foo<T>(x, y) => {
    |                ^ expected one of `=>`, `@`, `if`, or `|` here
 
-error[E0601]: `main` function not found in crate `pat_lt_bracket_3`
-   |
-   = note: consider adding a `main` function to `$DIR/pat-lt-bracket-3.rs`
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0601`.
diff --git a/src/test/ui/parser/pat-lt-bracket-5.rs b/src/test/ui/parser/pat-lt-bracket-5.rs
index 421d7a05bef..160b985dc6e 100644
--- a/src/test/ui/parser/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
index 567263576c8..6174ed63007 100644
--- a/src/test/ui/parser/pat-lt-bracket-5.stderr
+++ b/src/test/ui/parser/pat-lt-bracket-5.stderr
@@ -1,5 +1,5 @@
 error: expected one of `:`, `;`, `=`, or `@`, found `[`
-  --> $DIR/pat-lt-bracket-5.rs:12:10
+  --> $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
diff --git a/src/test/ui/parser/pat-lt-bracket-6.rs b/src/test/ui/parser/pat-lt-bracket-6.rs
index fb78e558a95..eaea9f4acd7 100644
--- a/src/test/ui/parser/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
index a173b26e07f..9666f18fac5 100644
--- a/src/test/ui/parser/pat-lt-bracket-6.stderr
+++ b/src/test/ui/parser/pat-lt-bracket-6.stderr
@@ -1,5 +1,5 @@
 error: expected one of `)`, `,`, or `@`, found `[`
-  --> $DIR/pat-lt-bracket-6.rs:12:19
+  --> $DIR/pat-lt-bracket-6.rs:14:19
    |
 LL |     let Test(&desc[..]) = x; //~ ERROR: expected one of `)`, `,`, or `@`, found `[`
    |                   ^ expected one of `)`, `,`, or `@` here
diff --git a/src/test/ui/parser/pat-lt-bracket-7.rs b/src/test/ui/parser/pat-lt-bracket-7.rs
index d75589d8889..ac1c1f7ee1f 100644
--- a/src/test/ui/parser/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
index 31fd8b16b21..09a398fb2b0 100644
--- a/src/test/ui/parser/pat-lt-bracket-7.stderr
+++ b/src/test/ui/parser/pat-lt-bracket-7.stderr
@@ -1,5 +1,5 @@
 error: expected one of `)`, `,`, or `@`, found `[`
-  --> $DIR/pat-lt-bracket-7.rs:12:16
+  --> $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
diff --git a/src/test/ui/parser/pat-ranges-1.rs b/src/test/ui/parser/pat-ranges-1.rs
index 857a3924aec..7aa02871018 100644
--- a/src/test/ui/parser/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
index 10825036566..61d1bf258fe 100644
--- a/src/test/ui/parser/pat-ranges-1.stderr
+++ b/src/test/ui/parser/pat-ranges-1.stderr
@@ -1,5 +1,5 @@
 error: expected one of `:`, `;`, or `=`, found `..=`
-  --> $DIR/pat-ranges-1.rs:14:21
+  --> $DIR/pat-ranges-1.rs:16:21
    |
 LL |     let macropus!() ..= 11 = 12; //~ error: expected one of `:`, `;`, or `=`, found `..=`
    |                     ^^^ expected one of `:`, `;`, or `=` here
diff --git a/src/test/ui/parser/pat-ranges-2.rs b/src/test/ui/parser/pat-ranges-2.rs
index 64c749333cf..123aa0d5088 100644
--- a/src/test/ui/parser/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
index bfcf8c22a7e..29f641f2be4 100644
--- a/src/test/ui/parser/pat-ranges-2.stderr
+++ b/src/test/ui/parser/pat-ranges-2.stderr
@@ -1,5 +1,5 @@
 error: expected one of `::`, `:`, `;`, or `=`, found `!`
-  --> $DIR/pat-ranges-2.rs:14:26
+  --> $DIR/pat-ranges-2.rs:16:26
    |
 LL |     let 10 ..= makropulos!() = 12; //~ error: expected one of `::`, `:`, `;`, or `=`, found `!`
    |                          ^ expected one of `::`, `:`, `;`, or `=` here
diff --git a/src/test/ui/parser/pat-ranges-3.rs b/src/test/ui/parser/pat-ranges-3.rs
index 1327a9fab36..6384b606219 100644
--- a/src/test/ui/parser/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
index 403cebccdd2..c78c43cddbf 100644
--- a/src/test/ui/parser/pat-ranges-3.stderr
+++ b/src/test/ui/parser/pat-ranges-3.stderr
@@ -1,5 +1,5 @@
 error: expected one of `:`, `;`, or `=`, found `+`
-  --> $DIR/pat-ranges-3.rs:14:19
+  --> $DIR/pat-ranges-3.rs:16:19
    |
 LL |     let 10 ..= 10 + 3 = 12; //~ expected one of `:`, `;`, or `=`, found `+`
    |                   ^ expected one of `:`, `;`, or `=` here
diff --git a/src/test/ui/parser/pat-ranges-4.rs b/src/test/ui/parser/pat-ranges-4.rs
index c159c770250..023e5b40797 100644
--- a/src/test/ui/parser/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
index 557f35370cb..40b7fc8f753 100644
--- a/src/test/ui/parser/pat-ranges-4.stderr
+++ b/src/test/ui/parser/pat-ranges-4.stderr
@@ -1,5 +1,5 @@
 error: expected one of `...`, `..=`, `..`, `:`, `;`, or `=`, found `-`
-  --> $DIR/pat-ranges-4.rs:14:12
+  --> $DIR/pat-ranges-4.rs:16:12
    |
 LL |     let 10 - 3 ..= 10 = 8;
    |            ^ expected one of `...`, `..=`, `..`, `:`, `;`, or `=` here
diff --git a/src/test/ui/parser/pub-method-macro.rs b/src/test/ui/parser/pub-method-macro.rs
index 83db24b8c01..817a9465ef3 100644
--- a/src/test/ui/parser/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
index 2c348223fca..91151ce7279 100644
--- a/src/test/ui/parser/pub-method-macro.stderr
+++ b/src/test/ui/parser/pub-method-macro.stderr
@@ -1,5 +1,5 @@
 error: can't qualify macro invocation with `pub`
-  --> $DIR/pub-method-macro.rs:27:9
+  --> $DIR/pub-method-macro.rs:29:9
    |
 LL |         pub defn!(f); //~ ERROR can't qualify macro invocation with `pub`
    |         ^^^
diff --git a/src/test/ui/parser/range_inclusive.rs b/src/test/ui/parser/range_inclusive.rs
index 2aa7d6d6cd7..0d344cf6444 100644
--- a/src/test/ui/parser/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
index a8ded6d0cbe..90b7c089103 100644
--- a/src/test/ui/parser/range_inclusive.stderr
+++ b/src/test/ui/parser/range_inclusive.stderr
@@ -1,5 +1,5 @@
 error[E0586]: inclusive range with no end
-  --> $DIR/range_inclusive.rs:14:19
+  --> $DIR/range_inclusive.rs:16:19
    |
 LL |     for _ in 1..= {} //~ERROR inclusive range with no end
    |                   ^
diff --git a/src/test/ui/parser/raw/raw_string.rs b/src/test/ui/parser/raw/raw_string.rs
index f1eb91d44fd..de80abfbe49 100644
--- a/src/test/ui/parser/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/parser/raw/raw_string.stderr b/src/test/ui/parser/raw/raw_string.stderr
index ddf1cfe406f..9e46d1955a0 100644
--- a/src/test/ui/parser/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/ui/parser/trait-object-polytrait-priority.rs b/src/test/ui/parser/trait-object-polytrait-priority.rs
index b5fc06ddaac..646ef487665 100644
--- a/src/test/ui/parser/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
index 2aac799ac50..4ceff81885a 100644
--- a/src/test/ui/parser/trait-object-polytrait-priority.stderr
+++ b/src/test/ui/parser/trait-object-polytrait-priority.stderr
@@ -1,5 +1,5 @@
 error[E0178]: expected a path on the left-hand side of `+`, not `&for<'a> Trait<'a>`
-  --> $DIR/trait-object-polytrait-priority.rs:14:12
+  --> $DIR/trait-object-polytrait-priority.rs:16:12
    |
 LL |     let _: &for<'a> Trait<'a> + 'static;
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try adding parentheses: `&(for<'a> Trait<'a> + 'static)`
diff --git a/src/test/ui/parser/trait-pub-assoc-const.rs b/src/test/ui/parser/trait-pub-assoc-const.rs
index cce6b5c4cbf..0a412092017 100644
--- a/src/test/ui/parser/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
index 44d6fa9ca66..9e82d348453 100644
--- a/src/test/ui/parser/trait-pub-assoc-const.stderr
+++ b/src/test/ui/parser/trait-pub-assoc-const.stderr
@@ -1,5 +1,5 @@
 error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `pub`
-  --> $DIR/trait-pub-assoc-const.rs:12:5
+  --> $DIR/trait-pub-assoc-const.rs:14:5
    |
 LL | trait Foo {
    |            - expected one of 7 possible tokens here
diff --git a/src/test/ui/parser/trait-pub-assoc-ty.rs b/src/test/ui/parser/trait-pub-assoc-ty.rs
index d6a4e5e021d..940743d3ffa 100644
--- a/src/test/ui/parser/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
index c8ba1cc9d14..47ae68353ac 100644
--- a/src/test/ui/parser/trait-pub-assoc-ty.stderr
+++ b/src/test/ui/parser/trait-pub-assoc-ty.stderr
@@ -1,5 +1,5 @@
 error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `pub`
-  --> $DIR/trait-pub-assoc-ty.rs:12:5
+  --> $DIR/trait-pub-assoc-ty.rs:14:5
    |
 LL | trait Foo {
    |            - expected one of 7 possible tokens here
diff --git a/src/test/ui/parser/trait-pub-method.rs b/src/test/ui/parser/trait-pub-method.rs
index 286cb4dbff7..f9c064a105c 100644
--- a/src/test/ui/parser/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
index 125a25fb8b5..49bcb64aa7d 100644
--- a/src/test/ui/parser/trait-pub-method.stderr
+++ b/src/test/ui/parser/trait-pub-method.stderr
@@ -1,5 +1,5 @@
 error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `pub`
-  --> $DIR/trait-pub-method.rs:12:5
+  --> $DIR/trait-pub-method.rs:14:5
    |
 LL | trait Foo {
    |            - expected one of 7 possible tokens here
diff --git a/src/test/ui/parser/unclosed-braces.rs b/src/test/ui/parser/unclosed-braces.rs
index 802133ae6b9..82f2ffd4dc0 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 4f865bc9b39..3fdfdc0a809 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/ui/parser/underscore-suffix-for-float.rs b/src/test/ui/parser/underscore-suffix-for-float.rs
index 8327217e6f2..bb1cf5949b9 100644
--- a/src/test/ui/parser/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
index f59c7612c6f..18e6dac2608 100644
--- a/src/test/ui/parser/underscore-suffix-for-float.stderr
+++ b/src/test/ui/parser/underscore-suffix-for-float.stderr
@@ -1,15 +1,8 @@
 error: expected identifier, found reserved identifier `_`
-  --> $DIR/underscore-suffix-for-float.rs:12:16
+  --> $DIR/underscore-suffix-for-float.rs:14:16
    |
 LL |     let a = 42._; //~ ERROR expected identifier, found reserved identifier `_`
    |                ^ expected identifier, found reserved identifier
 
-error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
-  --> $DIR/underscore-suffix-for-float.rs:12:16
-   |
-LL |     let a = 42._; //~ ERROR expected identifier, found reserved identifier `_`
-   |                ^
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0610`.
diff --git a/src/test/ui/parser/underscore-suffix-for-string.rs b/src/test/ui/parser/underscore-suffix-for-string.rs
index 6917134c5f7..3ef29a3692e 100644
--- a/src/test/ui/parser/underscore-suffix-for-string.rs
+++ b/src/test/ui/parser/underscore-suffix-for-string.rs
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // compile-pass
+// compile-flags: -Z parse-only
 
 fn main() {
     let _ = "Foo"_;
diff --git a/src/test/ui/parser/underscore-suffix-for-string.stderr b/src/test/ui/parser/underscore-suffix-for-string.stderr
index 5455588cf17..bbce7097354 100644
--- a/src/test/ui/parser/underscore-suffix-for-string.stderr
+++ b/src/test/ui/parser/underscore-suffix-for-string.stderr
@@ -1,5 +1,5 @@
 warning: underscore literal suffix is not allowed
-  --> $DIR/underscore-suffix-for-string.rs:14:18
+  --> $DIR/underscore-suffix-for-string.rs:15:18
    |
 LL |     let _ = "Foo"_;
    |                  ^
diff --git a/src/test/ui/parser/wrong-escape-of-curly-braces.rs b/src/test/ui/parser/wrong-escape-of-curly-braces.rs
index d86bf726cbd..e501f5ef1fd 100644
--- a/src/test/ui/parser/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
index 6c3e26175be..cbb5c4ff3ec 100644
--- a/src/test/ui/parser/wrong-escape-of-curly-braces.stderr
+++ b/src/test/ui/parser/wrong-escape-of-curly-braces.stderr
@@ -1,31 +1,26 @@
 error: unknown character escape: {
-  --> $DIR/wrong-escape-of-curly-braces.rs:13:17
+  --> $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:13:17
+  --> $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:13:30
+  --> $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:13:30
+  --> $DIR/wrong-escape-of-curly-braces.rs:15:30
    |
 LL |     let bad = "/{it is wrong/}";
    |                              ^
 
-error[E0601]: `main` function not found in crate `wrong_escape_of_curly_braces`
-   |
-   = note: consider adding a `main` function to `$DIR/wrong-escape-of-curly-braces.rs`
-
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0601`.