rust/compiler/rustc_expand
Matthias Krüger 1a6ed3050f
Rollup merge of #103439 - Nilstrieb:help-me-with-my-macro, r=estebank
Show note where the macro failed to match

When feeding the wrong tokens, it used to fail with a very generic error that wasn't very helpful. This change tries to help by noting where specifically the matching went wrong.

```rust
macro_rules! uwu {
    (a a a b) => {};
}
uwu! { a a a c }
```

```diff
error: no rules expected the token `c`
 --> macros.rs:5:14
  |
1 | macro_rules! uwu {
  | ---------------- when calling this macro
...
4 | uwu! { a a a c }
  |              ^ no rules expected this token in macro call
  |
+note: while trying to match `b`
+ --> macros.rs:2:12
+  |
+2 |     (a a a b) => {};
+  |            ^
```
2022-11-15 10:44:07 +01:00
..
src Rollup merge of #103439 - Nilstrieb:help-me-with-my-macro, r=estebank 2022-11-15 10:44:07 +01:00
Cargo.toml proc_macro: use crossbeam channels for the proc_macro cross-thread bridge 2022-07-29 17:38:12 -04:00