Lang item attributes are not handled on enum variants
Open
@powerboat9 is already working on this.
Since Jul 14, 2026.
- Dominant language
- C++
- Stars
- 2.9k
- Forks
- 231
- Avg merge
- 20h 2m
- Merged PRs (30d)
- 66
Description
Summary
Lang item attributes on enum variants are not handled.
Reproducer
I tried this code:
#![feature(no_core, lang_items)]
#![no_core]
pub enum Poll {
#[lang = "Ready_wrong"]
Ready,
#[lang = "Pending_wrong"]
Pending
}
Does the code make use of any (1.49) nightly feature ?
- Nightly
Godbolt link
https://godbolt.org/z/e963es8Yq
Actual behavior
Compiler returned: 0
Expected behavior
error[E0522]: definition of an unknown language item: `Ready_wrong`
--> <source>:5:5
|
5 | #[lang = "Ready_wrong"]
| ^^^^^^^^^^^^^^^^^^^^^^^ definition of unknown language item `Ready_wrong`
error[E0522]: definition of an unknown language item: `Pending_wrong`
--> <source>:7:5
|
7 | #[lang = "Pending_wrong"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ definition of unknown language item `Pending_wrong`
GCC Version
master
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.