diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index a75152931468..154e0a1f6446 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 48bd00a3ee06..27c253234be6 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 adbcedd91f20..7dcff6e6644f 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 71c57fefc2e2..78dcf2e2e2ee 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 bcfcc4347039..2094b63ab368 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 917c03fbf4b1..9c7721589d9b 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 dbf2929afe4f..7def91da5eca 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 e34756229bdf..c75b0ac122ae 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 098c5aaec545..e15350fcad79 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 b4a90e35c40f..03dabb980f20 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 ec837cd6de36..bc306048cdc4 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 384622fb1686..f2f4ecadd7a1 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 59a922ebee1a..79609935f9ed 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 4bd614127314..1f0a95826fcd 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 df7476186960..442eb14116e4 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 2a358ae8307b..fe8ed8bb9a52 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 f1f18115825c..a64ee6a9ce26 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 33043ff5524a..b42c04f3ce28 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 b208c6f4244e..201e6ced2f9e 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 ca10bdd9848e..96325a2abb42 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 4508d5219a21..7ff16b803733 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 e07f4b8e5490..3f0e0d36d8f3 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 c358a21d1253..25348a3bfd18 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 08935a24a1b6..6685a29bb426 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 ee3d86a6638d..7049363c21b7 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 3bf851643f2c..4de817dbd9ca 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 3e548981f1ed..861d4cd12ab5 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 7de51c1ea75c..ea263d938d40 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 a00ded61758c..bcadd1f39fa9 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 bb44a6a8abb3..4548cebd0a88 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 e6dd4102462d..728972eca620 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 5afd1b2c6b8b..9e825193dc0d 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 8dc6c5465006..44435bde03c0 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 6d05064277d4..8b69c385378f 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 8b0300edce0e..42c58af76d8c 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 b213730ef754..5ee84cd5543b 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 a2e780d49b8e..e356ab1debcb 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 7d1110cf6df8..7fb7233dc698 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 1ff4368dac5e..9adbd8714098 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 69e2f3ae60be..bf5cbe0c4592 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 0cfb05b9332a..26ee6ce80d68 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 ce91de7e9d97..fbd59d200a0c 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 ebd897a06113..c4d8ba2086d2 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 b6bc53fad945..2faf833d4f12 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 fb400b6c2bb1..7e17e1f1d6c0 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 8a496c934b9c..c4b25d435793 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 2a3dd7fba0cf..2817912666e5 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 3f8d26bfec05..9c67575bcc14 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 8a99633b4fc1..0b9456bc080d 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 bb020d55bdb0..398fe8c5b8cf 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 a92ef2489243..f57abf8929e8 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 ea2043e6703c..96a17a8fb45e 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 364951a4feaf..176e17c7eb0f 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 a26b7fdc425f..6bcf588b5161 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 aaf95410b8ed..ae8e38c03773 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 a7adaacc0a5b..80a9b3d7c0d5 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 c4a00581274a..f06d5f29e9e0 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 30cc41c35880..f0d1feffec80 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 6edd808d8476..5673e4f2a4c7 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 753acdd75fe5..8af5af9e9330 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 45b3abfddfba..0b8f0ac221ab 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 6bdcf5c5edce..a044dff261db 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 c71e0ecd4949..1b33cb388575 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 b7feeecbfd91..b450cb25e6ba 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 96ba712bbae8..580b8c66c748 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 00fb2808faa9..fc3d071729fb 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 f6da2fc82c34..05c5a4bcb024 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 90d2acbe5816..0d9a111045a9 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 3a6d15e0086f..a91d513b83df 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 a50a757160dd..2c993b7654e6 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 3b329d782374..8462bd8fd016 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 6496ffebbc84..44d979ba9798 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 48cdeeb0d702..e65f95780bb9 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 cc219a6acb5e..0b380d6ae884 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 16834f491659..1946e984e5dc 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 95a4f36d1711..f406b2cc803f 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 9c35d77baf01..898b09206451 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 5d2908b92ef3..f54423139049 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 166e91b27ac1..f5113efad1ce 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 52cf420a9ffd..5996b744566c 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 1f1360eac007..bd3fbbe79a88 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 f307b12f66e7..bc05a7c4f25f 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 1e2725eb2feb..bd7527f399e5 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 90f73f8a9f42..5cc14dfef0ec 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 101fd938dcb2..24bd18a738fb 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 ed504cc7b7fd..e47452704142 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 3260506b3e19..579cd9f91665 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 305ef0ef075f..4b06312d0993 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 8c98da229c8b..0ace9ddf1f07 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 196a33906767..035c87b80bb9 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 05f82ec790cc..1aad0a780f96 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 1dd218003451..585109505d40 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 0069a26a40b7..07bc79016860 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 6e469e8c0b43..7b2b10a2d6dd 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 9155ebc71fa4..528873c17943 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 02f57e937dd7..b29bcbc76c3c 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 b5d36e577502..b637d07d8b6d 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 f70e6b926105..3f79e437189c 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 7cbaeb9d5184..e80feb66d607 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 aa679741c1c0..959bbfbf8826 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 72af521f6f1a..3db6d11c2e89 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 c56764459177..df8aeba6d716 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 8bb52142287f..0e0d07ca6a53 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 7268c4f387ec..d5b529af4b80 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 bd42eac0ecbe..7d2160dfd293 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 0378c326a89a..4d8669188686 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 0c94f76f1f6f..671be8c44b9c 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 95c0d174c332..7a8be0baa27f 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 0aaa2a63c7c4..c76bea89ab40 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 c42875382b98..29ec4f5844b1 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 1b631eb877d9..d3c48c6ded0d 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 e82afd544424..d3815c650a36 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 95cea65c610d..331fdc07cc15 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 64eac47e69b3..d4ce5518e465 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 ba04a5ac9af0..5e27d3e4f383 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 4aa01bcde698..33fb1e14eb3b 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 62b87e3f480a..cf171b694c37 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 d28d9a20c6ee..774b10a9f97c 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 c1e5121d6dd4..aa48144650fe 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 8ffbcd90df87..84b02e6ba096 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 766922f2f886..e8b76750eb98 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 52f867fe913b..18add7d011cb 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 75f7b5d4dd80..2940adee043a 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 9d4ec9c176cc..6a7ccff15544 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 d03698c1573b..84cf900129f9 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 d80f93d7ad0d..84094ab6ca89 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 314292085dfe..faf6b4a308a0 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 23b27b49a86f..9975609d8d3f 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 b6b2313aa09c..3026e159a443 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 0fc00c350748..72501ba0e4f4 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 bbf2152d5b79..7736394a6f5d 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 ff330047c4e9..993232e70ab3 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 a8b2fa4e115b..a1c737609d14 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 cde05bc1d524..71d826c67f8b 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 f2422830a21c..78a68e846d11 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 5da8674c37ea..3eaea86b8bc3 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 7c64d02efd74..5e8bc16ac6e9 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 96b86f1f5635..896751bd4a72 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 2e207f90d36c..528a2b1ad33a 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 4abb6093b244..df40fdde866e 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 0bf73bbdfe31..2a0ed9dcc243 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 752f72f0b083..3e2e69d2814e 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 782c90a6c26b..d880c06f8a1a 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 4767c66c2a05..987eae66f3e6 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 2826d3b4af94..388b7c8772e9 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 4d5473faf735..63d9e9414699 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 05bbaec37af0..4d40f86b9718 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 c52fb8c9b679..d2afd26ea9a3 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 062d3308c3de..cf8025726598 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 deae9a838660..e30308b295a3 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 978287a681eb..ac501d31beeb 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 78c575d33bad..284cdb8c6531 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 a3e27fbbe9aa..69898612771e 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 ccf9e2d86882..4b8bb31d19af 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 d6073a10307f..d6be8fce53e0 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 83afb33b641c..c7ef91f14f57 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 3403b28fdc9c..ce8960edde12 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 4151cf32346c..c37239ac42c8 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 c2b52b79f6c8..8762c1326cea 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 ef331bb0fd7b..b1aebf4a2d10 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 c67c14d35d89..c4601b4de171 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 7a7113cd594b..e2e3fcde83cf 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 8943abb49ae9..57b182f3c419 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 0cea87dba19b..04d3757dcda7 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 b067cee03d25..6a7f706624dd 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 a0e1d04a3dc5..c42fae71237d 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 c8711598163a..4e542fd7477f 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 9bb3c649cdfe..409b95077693 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 0e8e20b38918..ae61d1ea8586 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 d569ea25c46a..83794a70a4f4 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 83ebe7cc7a3b..f47ad01d7e12 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 116848c42c28..1388f8745df5 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 552c9f2efa2d..0736e483a497 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 b02de5ce08e9..4dafc36e912c 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 30302bbd16ef..ab9ff7ac19e5 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 9a7570a92f00..00ea593656ab 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 44c65d98c0b7..e586753087ad 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 ae5a68575f72..fd6f99bdbf9f 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 caf939e7b8aa..be1e89dd7179 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 c5559c4ea962..ea686aeb6e05 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 d1c2fc69f523..77e64e7c997e 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 c7f31045cb6a..e9de52c013b3 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 83c6897dee31..c58f42abb58f 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 f2705f58331b..7e76dbd31f0a 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 a6d4da526fb0..8fb71e13f16a 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 00ece3fcca34..1560c83bc70b 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 85addc822939..42b3e75bcf6d 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 c23b5dbb9cc8..2052193df912 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 4f973f81b164..1e6169f285b5 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 e594683feed1..8e72151ffe97 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 60a0a85d0abf..6e55baf06ced 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 940fa9c7f273..5f92d9860669 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 379d310a60bd..19a395806d6c 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 ee853ade18ea..fa5065b76302 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 41dbbeefc0a6..68cf661e2180 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 e62b39ad5aab..1824e32c425c 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 1ab79f5c80ec..c0d850343839 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 207bbe9a4460..f90b1cc94bb1 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 810983332615..dd763dc64c0e 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 8febbf8309ea..4abdbad9a030 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 51447b225763..7a20b00ce121 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 e60be6c81eb5..faaa0525f9df 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 191bd7821245..9b160434e36a 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 789cc886217e..8d10f64504a1 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 de6291c7cc38..ad2710e91e26 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 92dbea0424b6..1bcb5208d761 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 b2eb2064aeb0..a4a4c0dcfd91 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 524fd01b94c5..c1e1cc1c7f7f 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 a375a5962a56..143886e23377 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 52d0d1a5fba1..bcafa4e9fde2 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 34846ab496d2..63a36e984399 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 331a45239345..d202fa33cc1e 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 62e985f44f73..ef9d4558f687 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 3b3c7d5a30f9..a0e50d488124 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 ebdbdc4b2b54..3ac71176342b 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