Skip to content

Make lang items usable from libsyntax #20541

Closed
@nrc

Description

@nrc

Currently lang items are only available in the compiler proper, not in libsyntax. However, it is often useful to be able to use lang items for desugaring (see #20516, also range syntax which had to happen in the compiler rather than have a simple desugaring).

The solution I think, is to move the lang items code out of librustc and into libsyntax (or some other, new crate). However, lang items are based on def ids, and these do not exist as far as libsyntax is concerned (they are allocated in an early pass by librustc). Therefore to make this work, we have to change lang items to not use def ids, some how.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lang-itemArea: Language itemsC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions