From 2a24e97c80d5004cd1b57cb96a0bde6fe43a848d Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Mon, 9 Feb 2015 20:01:45 +0100 Subject: [PATCH] Return nonzero exit code if there are errors at a stop point --- src/librustc_driver/driver.rs | 15 ++++++++++----- src/test/compile-fail/mod_file_disambig.rs | 2 ++ src/test/compile-fail/mod_file_not_owning.rs | 2 ++ src/test/parse-fail/array-old-syntax-1.rs | 2 ++ .../parse-fail/ascii-only-character-escape.rs | 2 ++ ...associated-types-project-from-hrtb-explicit.rs | 2 ++ src/test/parse-fail/attr-bad-meta.rs | 2 ++ src/test/parse-fail/attr-before-eof.rs | 2 ++ src/test/parse-fail/attr-before-ext.rs | 2 ++ src/test/parse-fail/attr-before-let.rs | 2 ++ src/test/parse-fail/attr-before-stmt.rs | 2 ++ src/test/parse-fail/attr-dangling-in-fn.rs | 2 ++ src/test/parse-fail/attr-dangling-in-mod.rs | 2 ++ src/test/parse-fail/attr.rs | 2 ++ src/test/parse-fail/attrs-after-extern-mod.rs | 2 ++ src/test/parse-fail/bad-char-literals.rs | 2 ++ src/test/parse-fail/bad-lit-suffixes.rs | 2 ++ src/test/parse-fail/bad-match.rs | 2 ++ src/test/parse-fail/bad-name.rs | 2 ++ src/test/parse-fail/bad-value-ident-false.rs | 2 ++ src/test/parse-fail/bad-value-ident-true.rs | 2 ++ src/test/parse-fail/better-expected.rs | 2 ++ .../parse-fail/bind-struct-early-modifiers.rs | 2 ++ src/test/parse-fail/byte-literals.rs | 2 ++ src/test/parse-fail/byte-string-literals.rs | 2 ++ src/test/parse-fail/circular_modules_hello.rs | 2 ++ src/test/parse-fail/circular_modules_main.rs | 2 ++ src/test/parse-fail/class-implements-bad-trait.rs | 2 ++ src/test/parse-fail/column-offset-1-based.rs | 4 +++- src/test/parse-fail/doc-before-attr.rs | 2 ++ src/test/parse-fail/doc-before-eof.rs | 2 ++ src/test/parse-fail/doc-before-extern-rbrace.rs | 2 ++ src/test/parse-fail/doc-before-macro.rs | 2 ++ src/test/parse-fail/doc-before-rbrace.rs | 2 ++ src/test/parse-fail/doc-before-semi.rs | 2 ++ src/test/parse-fail/duplicate-visibility.rs | 2 ++ src/test/parse-fail/empty-impl-semicolon.rs | 2 ++ .../parse-fail/extern-expected-fn-or-brace.rs | 2 ++ src/test/parse-fail/extern-foreign-crate.rs | 2 ++ src/test/parse-fail/extern-no-fn.rs | 2 ++ .../parse-fail/generic-non-trailing-defaults.rs | 2 ++ src/test/parse-fail/import-from-path.rs | 2 ++ src/test/parse-fail/import-from-rename.rs | 2 ++ src/test/parse-fail/import-glob-path.rs | 2 ++ src/test/parse-fail/import-glob-rename.rs | 2 ++ src/test/parse-fail/int-literal-too-large-span.rs | 2 ++ src/test/parse-fail/issue-10392-2.rs | 2 ++ src/test/parse-fail/issue-10392.rs | 2 ++ src/test/parse-fail/issue-10412.rs | 2 ++ src/test/parse-fail/issue-10636-1.rs | 2 ++ src/test/parse-fail/issue-10636-2.rs | 2 ++ src/test/parse-fail/issue-12560-1.rs | 2 ++ src/test/parse-fail/issue-14182.rs | 2 ++ src/test/parse-fail/issue-14303-enum.rs | 2 ++ src/test/parse-fail/issue-14303-fn-def.rs | 2 ++ src/test/parse-fail/issue-14303-fncall.rs | 2 ++ src/test/parse-fail/issue-14303-impl.rs | 2 ++ src/test/parse-fail/issue-14303-path.rs | 2 ++ src/test/parse-fail/issue-14303-struct.rs | 2 ++ src/test/parse-fail/issue-14303-trait.rs | 2 ++ src/test/parse-fail/issue-15914.rs | 2 ++ src/test/parse-fail/issue-1655.rs | 2 ++ src/test/parse-fail/issue-17383.rs | 2 ++ src/test/parse-fail/issue-17718-const-mut.rs | 2 ++ src/test/parse-fail/issue-17904.rs | 2 ++ src/test/parse-fail/issue-1802-1.rs | 2 ++ src/test/parse-fail/issue-1802-2.rs | 2 ++ src/test/parse-fail/issue-19096.rs | 2 ++ src/test/parse-fail/issue-19398.rs | 2 ++ src/test/parse-fail/issue-20711-2.rs | 2 ++ src/test/parse-fail/issue-20711.rs | 2 ++ src/test/parse-fail/issue-21153.rs | 2 ++ src/test/parse-fail/issue-2354-1.rs | 2 ++ src/test/parse-fail/issue-2354.rs | 2 ++ src/test/parse-fail/issue-3036.rs | 2 ++ src/test/parse-fail/issue-5544-a.rs | 2 ++ src/test/parse-fail/issue-5544-b.rs | 2 ++ src/test/parse-fail/issue-5806.rs | 2 ++ src/test/parse-fail/issue-6610.rs | 2 ++ src/test/parse-fail/issue-8537.rs | 2 ++ src/test/parse-fail/keyword-abstract.rs | 2 ++ src/test/parse-fail/keyword-as-as-identifier.rs | 2 ++ .../parse-fail/keyword-break-as-identifier.rs | 2 ++ src/test/parse-fail/keyword-do-as-identifier.rs | 2 ++ src/test/parse-fail/keyword-else-as-identifier.rs | 2 ++ src/test/parse-fail/keyword-enum-as-identifier.rs | 2 ++ .../parse-fail/keyword-extern-as-identifier.rs | 2 ++ src/test/parse-fail/keyword-final.rs | 2 ++ src/test/parse-fail/keyword-fn-as-identifier.rs | 2 ++ src/test/parse-fail/keyword-for-as-identifier.rs | 2 ++ src/test/parse-fail/keyword-if-as-identifier.rs | 2 ++ src/test/parse-fail/keyword-impl-as-identifier.rs | 2 ++ src/test/parse-fail/keyword-let-as-identifier.rs | 2 ++ src/test/parse-fail/keyword-loop-as-identifier.rs | 2 ++ .../parse-fail/keyword-match-as-identifier.rs | 2 ++ src/test/parse-fail/keyword-mod-as-identifier.rs | 2 ++ src/test/parse-fail/keyword-mut-as-identifier.rs | 2 ++ src/test/parse-fail/keyword-override.rs | 2 ++ src/test/parse-fail/keyword-priv-as-identifier.rs | 2 ++ src/test/parse-fail/keyword-pub-as-identifier.rs | 2 ++ src/test/parse-fail/keyword-ref-as-identifier.rs | 2 ++ .../parse-fail/keyword-return-as-identifier.rs | 2 ++ src/test/parse-fail/keyword-self-as-identifier.rs | 2 ++ .../parse-fail/keyword-static-as-identifier.rs | 2 ++ .../parse-fail/keyword-struct-as-identifier.rs | 2 ++ .../parse-fail/keyword-super-as-identifier.rs | 2 ++ src/test/parse-fail/keyword-super.rs | 2 ++ .../parse-fail/keyword-trait-as-identifier.rs | 2 ++ src/test/parse-fail/keyword-type-as-identifier.rs | 2 ++ src/test/parse-fail/keyword-typeof.rs | 2 ++ .../parse-fail/keyword-unsafe-as-identifier.rs | 2 ++ src/test/parse-fail/keyword-use-as-identifier.rs | 2 ++ .../parse-fail/keyword-while-as-identifier.rs | 2 ++ src/test/parse-fail/keyword.rs | 2 ++ .../keywords-followed-by-double-colon.rs | 2 ++ src/test/parse-fail/lex-bad-char-literals.rs | 1 + src/test/parse-fail/lex-bad-numeric-literals.rs | 2 ++ src/test/parse-fail/lex-bad-token.rs | 2 ++ .../lex-bare-cr-string-literal-doc-comment.rs | 2 ++ src/test/parse-fail/lifetime-no-keyword.rs | 2 ++ src/test/parse-fail/lifetime-obsoleted-self.rs | 2 ++ src/test/parse-fail/macro-attribute.rs | 2 ++ src/test/parse-fail/macro-bad-delimiter-ident.rs | 2 ++ src/test/parse-fail/macro-keyword.rs | 2 ++ .../macro-mismatched-delim-brace-paren.rs | 2 ++ .../macro-mismatched-delim-paren-brace.rs | 2 ++ src/test/parse-fail/macros-no-semicolon-items.rs | 2 ++ src/test/parse-fail/macros-no-semicolon.rs | 2 ++ .../parse-fail/match-arrows-block-then-binop.rs | 2 ++ src/test/parse-fail/match-vec-invalid.rs | 2 ++ src/test/parse-fail/mod_file_not_exist.rs | 2 ++ src/test/parse-fail/mod_file_with_path_attr.rs | 2 ++ src/test/parse-fail/multitrait.rs | 2 ++ src/test/parse-fail/mut-patterns.rs | 2 ++ src/test/parse-fail/new-unicode-escapes-1.rs | 2 ++ src/test/parse-fail/new-unicode-escapes-2.rs | 2 ++ src/test/parse-fail/new-unicode-escapes-3.rs | 2 ++ src/test/parse-fail/new-unicode-escapes-4.rs | 2 ++ src/test/parse-fail/no-binary-float-literal.rs | 2 ++ src/test/parse-fail/no-hex-float-literal.rs | 2 ++ src/test/parse-fail/no-unsafe-self.rs | 2 ++ src/test/parse-fail/non-str-meta.rs | 2 ++ src/test/parse-fail/not-a-pred.rs | 2 ++ src/test/parse-fail/obsolete-proc.rs | 2 ++ src/test/parse-fail/omitted-arg-in-item-fn.rs | 2 ++ src/test/parse-fail/paamayim-nekudotayim.rs | 2 ++ .../parse-fail/parenthesized-box-expr-message.rs | 2 ++ src/test/parse-fail/pat-range-bad-dots.rs | 2 ++ src/test/parse-fail/pat-ref-enum.rs | 2 ++ src/test/parse-fail/qquote-1.rs | 2 ++ src/test/parse-fail/qquote-2.rs | 2 ++ src/test/parse-fail/range-3.rs | 2 ++ src/test/parse-fail/range-4.rs | 2 ++ src/test/parse-fail/raw-byte-string-eof.rs | 2 ++ src/test/parse-fail/raw-byte-string-literals.rs | 2 ++ src/test/parse-fail/raw-str-delim.rs | 2 ++ src/test/parse-fail/raw-str-unbalanced.rs | 2 ++ src/test/parse-fail/raw-str-unterminated.rs | 2 ++ src/test/parse-fail/regions-fn-bound.rs | 4 ++++ .../parse-fail/regions-infer-paramd-method.rs | 2 ++ src/test/parse-fail/regions-out-of-scope-slice.rs | 2 ++ src/test/parse-fail/regions-trait-2.rs | 2 ++ src/test/parse-fail/regions-trait-3.rs | 2 ++ .../parse-fail/removed-syntax-closure-lifetime.rs | 2 ++ .../parse-fail/removed-syntax-enum-newtype.rs | 2 ++ .../parse-fail/removed-syntax-extern-const.rs | 2 ++ src/test/parse-fail/removed-syntax-field-let.rs | 2 ++ .../parse-fail/removed-syntax-field-semicolon.rs | 2 ++ src/test/parse-fail/removed-syntax-fixed-vec.rs | 2 ++ src/test/parse-fail/removed-syntax-fn-pure.rs | 2 ++ src/test/parse-fail/removed-syntax-fn-sigil.rs | 2 ++ src/test/parse-fail/removed-syntax-larrow-init.rs | 2 ++ src/test/parse-fail/removed-syntax-larrow-move.rs | 2 ++ src/test/parse-fail/removed-syntax-mode.rs | 2 ++ .../parse-fail/removed-syntax-mut-vec-expr.rs | 2 ++ src/test/parse-fail/removed-syntax-mut-vec-ty.rs | 2 ++ .../parse-fail/removed-syntax-ptr-lifetime.rs | 2 ++ src/test/parse-fail/removed-syntax-record.rs | 2 ++ src/test/parse-fail/removed-syntax-static-fn.rs | 2 ++ .../parse-fail/removed-syntax-uniq-mut-expr.rs | 2 ++ src/test/parse-fail/removed-syntax-uniq-mut-ty.rs | 2 ++ src/test/parse-fail/removed-syntax-with-1.rs | 2 ++ src/test/parse-fail/removed-syntax-with-2.rs | 2 ++ .../require-parens-for-chained-comparison.rs | 2 ++ src/test/parse-fail/struct-literal-in-for.rs | 2 ++ src/test/parse-fail/struct-literal-in-if.rs | 2 ++ .../struct-literal-in-match-discriminant.rs | 2 ++ src/test/parse-fail/struct-literal-in-while.rs | 2 ++ src/test/parse-fail/struct-no-fields-2.rs | 2 ++ src/test/parse-fail/struct-no-fields-3.rs | 2 ++ src/test/parse-fail/struct-no-fields-4.rs | 2 ++ src/test/parse-fail/struct-no-fields-5.rs | 2 ++ src/test/parse-fail/struct-no-fields-enumlike.rs | 2 ++ src/test/parse-fail/struct-no-fields.rs | 2 ++ src/test/parse-fail/struct-variant-no-fields.rs | 2 ++ src/test/parse-fail/struct-variant-no-pub.rs | 2 ++ src/test/parse-fail/syntax-trait-polarity.rs | 2 ++ .../parse-fail/tag-variant-disr-non-nullary.rs | 2 ++ .../trailing-carriage-return-in-string.rs | 2 ++ src/test/parse-fail/trailing-plus-in-bounds.rs | 2 ++ src/test/parse-fail/trait-bounds-not-on-impl.rs | 2 ++ src/test/parse-fail/trait-keyword.rs | 2 ++ .../parse-fail/type-parameters-in-field-exprs.rs | 2 ++ src/test/parse-fail/unbalanced-doublequote.rs | 2 ++ .../unboxed-closure-sugar-used-on-struct-3.rs | 2 ++ src/test/parse-fail/unsized.rs | 2 ++ src/test/parse-fail/unsized2.rs | 2 ++ .../use-as-where-use-ends-with-mod-sep.rs | 2 ++ src/test/parse-fail/use-ends-with-mod-sep.rs | 2 ++ src/test/parse-fail/use-mod-4.rs | 2 ++ src/test/parse-fail/variadic-ffi-1.rs | 2 ++ src/test/parse-fail/variadic-ffi-3.rs | 2 ++ src/test/parse-fail/variadic-ffi-4.rs | 2 ++ src/test/parse-fail/virtual-structs.rs | 2 ++ .../where-clauses-no-bounds-or-predicates.rs | 2 ++ 215 files changed, 440 insertions(+), 6 deletions(-) diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index a751529314684..154e0a1f64460 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, addl_plugins: Option>, 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 48bd00a3ee06c..27c253234be66 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 adbcedd91f205..7dcff6e6644f1 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 71c57fefc2e26..78dcf2e2e2ee7 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 bcfcc4347039b..2094b63ab3688 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 917c03fbf4b1c..9c7721589d9b7 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 dbf2929afe4f8..7def91da5eca4 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 e34756229bdfa..c75b0ac122aeb 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 098c5aaec545c..e15350fcad79c 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 b4a90e35c40f1..03dabb980f20d 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 ec837cd6de36d..bc306048cdc4a 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 384622fb1686d..f2f4ecadd7a1d 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 59a922ebee1af..79609935f9ed8 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 4bd6141273141..1f0a95826fcd7 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 df74761869608..442eb14116e4c 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 2a358ae8307b6..fe8ed8bb9a52f 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 f1f18115825ca..a64ee6a9ce265 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 33043ff5524a4..b42c04f3ce281 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 b208c6f4244ef..201e6ced2f9e8 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 ca10bdd9848ec..96325a2abb424 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 4508d5219a217..7ff16b8037339 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 e07f4b8e54900..3f0e0d36d8f38 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 c358a21d1253e..25348a3bfd18f 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 08935a24a1b61..6685a29bb4264 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 ee3d86a6638d8..7049363c21b77 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 3bf851643f2c3..4de817dbd9ca7 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 3e548981f1ed4..861d4cd12ab5c 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 7de51c1ea75ca..ea263d938d40c 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 a00ded61758c2..bcadd1f39fa98 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 `` +// compile-flags: -Z parse-only + +# //~ ERROR 13:1: 13:2 error: expected `[`, found `` diff --git a/src/test/parse-fail/doc-before-attr.rs b/src/test/parse-fail/doc-before-attr.rs index bb44a6a8abb32..4548cebd0a886 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 e6dd4102462d5..728972eca6206 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 5afd1b2c6b8b9..9e825193dc0d8 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 8dc6c54650067..44435bde03c0d 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 6d05064277d44..8b69c385378f8 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 8b0300edce0e8..42c58af76d8c5 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 b213730ef754f..5ee84cd5543ba 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 a2e780d49b8ea..e356ab1debcbe 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 7d1110cf6df83..7fb7233dc6982 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 1ff4368dac5e2..9adbd87140986 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 69e2f3ae60be5..bf5cbe0c4592a 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 0cfb05b9332a4..26ee6ce80d68a 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; //~ 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 ce91de7e9d97a..fbd59d200a0cd 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 ebd897a061139..c4d8ba2086d21 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 b6bc53fad945f..2faf833d4f127 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 fb400b6c2bb1e..7e17e1f1d6c06 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 8a496c934b9c9..c4b25d4357933 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 2a3dd7fba0cff..2817912666e55 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 3f8d26bfec05d..9c67575bcc145 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 8a99633b4fc11..0b9456bc080d9 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 ; //~ 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 bb020d55bdb0b..398fe8c5b8cf3 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 a92ef24892432..f57abf8929e83 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) { 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 ea2043e6703c2..96a17a8fb45e6 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 364951a4feafb..176e17c7eb0ff 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 a26b7fdc425f1..6bcf588b5161b 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 aaf95410b8ed3..ae8e38c03773f 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 a7adaacc0a5bf..80a9b3d7c0d5b 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 c4a00581274ac..f06d5f29e9e07 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 30cc41c35880e..f0d1feffec80b 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 6edd808d84762..5673e4f2a4c7d 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 753acdd75fe55..8af5af9e93302 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 45b3abfddfba2..0b8f0ac221ab2 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 6bdcf5c5edced..a044dff261db3 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 c71e0ecd49496..1b33cb3885758 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 b7feeecbfd91e..b450cb25e6ba8 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 96ba712bbae8b..580b8c66c7483 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 where U: Eq(U); //This is parsed as the new Fn* style parenthesis syntax. struct Baz where U: Eq(U) -> R; // Notice this parses as well. struct Baz(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 00fb2808faa95..fc3d071729fbc 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 f6da2fc82c34d..05c5a4bcb0240 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 90d2acbe5816a..0d9a111045a99 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::; //~ 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 3a6d15e0086f7..a91d513b83df5 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 a50a757160dde..2c993b7654e67 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 3b329d7823749..8462bd8fd016a 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 6496ffebbc849..44d979ba9798b 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: 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 48cdeeb0d7027..e65f95780bb96 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 cc219a6acb5ef..0b380d6ae8847 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 16834f491659b..1946e984e5dc9 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 95a4f36d1711c..f406b2cc803fc 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 9c35d77baf015..898b092064518 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 5d2908b92ef3e..f54423139049e 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 166e91b27ac13..f5113efad1ce8 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 52cf420a9ffda..5996b744566ce 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 1f1360eac0078..bd3fbbe79a88b 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 f307b12f66e70..bc05a7c4f25fb 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 1e2725eb2feb9..bd7527f399e59 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 90f73f8a9f422..5cc14dfef0ec6 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 101fd938dcb22..24bd18a738fbe 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 ed504cc7b7fde..e474527041428 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 3260506b3e193..579cd9f916652 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 305ef0ef075f7..4b06312d0993b 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 8c98da229c8b7..0ace9ddf1f074 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 196a33906767b..035c87b80bb9c 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 05f82ec790cc5..1aad0a780f968 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 1dd2180034519..585109505d408 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 0069a26a40b7e..07bc790168608 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 6e469e8c0b437..7b2b10a2d6dde 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 9155ebc71fa43..528873c179432 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 02f57e937dd7b..b29bcbc76c3cd 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 b5d36e577502d..b637d07d8b6d0 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 f70e6b9261053..3f79e437189c2 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 7cbaeb9d51841..e80feb66d6071 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 aa679741c1c08..959bbfbf88264 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 72af521f6f1a9..3db6d11c2e89c 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 c567644591772..df8aeba6d7164 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 8bb52142287f8..0e0d07ca6a537 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 7268c4f387eca..d5b529af4b80e 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 bd42eac0ecbe0..7d2160dfd2937 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 0378c326a89a7..4d86691886865 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 0c94f76f1f6f6..671be8c44b9c6 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 95c0d174c3322..7a8be0baa27f5 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 0aaa2a63c7c4f..c76bea89ab40d 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 c42875382b98d..29ec4f5844b1e 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 1b631eb877d9a..d3c48c6ded0d0 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 e82afd544424d..d3815c650a36f 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 95cea65c610dd..331fdc07cc15c 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 64eac47e69b32..d4ce5518e465d 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 ba04a5ac9af09..5e27d3e4f383e 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 4aa01bcde6989..33fb1e14eb3b9 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 62b87e3f480ad..cf171b694c377 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 d28d9a20c6eed..774b10a9f97c5 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 c1e5121d6dd4e..aa48144650fed 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 8ffbcd90df877..84b02e6ba0964 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 766922f2f8864..e8b76750eb985 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 52f867fe913b8..18add7d011cba 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 75f7b5d4dd809..2940adee043a5 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 9d4ec9c176cce..6a7ccff155448 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 d03698c1573b1..84cf900129f95 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 d80f93d7ad0d0..84094ab6ca89c 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 314292085dfe6..faf6b4a308a07 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 23b27b49a86f6..9975609d8d3f8 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 b6b2313aa09c3..3026e159a4439 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 0fc00c350748a..72501ba0e4f4d 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 bbf2152d5b795..7736394a6f5d0 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 ff330047c4e96..993232e70ab3b 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 a8b2fa4e115be..a1c737609d14a 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 cde05bc1d524e..71d826c67f8bd 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 f2422830a21cc..78a68e846d111 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 5da8674c37ea5..3eaea86b8bc3c 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 7c64d02efd746..5e8bc16ac6e9f 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 96b86f1f5635f..896751bd4a727 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 2e207f90d36cd..528a2b1ad33a2 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 4abb6093b2443..df40fdde866e1 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 0bf73bbdfe31c..2a0ed9dcc243f 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 752f72f0b0833..3e2e69d2814e5 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 782c90a6c26b0..d880c06f8a1a6 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 4767c66c2a058..987eae66f3e63 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 2826d3b4af942..388b7c8772e9a 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 4d5473faf7352..63d9e94146993 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 05bbaec37af02..4d40f86b97182 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 c52fb8c9b6797..d2afd26ea9a3d 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 062d3308c3de6..cf8025726598c 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) { 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 deae9a8386603..e30308b295a37 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 978287a681eb1..ac501d31beebd 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 78c575d33bad0..284cdb8c6531a 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 a3e27fbbe9aa3..69898612771e7 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 ccf9e2d86882b..4b8bb31d19af5 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 d6073a10307fd..d6be8fce53e0f 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 83afb33b641cf..c7ef91f14f578 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 3403b28fdc9c0..ce8960edde12f 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 4151cf32346ce..c37239ac42c80 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 c2b52b79f6c87..8762c1326ceaa 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| { panic!(); } fn subtype(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 ef331bb0fd7bc..b1aebf4a2d106 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 c67c14d35d895..c4601b4de1713 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 7a7113cd594b5..e2e3fcde83cf1 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 8943abb49ae93..57b182f3c4194 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 0cea87dba19bb..04d3757dcda70 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; //~ 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 b067cee03d257..6a7f706624dde 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 a0e1d04a3dc5d..c42fae71237da 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 c8711598163a0..4e542fd7477f3 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 9bb3c649cdfe2..409b950776939 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 0e8e20b389187..ae61d1ea85861 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 d569ea25c46a7..83794a70a4f43 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 83ebe7cc7a3bd..f47ad01d7e129 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 116848c42c28e..1388f8745df57 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 552c9f2efa2de..0736e483a4979 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 b02de5ce08e94..4dafc36e912c5 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 30302bbd16ef8..ab9ff7ac19e5e 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 9a7570a92f002..00ea593656abb 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 44c65d98c0b72..e586753087ada 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 ae5a68575f72f..fd6f99bdbf9f4 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 caf939e7b8aa9..be1e89dd71799 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 c5559c4ea9621..ea686aeb6e05a 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 d1c2fc69f5233..77e64e7c997ea 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; //~^ 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 c7f31045cb6a2..e9de52c013b3a 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 83c6897dee311..c58f42abb58f0 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 f2705f58331b4..7e76dbd31f0a3 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() {} 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 a6d4da526fb0e..8fb71e13f16a2 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 00ece3fcca341..1560c83bc70ba 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 85addc822939d..42b3e75bcf6d1 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 c23b5dbb9cc86..2052193df9125 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 4f973f81b1641..1e6169f285b5c 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 e594683feed17..8e72151ffe979 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 60a0a85d0abf1..6e55baf06cedf 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 940fa9c7f273f..5f92d98606693 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 379d310a60bd4..19a395806d6cf 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 ee853ade18eab..fa5065b763027 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 41dbbeefc0a60..68cf661e21805 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 e62b39ad5aabd..1824e32c425c4 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 1ab79f5c80ecc..c0d850343839f 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 207bbe9a44602..f90b1cc94bb1b 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 810983332615e..dd763dc64c0e8 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 8febbf8309ea7..4abdbad9a0300 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 51447b225763b..7a20b00ce121d 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 e60be6c81eb58..faaa0525f9df7 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 191bd78212458..9b160434e36ae 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 789cc886217ec..8d10f64504a12 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 de6291c7cc38b..ad2710e91e267 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 { diff --git a/src/test/parse-fail/unsized.rs b/src/test/parse-fail/unsized.rs index 92dbea0424b6f..1bcb5208d7610 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 b2eb2064aeb09..a4a4c0dcfd916 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() {} 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 524fd01b94c51..c1e1cc1c7f7f3 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 a375a5962a567..143886e23377f 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 52d0d1a5fba15..bcafa4e9fde25 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 34846ab496d2f..63a36e984399d 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 331a45239345c..d202fa33cc1e3 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 62e985f44f734..ef9d4558f687d 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 3b3c7d5a30f94..a0e50d488124f 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 ebdbdc4b2b54f..3ac71176342ba 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) -> bool where { //~^ ERROR a `where` clause must have at least one predicate in it true