Break the ABI promise around `MaybeUninit`
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 10/100
Línea de trabajo
Start with the MaybeUninit API docs and the ABI compatibility list linked above, then read the earlier ptr::copy debate in unsafe-code-guidelines#518. The open question is whether to replace the blanket ABI promise with an integer/SIMD allowlist or a narrower denylist; the proposed lint firing on MaybeUninit in extern "C" declarations is the concrete entry point for ecosystem exploration. Done would mean an agreed policy plus crater/lint evidence, not a newcomer patch.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
We keep discovering that the MaybeUninit ABI promise (which didn't make it to this list but is mentioned in the MaybeUninit API docs) is causing problems:
- For
bool, the LLVM IR we generate is not in a shape where LLVM would guarantee ABI compatibility to us. Fixing this would require non-trivial changes on the LLVM side, if it is practical at all, and would also entirely preclude some hypothetical ABIs. - For float types, upholding the promise will become pretty much impossible when we migrate to the byte type. We need
MaybeUninit<f64>to map tob64on the LLVM side to ensure that partially initializedf64have their initialized bytes preserved, but LLVM has no way of knowing that this particularb64should be passed as a float rather than an int. Maybe LLVM could be extended to make that work, but it's not clear if upstream LLVM is really open to this idea. - Doing a copyof type
Tviaptr::copyis not the same as doing the copy at typeMaybeUninit<T>: the latter erases padding. That's very surprising and not at all intentional. (This was the topic of a previous debate in https://github.com/rust-lang/unsafe-code-guidelines/issues/518.)
It seems fairly inevitable that we have to break our ABI promise at least a little bit. In the opsem meeting, people ere generally on-board with exploring the option of replacing the promise of ABI compatibility for all types with a promise that only covers a particular set of types (in particular integers, and hopefully SIMD vectors of integers). There's an alternative where we only take back the promise for bool and float types and structs containing bool or float types, but even assembling that list would be quite non-trivial, and there's a non-trivial risk that more surprises are lurking in this space. So if we can get away with it, having an allowlist would be much better than a denylist.
To see whether this is feasible, we're going to have to do a bit of ecosystem exploration.
- @joshlf is letting the LLMs lose on this to try and find impacted code.
- We agreed to do a crater run with a lint that fires on
MaybeUninitinextern "C"function declarations. (Someone still has to volunteer to write that lint. :)
- Lenguaje dominante
- Sin datos de lenguaje
- Estrellas
- 760
- Forks
- 68
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rust-lang/unsafe-code-guidelines
-
I-opsem-nominated
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
rust-lang/unsafe-code-guidelines#634 · 5 comentarios ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 12/100
rust-lang/unsafe-code-guidelines#632 · 8 comentarios · 1 reacción ·
-
I-opsem-nominated
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
rust-lang/unsafe-code-guidelines#630 · 1 reacción ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Todos los issues de rust-lang/unsafe-code-guidelines
Issues similares
-
bug core-lang
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Call-argument syntax diagnostic needs example spacing and removal of confusing trailing sentenceAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
mw00/project-maya#1368 ·
Los mantenedores suelen responder en 2 días
-
test(bind-json): legacy Solidity fixture requires an unavailable solc on Linux ARM64Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
foundry-rs/foundry#18828 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día