Are raw pointers fully equivalent to the place they are created from?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 20/100
Direzione di ricerca
No files, tests, or implementation entry points are named. Start by reading the Tree Borrows discussion in this issue and the linked issues about non-mut local variables and raw-pointer retagging. Done means reaching and documenting a decision on whether raw pointers should retain the tag of their source place.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
In Tree Borrows, &raw const/mut expressions don't do anything -- the raw pointer created by this expression just has whatever tag the place they point to has. This makes code like the following legal:
let mut a = 0;
let ptr = &raw mut a;
a = 1;
*ptr = 2;
*ptr and a are allowed to freely alias.
I think this best reflects programmer expectations. In the early days of Stacked Borrows, this came up as a surprise for multiple people, and one c2rust translation tool had to change the code they generate to deal with this. This also simplifies the model since we no longer have to (somewhat awkwardly) identify when a raw pointer is created from a "safe" place (reference/local/Box), and only retag those. This is in contrast to references which we can just always retag no matter where we encounter them.
This somewhat relates to the following questions:
- https://github.com/rust-lang/unsafe-code-guidelines/issues/400: in TB, at least the aliasing model has nothing against mutating non-
mutlocal variables. We would have to introduce a separate check for this purpose. - https://github.com/rust-lang/unsafe-code-guidelines/issues/257:
*mutand*constcannot make a difference if raw pointers never get retagged.
- 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 12/100
rust-lang/unsafe-code-guidelines#632 · 8 commenti · 1 reazione ·
-
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 ·
Tutte le issue di rust-lang/unsafe-code-guidelines
Issue simili
-
bug core-lang
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Call-argument syntax diagnostic needs example spacing and removal of confusing trailing sentenceAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
mw00/project-maya#1368 ·
I maintainer di solito rispondono entro 2 giorni
-
test(bind-json): legacy Solidity fixture requires an unavailable solc on Linux ARM64Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
foundry-rs/foundry#18828 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno