diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index 9f3a80b11516..e731be578cde 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 ``", ", found the end of the macro arm"), + format!( + "macro expansion ends with an incomplete expression: {}", + msg.0.replace(", found ``", ""), + ), 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 943183814f73..d0edc368ad5e 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 e7379988892b..c4e1e0257c55 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 f6e6ecf112a3..672871c49ca5 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 { () => () }