-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Remove doctree::Macro and distinguish between macro_rules!
and pub macro
#79455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ccb9cc1
Remove doctree::Macro
CraftSpider 18276b2
Apply review: use from_hir, add macro source fix.
CraftSpider c007f43
Add test, fix pub macro impl, compile error
CraftSpider 949b72e
Update decl_macro test, add decl_macro_priv test for --document-priva…
CraftSpider a61c09a
Update src/test/rustdoc/decl_macro_priv.rs
CraftSpider ff69093
Add support for multi-argument decl macros
CraftSpider d23b57c
Add test for macro by example syntax in decl macros with only one option
CraftSpider File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,39 @@ | ||
#![feature(decl_macro)] | ||
|
||
// @has decl_macro/macro.my_macro.html //pre 'pub macro my_macro() {' | ||
// @has - //pre '...' | ||
// @has - //pre '}' | ||
pub macro my_macro() { | ||
|
||
} | ||
|
||
// @has decl_macro/macro.my_macro_2.html //pre 'pub macro my_macro_2($($tok:tt)*) {' | ||
// @has - //pre '...' | ||
// @has - //pre '}' | ||
pub macro my_macro_2($($tok:tt)*) { | ||
|
||
} | ||
|
||
// @has decl_macro/macro.my_macro_multi.html //pre 'pub macro my_macro_multi {' | ||
// @has - //pre '(_) => { ... },' | ||
// @has - //pre '($foo:ident . $bar:expr) => { ... },' | ||
// @has - //pre '($($foo:literal),+) => { ... }' | ||
// @has - //pre '}' | ||
pub macro my_macro_multi { | ||
(_) => { | ||
|
||
}, | ||
($foo:ident . $bar:expr) => { | ||
|
||
}, | ||
($($foo:literal),+) => { | ||
|
||
} | ||
} | ||
|
||
// @has decl_macro/macro.by_example_single.html //pre 'pub macro by_example_single($foo:expr) {' | ||
// @has - //pre '...' | ||
// @has - //pre '}' | ||
pub macro by_example_single { | ||
($foo:expr) => {} | ||
} |
This file contains hidden or 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,14 @@ | ||
// compile-flags: --document-private-items | ||
|
||
#![feature(decl_macro)] | ||
|
||
// @has decl_macro_priv/macro.crate_macro.html //pre 'pub(crate) macro crate_macro() {' | ||
// @has - //pre '...' | ||
// @has - //pre '}' | ||
pub(crate) macro crate_macro() {} | ||
|
||
// @has decl_macro_priv/macro.priv_macro.html //pre 'macro priv_macro() {' | ||
CraftSpider marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// @!has - //pre 'pub macro priv_macro() {' | ||
// @has - //pre '...' | ||
// @has - //pre '}' | ||
macro priv_macro() {} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.