Allow adding attributes to functions in ParseCallbacks

Aperta
#3,533 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
63/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
tooling

Direzione di ricerca

Start by reading ParseCallbacks::add_attributes() and its uses in rust-bindgen, especially the paths that add attributes to struct, enum, and union declarations. Then trace how function bindings are generated and identify where callback-provided attributes could be applied. Done means function bindings can receive attributes such as #[target_feature(enable = "sse2")]; the issue does not name a test, so check the existing callback tests for a suitable place to cover it.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

C-feature-request

ParseCallbacks::add_attributes() is only used for struct/enum/union declarations
There doesn't seem to be a way to add attributes to functions

Use case: adding #[target_feature(enable = "sse2")] to the bindings for the functions in https://github.com/php/php-src/blob/PHP-8.5.12/Zend/zend_simd.h#L49, which are only defined on the C side when SSE2 is available

Lingua principale
Rust
Stelle
5.3k
Fork
846
Merge medio
2g 6h
PR unite (30g)
11

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rust-lang/rust-bindgen

Tutte le issue di rust-lang/rust-bindgen

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.