Struct syntax::ext::base::ExtCtxt[][src]

pub struct ExtCtxt<'a> {
    pub parse_sess: &'a ParseSess,
    pub ecfg: ExpansionConfig<'a>,
    pub root_path: PathBuf,
    pub resolver: &'a mut Resolver,
    pub resolve_err_count: usize,
    pub current_expansion: ExpansionData,
    pub expansions: HashMap<Span, Vec<String>>,
}

One of these is made during expansion and incrementally updated as we go; when a macro expansion occurs, the resulting nodes have the backtrace() -> expn_info of their expansion context stored into their span.

Fields

Methods

impl<'a> ExtCtxt<'a>
[src]

Returns a Folder for deeply expanding all macros in an AST node.

Returns a Folder that deeply expands all macros and assigns all node ids in an AST node. Once node ids are assigned, the node may not be expanded, removed, or otherwise modified.

Returns span for the macro which originally caused the current expansion to happen.

Stops backtracing at include! boundary.

Emit msg attached to sp, and stop compilation immediately.

span_err should be strongly preferred where-ever possible: this should only be used when:

  • continuing has a high risk of flow-on errors (e.g. errors in declaring a macro would cause all uses of that macro to complain about "undefined macro"), or
  • there is literally nothing else that can be done (however, in most cases one can construct a dummy expression/item to substitute; we never hit resolve/type-checking so the dummy value doesn't have to match anything)

Emit msg attached to sp, without immediately stopping compilation.

Compilation will be stopped in the near future (at the end of the macro expansion phase).

Important traits for Vec<u8>

Trait Implementations

impl<'a> AstBuilder for ExtCtxt<'a>
[src]

Constructs a qualified path.

Constructs a path like <self_type as trait_path>::ident.

Constructs a qualified path.

Constructs a path like <self_type as trait_path>::ident<'a, T, A=Bar>.

Constructs a QPath expression.

impl<'a> ExtParseUtils for ExtCtxt<'a>
[src]

Important traits for Vec<u8>

Auto Trait Implementations

impl<'a> !Send for ExtCtxt<'a>

impl<'a> !Sync for ExtCtxt<'a>