From 241b8d6fdb2f69e0785221f11814eee2169685fe Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 10 Apr 2022 21:05:42 -0700 Subject: [PATCH] Show simpler rules in macro documentation --- src/lib.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 917bbd5..2be14c7 100644 --- a/src/lib.rs +++ b/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=>) => {{