about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-12-21 01:47:03 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-12-27 15:51:37 +0300
commit15cefe4b2a65bb2a4febcd353cb37b90dfafa4f1 (patch)
tree0751ff1245a5e139c0bb3399441b9e8c76e71d9f /src/test
parentb99fb2f5445fa5a791cca7601c7d609aaf708304 (diff)
downloadrust-15cefe4b2a65bb2a4febcd353cb37b90dfafa4f1.tar.gz
rust-15cefe4b2a65bb2a4febcd353cb37b90dfafa4f1.zip
Make sure feature gate errors are recoverable
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/feature-gates/feature-gate-asm2.rs2
-rw-r--r--src/test/ui/feature-gates/feature-gate-asm2.stderr4
-rw-r--r--src/test/ui/feature-gates/feature-gate-concat_idents2.rs1
-rw-r--r--src/test/ui/feature-gates/feature-gate-concat_idents2.stderr11
-rw-r--r--src/test/ui/feature-gates/feature-gate-log_syntax.stdout1
-rw-r--r--src/test/ui/feature-gates/feature-gate-log_syntax2.rs2
-rw-r--r--src/test/ui/feature-gates/feature-gate-log_syntax2.stderr4
-rw-r--r--src/test/ui/feature-gates/feature-gate-log_syntax2.stdout1
-rw-r--r--src/test/ui/trace_macros-gate.rs12
-rw-r--r--src/test/ui/trace_macros-gate.stderr36
10 files changed, 30 insertions, 44 deletions
diff --git a/src/test/ui/feature-gates/feature-gate-asm2.rs b/src/test/ui/feature-gates/feature-gate-asm2.rs
index b842cba8a7d..259b0a14e5c 100644
--- a/src/test/ui/feature-gates/feature-gate-asm2.rs
+++ b/src/test/ui/feature-gates/feature-gate-asm2.rs
@@ -2,6 +2,6 @@
 
 fn main() {
     unsafe {
-        println!("{}", asm!("")); //~ ERROR inline assembly is not stable
+        println!("{:?}", asm!("")); //~ ERROR inline assembly is not stable
     }
 }
