Skip to content

Commit

Permalink
Merge pull request #219 from dtolnay/doc
Browse files Browse the repository at this point in the history
Show simpler rules in macro documentation
  • Loading branch information
dtolnay committed Apr 11, 2022
2 parents b5160b1 + 241b8d6 commit 0447cf0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/lib.rs
Expand Up @@ -468,6 +468,15 @@ pub mod spanned;
/// # }
/// # }
/// ```
#[cfg(doc)]
#[macro_export]
macro_rules! quote {
($($tt:tt)*) => {
...
};
}

#[cfg(not(doc))]
#[macro_export]
macro_rules! quote {
() => {
Expand Down Expand Up @@ -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=>) => {{
Expand Down

0 comments on commit 0447cf0

Please sign in to comment.