Skip to content

quote_expr! and friends should emit token-trees directly #16472

Closed
@pnkfelix

Description

@pnkfelix

The lines of code here: quote.rs#L226 are sub-optimal and also require hacks like the one described on #15962 to actually work correctly.

Effectively, the current code is implementing to_tokens by going through the transformation sequence:

AST -> string -> token-trees

The methods should instead be emitting token-trees directly from the AST, avoiding the serialization to and de-serialization from the intermediate string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-syntaxextArea: Syntax extensions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions