summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2018-10-25 10:09:19 -0700
committerEsteban Küber <esteban@kuber.com.ar>2018-11-23 15:37:31 -0800
commitea9ccb6046aa1733aa1761fc942f8432fb63f107 (patch)
treedb42da1149aebe1315d35101666bd5bee8c29c96 /src/test
parent910ec6d97ff03549c22352d7763be02b60d73470 (diff)
downloadrust-ea9ccb6046aa1733aa1761fc942f8432fb63f107.tar.gz
rust-ea9ccb6046aa1733aa1761fc942f8432fb63f107.zip
Point at end of macro arm when encountering EOF
Fix #52866
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/directory_ownership/macro-expanded-mod.rs3
-rw-r--r--src/test/ui/directory_ownership/macro-expanded-mod.stderr6
-rw-r--r--src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr6
-rw-r--r--src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr6
-rw-r--r--src/test/ui/macros/macro-at-most-once-rep-2018.stderr8
-rw-r--r--src/test/ui/macros/macro-in-expression-context-2.stderr2
6 files changed, 16 insertions, 15 deletions
diff --git a/src/test/ui/directory_ownership/macro-expanded-mod.rs b/src/test/ui/directory_ownership/macro-expanded-mod.rs
index 8e631a64f7a..78356f981fc 100644
--- a/src/test/ui/directory_ownership/macro-expanded-mod.rs
+++ b/src/test/ui/directory_ownership/macro-expanded-mod.rs
@@ -12,6 +12,7 @@
 
 macro_rules! mod_decl {
     ($i:ident) => { mod $i; }
+    //~^ ERROR Cannot declare a non-inline module inside a block
 }
 
 mod macro_expanded_mod_helper {
@@ -19,5 +20,5 @@ mod macro_expanded_mod_helper {
 }
 
 fn main() {
-    mod_decl!(foo); //~ ERROR Cannot declare a non-inline module inside a block
+    mod_decl!(foo);
 }
diff --git a/src/test/ui/directory_ownership/macro-expanded-mod.stderr b/src/test/ui/directory_ownership/macro-expanded-mod.stderr
index a9efcd883c1..f58e864a755 100644
--- a/src/test/ui/directory_ownership/macro-expanded-mod.stderr
+++ b/src/test/ui/directory_ownership/macro-expanded-mod.stderr
@@ -1,8 +1,8 @@
 error: Cannot declare a non-inline module inside a block unless it has a path attribute
-  --> $DIR/macro-expanded-mod.rs:22:15
+  --> $DIR/macro-expanded-mod.rs:14:28
    |
-LL |     mod_decl!(foo); //~ ERROR Cannot declare a non-inline module inside a block
-   |               ^^^
+LL |     ($i:ident) => { mod $i; }
+   |                            ^
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr b/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr
index b6ff60f1492..bf7fc28c758 100644
--- a/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr
+++ b/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr
@@ -22,11 +22,11 @@ error: no rules expected the token `async`
 LL |     r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async`
    |                                   ^^^^^ no rules expected the token `async`
 
-error: expected one of `move`, `|`, or `||`, found `<eof>`
-  --> <::edition_kw_macro_2015::passes_ident macros>:1:22
+error: expected one of `move`, `|`, or `||`, found the end of the macro arm
+  --> <::edition_kw_macro_2015::passes_ident macros>:1:25
    |
 LL | ( $ i : ident ) => ( $ i )
-   |                      ^^^ expected one of `move`, `|`, or `||` here
+   |                         ^
 
 error: aborting due to 5 previous errors
 
diff --git a/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr b/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr
index ffe666a7e64..4ab29ba67a0 100644
--- a/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr
+++ b/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr
@@ -22,11 +22,11 @@ error: no rules expected the token `async`
 LL |     r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async`
    |                                   ^^^^^ no rules expected the token `async`
 
-error: expected one of `move`, `|`, or `||`, found `<eof>`
-  --> <::edition_kw_macro_2018::passes_ident macros>:1:22
+error: expected one of `move`, `|`, or `||`, found the end of the macro arm
+  --> <::edition_kw_macro_2018::passes_ident macros>:1:25
    |
 LL | ( $ i : ident ) => ( $ i )
-   |                      ^^^ expected one of `move`, `|`, or `||` here
+   |                         ^
 
 error: aborting due to 5 previous errors
 
diff --git a/src/test/ui/macros/macro-at-most-once-rep-2018.stderr b/src/test/ui/macros/macro-at-most-once-rep-2018.stderr
index 25dd66b81f5..19a9cf3a6f5 100644
--- a/src/test/ui/macros/macro-at-most-once-rep-2018.stderr
+++ b/src/test/ui/macros/macro-at-most-once-rep-2018.stderr
@@ -41,13 +41,13 @@ LL |     barplus!(); //~ERROR unexpected end of macro invocation
    |     ^^^^^^^^^^^ unexpected end of macro invocation
 
 error: unexpected end of macro invocation
-  --> $DIR/macro-at-most-once-rep-2018.rs:41:14
+  --> $DIR/macro-at-most-once-rep-2018.rs:41:15
    |
 LL | macro_rules! barplus {
    | -------------------- when calling this macro
 ...
 LL |     barplus!(a); //~ERROR unexpected end of macro invocation
-   |              ^ unexpected end of macro invocation
+   |               ^ unexpected end of macro invocation
 
 error: no rules expected the token `?`
   --> $DIR/macro-at-most-once-rep-2018.rs:42:15
@@ -77,13 +77,13 @@ LL |     barstar!(); //~ERROR unexpected end of macro invocation
    |     ^^^^^^^^^^^ unexpected end of macro invocation
 
 error: unexpected end of macro invocation
-  --> $DIR/macro-at-most-once-rep-2018.rs:48:14
+  --> $DIR/macro-at-most-once-rep-2018.rs:48:15
    |
 LL | macro_rules! barstar {
    | -------------------- when calling this macro
 ...
 LL |     barstar!(a); //~ERROR unexpected end of macro invocation
-   |              ^ unexpected end of macro invocation
+   |               ^ unexpected end of macro invocation
 
 error: no rules expected the token `?`
   --> $DIR/macro-at-most-once-rep-2018.rs:49:15
diff --git a/src/test/ui/macros/macro-in-expression-context-2.stderr b/src/test/ui/macros/macro-in-expression-context-2.stderr
index 80d5dbd66cc..3a4c9c0cdec 100644
--- a/src/test/ui/macros/macro-in-expression-context-2.stderr
+++ b/src/test/ui/macros/macro-in-expression-context-2.stderr
@@ -1,4 +1,4 @@
-error: expected expression, found `<eof>`
+error: expected expression, found the end of the macro arm
   --> $DIR/macro-in-expression-context-2.rs:5:16
    |
 LL |         _ => { empty!() }