From 83268ff494fddafefd908e283f25cfb262a72a10 Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Thu, 16 Aug 2018 02:10:54 +0300 Subject: [PATCH 1/3] syntax_ext: remove leftover span_err_if_not_stage0 macro. --- src/libsyntax_ext/deriving/default.rs | 4 ++-- src/libsyntax_ext/deriving/mod.rs | 11 ----------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/libsyntax_ext/deriving/default.rs b/src/libsyntax_ext/deriving/default.rs index 958116f7809bb..adbc5828b8fb8 100644 --- a/src/libsyntax_ext/deriving/default.rs +++ b/src/libsyntax_ext/deriving/default.rs @@ -76,8 +76,8 @@ fn default_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructur } } StaticEnum(..) => { - span_err_if_not_stage0!(cx, trait_span, E0665, - "`Default` cannot be derived for enums, only structs"); + span_err!(cx, trait_span, E0665, + "`Default` cannot be derived for enums, only structs"); // let compilation continue cx.expr_usize(trait_span, 0) } diff --git a/src/libsyntax_ext/deriving/mod.rs b/src/libsyntax_ext/deriving/mod.rs index 2f5e42d2f7b17..ae47a028bc386 100644 --- a/src/libsyntax_ext/deriving/mod.rs +++ b/src/libsyntax_ext/deriving/mod.rs @@ -19,17 +19,6 @@ use syntax::ptr::P; use syntax::symbol::Symbol; use syntax_pos::Span; -macro_rules! span_err_if_not_stage0 { - ($cx:expr, $sp:expr, $code:ident, $text:tt) => { - #[cfg(not(stage0))] { - span_err!($cx, $sp, $code, $text) - } - #[cfg(stage0)] { - $cx.span_err($sp, $text) - } - } -} - macro path_local($x:ident) { generic::ty::Path::new_local(stringify!($x)) } From 494889ede14cd8f1fe1dc20d8f00ec1634649a91 Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Thu, 16 Aug 2018 02:11:44 +0300 Subject: [PATCH 2/3] Revert "Ignore test that fails on stage1" This reverts commit 0e43e6fef251732f5268738eee9c258668ec7942. --- src/test/ui/macros/macros-nonfatal-errors.rs | 1 - .../ui/macros/macros-nonfatal-errors.stderr | 30 +++++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/test/ui/macros/macros-nonfatal-errors.rs b/src/test/ui/macros/macros-nonfatal-errors.rs index 7290d18beb74e..2815e1be70983 100644 --- a/src/test/ui/macros/macros-nonfatal-errors.rs +++ b/src/test/ui/macros/macros-nonfatal-errors.rs @@ -10,7 +10,6 @@ // normalize-stderr-test: "The system cannot find the file specified\." -> "No such file or directory" // ignore-tidy-linelength -// ignore-stage1 // test that errors in a (selection) of macros don't kill compilation // immediately, so that we get more errors listed at a time. diff --git a/src/test/ui/macros/macros-nonfatal-errors.stderr b/src/test/ui/macros/macros-nonfatal-errors.stderr index efb2c248813d7..084042acc974d 100644 --- a/src/test/ui/macros/macros-nonfatal-errors.stderr +++ b/src/test/ui/macros/macros-nonfatal-errors.stderr @@ -1,47 +1,47 @@ error[E0665]: `Default` cannot be derived for enums, only structs - --> $DIR/macros-nonfatal-errors.rs:21:10 + --> $DIR/macros-nonfatal-errors.rs:20:10 | LL | #[derive(Default)] //~ ERROR | ^^^^^^^ error: inline assembly must be a string literal - --> $DIR/macros-nonfatal-errors.rs:25:10 + --> $DIR/macros-nonfatal-errors.rs:24:10 | LL | asm!(invalid); //~ ERROR | ^^^^^^^ error: concat_idents! requires ident args. - --> $DIR/macros-nonfatal-errors.rs:27:5 + --> $DIR/macros-nonfatal-errors.rs:26:5 | LL | concat_idents!("not", "idents"); //~ ERROR | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: argument must be a string literal - --> $DIR/macros-nonfatal-errors.rs:29:17 + --> $DIR/macros-nonfatal-errors.rs:28:17 | LL | option_env!(invalid); //~ ERROR | ^^^^^^^ error: expected string literal - --> $DIR/macros-nonfatal-errors.rs:30:10 + --> $DIR/macros-nonfatal-errors.rs:29:10 | LL | env!(invalid); //~ ERROR | ^^^^^^^ error: expected string literal - --> $DIR/macros-nonfatal-errors.rs:31:10 + --> $DIR/macros-nonfatal-errors.rs:30:10 | LL | env!(foo, abr, baz); //~ ERROR | ^^^ error: environment variable `RUST_HOPEFULLY_THIS_DOESNT_EXIST` not defined - --> $DIR/macros-nonfatal-errors.rs:32:5 + --> $DIR/macros-nonfatal-errors.rs:31:5 | LL | env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST"); //~ ERROR | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0658]: non-ident macro paths are experimental (see issue #35896) - --> $DIR/macros-nonfatal-errors.rs:34:5 + --> $DIR/macros-nonfatal-errors.rs:33:5 | LL | foo::blah!(); //~ ERROR | ^^^^^^^^^ @@ -49,7 +49,7 @@ LL | foo::blah!(); //~ ERROR = help: add #![feature(use_extern_macros)] to the crate attributes to enable error: format argument must be a string literal - --> $DIR/macros-nonfatal-errors.rs:36:13 + --> $DIR/macros-nonfatal-errors.rs:35:13 | LL | format!(invalid); //~ ERROR | ^^^^^^^ @@ -59,37 +59,37 @@ LL | format!("{}", invalid); //~ ERROR | ^^^^^ error: argument must be a string literal - --> $DIR/macros-nonfatal-errors.rs:38:14 + --> $DIR/macros-nonfatal-errors.rs:37:14 | LL | include!(invalid); //~ ERROR | ^^^^^^^ error: argument must be a string literal - --> $DIR/macros-nonfatal-errors.rs:40:18 + --> $DIR/macros-nonfatal-errors.rs:39:18 | LL | include_str!(invalid); //~ ERROR | ^^^^^^^ error: couldn't read $DIR/i'd be quite surprised if a file with this name existed: No such file or directory (os error 2) - --> $DIR/macros-nonfatal-errors.rs:41:5 + --> $DIR/macros-nonfatal-errors.rs:40:5 | LL | include_str!("i'd be quite surprised if a file with this name existed"); //~ ERROR | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: argument must be a string literal - --> $DIR/macros-nonfatal-errors.rs:42:20 + --> $DIR/macros-nonfatal-errors.rs:41:20 | LL | include_bytes!(invalid); //~ ERROR | ^^^^^^^ error: couldn't read $DIR/i'd be quite surprised if a file with this name existed: No such file or directory (os error 2) - --> $DIR/macros-nonfatal-errors.rs:43:5 + --> $DIR/macros-nonfatal-errors.rs:42:5 | LL | include_bytes!("i'd be quite surprised if a file with this name existed"); //~ ERROR | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: trace_macros! accepts only `true` or `false` - --> $DIR/macros-nonfatal-errors.rs:45:5 + --> $DIR/macros-nonfatal-errors.rs:44:5 | LL | trace_macros!(invalid); //~ ERROR | ^^^^^^^^^^^^^^^^^^^^^^^ From e7b65bd4578b1d8254f6ef700994fe3677693f02 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 16 Aug 2018 15:37:33 +0200 Subject: [PATCH 3/3] enable more tests on stage1 again --- src/test/ui/E0660.rs | 2 -- src/test/ui/E0660.stderr | 4 ++-- src/test/ui/E0661.rs | 2 -- src/test/ui/E0661.stderr | 2 +- src/test/ui/E0662.rs | 2 -- src/test/ui/E0662.stderr | 2 +- src/test/ui/E0663.rs | 2 -- src/test/ui/E0663.stderr | 2 +- src/test/ui/E0664.rs | 2 -- src/test/ui/E0664.stderr | 2 +- src/test/ui/E0665.rs | 2 -- src/test/ui/E0665.stderr | 2 +- 12 files changed, 7 insertions(+), 19 deletions(-) diff --git a/src/test/ui/E0660.rs b/src/test/ui/E0660.rs index 82ef38e96cded..2981e4ea8b3a3 100644 --- a/src/test/ui/E0660.rs +++ b/src/test/ui/E0660.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-stage1 - #![feature(asm)] fn main() { diff --git a/src/test/ui/E0660.stderr b/src/test/ui/E0660.stderr index fcf3e9a255273..e8acb282be94d 100644 --- a/src/test/ui/E0660.stderr +++ b/src/test/ui/E0660.stderr @@ -1,11 +1,11 @@ error[E0660]: malformed inline assembly - --> $DIR/E0660.rs:17:5 + --> $DIR/E0660.rs:15:5 | LL | asm!("nop" "nop"); | ^^^^^^^^^^^^^^^^^^ error[E0660]: malformed inline assembly - --> $DIR/E0660.rs:19:5 + --> $DIR/E0660.rs:17:5 | LL | asm!("nop" "nop" : "=r"(a)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/E0661.rs b/src/test/ui/E0661.rs index 7f8a0d8b57420..2410eba02451f 100644 --- a/src/test/ui/E0661.rs +++ b/src/test/ui/E0661.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-stage1 - #![feature(asm)] fn main() { diff --git a/src/test/ui/E0661.stderr b/src/test/ui/E0661.stderr index d8b974d424074..90aeca5612ae4 100644 --- a/src/test/ui/E0661.stderr +++ b/src/test/ui/E0661.stderr @@ -1,5 +1,5 @@ error[E0661]: output operand constraint lacks '=' or '+' - --> $DIR/E0661.rs:17:18 + --> $DIR/E0661.rs:15:18 | LL | asm!("nop" : "r"(a)); | ^^^ diff --git a/src/test/ui/E0662.rs b/src/test/ui/E0662.rs index 6adb11c56169c..700540fd1e0c0 100644 --- a/src/test/ui/E0662.rs +++ b/src/test/ui/E0662.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-stage1 - #![feature(asm)] fn main() { diff --git a/src/test/ui/E0662.stderr b/src/test/ui/E0662.stderr index 215e3a6d2f023..31655ca198794 100644 --- a/src/test/ui/E0662.stderr +++ b/src/test/ui/E0662.stderr @@ -1,5 +1,5 @@ error[E0662]: input operand constraint contains '=' - --> $DIR/E0662.rs:18:12 + --> $DIR/E0662.rs:16:12 | LL | : "=test"("a") //~ ERROR E0662 | ^^^^^^^ diff --git a/src/test/ui/E0663.rs b/src/test/ui/E0663.rs index 9eb05ada4a82a..dea2b9156b7e9 100644 --- a/src/test/ui/E0663.rs +++ b/src/test/ui/E0663.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-stage1 - #![feature(asm)] fn main() { diff --git a/src/test/ui/E0663.stderr b/src/test/ui/E0663.stderr index 123aa73eccc5e..0a287620f20e1 100644 --- a/src/test/ui/E0663.stderr +++ b/src/test/ui/E0663.stderr @@ -1,5 +1,5 @@ error[E0663]: input operand constraint contains '+' - --> $DIR/E0663.rs:18:12 + --> $DIR/E0663.rs:16:12 | LL | : "+test"("a") //~ ERROR E0663 | ^^^^^^^ diff --git a/src/test/ui/E0664.rs b/src/test/ui/E0664.rs index 738ffc18e3827..9773f604c468b 100644 --- a/src/test/ui/E0664.rs +++ b/src/test/ui/E0664.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-stage1 - #![feature(asm)] fn main() { diff --git a/src/test/ui/E0664.stderr b/src/test/ui/E0664.stderr index 570811729be85..1e79c84cbc8c4 100644 --- a/src/test/ui/E0664.stderr +++ b/src/test/ui/E0664.stderr @@ -1,5 +1,5 @@ error[E0664]: clobber should not be surrounded by braces - --> $DIR/E0664.rs:19:12 + --> $DIR/E0664.rs:17:12 | LL | : "{eax}" //~ ERROR E0664 | ^^^^^^^ diff --git a/src/test/ui/E0665.rs b/src/test/ui/E0665.rs index 8888bedf01687..0a0bd3f59052c 100644 --- a/src/test/ui/E0665.rs +++ b/src/test/ui/E0665.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-stage1 - #[derive(Default)] //~ ERROR E0665 enum Food { Sweet, diff --git a/src/test/ui/E0665.stderr b/src/test/ui/E0665.stderr index c97e9e5ea89d0..268224cac3826 100644 --- a/src/test/ui/E0665.stderr +++ b/src/test/ui/E0665.stderr @@ -1,5 +1,5 @@ error[E0665]: `Default` cannot be derived for enums, only structs - --> $DIR/E0665.rs:13:10 + --> $DIR/E0665.rs:11:10 | LL | #[derive(Default)] //~ ERROR E0665 | ^^^^^^^