Skip to content

Hygiene issues when reparsing token trees #16987

Closed
@uorbe001

Description

@uorbe001

I get errors when I call to_tokens on a parsed block and parse that again using procedural macros. It seems to be related to hygiene being lost when you do that, but I might be wrong, here's a gist that shows the problem: https://gist.github.com/uorbe001/1118f22c378d2e382d29

If I try to compile that gist, I get the following error on the assert! line:

<quote expansion>:4:50: 4:53 error: unresolved name `one`.
<quote expansion>:4                          name_66,ctxt_2!(1i == one);

I thought this was related to #8063, but apparently this is a separate issue.

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