Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Why would a reference dereference?

Aperta
#55 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
25/100
Tipo di issue
Documentazione
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
documentation

Direzione di ricerca

Start with the “Destructuring” section referenced in the issue and determine which interpretation of references and dereferencing the text intends. Done means the passage clearly states the intended behavior and explains why matching a reference dereferences the object; no file or test is named in the payload.

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

Descrizione

In Destructuring, you write

Lets say you want a reference to a variable in a pattern. You can't use & because that matches a reference, rather than creates one (and thus has the effect of dereferencing the object). For example, ...

  1. Do you mean a) "Let's say you want to make a reference to an (ordinary) struct field using a pattern (effectively aliasing the field)", b) "Let's say you want to refer to a reference variable in a struct using a pattern (creating an additional reference to the object referred to by the field)" or c) something else?

  2. Why would "matching a reference" have the effect of dereferencing the object? On the face of it, that is surprising behavior (unless it's to avoid a &&T (in which case I'd still have expected the dereference to yield the expected &T)). Maybe another sentence explaining why the dereference would be helpful?

Lingua principale
Rust
Stelle
3.9k
Fork
297
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

  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 nrc/r4cppp

Tutte le issue di nrc/r4cppp

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.