Make lang items usable from libsyntax #20541
Labels
A-lang-item
Area: Language items
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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.
The text was updated successfully, but these errors were encountered: