[−][src]Struct rustc_ap_rustc_expand::base::SyntaxExtension
A struct representing a macro definition in "lowered" form ready for expansion.
Fields
kind: SyntaxExtensionKind
A syntax extension kind.
span: Span
Span of the macro definition.
allow_internal_unstable: Option<Lrc<[Symbol]>>
Whitelist of unstable features that are treated as stable inside this macro.
allow_internal_unsafe: bool
Suppresses the unsafe_code
lint for code produced by this macro.
local_inner_macros: bool
Enables the macro helper hack (ident!(...)
-> $crate::ident!(...)
) for this macro.
stability: Option<Stability>
The macro's stability info.
deprecation: Option<Deprecation>
The macro's deprecation info.
helper_attrs: Vec<Symbol>
Names of helper attributes registered by this macro.
edition: Edition
Edition of the crate in which this macro is defined.
is_builtin: bool
Built-in macros have a couple of special properties like availability
in #[no_implicit_prelude]
modules, so we have to keep this flag.
is_derive_copy: bool
We have to identify macros providing a Copy
impl early for compatibility reasons.
Methods
impl SyntaxExtension
[src]
pub fn macro_kind(&self) -> MacroKind
[src]
Returns which kind of macro calls this syntax extension.
pub fn default(kind: SyntaxExtensionKind, edition: Edition) -> SyntaxExtension
[src]
Constructs a syntax extension with default properties.
pub fn new(
sess: &ParseSess,
kind: SyntaxExtensionKind,
span: Span,
helper_attrs: Vec<Symbol>,
edition: Edition,
name: Name,
attrs: &[Attribute]
) -> SyntaxExtension
[src]
sess: &ParseSess,
kind: SyntaxExtensionKind,
span: Span,
helper_attrs: Vec<Symbol>,
edition: Edition,
name: Name,
attrs: &[Attribute]
) -> SyntaxExtension
Constructs a syntax extension with the given properties and other properties converted from attributes.
pub fn dummy_bang(edition: Edition) -> SyntaxExtension
[src]
pub fn dummy_derive(edition: Edition) -> SyntaxExtension
[src]
pub fn non_macro_attr(mark_used: bool, edition: Edition) -> SyntaxExtension
[src]
pub fn expn_data(
&self,
parent: ExpnId,
call_site: Span,
descr: Symbol
) -> ExpnData
[src]
&self,
parent: ExpnId,
call_site: Span,
descr: Symbol
) -> ExpnData
Auto Trait Implementations
impl !RefUnwindSafe for SyntaxExtension
impl !Send for SyntaxExtension
impl !Sync for SyntaxExtension
impl Unpin for SyntaxExtension
impl !UnwindSafe for SyntaxExtension
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Erased for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> MaybeResult<T> for T
[src]
type Error = !
fn from(Result<T, <T as MaybeResult<T>>::Error>) -> T
[src]
fn to_result(self) -> Result<T, <T as MaybeResult<T>>::Error>
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<E> SpecializationError for E
[src]
default fn not_found<S, T>(
trait_name: &'static str,
method_name: &'static str
) -> E where
T: ?Sized,
[src]
trait_name: &'static str,
method_name: &'static str
) -> E where
T: ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,