Skip to content

Commit

Permalink
Show simpler rules in macro documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Apr 11, 2022
1 parent b5160b1 commit 241b8d6
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

1 comment on commit 241b8d6

@juliandanciu
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the ellipsis (...) mean in this context?

Please sign in to comment.