mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
9828e960ab
This was added (with a different name) to improve an error message. It is no longer needed -- removing it changes the error message, but overall I think the new message is no worse: - the mention of `#` in the first line is a little worse, - but the extra context makes it very clear what the problem is, perhaps even clearer than the old message, - and the removal of the note about the `expr` fragment (an internal detail of `__rust_force_expr`) is an improvement. Overall I think the error is quite clear and still far better than the old message that prompted #61933, which didn't even mention patterns. The motivation for this is #124141, which will cause pasted metavariables to be tokenized and reparsed instead of the AST node being cached. This change in behaviour occasionally has a non-zero perf cost, and `__rust_force_expr` causes the tokenize/reparse step to occur twice. Removing `__rust_force_expr` greatly reduces the extra overhead for the `deep-vector` benchmark.
15 lines
463 B
Plaintext
15 lines
463 B
Plaintext
error: expected pattern, found `#`
|
|
--> $DIR/vec-macro-in-pattern.rs:7:14
|
|
|
|
|
LL | Some(vec![43]) => {}
|
|
| ^^^^^^^^
|
|
| |
|
|
| expected pattern
|
|
| in this macro invocation
|
|
| this macro call doesn't expand to a pattern
|
|
|
|
|
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error: aborting due to 1 previous error
|
|
|