What is windows-rs doing with `MaybeUninit` in bindgen?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 12/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- documentation
Direzione di ricerca
This is a discussion thread, not a scoped change: it asks @kennykerr to explain why crates/libs/bindgen/src/types/mod.rs (around lines 812-819) wraps types in MaybeUninit at the ABI level. Start by reading that block alongside #631, then try to reproduce it by running the binding generator over an API that would trigger the MaybeUninit emission and checking whether the pre-baked bindings in the crate ever contain it. Done here means a posted explanation of what the code does and whether generated-vs-prebuilt bindings differ, since no patch is requested.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
This is part of https://github.com/rust-lang/unsafe-code-guidelines/issues/631:
@N1ark found this fun bit of code:
https://github.com/microsoft/windows-rs/blob/aa019b4f7828eb4786bad52181bd5a3a8972a156/crates/libs/bindgen/src/types/mod.rs#L812-L819
This wraps some types in MaybeUninit on the ABI level. That's quite concerning if we're taking back the ABI compatibility promise (see #631). We should understand what happens here.
@kennykerr could you help us understand this, and explain what that code does / why it uses MaybeUninit? What kinds of APIs would cause it to emit a MaybeUninit? It seems like the files in the repo don't actually use MaybeUninit for their bindings (at least, GH code search doesn't seem to find anything), so does this only affect people that generate their own bindings? I'd expect the pre-baked bindings to use the same binding generator though so we should see the MaybeUninit somewhere in that crate, right?
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 760
- Fork
- 68
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rust-lang/unsafe-code-guidelines
-
I-opsem-nominated
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
rust-lang/unsafe-code-guidelines#634 · 5 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
rust-lang/unsafe-code-guidelines#631 · 7 commenti ·
-
I-opsem-nominated
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
rust-lang/unsafe-code-guidelines#630 · 1 reazione ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Tutte le issue di rust-lang/unsafe-code-guidelines
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
MPCoreDeveloper/SharpCoreDB#531 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
IzzyOnDroid inclusionApertaF-Droid FOSS question
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
d4rken-org/butler#365 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 94/100
githubnext/gh-aw-workshop#6293 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
ShaftHQ/chaosengine-harness#423 ·
I maintainer di solito rispondono entro 1 giorno
-
[External Plugin]: zooopApertaexternal-plugin ready-for-review
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
github/awesome-copilot#6655 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno