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]

[src]

[src]

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

[src]

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.

[src]

[src]

[src]

[src]

[src]

[src]

[src]

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

Stops backtracing at include! boundary.

[src]

[src]

[src]

[src]

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)

[src]

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).

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

Important traits for Vec<u8>
[src]

[src]

[src]

Trait Implementations

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

[src]

[src]

[src]

[src]

[src]

Constructs a qualified path.

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

[src]

Constructs a qualified path.

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

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

Constructs a QPath expression.

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

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

[src]

[src]

[src]

Important traits for Vec<u8>
[src]

Auto Trait Implementations

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

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