Module rustc_span::hygiene

source ·
Expand description

Machinery for hygienic macros.

Inspired by Matthew Flatt et al., “Macros That Work Together: Compile-Time Bindings, Partial Expansion, and Definition Contexts,” Journal of Functional Programming 22, no. 2 (March 1, 2012): 181–216, https://doi.org/10.1017/S0956796812000093.

Structs

  • A subset of properties from both macro definition and macro call available through global data. Avoid using this if you have access to the original definition or call structures.
  • A unique hash value associated to an expansion.
  • A unique ID associated with a macro invocation and expansion.
  • A unique ID associated with a macro invocation and expansion.
  • Additional information used to assist in decoding hygiene data
  • Additional information used to assist in decoding hygiene data
  • A unique ID associated with a macro invocation and expansion.
  • A SyntaxContext represents a chain of pairs (ExpnId, Transparency) named “marks”.

Enums

  • The kind of AST transform.
  • The kind of compiler desugaring.
  • Expansion kind.
  • The kind of macro invocation or definition.
  • A property of a macro expansion that determines how identifiers produced by that expansion are resolved.

Functions