mirror of
https://gitee.com/openharmony/third_party_rust_quote
synced 2024-11-23 07:10:01 +00:00
Merge pull request #219 from dtolnay/doc
Show simpler rules in macro documentation
This commit is contained in:
commit
0447cf03ff
18
src/lib.rs
18
src/lib.rs
@ -468,6 +468,15 @@ pub mod spanned;
|
||||
/// # }
|
||||
/// # }
|
||||
/// ```
|
||||
#[cfg(doc)]
|
||||
#[macro_export]
|
||||
macro_rules! quote {
|
||||
($($tt:tt)*) => {
|
||||
...
|
||||
};
|
||||
}
|
||||
|
||||
#[cfg(not(doc))]
|
||||
#[macro_export]
|
||||
macro_rules! quote {
|
||||
() => {
|
||||
@ -598,6 +607,15 @@ macro_rules! quote {
|
||||
/// In this example it is important for the where-clause to be spanned with the
|
||||
/// line/column information of the user's input type so that error messages are
|
||||
/// placed appropriately by the compiler.
|
||||
#[cfg(doc)]
|
||||
#[macro_export]
|
||||
macro_rules! quote_spanned {
|
||||
($span:expr=> $($tt:tt)*) => {
|
||||
...
|
||||
};
|
||||
}
|
||||
|
||||
#[cfg(not(doc))]
|
||||
#[macro_export]
|
||||
macro_rules! quote_spanned {
|
||||
($span:expr=>) => {{
|
||||
|
Loading…
Reference in New Issue
Block a user