about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2015-02-09 20:01:45 +0100
committerFlorian Hahn <flo@fhahn.com>2015-04-18 12:23:49 +0200
commit2a24e97c80d5004cd1b57cb96a0bde6fe43a848d (patch)
tree231f176011e80bb6e66d3d89bbd90fa71bbc6d43
parent7a5754b330e78e2ab5a2682a16f53f4f9fe96ed7 (diff)
downloadrust-2a24e97c80d5004cd1b57cb96a0bde6fe43a848d.tar.gz
rust-2a24e97c80d5004cd1b57cb96a0bde6fe43a848d.zip
Return nonzero exit code if there are errors at a stop point
-rw-r--r--src/librustc_driver/driver.rs15
-rw-r--r--src/test/compile-fail/mod_file_disambig.rs2
-rw-r--r--src/test/compile-fail/mod_file_not_owning.rs2
-rw-r--r--src/test/parse-fail/array-old-syntax-1.rs2
-rw-r--r--src/test/parse-fail/ascii-only-character-escape.rs2
-rw-r--r--src/test/parse-fail/associated-types-project-from-hrtb-explicit.rs2
-rw-r--r--src/test/parse-fail/attr-bad-meta.rs2
-rw-r--r--src/test/parse-fail/attr-before-eof.rs2
-rw-r--r--src/test/parse-fail/attr-before-ext.rs2
-rw-r--r--src/test/parse-fail/attr-before-let.rs2
-rw-r--r--src/test/parse-fail/attr-before-stmt.rs2
-rw-r--r--src/test/parse-fail/attr-dangling-in-fn.rs2
-rw-r--r--src/test/parse-fail/attr-dangling-in-mod.rs2
-rw-r--r--src/test/parse-fail/attr.rs2
-rw-r--r--src/test/parse-fail/attrs-after-extern-mod.rs2
-rw-r--r--src/test/parse-fail/bad-char-literals.rs2
-rw-r--r--src/test/parse-fail/bad-lit-suffixes.rs2
-rw-r--r--src/test/parse-fail/bad-match.rs2
-rw-r--r--src/test/parse-fail/bad-name.rs2
-rw-r--r--src/test/parse-fail/bad-value-ident-false.rs2
-rw-r--r--src/test/parse-fail/bad-value-ident-true.rs2
-rw-r--r--src/test/parse-fail/better-expected.rs2
-rw-r--r--src/test/parse-fail/bind-struct-early-modifiers.rs2
-rw-r--r--src/test/parse-fail/byte-literals.rs2
-rw-r--r--src/test/parse-fail/byte-string-literals.rs2
-rw-r--r--src/test/parse-fail/circular_modules_hello.rs2
-rw-r--r--src/test/parse-fail/circular_modules_main.rs2
-rw-r--r--src/test/parse-fail/class-implements-bad-trait.rs2
-rw-r--r--src/test/parse-fail/column-offset-1-based.rs4
-rw-r--r--src/test/parse-fail/doc-before-attr.rs2
-rw-r--r--src/test/parse-fail/doc-before-eof.rs2
-rw-r--r--src/test/parse-fail/doc-before-extern-rbrace.rs2
-rw-r--r--src/test/parse-fail/doc-before-macro.rs2
-rw-r--r--src/test/parse-fail/doc-before-rbrace.rs2
-rw-r--r--src/test/parse-fail/doc-before-semi.rs2
-rw-r--r--src/test/parse-fail/duplicate-visibility.rs2
-rw-r--r--src/test/parse-fail/empty-impl-semicolon.rs2
-rw-r--r--src/test/parse-fail/extern-expected-fn-or-brace.rs2
-rw-r--r--src/test/parse-fail/extern-foreign-crate.rs2
-rw-r--r--src/test/parse-fail/extern-no-fn.rs2
-rw-r--r--src/test/parse-fail/generic-non-trailing-defaults.rs2
-rw-r--r--src/test/parse-fail/import-from-path.rs2
-rw-r--r--src/test/parse-fail/import-from-rename.rs2
-rw-r--r--src/test/parse-fail/import-glob-path.rs2
-rw-r--r--src/test/parse-fail/import-glob-rename.rs2
-rw-r--r--src/test/parse-fail/int-literal-too-large-span.rs2
-rw-r--r--src/test/parse-fail/issue-10392-2.rs2
-rw-r--r--src/test/parse-fail/issue-10392.rs2
-rw-r--r--src/test/parse-fail/issue-10412.rs2
-rw-r--r--src/test/parse-fail/issue-10636-1.rs2
-rw-r--r--src/test/parse-fail/issue-10636-2.rs2
-rw-r--r--src/test/parse-fail/issue-12560-1.rs2
-rw-r--r--src/test/parse-fail/issue-14182.rs2
-rw-r--r--src/test/parse-fail/issue-14303-enum.rs2
-rw-r--r--src/test/parse-fail/issue-14303-fn-def.rs2
-rw-r--r--src/test/parse-fail/issue-14303-fncall.rs2
-rw-r--r--src/test/parse-fail/issue-14303-impl.rs2
-rw-r--r--src/test/parse-fail/issue-14303-path.rs2
-rw-r--r--src/test/parse-fail/issue-14303-struct.rs2
-rw-r--r--src/test/parse-fail/issue-14303-trait.rs2
-rw-r--r--src/test/parse-fail/issue-15914.rs2
-rw-r--r--src/test/parse-fail/issue-1655.rs2
-rw-r--r--src/test/parse-fail/issue-17383.rs2
-rw-r--r--src/test/parse-fail/issue-17718-const-mut.rs2
-rw-r--r--src/test/parse-fail/issue-17904.rs2
-rw-r--r--src/test/parse-fail/issue-1802-1.rs2
-rw-r--r--src/test/parse-fail/issue-1802-2.rs2
-rw-r--r--src/test/parse-fail/issue-19096.rs2
-rw-r--r--src/test/parse-fail/issue-19398.rs2
-rw-r--r--src/test/parse-fail/issue-20711-2.rs2
-rw-r--r--src/test/parse-fail/issue-20711.rs2
-rw-r--r--src/test/parse-fail/issue-21153.rs2
-rw-r--r--src/test/parse-fail/issue-2354-1.rs2
-rw-r--r--src/test/parse-fail/issue-2354.rs2
-rw-r--r--src/test/parse-fail/issue-3036.rs2
-rw-r--r--src/test/parse-fail/issue-5544-a.rs2
-rw-r--r--src/test/parse-fail/issue-5544-b.rs2
-rw-r--r--src/test/parse-fail/issue-5806.rs2
-rw-r--r--src/test/parse-fail/issue-6610.rs2
-rw-r--r--src/test/parse-fail/issue-8537.rs2
-rw-r--r--src/test/parse-fail/keyword-abstract.rs2
-rw-r--r--src/test/parse-fail/keyword-as-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-break-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-do-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-else-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-enum-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-extern-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-final.rs2
-rw-r--r--src/test/parse-fail/keyword-fn-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-for-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-if-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-impl-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-let-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-loop-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-match-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-mod-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-mut-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-override.rs2
-rw-r--r--src/test/parse-fail/keyword-priv-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-pub-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-ref-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-return-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-self-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-static-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-struct-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-super-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-super.rs2
-rw-r--r--src/test/parse-fail/keyword-trait-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-type-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-typeof.rs2
-rw-r--r--src/test/parse-fail/keyword-unsafe-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-use-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword-while-as-identifier.rs2
-rw-r--r--src/test/parse-fail/keyword.rs2
-rw-r--r--src/test/parse-fail/keywords-followed-by-double-colon.rs2
-rw-r--r--src/test/parse-fail/lex-bad-char-literals.rs1
-rw-r--r--src/test/parse-fail/lex-bad-numeric-literals.rs2
-rw-r--r--src/test/parse-fail/lex-bad-token.rs2
-rw-r--r--src/test/parse-fail/lex-bare-cr-string-literal-doc-comment.rs2
-rw-r--r--src/test/parse-fail/lifetime-no-keyword.rs2
-rw-r--r--src/test/parse-fail/lifetime-obsoleted-self.rs2
-rw-r--r--src/test/parse-fail/macro-attribute.rs2
-rw-r--r--src/test/parse-fail/macro-bad-delimiter-ident.rs2
-rw-r--r--src/test/parse-fail/macro-keyword.rs2
-rw-r--r--src/test/parse-fail/macro-mismatched-delim-brace-paren.rs2
-rw-r--r--src/test/parse-fail/macro-mismatched-delim-paren-brace.rs2
-rw-r--r--src/test/parse-fail/macros-no-semicolon-items.rs2
-rw-r--r--src/test/parse-fail/macros-no-semicolon.rs2
-rw-r--r--src/test/parse-fail/match-arrows-block-then-binop.rs2
-rw-r--r--src/test/parse-fail/match-vec-invalid.rs2
-rw-r--r--src/test/parse-fail/mod_file_not_exist.rs2
-rw-r--r--src/test/parse-fail/mod_file_with_path_attr.rs2
-rw-r--r--src/test/parse-fail/multitrait.rs2
-rw-r--r--src/test/parse-fail/mut-patterns.rs2
-rw-r--r--src/test/parse-fail/new-unicode-escapes-1.rs2
-rw-r--r--src/test/parse-fail/new-unicode-escapes-2.rs2
-rw-r--r--src/test/parse-fail/new-unicode-escapes-3.rs2
-rw-r--r--src/test/parse-fail/new-unicode-escapes-4.rs2
-rw-r--r--src/test/parse-fail/no-binary-float-literal.rs2
-rw-r--r--src/test/parse-fail/no-hex-float-literal.rs2
-rw-r--r--src/test/parse-fail/no-unsafe-self.rs2
-rw-r--r--src/test/parse-fail/non-str-meta.rs2
-rw-r--r--src/test/parse-fail/not-a-pred.rs2
-rw-r--r--src/test/parse-fail/obsolete-proc.rs2
-rw-r--r--src/test/parse-fail/omitted-arg-in-item-fn.rs2
-rw-r--r--src/test/parse-fail/paamayim-nekudotayim.rs2
-rw-r--r--src/test/parse-fail/parenthesized-box-expr-message.rs2
-rw-r--r--src/test/parse-fail/pat-range-bad-dots.rs2
-rw-r--r--src/test/parse-fail/pat-ref-enum.rs2
-rw-r--r--src/test/parse-fail/qquote-1.rs2
-rw-r--r--src/test/parse-fail/qquote-2.rs2
-rw-r--r--src/test/parse-fail/range-3.rs2
-rw-r--r--src/test/parse-fail/range-4.rs2
-rw-r--r--src/test/parse-fail/raw-byte-string-eof.rs2
-rw-r--r--src/test/parse-fail/raw-byte-string-literals.rs2
-rw-r--r--src/test/parse-fail/raw-str-delim.rs2
-rw-r--r--src/test/parse-fail/raw-str-unbalanced.rs2
-rw-r--r--src/test/parse-fail/raw-str-unterminated.rs2
-rw-r--r--src/test/parse-fail/regions-fn-bound.rs4
-rw-r--r--src/test/parse-fail/regions-infer-paramd-method.rs2
-rw-r--r--src/test/parse-fail/regions-out-of-scope-slice.rs2
-rw-r--r--src/test/parse-fail/regions-trait-2.rs2
-rw-r--r--src/test/parse-fail/regions-trait-3.rs2
-rw-r--r--src/test/parse-fail/removed-syntax-closure-lifetime.rs2
-rw-r--r--src/test/parse-fail/removed-syntax-enum-newtype.rs2
-rw-r--r--src/test/parse-fail/removed-syntax-extern-const.rs2
-rw-r--r--src/test/parse-fail/removed-syntax-field-let.rs2
-rw-r--r--src/test/parse-fail/removed-syntax-field-semicolon.rs2
-rw-r--r--src/test/parse-fail/removed-syntax-fixed-vec.rs2
-rw-r--r--src/test/parse-fail/removed-syntax-fn-pure.rs2
-rw-r--r--src/test/parse-fail/removed-syntax-fn-sigil.rs2
-rw-r--r--src/test/parse-fail/removed-syntax-larrow-init.rs2
-rw-r--r--src/test/parse-fail/removed-syntax-larrow-move.rs2
-rw-r--r--src/test/parse-fail/removed-syntax-mode.rs2
-rw-r--r--src/test/parse-fail/removed-syntax-mut-vec-expr.rs2
-rw-r--r--src/test/parse-fail/removed-syntax-mut-vec-ty.rs2
-rw-r--r--src/test/parse-fail/removed-syntax-ptr-lifetime.rs2
-rw-r--r--src/test/parse-fail/removed-syntax-record.rs2
-rw-r--r--src/test/parse-fail/removed-syntax-static-fn.rs2
-rw-r--r--src/test/parse-fail/removed-syntax-uniq-mut-expr.rs2
-rw-r--r--src/test/parse-fail/removed-syntax-uniq-mut-ty.rs2
-rw-r--r--src/test/parse-fail/removed-syntax-with-1.rs2
-rw-r--r--src/test/parse-fail/removed-syntax-with-2.rs2
-rw-r--r--src/test/parse-fail/require-parens-for-chained-comparison.rs2
-rw-r--r--src/test/parse-fail/struct-literal-in-for.rs2
-rw-r--r--src/test/parse-fail/struct-literal-in-if.rs2
-rw-r--r--src/test/parse-fail/struct-literal-in-match-discriminant.rs2
-rw-r--r--src/test/parse-fail/struct-literal-in-while.rs2
-rw-r--r--src/test/parse-fail/struct-no-fields-2.rs2
-rw-r--r--src/test/parse-fail/struct-no-fields-3.rs2
-rw-r--r--src/test/parse-fail/struct-no-fields-4.rs2
-rw-r--r--src/test/parse-fail/struct-no-fields-5.rs2
-rw-r--r--src/test/parse-fail/struct-no-fields-enumlike.rs2
-rw-r--r--src/test/parse-fail/struct-no-fields.rs2
-rw-r--r--src/test/parse-fail/struct-variant-no-fields.rs2
-rw-r--r--src/test/parse-fail/struct-variant-no-pub.rs2
-rw-r--r--src/test/parse-fail/syntax-trait-polarity.rs2
-rw-r--r--src/test/parse-fail/tag-variant-disr-non-nullary.rs2
-rw-r--r--src/test/parse-fail/trailing-carriage-return-in-string.rs2
-rw-r--r--src/test/parse-fail/trailing-plus-in-bounds.rs2
-rw-r--r--src/test/parse-fail/trait-bounds-not-on-impl.rs2
-rw-r--r--src/test/parse-fail/trait-keyword.rs2
-rw-r--r--src/test/parse-fail/type-parameters-in-field-exprs.rs2
-rw-r--r--src/test/parse-fail/unbalanced-doublequote.rs2
-rw-r--r--src/test/parse-fail/unboxed-closure-sugar-used-on-struct-3.rs2
-rw-r--r--src/test/parse-fail/unsized.rs2
-rw-r--r--src/test/parse-fail/unsized2.rs2
-rw-r--r--src/test/parse-fail/use-as-where-use-ends-with-mod-sep.rs2
-rw-r--r--src/test/parse-fail/use-ends-with-mod-sep.rs2
-rw-r--r--src/test/parse-fail/use-mod-4.rs2
-rw-r--r--src/test/parse-fail/variadic-ffi-1.rs2
-rw-r--r--src/test/parse-fail/variadic-ffi-3.rs2
-rw-r--r--src/test/parse-fail/variadic-ffi-4.rs2
-rw-r--r--src/test/parse-fail/virtual-structs.rs2
-rw-r--r--src/test/parse-fail/where-clauses-no-bounds-or-predicates.rs2
215 files changed, 440 insertions, 6 deletions
diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs
index a7515293146..154e0a1f644 100644
--- a/src/librustc_driver/driver.rs
+++ b/src/librustc_driver/driver.rs
@@ -52,11 +52,11 @@ pub fn compile_input(sess: Session,
                      output: &Option<PathBuf>,
                      addl_plugins: Option<Vec<String>>,
                      control: CompileController) {
-    macro_rules! controller_entry_point{($point: ident, $make_state: expr) => ({
-        {
-            let state = $make_state;
-            (control.$point.callback)(state);
-        }
+    macro_rules! controller_entry_point{($point: ident, $tsess: expr, $make_state: expr) => ({
+        let state = $make_state;
+        (control.$point.callback)(state);
+
+        $tsess.abort_if_errors();
         if control.$point.stop == Compilation::Stop {
             return;
         }
@@ -70,6 +70,7 @@ pub fn compile_input(sess: Session,
             let krate = phase_1_parse_input(&sess, cfg, input);
 
             controller_entry_point!(after_parse,
+                                    sess,
                                     CompileState::state_after_parse(input,
                                                                     &sess,
                                                                     outdir,
@@ -96,6 +97,7 @@ pub fn compile_input(sess: Session,
         };
 
         controller_entry_point!(after_expand,
+                                sess,
                                 CompileState::state_after_expand(input,
                                                                  &sess,
                                                                  outdir,
@@ -109,6 +111,7 @@ pub fn compile_input(sess: Session,
         write_out_deps(&sess, input, &outputs, &id[..]);
 
         controller_entry_point!(after_write_deps,
+                                sess,
                                 CompileState::state_after_write_deps(input,
                                                                      &sess,
                                                                      outdir,
@@ -123,6 +126,7 @@ pub fn compile_input(sess: Session,
                                                    control.make_glob_map);
 
         controller_entry_point!(after_analysis,
+                                analysis.ty_cx.sess,
                                 CompileState::state_after_analysis(input,
                                                                    &analysis.ty_cx.sess,
                                                                    outdir,
@@ -149,6 +153,7 @@ pub fn compile_input(sess: Session,
     phase_5_run_llvm_passes(&sess, &trans, &outputs);
 
     controller_entry_point!(after_llvm,
+                            sess,
                             CompileState::state_after_llvm(input,
                                                            &sess,
                                                            outdir,
diff --git a/src/test/compile-fail/mod_file_disambig.rs b/src/test/compile-fail/mod_file_disambig.rs
index 48bd00a3ee0..27c253234be 100644
--- a/src/test/compile-fail/mod_file_disambig.rs
+++ b/src/test/compile-fail/mod_file_disambig.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
+
 mod mod_file_disambig_aux; //~ ERROR file for module `mod_file_disambig_aux` found at both
 
 fn main() {
diff --git a/src/test/compile-fail/mod_file_not_owning.rs b/src/test/compile-fail/mod_file_not_owning.rs
index adbcedd91f2..7dcff6e6644 100644
--- a/src/test/compile-fail/mod_file_not_owning.rs
+++ b/src/test/compile-fail/mod_file_not_owning.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
+
 // error-pattern: cannot declare a new module at this location
 
 mod mod_file_not_owning_aux1;
diff --git a/src/test/parse-fail/array-old-syntax-1.rs b/src/test/parse-fail/array-old-syntax-1.rs
index 71c57fefc2e..78dcf2e2e2e 100644
--- a/src/test/parse-fail/array-old-syntax-1.rs
+++ b/src/test/parse-fail/array-old-syntax-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
+
 // Test that the old fixed length array syntax is a parsing error.
 
 fn main() {
diff --git a/src/test/parse-fail/ascii-only-character-escape.rs b/src/test/parse-fail/ascii-only-character-escape.rs
index bcfcc434703..2094b63ab36 100644
--- a/src/test/parse-fail/ascii-only-character-escape.rs
+++ b/src/test/parse-fail/ascii-only-character-escape.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 = "\x80"; //~ ERROR may only be used
     let y = "\xff"; //~ ERROR may only be used
diff --git a/src/test/parse-fail/associated-types-project-from-hrtb-explicit.rs b/src/test/parse-fail/associated-types-project-from-hrtb-explicit.rs
index 917c03fbf4b..9c7721589d9 100644
--- a/src/test/parse-fail/associated-types-project-from-hrtb-explicit.rs
+++ b/src/test/parse-fail/associated-types-project-from-hrtb-explicit.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
+
 // Test you can't use a higher-ranked trait bound inside of a qualified
 // path (just won't parse).
 
diff --git a/src/test/parse-fail/attr-bad-meta.rs b/src/test/parse-fail/attr-bad-meta.rs
index dbf2929afe4..7def91da5ec 100644
--- a/src/test/parse-fail/attr-bad-meta.rs
+++ b/src/test/parse-fail/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
+
 // error-pattern:expected `]`
 
 // asterisk is bogus
diff --git a/src/test/parse-fail/attr-before-eof.rs b/src/test/parse-fail/attr-before-eof.rs
index e34756229bd..c75b0ac122a 100644
--- a/src/test/parse-fail/attr-before-eof.rs
+++ b/src/test/parse-fail/attr-before-eof.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
+
 #[derive(Debug)] //~ERROR expected item after attributes
diff --git a/src/test/parse-fail/attr-before-ext.rs b/src/test/parse-fail/attr-before-ext.rs
index 098c5aaec54..e15350fcad7 100644
--- a/src/test/parse-fail/attr-before-ext.rs
+++ b/src/test/parse-fail/attr-before-ext.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() {
     #[attr] //~ ERROR expected item after attributes
     println!("hi");
diff --git a/src/test/parse-fail/attr-before-let.rs b/src/test/parse-fail/attr-before-let.rs
index b4a90e35c40..03dabb980f2 100644
--- a/src/test/parse-fail/attr-before-let.rs
+++ b/src/test/parse-fail/attr-before-let.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() {
     #[attr] //~ ERROR expected item
     let __isize = 0;
diff --git a/src/test/parse-fail/attr-before-stmt.rs b/src/test/parse-fail/attr-before-stmt.rs
index ec837cd6de3..bc306048cdc 100644
--- a/src/test/parse-fail/attr-before-stmt.rs
+++ b/src/test/parse-fail/attr-before-stmt.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
+
 // error-pattern:expected item
 
 fn f() {
diff --git a/src/test/parse-fail/attr-dangling-in-fn.rs b/src/test/parse-fail/attr-dangling-in-fn.rs
index 384622fb168..f2f4ecadd7a 100644
--- a/src/test/parse-fail/attr-dangling-in-fn.rs
+++ b/src/test/parse-fail/attr-dangling-in-fn.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
+
 // error-pattern:expected item
 
 fn f() {
diff --git a/src/test/parse-fail/attr-dangling-in-mod.rs b/src/test/parse-fail/attr-dangling-in-mod.rs
index 59a922ebee1..79609935f9e 100644
--- a/src/test/parse-fail/attr-dangling-in-mod.rs
+++ b/src/test/parse-fail/attr-dangling-in-mod.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
+
 // error-pattern:expected item
 
 fn main() {
diff --git a/src/test/parse-fail/attr.rs b/src/test/parse-fail/attr.rs
index 4bd61412731..1f0a95826fc 100644
--- a/src/test/parse-fail/attr.rs
+++ b/src/test/parse-fail/attr.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(lang_items)]
 
 fn main() {}
diff --git a/src/test/parse-fail/attrs-after-extern-mod.rs b/src/test/parse-fail/attrs-after-extern-mod.rs
index df747618696..442eb14116e 100644
--- a/src/test/parse-fail/attrs-after-extern-mod.rs
+++ b/src/test/parse-fail/attrs-after-extern-mod.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
+
 // Constants (static variables) can be used to match in patterns, but mutable
 // statics cannot. This ensures that there's some form of error if this is
 // attempted.
diff --git a/src/test/parse-fail/bad-char-literals.rs b/src/test/parse-fail/bad-char-literals.rs
index 2a358ae8307..fe8ed8bb9a5 100644
--- a/src/test/parse-fail/bad-char-literals.rs
+++ b/src/test/parse-fail/bad-char-literals.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
+
 // ignore-tidy-cr
 // ignore-tidy-tab
 fn main() {
diff --git a/src/test/parse-fail/bad-lit-suffixes.rs b/src/test/parse-fail/bad-lit-suffixes.rs
index f1f18115825..a64ee6a9ce2 100644
--- a/src/test/parse-fail/bad-lit-suffixes.rs
+++ b/src/test/parse-fail/bad-lit-suffixes.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
+
 
 extern
     "C"suffix //~ ERROR ABI spec with a suffix is illegal
diff --git a/src/test/parse-fail/bad-match.rs b/src/test/parse-fail/bad-match.rs
index 33043ff5524..b42c04f3ce2 100644
--- a/src/test/parse-fail/bad-match.rs
+++ b/src/test/parse-fail/bad-match.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
+
 // error-pattern: expected
 
 fn main() {
diff --git a/src/test/parse-fail/bad-name.rs b/src/test/parse-fail/bad-name.rs
index b208c6f4244..201e6ced2f9 100644
--- a/src/test/parse-fail/bad-name.rs
+++ b/src/test/parse-fail/bad-name.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
+
 // error-pattern: expected
 
 fn main() {
diff --git a/src/test/parse-fail/bad-value-ident-false.rs b/src/test/parse-fail/bad-value-ident-false.rs
index ca10bdd9848..96325a2abb4 100644
--- a/src/test/parse-fail/bad-value-ident-false.rs
+++ b/src/test/parse-fail/bad-value-ident-false.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 false() { } //~ ERROR expected identifier, found keyword `false`
 fn main() { }
diff --git a/src/test/parse-fail/bad-value-ident-true.rs b/src/test/parse-fail/bad-value-ident-true.rs
index 4508d5219a2..7ff16b80373 100644
--- a/src/test/parse-fail/bad-value-ident-true.rs
+++ b/src/test/parse-fail/bad-value-ident-true.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 true() { } //~ ERROR expected identifier, found keyword `true`
 fn main() { }
diff --git a/src/test/parse-fail/better-expected.rs b/src/test/parse-fail/better-expected.rs
index e07f4b8e549..3f0e0d36d8f 100644
--- a/src/test/parse-fail/better-expected.rs
+++ b/src/test/parse-fail/better-expected.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: [isize 3]; //~ ERROR expected one of `(`, `+`, `::`, `;`, `<`, or `]`, found `3`
 }
diff --git a/src/test/parse-fail/bind-struct-early-modifiers.rs b/src/test/parse-fail/bind-struct-early-modifiers.rs
index c358a21d125..25348a3bfd1 100644
--- a/src/test/parse-fail/bind-struct-early-modifiers.rs
+++ b/src/test/parse-fail/bind-struct-early-modifiers.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() {
     struct Foo { x: isize }
     match (Foo { x: 10 }) {
diff --git a/src/test/parse-fail/byte-literals.rs b/src/test/parse-fail/byte-literals.rs
index 08935a24a1b..6685a29bb42 100644
--- a/src/test/parse-fail/byte-literals.rs
+++ b/src/test/parse-fail/byte-literals.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
+
 
 // ignore-tidy-tab
 
diff --git a/src/test/parse-fail/byte-string-literals.rs b/src/test/parse-fail/byte-string-literals.rs
index ee3d86a6638..7049363c21b 100644
--- a/src/test/parse-fail/byte-string-literals.rs
+++ b/src/test/parse-fail/byte-string-literals.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
+
 
 // ignore-tidy-tab
 
diff --git a/src/test/parse-fail/circular_modules_hello.rs b/src/test/parse-fail/circular_modules_hello.rs
index 3bf851643f2..4de817dbd9c 100644
--- a/src/test/parse-fail/circular_modules_hello.rs
+++ b/src/test/parse-fail/circular_modules_hello.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
+
 // ignore-test: this is an auxiliary file for circular-modules-main.rs
 
 mod circular_modules_main;
diff --git a/src/test/parse-fail/circular_modules_main.rs b/src/test/parse-fail/circular_modules_main.rs
index 3e548981f1e..861d4cd12ab 100644
--- a/src/test/parse-fail/circular_modules_main.rs
+++ b/src/test/parse-fail/circular_modules_main.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
+
 #[path = "circular_modules_hello.rs"]
 mod circular_modules_hello; //~ ERROR: circular modules
 
diff --git a/src/test/parse-fail/class-implements-bad-trait.rs b/src/test/parse-fail/class-implements-bad-trait.rs
index 7de51c1ea75..ea263d938d4 100644
--- a/src/test/parse-fail/class-implements-bad-trait.rs
+++ b/src/test/parse-fail/class-implements-bad-trait.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
+
 // error-pattern:nonexistent
 class cat : nonexistent {
   let meows: usize;
diff --git a/src/test/parse-fail/column-offset-1-based.rs b/src/test/parse-fail/column-offset-1-based.rs
index a00ded61758..bcadd1f39fa 100644
--- a/src/test/parse-fail/column-offset-1-based.rs
+++ b/src/test/parse-fail/column-offset-1-based.rs
@@ -8,4 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-# //~ ERROR 11:1: 11:2 error: expected `[`, found `<eof>`
+// compile-flags: -Z parse-only
+
+# //~ ERROR 13:1: 13:2 error: expected `[`, found `<eof>`
diff --git a/src/test/parse-fail/doc-before-attr.rs b/src/test/parse-fail/doc-before-attr.rs
index bb44a6a8abb..4548cebd0a8 100644
--- a/src/test/parse-fail/doc-before-attr.rs
+++ b/src/test/parse-fail/doc-before-attr.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
+
 /// hi
 #[derive(Debug)] //~ERROR expected item after attributes
diff --git a/src/test/parse-fail/doc-before-eof.rs b/src/test/parse-fail/doc-before-eof.rs
index e6dd4102462..728972eca62 100644
--- a/src/test/parse-fail/doc-before-eof.rs
+++ b/src/test/parse-fail/doc-before-eof.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
+
 /// hi //~ERROR expected item after doc comment
diff --git a/src/test/parse-fail/doc-before-extern-rbrace.rs b/src/test/parse-fail/doc-before-extern-rbrace.rs
index 5afd1b2c6b8..9e825193dc0 100644
--- a/src/test/parse-fail/doc-before-extern-rbrace.rs
+++ b/src/test/parse-fail/doc-before-extern-rbrace.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
+
 extern {
     /// hi
 }
diff --git a/src/test/parse-fail/doc-before-macro.rs b/src/test/parse-fail/doc-before-macro.rs
index 8dc6c546500..44435bde03c 100644
--- a/src/test/parse-fail/doc-before-macro.rs
+++ b/src/test/parse-fail/doc-before-macro.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() {
     /// hi
     println!("hi");
diff --git a/src/test/parse-fail/doc-before-rbrace.rs b/src/test/parse-fail/doc-before-rbrace.rs
index 6d05064277d..8b69c385378 100644
--- a/src/test/parse-fail/doc-before-rbrace.rs
+++ b/src/test/parse-fail/doc-before-rbrace.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() {
     println!("Hi"); /// hi
     //~^ ERROR expected item after doc comment
diff --git a/src/test/parse-fail/doc-before-semi.rs b/src/test/parse-fail/doc-before-semi.rs
index 8b0300edce0..42c58af76d8 100644
--- a/src/test/parse-fail/doc-before-semi.rs
+++ b/src/test/parse-fail/doc-before-semi.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() {
     /// hi
     ;
diff --git a/src/test/parse-fail/duplicate-visibility.rs b/src/test/parse-fail/duplicate-visibility.rs
index b213730ef75..5ee84cd5543 100644
--- a/src/test/parse-fail/duplicate-visibility.rs
+++ b/src/test/parse-fail/duplicate-visibility.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
+
 // error-pattern:unmatched visibility `pub`
 extern {
     pub pub fn foo();
diff --git a/src/test/parse-fail/empty-impl-semicolon.rs b/src/test/parse-fail/empty-impl-semicolon.rs
index a2e780d49b8..e356ab1debc 100644
--- a/src/test/parse-fail/empty-impl-semicolon.rs
+++ b/src/test/parse-fail/empty-impl-semicolon.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
+
 impl Foo; //~ ERROR expected one of `(`, `+`, `..`, `::`, `<`, `for`, `where`, or `{`, found `;`
diff --git a/src/test/parse-fail/extern-expected-fn-or-brace.rs b/src/test/parse-fail/extern-expected-fn-or-brace.rs
index 7d1110cf6df..7fb7233dc69 100644
--- a/src/test/parse-fail/extern-expected-fn-or-brace.rs
+++ b/src/test/parse-fail/extern-expected-fn-or-brace.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
+
 // Verifies that the expected token errors for `extern crate` are
 // raised
 
diff --git a/src/test/parse-fail/extern-foreign-crate.rs b/src/test/parse-fail/extern-foreign-crate.rs
index 1ff4368dac5..9adbd871409 100644
--- a/src/test/parse-fail/extern-foreign-crate.rs
+++ b/src/test/parse-fail/extern-foreign-crate.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
+
 // Verifies that the expected token errors for `extern crate` are
 // raised
 
diff --git a/src/test/parse-fail/extern-no-fn.rs b/src/test/parse-fail/extern-no-fn.rs
index 69e2f3ae60b..bf5cbe0c459 100644
--- a/src/test/parse-fail/extern-no-fn.rs
+++ b/src/test/parse-fail/extern-no-fn.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
+
 extern {
     f(); //~ ERROR expected one of `fn`, `pub`, `static`, `unsafe`, or `}`, found `f`
 }
diff --git a/src/test/parse-fail/generic-non-trailing-defaults.rs b/src/test/parse-fail/generic-non-trailing-defaults.rs
index 0cfb05b9332..26ee6ce80d6 100644
--- a/src/test/parse-fail/generic-non-trailing-defaults.rs
+++ b/src/test/parse-fail/generic-non-trailing-defaults.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 Heap;
 
 struct Vec<A = Heap, T>; //~ ERROR type parameters with a default must be trailing
diff --git a/src/test/parse-fail/import-from-path.rs b/src/test/parse-fail/import-from-path.rs
index ce91de7e9d9..fbd59d200a0 100644
--- a/src/test/parse-fail/import-from-path.rs
+++ b/src/test/parse-fail/import-from-path.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
+
 // error-pattern:expected
 use foo::{bar}::baz
diff --git a/src/test/parse-fail/import-from-rename.rs b/src/test/parse-fail/import-from-rename.rs
index ebd897a0611..c4d8ba2086d 100644
--- a/src/test/parse-fail/import-from-rename.rs
+++ b/src/test/parse-fail/import-from-rename.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
+
 // error-pattern:expected
 
 use foo::{bar} as baz;
diff --git a/src/test/parse-fail/import-glob-path.rs b/src/test/parse-fail/import-glob-path.rs
index b6bc53fad94..2faf833d4f1 100644
--- a/src/test/parse-fail/import-glob-path.rs
+++ b/src/test/parse-fail/import-glob-path.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
+
 // error-pattern:expected
 use foo::*::bar
diff --git a/src/test/parse-fail/import-glob-rename.rs b/src/test/parse-fail/import-glob-rename.rs
index fb400b6c2bb..7e17e1f1d6c 100644
--- a/src/test/parse-fail/import-glob-rename.rs
+++ b/src/test/parse-fail/import-glob-rename.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
+
 // error-pattern:expected
 
 use foo::* as baz;
diff --git a/src/test/parse-fail/int-literal-too-large-span.rs b/src/test/parse-fail/int-literal-too-large-span.rs
index 8a496c934b9..c4b25d43579 100644
--- a/src/test/parse-fail/int-literal-too-large-span.rs
+++ b/src/test/parse-fail/int-literal-too-large-span.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
+
 // issue #17123
 
 fn main() {
diff --git a/src/test/parse-fail/issue-10392-2.rs b/src/test/parse-fail/issue-10392-2.rs
index 2a3dd7fba0c..2817912666e 100644
--- a/src/test/parse-fail/issue-10392-2.rs
+++ b/src/test/parse-fail/issue-10392-2.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 A { foo: isize }
 
 fn a() -> A { panic!() }
diff --git a/src/test/parse-fail/issue-10392.rs b/src/test/parse-fail/issue-10392.rs
index 3f8d26bfec0..9c67575bcc1 100644
--- a/src/test/parse-fail/issue-10392.rs
+++ b/src/test/parse-fail/issue-10392.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 A { foo: isize }
 
 fn a() -> A { panic!() }
diff --git a/src/test/parse-fail/issue-10412.rs b/src/test/parse-fail/issue-10412.rs
index 8a99633b4fc..0b9456bc080 100644
--- a/src/test/parse-fail/issue-10412.rs
+++ b/src/test/parse-fail/issue-10412.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 Serializable<'self, T> { //~ ERROR no longer a special lifetime
     fn serialize(val : &'self T) -> Vec<u8> ; //~ ERROR no longer a special lifetime
diff --git a/src/test/parse-fail/issue-10636-1.rs b/src/test/parse-fail/issue-10636-1.rs
index bb020d55bdb..398fe8c5b8c 100644
--- a/src/test/parse-fail/issue-10636-1.rs
+++ b/src/test/parse-fail/issue-10636-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
+
 struct Obj { //~ NOTE: unclosed delimiter
     member: usize
 ) //~ ERROR: incorrect close delimiter
diff --git a/src/test/parse-fail/issue-10636-2.rs b/src/test/parse-fail/issue-10636-2.rs
index a92ef248924..f57abf8929e 100644
--- a/src/test/parse-fail/issue-10636-2.rs
+++ b/src/test/parse-fail/issue-10636-2.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
+
 pub fn trace_option(option: Option<isize>) {
     option.map(|some| 42; //~ NOTE: unclosed delimiter
 } //~ ERROR: incorrect close delimiter
diff --git a/src/test/parse-fail/issue-12560-1.rs b/src/test/parse-fail/issue-12560-1.rs
index ea2043e6703..96a17a8fb45 100644
--- a/src/test/parse-fail/issue-12560-1.rs
+++ b/src/test/parse-fail/issue-12560-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
+
 // For style and consistency reasons, non-parametrized enum variants must
 // be used simply as `ident` instead of `ident ()`.
 // This test-case covers enum declaration.
diff --git a/src/test/parse-fail/issue-14182.rs b/src/test/parse-fail/issue-14182.rs
index 364951a4fea..176e17c7eb0 100644
--- a/src/test/parse-fail/issue-14182.rs
+++ b/src/test/parse-fail/issue-14182.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
+
 // ignore-test FIXME(japari) remove test
 
 struct Foo {
diff --git a/src/test/parse-fail/issue-14303-enum.rs b/src/test/parse-fail/issue-14303-enum.rs
index a26b7fdc425..6bcf588b516 100644
--- a/src/test/parse-fail/issue-14303-enum.rs
+++ b/src/test/parse-fail/issue-14303-enum.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
+
 enum X<'a, T, 'b> {
 //~^ ERROR lifetime parameters must be declared prior to type parameters
     A(&'a T)
diff --git a/src/test/parse-fail/issue-14303-fn-def.rs b/src/test/parse-fail/issue-14303-fn-def.rs
index aaf95410b8e..ae8e38c0377 100644
--- a/src/test/parse-fail/issue-14303-fn-def.rs
+++ b/src/test/parse-fail/issue-14303-fn-def.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 foo<'a, T, 'b>(x: &'a T) {}
 //~^ ERROR lifetime parameters must be declared prior to type parameters
diff --git a/src/test/parse-fail/issue-14303-fncall.rs b/src/test/parse-fail/issue-14303-fncall.rs
index a7adaacc0a5..80a9b3d7c0d 100644
--- a/src/test/parse-fail/issue-14303-fncall.rs
+++ b/src/test/parse-fail/issue-14303-fncall.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() {
     (0..4)
     .map(|x| x * 2)
diff --git a/src/test/parse-fail/issue-14303-impl.rs b/src/test/parse-fail/issue-14303-impl.rs
index c4a00581274..f06d5f29e9e 100644
--- a/src/test/parse-fail/issue-14303-impl.rs
+++ b/src/test/parse-fail/issue-14303-impl.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 X { x: isize }
 
 impl<'a, T, 'b> X {}
diff --git a/src/test/parse-fail/issue-14303-path.rs b/src/test/parse-fail/issue-14303-path.rs
index 30cc41c3588..f0d1feffec8 100644
--- a/src/test/parse-fail/issue-14303-path.rs
+++ b/src/test/parse-fail/issue-14303-path.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 bar<'a, T>(x: mymodule::X<'a, T, 'b, 'c>) {}
 //~^ ERROR lifetime parameters must be declared prior to type parameters
diff --git a/src/test/parse-fail/issue-14303-struct.rs b/src/test/parse-fail/issue-14303-struct.rs
index 6edd808d847..5673e4f2a4c 100644
--- a/src/test/parse-fail/issue-14303-struct.rs
+++ b/src/test/parse-fail/issue-14303-struct.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 X<'a, T, 'b> {
 //~^ ERROR lifetime parameters must be declared prior to type parameters
     x: &'a T
diff --git a/src/test/parse-fail/issue-14303-trait.rs b/src/test/parse-fail/issue-14303-trait.rs
index 753acdd75fe..8af5af9e933 100644
--- a/src/test/parse-fail/issue-14303-trait.rs
+++ b/src/test/parse-fail/issue-14303-trait.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
+
 trait Foo<'a, T, 'b> {}
 //~^ ERROR lifetime parameters must be declared prior to type parameters
diff --git a/src/test/parse-fail/issue-15914.rs b/src/test/parse-fail/issue-15914.rs
index 45b3abfddfb..0b8f0ac221a 100644
--- a/src/test/parse-fail/issue-15914.rs
+++ b/src/test/parse-fail/issue-15914.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 ref
         (); //~ ERROR expected identifier, found `(`
diff --git a/src/test/parse-fail/issue-1655.rs b/src/test/parse-fail/issue-1655.rs
index 6bdcf5c5edc..a044dff261d 100644
--- a/src/test/parse-fail/issue-1655.rs
+++ b/src/test/parse-fail/issue-1655.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
+
 // error-pattern:expected `[`, found `vec`
 mod blade_runner {
     #vec[doc(
diff --git a/src/test/parse-fail/issue-17383.rs b/src/test/parse-fail/issue-17383.rs
index c71e0ecd494..1b33cb38857 100644
--- a/src/test/parse-fail/issue-17383.rs
+++ b/src/test/parse-fail/issue-17383.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
+
 enum X {
     A =
         b'a' //~ ERROR discriminator values can only be used with a c-like enum
diff --git a/src/test/parse-fail/issue-17718-const-mut.rs b/src/test/parse-fail/issue-17718-const-mut.rs
index b7feeecbfd9..b450cb25e6b 100644
--- a/src/test/parse-fail/issue-17718-const-mut.rs
+++ b/src/test/parse-fail/issue-17718-const-mut.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
+
 const
 mut //~ ERROR: const globals cannot be mutable
 //~^ HELP did you mean to declare a static?
diff --git a/src/test/parse-fail/issue-17904.rs b/src/test/parse-fail/issue-17904.rs
index 96ba712bbae..580b8c66c74 100644
--- a/src/test/parse-fail/issue-17904.rs
+++ b/src/test/parse-fail/issue-17904.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 Baz<U> where U: Eq(U); //This is parsed as the new Fn* style parenthesis syntax.
 struct Baz<U> where U: Eq(U) -> R; // Notice this parses as well.
 struct Baz<U>(U) where U: Eq; // This rightfully signals no error as well.
diff --git a/src/test/parse-fail/issue-1802-1.rs b/src/test/parse-fail/issue-1802-1.rs
index 00fb2808faa..fc3d071729f 100644
--- a/src/test/parse-fail/issue-1802-1.rs
+++ b/src/test/parse-fail/issue-1802-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
+
 // error-pattern:no valid digits found for number
 fn main() {
     log(error, 0b);
diff --git a/src/test/parse-fail/issue-1802-2.rs b/src/test/parse-fail/issue-1802-2.rs
index f6da2fc82c3..05c5a4bcb02 100644
--- a/src/test/parse-fail/issue-1802-2.rs
+++ b/src/test/parse-fail/issue-1802-2.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
+
 // error-pattern:no valid digits found for number
 fn main() {
     log(error, 0b_usize);
diff --git a/src/test/parse-fail/issue-19096.rs b/src/test/parse-fail/issue-19096.rs
index 90d2acbe581..0d9a111045a 100644
--- a/src/test/parse-fail/issue-19096.rs
+++ b/src/test/parse-fail/issue-19096.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 t = (42, 42);
     t.0::<isize>; //~ ERROR expected one of `.`, `;`, `}`, or an operator, found `::`
diff --git a/src/test/parse-fail/issue-19398.rs b/src/test/parse-fail/issue-19398.rs
index 3a6d15e0086..a91d513b83d 100644
--- a/src/test/parse-fail/issue-19398.rs
+++ b/src/test/parse-fail/issue-19398.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 T {
     extern "Rust" unsafe fn foo(); //~ ERROR expected `fn`, found `unsafe`
 }
diff --git a/src/test/parse-fail/issue-20711-2.rs b/src/test/parse-fail/issue-20711-2.rs
index a50a757160d..2c993b7654e 100644
--- a/src/test/parse-fail/issue-20711-2.rs
+++ b/src/test/parse-fail/issue-20711-2.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;
 
 impl Foo {
diff --git a/src/test/parse-fail/issue-20711.rs b/src/test/parse-fail/issue-20711.rs
index 3b329d78237..8462bd8fd01 100644
--- a/src/test/parse-fail/issue-20711.rs
+++ b/src/test/parse-fail/issue-20711.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;
 
 impl Foo {
diff --git a/src/test/parse-fail/issue-21153.rs b/src/test/parse-fail/issue-21153.rs
index 6496ffebbc8..44d979ba979 100644
--- a/src/test/parse-fail/issue-21153.rs
+++ b/src/test/parse-fail/issue-21153.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 MyTrait<T>: Iterator {
     Item = T; //~ ERROR expected one of `extern`, `fn`, `type`, or `unsafe`, found `Item`
 }
diff --git a/src/test/parse-fail/issue-2354-1.rs b/src/test/parse-fail/issue-2354-1.rs
index 48cdeeb0d70..e65f95780bb 100644
--- a/src/test/parse-fail/issue-2354-1.rs
+++ b/src/test/parse-fail/issue-2354-1.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
+
 static foo: isize = 2; } //~ ERROR incorrect close delimiter:
diff --git a/src/test/parse-fail/issue-2354.rs b/src/test/parse-fail/issue-2354.rs
index cc219a6acb5..0b380d6ae88 100644
--- a/src/test/parse-fail/issue-2354.rs
+++ b/src/test/parse-fail/issue-2354.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 foo() { //~ HELP did you mean to close this delimiter?
   match Some(x) {
       Some(y) { panic!(); }
diff --git a/src/test/parse-fail/issue-3036.rs b/src/test/parse-fail/issue-3036.rs
index 16834f49165..1946e984e5d 100644
--- a/src/test/parse-fail/issue-3036.rs
+++ b/src/test/parse-fail/issue-3036.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
+
 // Testing that semicolon tokens are printed correctly in errors
 
 fn main()
diff --git a/src/test/parse-fail/issue-5544-a.rs b/src/test/parse-fail/issue-5544-a.rs
index 95a4f36d171..f406b2cc803 100644
--- a/src/test/parse-fail/issue-5544-a.rs
+++ b/src/test/parse-fail/issue-5544-a.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 __isize = 18446744073709551616; // 2^64
     //~^ ERROR int literal is too large
diff --git a/src/test/parse-fail/issue-5544-b.rs b/src/test/parse-fail/issue-5544-b.rs
index 9c35d77baf0..898b0920645 100644
--- a/src/test/parse-fail/issue-5544-b.rs
+++ b/src/test/parse-fail/issue-5544-b.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 __isize = 0xff_ffff_ffff_ffff_ffff;
     //~^ ERROR int literal is too large
diff --git a/src/test/parse-fail/issue-5806.rs b/src/test/parse-fail/issue-5806.rs
index 5d2908b92ef..f5442313904 100644
--- a/src/test/parse-fail/issue-5806.rs
+++ b/src/test/parse-fail/issue-5806.rs
@@ -13,6 +13,8 @@
 // ignore-openbsd
 // ignore-bitrig
 
+// compile-flags: -Z parse-only
+
 #[path = "../compile-fail"]
 mod foo; //~ ERROR: a directory
 
diff --git a/src/test/parse-fail/issue-6610.rs b/src/test/parse-fail/issue-6610.rs
index 166e91b27ac..f5113efad1c 100644
--- a/src/test/parse-fail/issue-6610.rs
+++ b/src/test/parse-fail/issue-6610.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 { fn a() } //~ ERROR expected `;` or `{`, found `}`
 
 fn main() {}
diff --git a/src/test/parse-fail/issue-8537.rs b/src/test/parse-fail/issue-8537.rs
index 52cf420a9ff..5996b744566 100644
--- a/src/test/parse-fail/issue-8537.rs
+++ b/src/test/parse-fail/issue-8537.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
+
 pub extern
   "invalid-ab_isize" //~ ERROR illegal ABI
 fn foo() {}
diff --git a/src/test/parse-fail/keyword-abstract.rs b/src/test/parse-fail/keyword-abstract.rs
index 1f1360eac00..bd3fbbe79a8 100644
--- a/src/test/parse-fail/keyword-abstract.rs
+++ b/src/test/parse-fail/keyword-abstract.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 abstract = (); //~ ERROR `abstract` is a reserved keyword
 }
diff --git a/src/test/parse-fail/keyword-as-as-identifier.rs b/src/test/parse-fail/keyword-as-as-identifier.rs
index f307b12f66e..bc05a7c4f25 100644
--- a/src/test/parse-fail/keyword-as-as-identifier.rs
+++ b/src/test/parse-fail/keyword-as-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py as'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-break-as-identifier.rs b/src/test/parse-fail/keyword-break-as-identifier.rs
index 1e2725eb2fe..bd7527f399e 100644
--- a/src/test/parse-fail/keyword-break-as-identifier.rs
+++ b/src/test/parse-fail/keyword-break-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py break'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-do-as-identifier.rs b/src/test/parse-fail/keyword-do-as-identifier.rs
index 90f73f8a9f4..5cc14dfef0e 100644
--- a/src/test/parse-fail/keyword-do-as-identifier.rs
+++ b/src/test/parse-fail/keyword-do-as-identifier.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 do = "bar"; //~ error: ident
 }
diff --git a/src/test/parse-fail/keyword-else-as-identifier.rs b/src/test/parse-fail/keyword-else-as-identifier.rs
index 101fd938dcb..24bd18a738f 100644
--- a/src/test/parse-fail/keyword-else-as-identifier.rs
+++ b/src/test/parse-fail/keyword-else-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py else'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-enum-as-identifier.rs b/src/test/parse-fail/keyword-enum-as-identifier.rs
index ed504cc7b7f..e4745270414 100644
--- a/src/test/parse-fail/keyword-enum-as-identifier.rs
+++ b/src/test/parse-fail/keyword-enum-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py enum'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-extern-as-identifier.rs b/src/test/parse-fail/keyword-extern-as-identifier.rs
index 3260506b3e1..579cd9f9166 100644
--- a/src/test/parse-fail/keyword-extern-as-identifier.rs
+++ b/src/test/parse-fail/keyword-extern-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py extern'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-final.rs b/src/test/parse-fail/keyword-final.rs
index 305ef0ef075..4b06312d099 100644
--- a/src/test/parse-fail/keyword-final.rs
+++ b/src/test/parse-fail/keyword-final.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 final = (); //~ ERROR `final` is a reserved keyword
 }
diff --git a/src/test/parse-fail/keyword-fn-as-identifier.rs b/src/test/parse-fail/keyword-fn-as-identifier.rs
index 8c98da229c8..0ace9ddf1f0 100644
--- a/src/test/parse-fail/keyword-fn-as-identifier.rs
+++ b/src/test/parse-fail/keyword-fn-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py fn'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-for-as-identifier.rs b/src/test/parse-fail/keyword-for-as-identifier.rs
index 196a3390676..035c87b80bb 100644
--- a/src/test/parse-fail/keyword-for-as-identifier.rs
+++ b/src/test/parse-fail/keyword-for-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py for'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-if-as-identifier.rs b/src/test/parse-fail/keyword-if-as-identifier.rs
index 05f82ec790c..1aad0a780f9 100644
--- a/src/test/parse-fail/keyword-if-as-identifier.rs
+++ b/src/test/parse-fail/keyword-if-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py if'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-impl-as-identifier.rs b/src/test/parse-fail/keyword-impl-as-identifier.rs
index 1dd21800345..585109505d4 100644
--- a/src/test/parse-fail/keyword-impl-as-identifier.rs
+++ b/src/test/parse-fail/keyword-impl-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py impl'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-let-as-identifier.rs b/src/test/parse-fail/keyword-let-as-identifier.rs
index 0069a26a40b..07bc7901686 100644
--- a/src/test/parse-fail/keyword-let-as-identifier.rs
+++ b/src/test/parse-fail/keyword-let-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py let'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-loop-as-identifier.rs b/src/test/parse-fail/keyword-loop-as-identifier.rs
index 6e469e8c0b4..7b2b10a2d6d 100644
--- a/src/test/parse-fail/keyword-loop-as-identifier.rs
+++ b/src/test/parse-fail/keyword-loop-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py loop'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-match-as-identifier.rs b/src/test/parse-fail/keyword-match-as-identifier.rs
index 9155ebc71fa..528873c1794 100644
--- a/src/test/parse-fail/keyword-match-as-identifier.rs
+++ b/src/test/parse-fail/keyword-match-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py match'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-mod-as-identifier.rs b/src/test/parse-fail/keyword-mod-as-identifier.rs
index 02f57e937dd..b29bcbc76c3 100644
--- a/src/test/parse-fail/keyword-mod-as-identifier.rs
+++ b/src/test/parse-fail/keyword-mod-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py mod'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-mut-as-identifier.rs b/src/test/parse-fail/keyword-mut-as-identifier.rs
index b5d36e57750..b637d07d8b6 100644
--- a/src/test/parse-fail/keyword-mut-as-identifier.rs
+++ b/src/test/parse-fail/keyword-mut-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py mut'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-override.rs b/src/test/parse-fail/keyword-override.rs
index f70e6b92610..3f79e437189 100644
--- a/src/test/parse-fail/keyword-override.rs
+++ b/src/test/parse-fail/keyword-override.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 override = (); //~ ERROR `override` is a reserved keyword
 }
diff --git a/src/test/parse-fail/keyword-priv-as-identifier.rs b/src/test/parse-fail/keyword-priv-as-identifier.rs
index 7cbaeb9d518..e80feb66d60 100644
--- a/src/test/parse-fail/keyword-priv-as-identifier.rs
+++ b/src/test/parse-fail/keyword-priv-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py priv'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-pub-as-identifier.rs b/src/test/parse-fail/keyword-pub-as-identifier.rs
index aa679741c1c..959bbfbf882 100644
--- a/src/test/parse-fail/keyword-pub-as-identifier.rs
+++ b/src/test/parse-fail/keyword-pub-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py pub'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-ref-as-identifier.rs b/src/test/parse-fail/keyword-ref-as-identifier.rs
index 72af521f6f1..3db6d11c2e8 100644
--- a/src/test/parse-fail/keyword-ref-as-identifier.rs
+++ b/src/test/parse-fail/keyword-ref-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py ref'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-return-as-identifier.rs b/src/test/parse-fail/keyword-return-as-identifier.rs
index c5676445917..df8aeba6d71 100644
--- a/src/test/parse-fail/keyword-return-as-identifier.rs
+++ b/src/test/parse-fail/keyword-return-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py return'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-self-as-identifier.rs b/src/test/parse-fail/keyword-self-as-identifier.rs
index 8bb52142287..0e0d07ca6a5 100644
--- a/src/test/parse-fail/keyword-self-as-identifier.rs
+++ b/src/test/parse-fail/keyword-self-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py self'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-static-as-identifier.rs b/src/test/parse-fail/keyword-static-as-identifier.rs
index 7268c4f387e..d5b529af4b8 100644
--- a/src/test/parse-fail/keyword-static-as-identifier.rs
+++ b/src/test/parse-fail/keyword-static-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py static'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-struct-as-identifier.rs b/src/test/parse-fail/keyword-struct-as-identifier.rs
index bd42eac0ecb..7d2160dfd29 100644
--- a/src/test/parse-fail/keyword-struct-as-identifier.rs
+++ b/src/test/parse-fail/keyword-struct-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py struct'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-super-as-identifier.rs b/src/test/parse-fail/keyword-super-as-identifier.rs
index 0378c326a89..4d866918868 100644
--- a/src/test/parse-fail/keyword-super-as-identifier.rs
+++ b/src/test/parse-fail/keyword-super-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py super'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-super.rs b/src/test/parse-fail/keyword-super.rs
index 0c94f76f1f6..671be8c44b9 100644
--- a/src/test/parse-fail/keyword-super.rs
+++ b/src/test/parse-fail/keyword-super.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 super: isize; //~ ERROR expected identifier, found keyword `super`
 }
diff --git a/src/test/parse-fail/keyword-trait-as-identifier.rs b/src/test/parse-fail/keyword-trait-as-identifier.rs
index 95c0d174c33..7a8be0baa27 100644
--- a/src/test/parse-fail/keyword-trait-as-identifier.rs
+++ b/src/test/parse-fail/keyword-trait-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py trait'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-type-as-identifier.rs b/src/test/parse-fail/keyword-type-as-identifier.rs
index 0aaa2a63c7c..c76bea89ab4 100644
--- a/src/test/parse-fail/keyword-type-as-identifier.rs
+++ b/src/test/parse-fail/keyword-type-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py type'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-typeof.rs b/src/test/parse-fail/keyword-typeof.rs
index c42875382b9..29ec4f5844b 100644
--- a/src/test/parse-fail/keyword-typeof.rs
+++ b/src/test/parse-fail/keyword-typeof.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 typeof = (); //~ ERROR `typeof` is a reserved keyword
 }
diff --git a/src/test/parse-fail/keyword-unsafe-as-identifier.rs b/src/test/parse-fail/keyword-unsafe-as-identifier.rs
index 1b631eb877d..d3c48c6ded0 100644
--- a/src/test/parse-fail/keyword-unsafe-as-identifier.rs
+++ b/src/test/parse-fail/keyword-unsafe-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py unsafe'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-use-as-identifier.rs b/src/test/parse-fail/keyword-use-as-identifier.rs
index e82afd54442..d3815c650a3 100644
--- a/src/test/parse-fail/keyword-use-as-identifier.rs
+++ b/src/test/parse-fail/keyword-use-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py use'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword-while-as-identifier.rs b/src/test/parse-fail/keyword-while-as-identifier.rs
index 95cea65c610..331fdc07cc1 100644
--- a/src/test/parse-fail/keyword-while-as-identifier.rs
+++ b/src/test/parse-fail/keyword-while-as-identifier.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
+
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py while'
 
 fn main() {
diff --git a/src/test/parse-fail/keyword.rs b/src/test/parse-fail/keyword.rs
index 64eac47e69b..d4ce5518e46 100644
--- a/src/test/parse-fail/keyword.rs
+++ b/src/test/parse-fail/keyword.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
+
 pub mod break {
     //~^ ERROR expected identifier, found keyword `break`
 }
diff --git a/src/test/parse-fail/keywords-followed-by-double-colon.rs b/src/test/parse-fail/keywords-followed-by-double-colon.rs
index ba04a5ac9af..5e27d3e4f38 100644
--- a/src/test/parse-fail/keywords-followed-by-double-colon.rs
+++ b/src/test/parse-fail/keywords-followed-by-double-colon.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() {
     struct::foo();  //~ ERROR expected identifier
     mut::baz(); //~ ERROR expected identifier
diff --git a/src/test/parse-fail/lex-bad-char-literals.rs b/src/test/parse-fail/lex-bad-char-literals.rs
index 4aa01bcde69..33fb1e14eb3 100644
--- a/src/test/parse-fail/lex-bad-char-literals.rs
+++ b/src/test/parse-fail/lex-bad-char-literals.rs
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// compile-flags: -Z parse-only
 static c3: char =
     '\x1' //~ ERROR: numeric character escape is too short
 ;
diff --git a/src/test/parse-fail/lex-bad-numeric-literals.rs b/src/test/parse-fail/lex-bad-numeric-literals.rs
index 62b87e3f480..cf171b694c3 100644
--- a/src/test/parse-fail/lex-bad-numeric-literals.rs
+++ b/src/test/parse-fail/lex-bad-numeric-literals.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() {
     0o1.0; //~ ERROR: octal float literal is not supported
     0o2f32; //~ ERROR: octal float literal is not supported
diff --git a/src/test/parse-fail/lex-bad-token.rs b/src/test/parse-fail/lex-bad-token.rs
index d28d9a20c6e..774b10a9f97 100644
--- a/src/test/parse-fail/lex-bad-token.rs
+++ b/src/test/parse-fail/lex-bad-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
+
 ● //~ ERROR: unknown start of token
diff --git a/src/test/parse-fail/lex-bare-cr-string-literal-doc-comment.rs b/src/test/parse-fail/lex-bare-cr-string-literal-doc-comment.rs
index c1e5121d6dd..aa48144650f 100644
--- a/src/test/parse-fail/lex-bare-cr-string-literal-doc-comment.rs
+++ b/src/test/parse-fail/lex-bare-cr-string-literal-doc-comment.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
+
 // ignore-tidy-cr
 
 /// doc comment with bare CR: '
'
diff --git a/src/test/parse-fail/lifetime-no-keyword.rs b/src/test/parse-fail/lifetime-no-keyword.rs
index 8ffbcd90df8..84b02e6ba09 100644
--- a/src/test/parse-fail/lifetime-no-keyword.rs
+++ b/src/test/parse-fail/lifetime-no-keyword.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 foo<'a>(a: &'a isize) { }
 fn bar(a: &'static isize) { }
 fn baz(a: &'let isize) { } //~ ERROR invalid lifetime name
diff --git a/src/test/parse-fail/lifetime-obsoleted-self.rs b/src/test/parse-fail/lifetime-obsoleted-self.rs
index 766922f2f88..e8b76750eb9 100644
--- a/src/test/parse-fail/lifetime-obsoleted-self.rs
+++ b/src/test/parse-fail/lifetime-obsoleted-self.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 baz(a: &'self isize) { } //~ ERROR invalid lifetime name: 'self is no longer a special lifetime
 
 fn main() { }
diff --git a/src/test/parse-fail/macro-attribute.rs b/src/test/parse-fail/macro-attribute.rs
index 52f867fe913..18add7d011c 100644
--- a/src/test/parse-fail/macro-attribute.rs
+++ b/src/test/parse-fail/macro-attribute.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
+
 #[doc = $not_there] //~ error: unexpected token: `$`
 fn main() { }
diff --git a/src/test/parse-fail/macro-bad-delimiter-ident.rs b/src/test/parse-fail/macro-bad-delimiter-ident.rs
index 75f7b5d4dd8..2940adee043 100644
--- a/src/test/parse-fail/macro-bad-delimiter-ident.rs
+++ b/src/test/parse-fail/macro-bad-delimiter-ident.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() {
     foo! bar < //~ ERROR expected `(` or `{`, found `<`
 }
diff --git a/src/test/parse-fail/macro-keyword.rs b/src/test/parse-fail/macro-keyword.rs
index 9d4ec9c176c..6a7ccff1554 100644
--- a/src/test/parse-fail/macro-keyword.rs
+++ b/src/test/parse-fail/macro-keyword.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 macro() {  //~ ERROR `macro` is a reserved keyword
 }
 
diff --git a/src/test/parse-fail/macro-mismatched-delim-brace-paren.rs b/src/test/parse-fail/macro-mismatched-delim-brace-paren.rs
index d03698c1573..84cf900129f 100644
--- a/src/test/parse-fail/macro-mismatched-delim-brace-paren.rs
+++ b/src/test/parse-fail/macro-mismatched-delim-brace-paren.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() {
     foo! {
         bar, "baz", 1, 2.0
diff --git a/src/test/parse-fail/macro-mismatched-delim-paren-brace.rs b/src/test/parse-fail/macro-mismatched-delim-paren-brace.rs
index d80f93d7ad0..84094ab6ca8 100644
--- a/src/test/parse-fail/macro-mismatched-delim-paren-brace.rs
+++ b/src/test/parse-fail/macro-mismatched-delim-paren-brace.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() {
     foo! (
         bar, "baz", 1, 2.0
diff --git a/src/test/parse-fail/macros-no-semicolon-items.rs b/src/test/parse-fail/macros-no-semicolon-items.rs
index 314292085df..faf6b4a308a 100644
--- a/src/test/parse-fail/macros-no-semicolon-items.rs
+++ b/src/test/parse-fail/macros-no-semicolon-items.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
+
 macro_rules! foo()  //~ ERROR semicolon
 
 fn main() {
diff --git a/src/test/parse-fail/macros-no-semicolon.rs b/src/test/parse-fail/macros-no-semicolon.rs
index 23b27b49a86..9975609d8d3 100644
--- a/src/test/parse-fail/macros-no-semicolon.rs
+++ b/src/test/parse-fail/macros-no-semicolon.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() {
     assert!(1 == 2)
     assert!(3 == 4) //~ ERROR expected one of `.`, `;`, `}`, or an operator, found `assert`
diff --git a/src/test/parse-fail/match-arrows-block-then-binop.rs b/src/test/parse-fail/match-arrows-block-then-binop.rs
index b6b2313aa09..3026e159a44 100644
--- a/src/test/parse-fail/match-arrows-block-then-binop.rs
+++ b/src/test/parse-fail/match-arrows-block-then-binop.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 0 {
diff --git a/src/test/parse-fail/match-vec-invalid.rs b/src/test/parse-fail/match-vec-invalid.rs
index 0fc00c35074..72501ba0e4f 100644
--- a/src/test/parse-fail/match-vec-invalid.rs
+++ b/src/test/parse-fail/match-vec-invalid.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 a = Vec::new();
     match a {
diff --git a/src/test/parse-fail/mod_file_not_exist.rs b/src/test/parse-fail/mod_file_not_exist.rs
index bbf2152d5b7..7736394a6f5 100644
--- a/src/test/parse-fail/mod_file_not_exist.rs
+++ b/src/test/parse-fail/mod_file_not_exist.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
+
 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
 
diff --git a/src/test/parse-fail/mod_file_with_path_attr.rs b/src/test/parse-fail/mod_file_with_path_attr.rs
index ff330047c4e..993232e70ab 100644
--- a/src/test/parse-fail/mod_file_with_path_attr.rs
+++ b/src/test/parse-fail/mod_file_with_path_attr.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
+
 #[path = "not_a_real_file.rs"]
 mod m; //~ ERROR not_a_real_file.rs
 
diff --git a/src/test/parse-fail/multitrait.rs b/src/test/parse-fail/multitrait.rs
index a8b2fa4e115..a1c737609d1 100644
--- a/src/test/parse-fail/multitrait.rs
+++ b/src/test/parse-fail/multitrait.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 {
  y: isize
 }
diff --git a/src/test/parse-fail/mut-patterns.rs b/src/test/parse-fail/mut-patterns.rs
index cde05bc1d52..71d826c67f8 100644
--- a/src/test/parse-fail/mut-patterns.rs
+++ b/src/test/parse-fail/mut-patterns.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
+
 // Can't put mut in non-ident pattern
 
 pub fn main() {
diff --git a/src/test/parse-fail/new-unicode-escapes-1.rs b/src/test/parse-fail/new-unicode-escapes-1.rs
index f2422830a21..78a68e846d1 100644
--- a/src/test/parse-fail/new-unicode-escapes-1.rs
+++ b/src/test/parse-fail/new-unicode-escapes-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
+
 pub fn main() {
     let s = "\u{2603"; //~ ERROR unterminated unicode escape (needed a `}`)
 }
diff --git a/src/test/parse-fail/new-unicode-escapes-2.rs b/src/test/parse-fail/new-unicode-escapes-2.rs
index 5da8674c37e..3eaea86b8bc 100644
--- a/src/test/parse-fail/new-unicode-escapes-2.rs
+++ b/src/test/parse-fail/new-unicode-escapes-2.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
+
 pub fn main() {
     let s = "\u{260311111111}"; //~ ERROR overlong unicode escape (can have at most 6 hex digits)
 }
diff --git a/src/test/parse-fail/new-unicode-escapes-3.rs b/src/test/parse-fail/new-unicode-escapes-3.rs
index 7c64d02efd7..5e8bc16ac6e 100644
--- a/src/test/parse-fail/new-unicode-escapes-3.rs
+++ b/src/test/parse-fail/new-unicode-escapes-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
+
 pub fn main() {
     let s = "\u{d805}"; //~ ERROR illegal unicode character escape
 }
diff --git a/src/test/parse-fail/new-unicode-escapes-4.rs b/src/test/parse-fail/new-unicode-escapes-4.rs
index 96b86f1f563..896751bd4a7 100644
--- a/src/test/parse-fail/new-unicode-escapes-4.rs
+++ b/src/test/parse-fail/new-unicode-escapes-4.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
+
 pub fn main() {
     let s = "\u{lol}";
      //~^ ERROR illegal character in unicode escape: l
diff --git a/src/test/parse-fail/no-binary-float-literal.rs b/src/test/parse-fail/no-binary-float-literal.rs
index 2e207f90d36..528a2b1ad33 100644
--- a/src/test/parse-fail/no-binary-float-literal.rs
+++ b/src/test/parse-fail/no-binary-float-literal.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
+
 // error-pattern:binary float literal is not supported
 
 fn main() {
diff --git a/src/test/parse-fail/no-hex-float-literal.rs b/src/test/parse-fail/no-hex-float-literal.rs
index 4abb6093b24..df40fdde866 100644
--- a/src/test/parse-fail/no-hex-float-literal.rs
+++ b/src/test/parse-fail/no-hex-float-literal.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
+
 // error-pattern:hexadecimal float literal is not supported
 
 fn main() {
diff --git a/src/test/parse-fail/no-unsafe-self.rs b/src/test/parse-fail/no-unsafe-self.rs
index 0bf73bbdfe3..2a0ed9dcc24 100644
--- a/src/test/parse-fail/no-unsafe-self.rs
+++ b/src/test/parse-fail/no-unsafe-self.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 A {
     fn foo(*mut self); //~ ERROR cannot pass self by unsafe pointer
     fn bar(*self); //~ ERROR cannot pass self by unsafe pointer
diff --git a/src/test/parse-fail/non-str-meta.rs b/src/test/parse-fail/non-str-meta.rs
index 752f72f0b08..3e2e69d2814 100644
--- a/src/test/parse-fail/non-str-meta.rs
+++ b/src/test/parse-fail/non-str-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
+
 // Issue #623 - non-string meta items are not serialized correctly;
 // for now just forbid them
 
diff --git a/src/test/parse-fail/not-a-pred.rs b/src/test/parse-fail/not-a-pred.rs
index 782c90a6c26..d880c06f8a1 100644
--- a/src/test/parse-fail/not-a-pred.rs
+++ b/src/test/parse-fail/not-a-pred.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
+
 // error-pattern: lt
 
 fn f(a: isize, b: isize) : lt(a, b) { }
diff --git a/src/test/parse-fail/obsolete-proc.rs b/src/test/parse-fail/obsolete-proc.rs
index 4767c66c2a0..987eae66f3e 100644
--- a/src/test/parse-fail/obsolete-proc.rs
+++ b/src/test/parse-fail/obsolete-proc.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
+
 // Test that we generate obsolete syntax errors around usages of `proc`.
 
 fn foo(p: proc()) { } //~ ERROR `proc` is a reserved keyword
diff --git a/src/test/parse-fail/omitted-arg-in-item-fn.rs b/src/test/parse-fail/omitted-arg-in-item-fn.rs
index 2826d3b4af9..388b7c8772e 100644
--- a/src/test/parse-fail/omitted-arg-in-item-fn.rs
+++ b/src/test/parse-fail/omitted-arg-in-item-fn.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 foo(x) { //~ ERROR expected one of `:` or `@`, found `)`
 }
diff --git a/src/test/parse-fail/paamayim-nekudotayim.rs b/src/test/parse-fail/paamayim-nekudotayim.rs
index 4d5473faf73..63d9e941469 100644
--- a/src/test/parse-fail/paamayim-nekudotayim.rs
+++ b/src/test/parse-fail/paamayim-nekudotayim.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
+
 // http://phpsadness.com/sad/1
 
 fn main() {
diff --git a/src/test/parse-fail/parenthesized-box-expr-message.rs b/src/test/parse-fail/parenthesized-box-expr-message.rs
index 05bbaec37af..4d40f86b971 100644
--- a/src/test/parse-fail/parenthesized-box-expr-message.rs
+++ b/src/test/parse-fail/parenthesized-box-expr-message.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() {
     box(1 + 1) //~ HELP perhaps you meant `box() (foo)` instead?
     ; //~ ERROR expected expression, found `;`
diff --git a/src/test/parse-fail/pat-range-bad-dots.rs b/src/test/parse-fail/pat-range-bad-dots.rs
index c52fb8c9b67..d2afd26ea9a 100644
--- a/src/test/parse-fail/pat-range-bad-dots.rs
+++ b/src/test/parse-fail/pat-range-bad-dots.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
+
 pub fn main() {
     match 22 {
         0 .. 3 => {} //~ ERROR expected one of `...`, `=>`, `if`, or `|`, found `..`
diff --git a/src/test/parse-fail/pat-ref-enum.rs b/src/test/parse-fail/pat-ref-enum.rs
index 062d3308c3d..cf802572659 100644
--- a/src/test/parse-fail/pat-ref-enum.rs
+++ b/src/test/parse-fail/pat-ref-enum.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 matcher(x: Option<isize>) {
     match x {
       ref Some(i) => {} //~ ERROR expected identifier, found enum pattern
diff --git a/src/test/parse-fail/qquote-1.rs b/src/test/parse-fail/qquote-1.rs
index deae9a83866..e30308b295a 100644
--- a/src/test/parse-fail/qquote-1.rs
+++ b/src/test/parse-fail/qquote-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
+
 // ignore-test Can't use syntax crate here
 
 #![feature(quote)]
diff --git a/src/test/parse-fail/qquote-2.rs b/src/test/parse-fail/qquote-2.rs
index 978287a681e..ac501d31bee 100644
--- a/src/test/parse-fail/qquote-2.rs
+++ b/src/test/parse-fail/qquote-2.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
+
 // ignore-test Can't use syntax crate here
 
 #![feature(quote)]
diff --git a/src/test/parse-fail/range-3.rs b/src/test/parse-fail/range-3.rs
index 78c575d33ba..284cdb8c653 100644
--- a/src/test/parse-fail/range-3.rs
+++ b/src/test/parse-fail/range-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
+
 // Test range syntax - syntax errors.
 
 pub fn main() {
diff --git a/src/test/parse-fail/range-4.rs b/src/test/parse-fail/range-4.rs
index a3e27fbbe9a..69898612771 100644
--- a/src/test/parse-fail/range-4.rs
+++ b/src/test/parse-fail/range-4.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
+
 // Test range syntax - syntax errors.
 
 pub fn main() {
diff --git a/src/test/parse-fail/raw-byte-string-eof.rs b/src/test/parse-fail/raw-byte-string-eof.rs
index ccf9e2d8688..4b8bb31d19a 100644
--- a/src/test/parse-fail/raw-byte-string-eof.rs
+++ b/src/test/parse-fail/raw-byte-string-eof.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
+
 
 pub fn main() {
     br##"a"#;  //~ unterminated raw string
diff --git a/src/test/parse-fail/raw-byte-string-literals.rs b/src/test/parse-fail/raw-byte-string-literals.rs
index d6073a10307..d6be8fce53e 100644
--- a/src/test/parse-fail/raw-byte-string-literals.rs
+++ b/src/test/parse-fail/raw-byte-string-literals.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
+
 
 pub fn main() {
     br"é";  //~ raw byte string must be ASCII
diff --git a/src/test/parse-fail/raw-str-delim.rs b/src/test/parse-fail/raw-str-delim.rs
index 83afb33b641..c7ef91f14f5 100644
--- a/src/test/parse-fail/raw-str-delim.rs
+++ b/src/test/parse-fail/raw-str-delim.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 s: &'static str =
     r#x"#"x# //~ ERROR only `#` is allowed in raw string delimitation; found illegal character
 ;
diff --git a/src/test/parse-fail/raw-str-unbalanced.rs b/src/test/parse-fail/raw-str-unbalanced.rs
index 3403b28fdc9..ce8960edde1 100644
--- a/src/test/parse-fail/raw-str-unbalanced.rs
+++ b/src/test/parse-fail/raw-str-unbalanced.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 s: &'static str =
     r#"
       "## //~ ERROR expected one of `.`, `;`, or an operator, found `#`
diff --git a/src/test/parse-fail/raw-str-unterminated.rs b/src/test/parse-fail/raw-str-unterminated.rs
index 4151cf32346..c37239ac42c 100644
--- a/src/test/parse-fail/raw-str-unterminated.rs
+++ b/src/test/parse-fail/raw-str-unterminated.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 s: &'static str =
     r#" string literal goes on
         and on
diff --git a/src/test/parse-fail/regions-fn-bound.rs b/src/test/parse-fail/regions-fn-bound.rs
index c2b52b79f6c..8762c1326ce 100644
--- a/src/test/parse-fail/regions-fn-bound.rs
+++ b/src/test/parse-fail/regions-fn-bound.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
+
 // ignore-test
 // ignored because the first error does not show up.
 
@@ -21,6 +23,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// compile-flags: -Z parse-only
+
 fn of<T>() -> |T| { panic!(); }
 fn subtype<T>(x: |T|) { panic!(); }
 
diff --git a/src/test/parse-fail/regions-infer-paramd-method.rs b/src/test/parse-fail/regions-infer-paramd-method.rs
index ef331bb0fd7..b1aebf4a2d1 100644
--- a/src/test/parse-fail/regions-infer-paramd-method.rs
+++ b/src/test/parse-fail/regions-infer-paramd-method.rs
@@ -21,6 +21,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// compile-flags: -Z parse-only
+
 // Here: foo is parameterized because it contains a method that
 // refers to self.
 
diff --git a/src/test/parse-fail/regions-out-of-scope-slice.rs b/src/test/parse-fail/regions-out-of-scope-slice.rs
index c67c14d35d8..c4601b4de17 100644
--- a/src/test/parse-fail/regions-out-of-scope-slice.rs
+++ b/src/test/parse-fail/regions-out-of-scope-slice.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
+
 // ignore-test blk region isn't supported in the front-end
 
 fn foo(cond: bool) {
diff --git a/src/test/parse-fail/regions-trait-2.rs b/src/test/parse-fail/regions-trait-2.rs
index 7a7113cd594..e2e3fcde83c 100644
--- a/src/test/parse-fail/regions-trait-2.rs
+++ b/src/test/parse-fail/regions-trait-2.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
+
 // ignore-test #5723
 
 // Test that you cannot escape a reference
diff --git a/src/test/parse-fail/regions-trait-3.rs b/src/test/parse-fail/regions-trait-3.rs
index 8943abb49ae..57b182f3c41 100644
--- a/src/test/parse-fail/regions-trait-3.rs
+++ b/src/test/parse-fail/regions-trait-3.rs
@@ -21,6 +21,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// compile-flags: -Z parse-only
+
 trait get_ctxt<'a> {
     fn get_ctxt(self) -> &'a usize;
 }
diff --git a/src/test/parse-fail/removed-syntax-closure-lifetime.rs b/src/test/parse-fail/removed-syntax-closure-lifetime.rs
index 0cea87dba19..04d3757dcda 100644
--- a/src/test/parse-fail/removed-syntax-closure-lifetime.rs
+++ b/src/test/parse-fail/removed-syntax-closure-lifetime.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
+
 type closure = Box<lt/fn()>; //~ ERROR expected one of `(`, `+`, `,`, `::`, `<`, or `>`, found `/`
diff --git a/src/test/parse-fail/removed-syntax-enum-newtype.rs b/src/test/parse-fail/removed-syntax-enum-newtype.rs
index b067cee03d2..6a7f706624d 100644
--- a/src/test/parse-fail/removed-syntax-enum-newtype.rs
+++ b/src/test/parse-fail/removed-syntax-enum-newtype.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
+
 enum e = isize; //~ ERROR expected one of `<`, `where`, or `{`, found `=`
diff --git a/src/test/parse-fail/removed-syntax-extern-const.rs b/src/test/parse-fail/removed-syntax-extern-const.rs
index a0e1d04a3dc..c42fae71237 100644
--- a/src/test/parse-fail/removed-syntax-extern-const.rs
+++ b/src/test/parse-fail/removed-syntax-extern-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
+
 extern {
     const i: isize;
     //~^ ERROR expected one of `fn`, `pub`, `static`, `unsafe`, or `}`, found `const`
diff --git a/src/test/parse-fail/removed-syntax-field-let.rs b/src/test/parse-fail/removed-syntax-field-let.rs
index c8711598163..4e542fd7477 100644
--- a/src/test/parse-fail/removed-syntax-field-let.rs
+++ b/src/test/parse-fail/removed-syntax-field-let.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 {
     let foo: (),
     //~^  ERROR expected identifier, found keyword `let`
diff --git a/src/test/parse-fail/removed-syntax-field-semicolon.rs b/src/test/parse-fail/removed-syntax-field-semicolon.rs
index 9bb3c649cdf..409b9507769 100644
--- a/src/test/parse-fail/removed-syntax-field-semicolon.rs
+++ b/src/test/parse-fail/removed-syntax-field-semicolon.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 {
     bar: ();
     //~^ ERROR expected `,`, or `}`, found `;`
diff --git a/src/test/parse-fail/removed-syntax-fixed-vec.rs b/src/test/parse-fail/removed-syntax-fixed-vec.rs
index 0e8e20b3891..ae61d1ea858 100644
--- a/src/test/parse-fail/removed-syntax-fixed-vec.rs
+++ b/src/test/parse-fail/removed-syntax-fixed-vec.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
+
 type v = [isize * 3]; //~ ERROR expected one of `(`, `+`, `::`, `;`, `<`, or `]`, found `*`
diff --git a/src/test/parse-fail/removed-syntax-fn-pure.rs b/src/test/parse-fail/removed-syntax-fn-pure.rs
index d569ea25c46..83794a70a4f 100644
--- a/src/test/parse-fail/removed-syntax-fn-pure.rs
+++ b/src/test/parse-fail/removed-syntax-fn-pure.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
+
 pure fn f() {} //~ ERROR expected item, found `pure`
diff --git a/src/test/parse-fail/removed-syntax-fn-sigil.rs b/src/test/parse-fail/removed-syntax-fn-sigil.rs
index 83ebe7cc7a3..f47ad01d7e1 100644
--- a/src/test/parse-fail/removed-syntax-fn-sigil.rs
+++ b/src/test/parse-fail/removed-syntax-fn-sigil.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 x: fn~() = || (); //~ ERROR expected `(`, found `~`
 }
diff --git a/src/test/parse-fail/removed-syntax-larrow-init.rs b/src/test/parse-fail/removed-syntax-larrow-init.rs
index 116848c42c2..1388f8745df 100644
--- a/src/test/parse-fail/removed-syntax-larrow-init.rs
+++ b/src/test/parse-fail/removed-syntax-larrow-init.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 removed_moves() {
     let mut x = 0;
     let y <- x;
diff --git a/src/test/parse-fail/removed-syntax-larrow-move.rs b/src/test/parse-fail/removed-syntax-larrow-move.rs
index 552c9f2efa2..0736e483a49 100644
--- a/src/test/parse-fail/removed-syntax-larrow-move.rs
+++ b/src/test/parse-fail/removed-syntax-larrow-move.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 removed_moves() {
     let mut x = 0;
     let y = 0;
diff --git a/src/test/parse-fail/removed-syntax-mode.rs b/src/test/parse-fail/removed-syntax-mode.rs
index b02de5ce08e..4dafc36e912 100644
--- a/src/test/parse-fail/removed-syntax-mode.rs
+++ b/src/test/parse-fail/removed-syntax-mode.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
+
 fn f(+x: isize) {} //~ ERROR unexpected token: `+`
diff --git a/src/test/parse-fail/removed-syntax-mut-vec-expr.rs b/src/test/parse-fail/removed-syntax-mut-vec-expr.rs
index 30302bbd16e..ab9ff7ac19e 100644
--- a/src/test/parse-fail/removed-syntax-mut-vec-expr.rs
+++ b/src/test/parse-fail/removed-syntax-mut-vec-expr.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 v = [mut 1, 2, 3, 4];
     //~^  ERROR expected identifier, found keyword `mut`
diff --git a/src/test/parse-fail/removed-syntax-mut-vec-ty.rs b/src/test/parse-fail/removed-syntax-mut-vec-ty.rs
index 9a7570a92f0..00ea593656a 100644
--- a/src/test/parse-fail/removed-syntax-mut-vec-ty.rs
+++ b/src/test/parse-fail/removed-syntax-mut-vec-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
+
 type v = [mut isize];
     //~^  ERROR expected identifier, found keyword `mut`
     //~^^ ERROR expected one of `(`, `+`, `::`, `;`, `<`, or `]`, found `isize`
diff --git a/src/test/parse-fail/removed-syntax-ptr-lifetime.rs b/src/test/parse-fail/removed-syntax-ptr-lifetime.rs
index 44c65d98c0b..e586753087a 100644
--- a/src/test/parse-fail/removed-syntax-ptr-lifetime.rs
+++ b/src/test/parse-fail/removed-syntax-ptr-lifetime.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
+
 type bptr = &lifetime/isize; //~ ERROR expected one of `(`, `+`, `::`, `;`, or `<`, found `/`
diff --git a/src/test/parse-fail/removed-syntax-record.rs b/src/test/parse-fail/removed-syntax-record.rs
index ae5a68575f7..fd6f99bdbf9 100644
--- a/src/test/parse-fail/removed-syntax-record.rs
+++ b/src/test/parse-fail/removed-syntax-record.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
+
 type t = { f: () }; //~ ERROR expected type, found `{`
diff --git a/src/test/parse-fail/removed-syntax-static-fn.rs b/src/test/parse-fail/removed-syntax-static-fn.rs
index caf939e7b8a..be1e89dd717 100644
--- a/src/test/parse-fail/removed-syntax-static-fn.rs
+++ b/src/test/parse-fail/removed-syntax-static-fn.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/parse-fail/removed-syntax-uniq-mut-expr.rs b/src/test/parse-fail/removed-syntax-uniq-mut-expr.rs
index c5559c4ea96..ea686aeb6e0 100644
--- a/src/test/parse-fail/removed-syntax-uniq-mut-expr.rs
+++ b/src/test/parse-fail/removed-syntax-uniq-mut-expr.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 a_box = box mut 42;
     //~^  ERROR expected identifier, found keyword `mut`
diff --git a/src/test/parse-fail/removed-syntax-uniq-mut-ty.rs b/src/test/parse-fail/removed-syntax-uniq-mut-ty.rs
index d1c2fc69f52..77e64e7c997 100644
--- a/src/test/parse-fail/removed-syntax-uniq-mut-ty.rs
+++ b/src/test/parse-fail/removed-syntax-uniq-mut-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
+
 type mut_box = Box<mut isize>;
     //~^  ERROR expected identifier, found keyword `mut`
     //~^^ ERROR expected one of `(`, `+`, `,`, `::`, `<`, or `>`, found `isize`
diff --git a/src/test/parse-fail/removed-syntax-with-1.rs b/src/test/parse-fail/removed-syntax-with-1.rs
index c7f31045cb6..e9de52c013b 100644
--- a/src/test/parse-fail/removed-syntax-with-1.rs
+++ b/src/test/parse-fail/removed-syntax-with-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 removed_with() {
     struct S {
         foo: (),
diff --git a/src/test/parse-fail/removed-syntax-with-2.rs b/src/test/parse-fail/removed-syntax-with-2.rs
index 83c6897dee3..c58f42abb58 100644
--- a/src/test/parse-fail/removed-syntax-with-2.rs
+++ b/src/test/parse-fail/removed-syntax-with-2.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 removed_with() {
     struct S {
         foo: (),
diff --git a/src/test/parse-fail/require-parens-for-chained-comparison.rs b/src/test/parse-fail/require-parens-for-chained-comparison.rs
index f2705f58331..7e76dbd31f0 100644
--- a/src/test/parse-fail/require-parens-for-chained-comparison.rs
+++ b/src/test/parse-fail/require-parens-for-chained-comparison.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<T>() {}
 
 fn main() {
diff --git a/src/test/parse-fail/struct-literal-in-for.rs b/src/test/parse-fail/struct-literal-in-for.rs
index a6d4da526fb..8fb71e13f16 100644
--- a/src/test/parse-fail/struct-literal-in-for.rs
+++ b/src/test/parse-fail/struct-literal-in-for.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 {
     x: isize,
 }
diff --git a/src/test/parse-fail/struct-literal-in-if.rs b/src/test/parse-fail/struct-literal-in-if.rs
index 00ece3fcca3..1560c83bc70 100644
--- a/src/test/parse-fail/struct-literal-in-if.rs
+++ b/src/test/parse-fail/struct-literal-in-if.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 {
     x: isize,
 }
diff --git a/src/test/parse-fail/struct-literal-in-match-discriminant.rs b/src/test/parse-fail/struct-literal-in-match-discriminant.rs
index 85addc82293..42b3e75bcf6 100644
--- a/src/test/parse-fail/struct-literal-in-match-discriminant.rs
+++ b/src/test/parse-fail/struct-literal-in-match-discriminant.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 {
     x: isize,
 }
diff --git a/src/test/parse-fail/struct-literal-in-while.rs b/src/test/parse-fail/struct-literal-in-while.rs
index c23b5dbb9cc..2052193df91 100644
--- a/src/test/parse-fail/struct-literal-in-while.rs
+++ b/src/test/parse-fail/struct-literal-in-while.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 {
     x: isize,
 }
diff --git a/src/test/parse-fail/struct-no-fields-2.rs b/src/test/parse-fail/struct-no-fields-2.rs
index 4f973f81b16..1e6169f285b 100644
--- a/src/test/parse-fail/struct-no-fields-2.rs
+++ b/src/test/parse-fail/struct-no-fields-2.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;
 
 fn f2() {
diff --git a/src/test/parse-fail/struct-no-fields-3.rs b/src/test/parse-fail/struct-no-fields-3.rs
index e594683feed..8e72151ffe9 100644
--- a/src/test/parse-fail/struct-no-fields-3.rs
+++ b/src/test/parse-fail/struct-no-fields-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;
 
 fn g3() {
diff --git a/src/test/parse-fail/struct-no-fields-4.rs b/src/test/parse-fail/struct-no-fields-4.rs
index 60a0a85d0ab..6e55baf06ce 100644
--- a/src/test/parse-fail/struct-no-fields-4.rs
+++ b/src/test/parse-fail/struct-no-fields-4.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;
 
 fn h4() {
diff --git a/src/test/parse-fail/struct-no-fields-5.rs b/src/test/parse-fail/struct-no-fields-5.rs
index 940fa9c7f27..5f92d986066 100644
--- a/src/test/parse-fail/struct-no-fields-5.rs
+++ b/src/test/parse-fail/struct-no-fields-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
+
 struct Foo;
 
 fn i5() {
diff --git a/src/test/parse-fail/struct-no-fields-enumlike.rs b/src/test/parse-fail/struct-no-fields-enumlike.rs
index 379d310a60b..19a395806d6 100644
--- a/src/test/parse-fail/struct-no-fields-enumlike.rs
+++ b/src/test/parse-fail/struct-no-fields-enumlike.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(); //~ ERROR unit-like struct definition should be written as `struct Foo;`
 
 fn main() {}
diff --git a/src/test/parse-fail/struct-no-fields.rs b/src/test/parse-fail/struct-no-fields.rs
index ee853ade18e..fa5065b7630 100644
--- a/src/test/parse-fail/struct-no-fields.rs
+++ b/src/test/parse-fail/struct-no-fields.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 {}
 //~^ ERROR: unit-like struct definition should be written as `struct Foo;`
 
diff --git a/src/test/parse-fail/struct-variant-no-fields.rs b/src/test/parse-fail/struct-variant-no-fields.rs
index 41dbbeefc0a..68cf661e218 100644
--- a/src/test/parse-fail/struct-variant-no-fields.rs
+++ b/src/test/parse-fail/struct-variant-no-fields.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
+
 enum Foo {
     Bar {} //~ ERROR unit-like struct variant should be written without braces, as `Bar,`
 }
diff --git a/src/test/parse-fail/struct-variant-no-pub.rs b/src/test/parse-fail/struct-variant-no-pub.rs
index e62b39ad5aa..1824e32c425 100644
--- a/src/test/parse-fail/struct-variant-no-pub.rs
+++ b/src/test/parse-fail/struct-variant-no-pub.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
+
 enum Foo {
     Bar {
         pub a: isize //~ ERROR: `pub` is not allowed here
diff --git a/src/test/parse-fail/syntax-trait-polarity.rs b/src/test/parse-fail/syntax-trait-polarity.rs
index 1ab79f5c80e..c0d85034383 100644
--- a/src/test/parse-fail/syntax-trait-polarity.rs
+++ b/src/test/parse-fail/syntax-trait-polarity.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(optin_builtin_traits)]
 
 use std::marker::Send;
diff --git a/src/test/parse-fail/tag-variant-disr-non-nullary.rs b/src/test/parse-fail/tag-variant-disr-non-nullary.rs
index 207bbe9a446..f90b1cc94bb 100644
--- a/src/test/parse-fail/tag-variant-disr-non-nullary.rs
+++ b/src/test/parse-fail/tag-variant-disr-non-nullary.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
+
 //error-pattern: discriminator values can only be used with a c-like enum
 
 enum color {
diff --git a/src/test/parse-fail/trailing-carriage-return-in-string.rs b/src/test/parse-fail/trailing-carriage-return-in-string.rs
index 81098333261..dd763dc64c0 100644
--- a/src/test/parse-fail/trailing-carriage-return-in-string.rs
+++ b/src/test/parse-fail/trailing-carriage-return-in-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
+
 // ignore-tidy-cr
 // Issue #11669
 
diff --git a/src/test/parse-fail/trailing-plus-in-bounds.rs b/src/test/parse-fail/trailing-plus-in-bounds.rs
index 8febbf8309e..4abdbad9a03 100644
--- a/src/test/parse-fail/trailing-plus-in-bounds.rs
+++ b/src/test/parse-fail/trailing-plus-in-bounds.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
+
 use std::fmt::Debug;
 
 fn main() {
diff --git a/src/test/parse-fail/trait-bounds-not-on-impl.rs b/src/test/parse-fail/trait-bounds-not-on-impl.rs
index 51447b22576..7a20b00ce12 100644
--- a/src/test/parse-fail/trait-bounds-not-on-impl.rs
+++ b/src/test/parse-fail/trait-bounds-not-on-impl.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 {
 }
 
diff --git a/src/test/parse-fail/trait-keyword.rs b/src/test/parse-fail/trait-keyword.rs
index e60be6c81eb..faaa0525f9d 100644
--- a/src/test/parse-fail/trait-keyword.rs
+++ b/src/test/parse-fail/trait-keyword.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
+
 iface foo { } //~ ERROR iface
 
 fn main() {}
diff --git a/src/test/parse-fail/type-parameters-in-field-exprs.rs b/src/test/parse-fail/type-parameters-in-field-exprs.rs
index 191bd782124..9b160434e36 100644
--- a/src/test/parse-fail/type-parameters-in-field-exprs.rs
+++ b/src/test/parse-fail/type-parameters-in-field-exprs.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 {
     x: isize,
     y: isize,
diff --git a/src/test/parse-fail/unbalanced-doublequote.rs b/src/test/parse-fail/unbalanced-doublequote.rs
index 789cc886217..8d10f64504a 100644
--- a/src/test/parse-fail/unbalanced-doublequote.rs
+++ b/src/test/parse-fail/unbalanced-doublequote.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
+
 
 // error-pattern: unterminated double quote string
 
diff --git a/src/test/parse-fail/unboxed-closure-sugar-used-on-struct-3.rs b/src/test/parse-fail/unboxed-closure-sugar-used-on-struct-3.rs
index de6291c7cc3..ad2710e91e2 100644
--- a/src/test/parse-fail/unboxed-closure-sugar-used-on-struct-3.rs
+++ b/src/test/parse-fail/unboxed-closure-sugar-used-on-struct-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
+
 // Test that parentheses form doesn't work in expression paths.
 
 struct Bar<A,R> {
diff --git a/src/test/parse-fail/unsized.rs b/src/test/parse-fail/unsized.rs
index 92dbea0424b..1bcb5208d76 100644
--- a/src/test/parse-fail/unsized.rs
+++ b/src/test/parse-fail/unsized.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
+
 // Test syntax checks for `type` keyword.
 
 struct S1 for type; //~ ERROR expected `where`, `{`, `(`, or `;` after struct name, found `for`
diff --git a/src/test/parse-fail/unsized2.rs b/src/test/parse-fail/unsized2.rs
index b2eb2064aeb..a4a4c0dcfd9 100644
--- a/src/test/parse-fail/unsized2.rs
+++ b/src/test/parse-fail/unsized2.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
+
 // Test syntax checks for `type` keyword.
 
 fn f<X>() {}
diff --git a/src/test/parse-fail/use-as-where-use-ends-with-mod-sep.rs b/src/test/parse-fail/use-as-where-use-ends-with-mod-sep.rs
index 524fd01b94c..c1e1cc1c7f7 100644
--- a/src/test/parse-fail/use-as-where-use-ends-with-mod-sep.rs
+++ b/src/test/parse-fail/use-as-where-use-ends-with-mod-sep.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
+
 use std::any:: as foo; //~ ERROR expected identifier, found keyword `as`
 //~^ ERROR: expected one of `::`, `;`, or `as`, found `foo`
diff --git a/src/test/parse-fail/use-ends-with-mod-sep.rs b/src/test/parse-fail/use-ends-with-mod-sep.rs
index a375a5962a5..143886e2337 100644
--- a/src/test/parse-fail/use-ends-with-mod-sep.rs
+++ b/src/test/parse-fail/use-ends-with-mod-sep.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 std::any::; //~ ERROR expected identifier or `{` or `*`, found `;`
diff --git a/src/test/parse-fail/use-mod-4.rs b/src/test/parse-fail/use-mod-4.rs
index 52d0d1a5fba..bcafa4e9fde 100644
--- a/src/test/parse-fail/use-mod-4.rs
+++ b/src/test/parse-fail/use-mod-4.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
+
 use foo::self;
 //~^ ERROR expected identifier, found keyword `self`
 
diff --git a/src/test/parse-fail/variadic-ffi-1.rs b/src/test/parse-fail/variadic-ffi-1.rs
index 34846ab496d..63a36e98439 100644
--- a/src/test/parse-fail/variadic-ffi-1.rs
+++ b/src/test/parse-fail/variadic-ffi-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
+
 extern {
     fn printf(...); //~ ERROR: variadic function must be declared with at least one named argument
     fn printf(..., foo: isize); //~ ERROR: `...` must be last in argument list for variadic function
diff --git a/src/test/parse-fail/variadic-ffi-3.rs b/src/test/parse-fail/variadic-ffi-3.rs
index 331a4523934..d202fa33cc1 100644
--- a/src/test/parse-fail/variadic-ffi-3.rs
+++ b/src/test/parse-fail/variadic-ffi-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
+
 fn foo(x: isize, ...) {
     //~^ ERROR: only foreign functions are allowed to be variadic
 }
diff --git a/src/test/parse-fail/variadic-ffi-4.rs b/src/test/parse-fail/variadic-ffi-4.rs
index 62e985f44f7..ef9d4558f68 100644
--- a/src/test/parse-fail/variadic-ffi-4.rs
+++ b/src/test/parse-fail/variadic-ffi-4.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
+
 extern "C" fn foo(x: isize, ...) {
     //~^ ERROR: only foreign functions are allowed to be variadic
 }
diff --git a/src/test/parse-fail/virtual-structs.rs b/src/test/parse-fail/virtual-structs.rs
index 3b3c7d5a30f..a0e50d48812 100644
--- a/src/test/parse-fail/virtual-structs.rs
+++ b/src/test/parse-fail/virtual-structs.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
+
 // Test diagnostics for the removed struct inheritance feature.
 #![feature(struct_inherit)]
 
diff --git a/src/test/parse-fail/where-clauses-no-bounds-or-predicates.rs b/src/test/parse-fail/where-clauses-no-bounds-or-predicates.rs
index ebdbdc4b2b5..3ac71176342 100644
--- a/src/test/parse-fail/where-clauses-no-bounds-or-predicates.rs
+++ b/src/test/parse-fail/where-clauses-no-bounds-or-predicates.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 equal1<T>(_: &T, _: &T) -> bool where {
 //~^ ERROR a `where` clause must have at least one predicate in it
     true