about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/macros/trace_faulty_macros.rs2
-rw-r--r--tests/ui/macros/trace_faulty_macros.stderr13
-rw-r--r--tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.rs2
-rw-r--r--tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.stderr4
-rw-r--r--tests/ui/parser/mut-patterns.rs2
-rw-r--r--tests/ui/parser/mut-patterns.stderr4
6 files changed, 10 insertions, 17 deletions
diff --git a/tests/ui/macros/trace_faulty_macros.rs b/tests/ui/macros/trace_faulty_macros.rs
index 87036bb9c6f..e0cbbd8f5c9 100644
--- a/tests/ui/macros/trace_faulty_macros.rs
+++ b/tests/ui/macros/trace_faulty_macros.rs
@@ -46,7 +46,7 @@ macro_rules! test {
     (let $p:pat = $e:expr) => {test!(($p,$e))};
     // this should be expr
     //           vvv
-    (($p:pat, $e:pat)) => {let $p = $e;}; //~ ERROR expected expression, found pattern `1+1`
+    (($p:pat, $e:pat)) => {let $p = $e;}; //~ ERROR expected expression, found `pat` metavariable
 }
 
 fn foo() {
diff --git a/tests/ui/macros/trace_faulty_macros.stderr b/tests/ui/macros/trace_faulty_macros.stderr
index 10ad3faab16..73fed66e619 100644
--- a/tests/ui/macros/trace_faulty_macros.stderr
+++ b/tests/ui/macros/trace_faulty_macros.stderr
@@ -50,7 +50,7 @@ LL |     my_recursive_macro!();
    = note: expanding `my_recursive_macro! {  }`
    = note: to `my_recursive_macro! ();`
 
-error: expected expression, found pattern `A { a : a, b : 0, c : _, .. }`
+error: expected expression, found `pat` metavariable
   --> $DIR/trace_faulty_macros.rs:16:9
    |
 LL |         $a
@@ -69,22 +69,15 @@ LL | #[derive(Debug)]
 LL | fn use_derive_macro_as_attr() {}
    | -------------------------------- not a `struct`, `enum` or `union`
 
-error: expected expression, found pattern `1+1`
+error: expected expression, found `pat` metavariable
   --> $DIR/trace_faulty_macros.rs:49:37
    |
-LL |     (let $p:pat = $e:expr) => {test!(($p,$e))};
-   |                                          -- this is interpreted as expression, but it is expected to be pattern
-...
 LL |     (($p:pat, $e:pat)) => {let $p = $e;};
    |                                     ^^ expected expression
 ...
 LL |     test!(let x = 1+1);
-   |     ------------------
-   |     |             |
-   |     |             this is expected to be expression
-   |     in this macro invocation
+   |     ------------------ in this macro invocation
    |
-   = note: when forwarding a matched fragment to another macro-by-example, matchers in the second macro will see an opaque AST of the fragment type, not the underlying tokens
    = note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 note: trace_macro
diff --git a/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.rs b/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.rs
index 30f3781bf77..1a0833ebb2f 100644
--- a/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.rs
+++ b/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.rs
@@ -12,7 +12,7 @@ macro_rules! mac2 {
     ($eval:pat) => {
         let mut $eval = ();
         //~^ ERROR `mut` must be followed by a named binding
-        //~| ERROR expected identifier, found `does_not_exist!()`
+        //~| ERROR expected identifier, found metavariable
     };
 }
 
diff --git a/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.stderr b/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.stderr
index dda37d83282..59e1b64686b 100644
--- a/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.stderr
+++ b/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.stderr
@@ -15,11 +15,11 @@ LL -         let mut $eval = ();
 LL +         let $eval = ();
    |
 
-error: expected identifier, found `does_not_exist!()`
+error: expected identifier, found metavariable
   --> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:13:17
    |
 LL |         let mut $eval = ();
-   |                 ^^^^^ expected identifier
+   |                 ^^^^^ expected identifier, found metavariable
 ...
 LL |     mac2! { does_not_exist!() }
    |     --------------------------- in this macro invocation
diff --git a/tests/ui/parser/mut-patterns.rs b/tests/ui/parser/mut-patterns.rs
index 45968a516e3..ed33968c627 100644
--- a/tests/ui/parser/mut-patterns.rs
+++ b/tests/ui/parser/mut-patterns.rs
@@ -45,7 +45,7 @@ pub fn main() {
     // Make sure we don't accidentally allow `mut $p` where `$p:pat`.
     macro_rules! foo {
         ($p:pat) => {
-            let mut $p = 0; //~ ERROR expected identifier, found `x`
+            let mut $p = 0; //~ ERROR expected identifier, found metavariable
         }
     }
     foo!(x);
diff --git a/tests/ui/parser/mut-patterns.stderr b/tests/ui/parser/mut-patterns.stderr
index 43f6a344bf3..9dda2499f03 100644
--- a/tests/ui/parser/mut-patterns.stderr
+++ b/tests/ui/parser/mut-patterns.stderr
@@ -158,11 +158,11 @@ LL -     let mut W(mut a, W(b, W(ref c, W(d, B { box f }))))
 LL +     let W(mut a, W(mut b, W(ref c, W(mut d, B { box mut f }))))
    |
 
-error: expected identifier, found `x`
+error: expected identifier, found metavariable
   --> $DIR/mut-patterns.rs:48:21
    |
 LL |             let mut $p = 0;
-   |                     ^^ expected identifier
+   |                     ^^ expected identifier, found metavariable
 ...
 LL |     foo!(x);
    |     ------- in this macro invocation