Skip to content

DefPathData should use InternedString, not Name #35292

Closed
@nikomatsakis

Description

@nikomatsakis

Currently DefPathData embeds a Name. The intention was to have an interned string and ignore hygiene. But it turns out that Name still has a kind of quasi-hygiene -- using gensym, you can create two names with the same string representation but distinct identifiers. We should be using InternedString in DefPathData instead, I believe. Otherwise you can wind up with two def-ids with def-paths that, after serialization, appear exactly the same (since we serialize the Name by writing out the string value, but that is not sufficient to capture this gensym quality).

This shows up e.g. in the iter variable created by the for lowering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-incr-compArea: Incremental compilationT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions