Skip to content

Commit

Permalink
Auto merge of #52386 - Manishearth:quote-clarify, r=petrochenkov
Browse files Browse the repository at this point in the history
Clarify how the quote macro is loaded

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

r? @jseyfried
  • Loading branch information
bors committed Jul 16, 2018
2 parents 99140df + 58f3f7b commit 88b025b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libproc_macro/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 { () => {} }
Expand Down
3 changes: 3 additions & 0 deletions src/libproc_macro/quote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 88b025b

Please sign in to comment.