-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #86282 - camelid:macro_rules-matchers, r=jyn514
Pretty-print macro matchers instead of using source code Fixes #86208.
- Loading branch information
Showing
14 changed files
with
107 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// This is a regression test for issue #86208. | ||
// It is also a general test of macro_rules! display. | ||
|
||
#![crate_name = "foo"] | ||
|
||
// @has 'foo/macro.todo.html' | ||
// @has - '//span[@class="macro"]' 'macro_rules!' | ||
// @has - '//span[@class="ident"]' 'todo' | ||
// Note: count = 2 * ('=' + '>') + '+' = 2 * (1 + 1) + 1 = 5 | ||
// @count - '//pre[@class="rust macro"]//span[@class="op"]' 5 | ||
|
||
// @has - '{ ()' | ||
// @has - '//span[@class="op"]' '=' | ||
// @has - '//span[@class="op"]' '>' | ||
// @has - '{ ... };' | ||
|
||
// @has - '($(' | ||
// @has - '//span[@class="macro-nonterminal"]' '$' | ||
// @has - '//span[@class="macro-nonterminal"]' 'arg' | ||
// @has - ':' | ||
// @has - '//span[@class="ident"]' 'tt' | ||
// @has - '),' | ||
// @has - '//span[@class="op"]' '+' | ||
// @has - ')' | ||
pub use std::todo; | ||
|
||
mod mod1 { | ||
// @has 'foo/macro.macro1.html' | ||
// @has - 'macro_rules!' | ||
// @has - 'macro1' | ||
// @has - '{ ()' | ||
// @has - '($(' | ||
// @has - '//span[@class="macro-nonterminal"]' '$' | ||
// @has - '//span[@class="macro-nonterminal"]' 'arg' | ||
// @has - ':' | ||
// @has - 'expr' | ||
// @has - '),' | ||
// @has - '+' | ||
// @has - ')' | ||
#[macro_export] | ||
macro_rules! macro1 { | ||
() => {}; | ||
($($arg:expr),+) => { stringify!($($arg),+) }; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters