about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-08-08 19:17:37 +0200
committerCamille GILLOT <gillot.camille@gmail.com>2022-09-13 19:47:50 +0200
commitcb5ea8d0b67e4a46f9f30aa93107035d9a1dadf0 (patch)
tree87557d065eb35fb481d22976c60606ce6d1b98e6 /src/test
parent8823634db8c4ee65b4a3d47ccb1d81891e33d0de (diff)
downloadrust-cb5ea8d0b67e4a46f9f30aa93107035d9a1dadf0.tar.gz
rust-cb5ea8d0b67e4a46f9f30aa93107035d9a1dadf0.zip
Emit an error instead of reconstructing token stream.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/macros/syntax-error-recovery.rs1
-rw-r--r--src/test/ui/macros/syntax-error-recovery.stderr8
2 files changed, 8 insertions, 1 deletions
diff --git a/src/test/ui/macros/syntax-error-recovery.rs b/src/test/ui/macros/syntax-error-recovery.rs
index 2b2eec04705..ae6de3c5046 100644
--- a/src/test/ui/macros/syntax-error-recovery.rs
+++ b/src/test/ui/macros/syntax-error-recovery.rs
@@ -13,5 +13,6 @@ macro_rules! values {
 //~| ERROR macro expansion ignores token `(String)` and any following
 
 values!(STRING(1) as (String) => cfg(test),);
+//~^ ERROR expected one of `!` or `::`, found `<eof>`
 
 fn main() {}
diff --git a/src/test/ui/macros/syntax-error-recovery.stderr b/src/test/ui/macros/syntax-error-recovery.stderr
index 1d9ce110d7b..c153b3b910b 100644
--- a/src/test/ui/macros/syntax-error-recovery.stderr
+++ b/src/test/ui/macros/syntax-error-recovery.stderr
@@ -20,5 +20,11 @@ LL | values!(STRING(1) as (String) => cfg(test),);
    |
    = note: the usage of `values!` is likely invalid in item context
 
-error: aborting due to 2 previous errors
+error: expected one of `!` or `::`, found `<eof>`
+  --> $DIR/syntax-error-recovery.rs:15:9
+   |
+LL | values!(STRING(1) as (String) => cfg(test),);
+   |         ^^^^^^ expected one of `!` or `::`
+
+error: aborting due to 3 previous errors