diff --git a/src/test/ui/feature-gates/feature-gate-asm2.stderr b/src/test/ui/feature-gates/feature-gate-asm2.stderr
index aadedc88707..65c267a7695 100644
--- a/src/test/ui/feature-gates/feature-gate-asm2.stderr
+++ b/src/test/ui/feature-gates/feature-gate-asm2.stderr
@@ -1,8 +1,8 @@
 error[E0658]: inline assembly is not stable enough for use and is subject to change (see issue #29722)
   --> $DIR/feature-gate-asm2.rs:5:24
    |
-LL |         println!("{}", asm!("")); //~ ERROR inline assembly is not stable
-   |                        ^^^^^^^^
+LL |         println!("{:?}", asm!("")); //~ ERROR inline assembly is not stable
+   |                          ^^^^^^^^
    |
    = help: add #![feature(asm)] to the crate attributes to enable
 
diff --git a/src/test/ui/feature-gates/feature-gate-concat_idents2.rs b/src/test/ui/feature-gates/feature-gate-concat_idents2.rs
index 659e9626501..0cc6c577e8d 100644
--- a/src/test/ui/feature-gates/feature-gate-concat_idents2.rs
+++ b/src/test/ui/feature-gates/feature-gate-concat_idents2.rs
@@ -2,4 +2,5 @@
 
 fn main() {
     concat_idents!(a, b); //~ ERROR `concat_idents` is not stable enough
+                          //~| ERROR cannot find value `ab` in this scope
 }
diff --git a/src/test/ui/feature-gates/feature-gate-concat_idents2.stderr b/src/test/ui/feature-gates/feature-gate-concat_idents2.stderr
index 23c2e297645..eb648cbd56f 100644
--- a/src/test/ui/feature-gates/feature-gate-concat_idents2.stderr
+++ b/src/test/ui/feature-gates/feature-gate-concat_idents2.stderr
@@ -6,6 +6,13 @@ LL |     concat_idents!(a, b); //~ ERROR `concat_idents` is not stable enough
    |
    = help: add #![feature(concat_idents)] to the crate attributes to enable
 
-error: aborting due to previous error
+error[E0425]: cannot find value `ab` in this scope
+  --> $DIR/feature-gate-concat_idents2.rs:14:5
+   |
+LL |     concat_idents!(a, b); //~ ERROR `concat_idents` is not stable enough
+   |     ^^^^^^^^^^^^^^^^^^^^^ not found in this scope
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0658`.
+Some errors occurred: E0425, E0658.
+For more information about an error, try `rustc --explain E0425`.
diff --git a/src/test/ui/feature-gates/feature-gate-log_syntax.stdout b/src/test/ui/feature-gates/feature-gate-log_syntax.stdout
new file mode 100644
index 00000000000..8b137891791
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-log_syntax.stdout
@@ -0,0 +1 @@
+
diff --git a/src/test/ui/feature-gates/feature-gate-log_syntax2.rs b/src/test/ui/feature-gates/feature-gate-log_syntax2.rs
index 95baea6f7e4..a3906dcc16e 100644
--- a/src/test/ui/feature-gates/feature-gate-log_syntax2.rs
+++ b/src/test/ui/feature-gates/feature-gate-log_syntax2.rs
@@ -1,5 +1,5 @@
 // gate-test-log_syntax
 
 fn main() {
-    println!("{}", log_syntax!()); //~ ERROR `log_syntax!` is not stable
+    println!("{:?}", log_syntax!()); //~ ERROR `log_syntax!` is not stable
 }
diff --git a/src/test/ui/feature-gates/feature-gate-log_syntax2.stderr b/src/test/ui/feature-gates/feature-gate-log_syntax2.stderr
index 7f65794e5de..9ed3bbf7b75 100644
--- a/src/test/ui/feature-gates/feature-gate-log_syntax2.stderr
+++ b/src/test/ui/feature-gates/feature-gate-log_syntax2.stderr
@@ -1,8 +1,8 @@
 error[E0658]: `log_syntax!` is not stable enough for use and is subject to change (see issue #29598)
   --> $DIR/feature-gate-log_syntax2.rs:4:20
    |
-LL |     println!("{}", log_syntax!()); //~ ERROR `log_syntax!` is not stable
-   |                    ^^^^^^^^^^^^^
+LL |     println!("{:?}", log_syntax!()); //~ ERROR `log_syntax!` is not stable
+   |                      ^^^^^^^^^^^^^
    |
    = help: add #![feature(log_syntax)] to the crate attributes to enable
 
diff --git a/src/test/ui/feature-gates/feature-gate-log_syntax2.stdout b/src/test/ui/feature-gates/feature-gate-log_syntax2.stdout
new file mode 100644
index 00000000000..8b137891791
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-log_syntax2.stdout
@@ -0,0 +1 @@
+
diff --git a/src/test/ui/trace_macros-gate.rs b/src/test/ui/trace_macros-gate.rs
index d32ada5abc9..c9af04741ac 100644
--- a/src/test/ui/trace_macros-gate.rs
+++ b/src/test/ui/trace_macros-gate.rs
@@ -2,15 +2,9 @@
 
 fn main() {
     trace_macros!(); //~ ERROR `trace_macros` is not stable
-    trace_macros!(1); //~ ERROR `trace_macros` is not stable
-    trace_macros!(ident); //~ ERROR `trace_macros` is not stable
-    trace_macros!(for); //~ ERROR `trace_macros` is not stable
-    trace_macros!(true,); //~ ERROR `trace_macros` is not stable
-    trace_macros!(false 1); //~ ERROR `trace_macros` is not stable
-
-    // Errors are signalled early for the above, before expansion.
-    // See trace_macros-gate2 and trace_macros-gate3. for examples
-    // of the below being caught.
+                     //~| ERROR trace_macros! accepts only `true` or `false`
+    trace_macros!(true); //~ ERROR `trace_macros` is not stable
+    trace_macros!(false); //~ ERROR `trace_macros` is not stable
 
     macro_rules! expando {
         ($x: ident) => { trace_macros!($x) } //~ ERROR `trace_macros` is not stable
diff --git a/src/test/ui/trace_macros-gate.stderr b/src/test/ui/trace_macros-gate.stderr
index 1f7d8e898b6..a411fae8bcb 100644
--- a/src/test/ui/trace_macros-gate.stderr
+++ b/src/test/ui/trace_macros-gate.stderr
@@ -6,48 +6,30 @@ LL |     trace_macros!(); //~ ERROR `trace_macros` is not stable
    |
    = help: add #![feature(trace_macros)] to the crate attributes to enable
 
-error[E0658]: `trace_macros` is not stable enough for use and is subject to change (see issue #29598)
-  --> $DIR/trace_macros-gate.rs:5:5
-   |
-LL |     trace_macros!(1); //~ ERROR `trace_macros` is not stable
-   |     ^^^^^^^^^^^^^^^^^
+error: trace_macros! accepts only `true` or `false`
+  --> $DIR/trace_macros-gate.rs:14:5
    |
-   = help: add #![feature(trace_macros)] to the crate attributes to enable
+LL |     trace_macros!(); //~ ERROR `trace_macros` is not stable
+   |     ^^^^^^^^^^^^^^^^
 
 error[E0658]: `trace_macros` is not stable enough for use and is subject to change (see issue #29598)
   --> $DIR/trace_macros-gate.rs:6:5
    |
-LL |     trace_macros!(ident); //~ ERROR `trace_macros` is not stable
-   |     ^^^^^^^^^^^^^^^^^^^^^
+LL |     trace_macros!(true); //~ ERROR `trace_macros` is not stable
+   |     ^^^^^^^^^^^^^^^^^^^^
    |
    = help: add #![feature(trace_macros)] to the crate attributes to enable
 
 error[E0658]: `trace_macros` is not stable enough for use and is subject to change (see issue #29598)
   --> $DIR/trace_macros-gate.rs:7:5
    |
-LL |     trace_macros!(for); //~ ERROR `trace_macros` is not stable
-   |     ^^^^^^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(trace_macros)] to the crate attributes to enable
-
-error[E0658]: `trace_macros` is not stable enough for use and is subject to change (see issue #29598)
-  --> $DIR/trace_macros-gate.rs:8:5
-   |
-LL |     trace_macros!(true,); //~ ERROR `trace_macros` is not stable
+LL |     trace_macros!(false); //~ ERROR `trace_macros` is not stable
    |     ^^^^^^^^^^^^^^^^^^^^^
    |
    = help: add #![feature(trace_macros)] to the crate attributes to enable
 
 error[E0658]: `trace_macros` is not stable enough for use and is subject to change (see issue #29598)
-  --> $DIR/trace_macros-gate.rs:9:5
-   |
-LL |     trace_macros!(false 1); //~ ERROR `trace_macros` is not stable
-   |     ^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(trace_macros)] to the crate attributes to enable
-
-error[E0658]: `trace_macros` is not stable enough for use and is subject to change (see issue #29598)
-  --> $DIR/trace_macros-gate.rs:16:26
+  --> $DIR/trace_macros-gate.rs:20:26
    |
 LL |         ($x: ident) => { trace_macros!($x) } //~ ERROR `trace_macros` is not stable
    |                          ^^^^^^^^^^^^^^^^^
@@ -57,6 +39,6 @@ LL |     expando!(true);
    |
    = help: add #![feature(trace_macros)] to the crate attributes to enable
 
-error: aborting due to 7 previous errors
+error: aborting due to 5 previous errors
 
 For more information about this error, try `rustc --explain E0658`.