diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2018-11-23 15:37:27 -0800 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2018-11-23 15:49:31 -0800 |
| commit | d011313d843b3ddcf095db06907abffdd9cc5904 (patch) | |
| tree | 047eacaa425af5f01fb81c7345937770fb76c3ae | |
| parent | 950a3edf27bf3bad702b0f10ce771ae8bf7f58dd (diff) | |
Reword EOF in macro arm message
4 files changed, 7 insertions, 4 deletions
diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index 9f3a80b1151..e731be578cd 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -59,7 +59,10 @@ impl<'a> ParserAnyMacro<'a> { } let msg = &e.message[0]; e.message[0] = ( - msg.0.replace(", found `<eof>`", ", found the end of the macro arm"), + format!( + "macro expansion ends with an incomplete expression: {}", + msg.0.replace(", found `<eof>`", ""), + ), msg.1, ); } 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 943183814f7..d0edc368ad5 100644 --- a/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr +++ b/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr @@ -22,7 +22,7 @@ error: no rules expected the token `async` LL | r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async` | ^^^^^ no rules expected this token in macro call -error: expected one of `move`, `|`, or `||`, found the end of the macro arm +error: macro expansion ends with an incomplete expression: expected one of `move`, `|`, or `||` --> <::edition_kw_macro_2015::passes_ident macros>:1:25 | LL | ( $ i : ident ) => ( $ i ) 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 e7379988892..c4e1e0257c5 100644 --- a/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr +++ b/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr @@ -22,7 +22,7 @@ error: no rules expected the token `async` LL | r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async` | ^^^^^ no rules expected this token in macro call -error: expected one of `move`, `|`, or `||`, found the end of the macro arm +error: macro expansion ends with an incomplete expression: expected one of `move`, `|`, or `||` --> <::edition_kw_macro_2018::passes_ident macros>:1:25 | LL | ( $ i : ident ) => ( $ i ) 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 f6e6ecf112a..672871c49ca 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 the end of the macro arm +error: macro expansion ends with an incomplete expression: expected expression --> $DIR/macro-in-expression-context-2.rs:5:16 | LL | macro_rules! empty { () => () } |
