From 431aefb2d4d579b152f7f26f3e70d2fdc3db4bfb Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Thu, 12 Jul 2018 13:24:59 +0300 Subject: Functions introducing procedural macros reserve a slot in the macro namespace as well --- src/libsyntax/ext/base.rs | 3 +++ src/libsyntax/ext/expand.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index e49a521040f..b585f887269 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -571,6 +571,8 @@ pub enum MacroKind { Attr, /// A derive attribute macro - #[derive(Foo)] Derive, + /// A view of a procedural macro from the same crate that defines it. + ProcMacroStub, } impl MacroKind { @@ -579,6 +581,7 @@ impl MacroKind { MacroKind::Bang => "macro", MacroKind::Attr => "attribute macro", MacroKind::Derive => "derive macro", + MacroKind::ProcMacroStub => "crate-local procedural macro", } } } diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 865cb3d0d45..281ebaff272 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -232,7 +232,7 @@ pub enum InvocationKind { } impl Invocation { - fn span(&self) -> Span { + pub fn span(&self) -> Span { match self.kind { InvocationKind::Bang { span, .. } => span, InvocationKind::Attr { attr: Some(ref attr), .. } => attr.span, -- cgit 1.4.1-3-g733a5