Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proc_macro: Add an expand_expr method to TokenStream #87264

Merged
merged 1 commit into from Nov 13, 2021

Commits on Nov 12, 2021

  1. proc_macro: Add an expand_expr method to TokenStream

    This feature is aimed at giving proc macros access to powers similar to
    those used by builtin macros such as `format_args!` or `concat!`. These
    macros are able to accept macros in place of string literal parameters,
    such as the format string, as they perform recursive macro expansion
    while being expanded.
    
    This can be especially useful in many cases thanks to helper macros like
    `concat!`, `stringify!` and `include_str!` which are often used to
    construct string literals at compile-time in user code.
    
    For now, this method only allows expanding macros which produce
    literals, although more expresisons will be supported before the method
    is stabilized.
    mystor committed Nov 12, 2021
    Configuration menu
    Copy the full SHA
    3e4d3d2 View commit details
    Browse the repository at this point in the history