Skip to content

Commit f42e054

Browse files
committed
reword labels
1 parent 24c4fa0 commit f42e054

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

compiler/rustc_parse/src/parser/diagnostics.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,12 +2199,12 @@ impl<'a> Parser<'a> {
21992199
node.def_span(),
22002200
format!("this macro fragment matcher is {descr}"),
22012201
);
2202-
err.span_label(next.use_span(), format!("this is interpreted as {next_descr}"));
2202+
err.span_label(next.use_span(), format!("this is expected to be {next_descr}"));
22032203
err.span_label(
22042204
node.use_span(),
22052205
format!(
2206-
"this is interpreted as {}, but it was previously interpreted as {}",
2207-
descr, next_descr,
2206+
"this is interpreted as {}, but it is expected to be {}",
2207+
next_descr, descr,
22082208
),
22092209
);
22102210
show_link = true;

tests/ui/macros/trace_faulty_macros.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ error: expected expression, found pattern `1 + 1`
7373
--> $DIR/trace_faulty_macros.rs:49:37
7474
|
7575
LL | (let $p:pat = $e:expr) => {test!(($p,$e))};
76-
| ------- -- this is interpreted as pattern, but it was previously interpreted as expression
76+
| ------- -- this is interpreted as expression, but it is expected to be pattern
7777
| |
7878
| this macro fragment matcher is expression
7979
...
@@ -85,7 +85,7 @@ LL | (($p:pat, $e:pat)) => {let $p = $e;};
8585
LL | test!(let x = 1+1);
8686
| ------------------
8787
| | |
88-
| | this is interpreted as expression
88+
| | this is expected to be expression
8989
| in this macro invocation
9090
|
9191
= 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

0 commit comments

Comments
 (0)