Auto merge of #52386 - Manishearth:quote-clarify, r=petrochenkov

Clarify how the quote macro is loaded

@QuietMisdreavus needed to figure this out for writing a testcase, this should be better documented.

r? @jseyfried
This commit is contained in:
bors 2018-07-16 04:40:21 +00:00
commit 88b025bccb
2 changed files with 5 additions and 0 deletions

View File

@ -236,6 +236,8 @@ pub mod token_stream {
///
/// Unquoting is done with `$`, and works by taking the single next ident as the unquoted term.
/// To quote `$` itself, use `$$`.
///
/// This is a dummy macro, the actual implementation is in quote::Quoter
#[unstable(feature = "proc_macro", issue = "38356")]
#[macro_export]
macro_rules! quote { () => {} }

View File

@ -21,6 +21,9 @@ use syntax::parse::token;
use syntax::symbol::Symbol;
use syntax::tokenstream;
/// This is the actual quote!() proc macro
///
/// It is manually loaded in CStore::load_macro_untracked
pub struct Quoter;
pub fn unquote<T: Into<TokenStream> + Clone>(tokens: &T) -> TokenStream {