Rust-GCC / Rust-GCC/gccrs

Lang item attributes are not handled on enum variants

Open
#4,703 1 comment 0 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.