Auto merge of #86282 - camelid:macro_rules-matchers, r=jyn514

Pretty-print macro matchers instead of using source code

Fixes #86208.
This commit is contained in:
bors 2021-07-05 05:09:35 +00:00
commit 09d9b608d6
14 changed files with 107 additions and 70 deletions

View file

@ -8,7 +8,7 @@
#![feature /* 0#0 */(no_core)]
#![no_core /* 0#0 */]
macro_rules! foo /* 0#0 */ { ($ x : ident) => { y + $ x } }
macro_rules! foo /* 0#0 */ { ($x : ident) => { y + $x } }
fn bar /* 0#0 */() {
let x /* 0#0 */ = 1;

View file

@ -30,7 +30,7 @@ macro_rules! produce_it
*/ {
() =>
{
meta_macro :: print_def_site! ($ crate :: dummy! ()) ;
meta_macro :: print_def_site! ($crate :: dummy! ()) ;
// `print_def_site!` will respan the `$crate` identifier
// with `Span::def_site()`. This should cause it to resolve
// relative to `meta_macro`, *not* `make_macro` (despite

View file

@ -50,9 +50,9 @@ macro_rules! outer
/*
0#0
*/ {
($ item : item) =>
($item : item) =>
{
macro inner() { print_bang! { $ item } } inner! () ;
macro inner() { print_bang! { $item } } inner! () ;
} ;
}