Skip to content

Commit d011313

Browse files
committed
Reword EOF in macro arm message
1 parent 950a3ed commit d011313

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

src/libsyntax/ext/tt/macro_rules.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ impl<'a> ParserAnyMacro<'a> {
5959
}
6060
let msg = &e.message[0];
6161
e.message[0] = (
62-
msg.0.replace(", found `<eof>`", ", found the end of the macro arm"),
62+
format!(
63+
"macro expansion ends with an incomplete expression: {}",
64+
msg.0.replace(", found `<eof>`", ""),
65+
),
6366
msg.1,
6467
);
6568
}

src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ error: no rules expected the token `async`
2222
LL | r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async`
2323
| ^^^^^ no rules expected this token in macro call
2424

25-
error: expected one of `move`, `|`, or `||`, found the end of the macro arm
25+
error: macro expansion ends with an incomplete expression: expected one of `move`, `|`, or `||`
2626
--> <::edition_kw_macro_2015::passes_ident macros>:1:25
2727
|
2828
LL | ( $ i : ident ) => ( $ i )

src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ error: no rules expected the token `async`
2222
LL | r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async`
2323
| ^^^^^ no rules expected this token in macro call
2424

25-
error: expected one of `move`, `|`, or `||`, found the end of the macro arm
25+
error: macro expansion ends with an incomplete expression: expected one of `move`, `|`, or `||`
2626
--> <::edition_kw_macro_2018::passes_ident macros>:1:25
2727
|
2828
LL | ( $ i : ident ) => ( $ i )

src/test/ui/macros/macro-in-expression-context-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: expected expression, found the end of the macro arm
1+
error: macro expansion ends with an incomplete expression: expected expression
22
--> $DIR/macro-in-expression-context-2.rs:5:16
33
|
44
LL | macro_rules! empty { () => () }

0 commit comments

Comments
 (0)