Some paren rewrite handling / `stmt_expr_attributes` formatting could be improved

Aperta
#7,193 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
58/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
tooling

Direzione di ricerca

Read tests/source/issue_7190_remove_nested_parens_false.rs and tests/source/issue_7190_remove_nested_parens_true.rs to see the existing cases. Reproduce the shown formatting with the attribute inside nested parentheses, then trace how paren rewriting formats stmt_expr_attributes. Done when the output matches the example and the related formatting tests pass.

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

Descrizione

A-attributes A-statements C-bug I-poor-formatting

Follow-up to #7192. See tests/source/issue_7190_remove_nested_parens_false.rs and tests/source/issue_7190_remove_nested_parens_true.rs. For instance,

fn f() {
    {
    (
        #[allow(arithmetic_overflow)]
        (1u8 + 255u8)
    )
    }
}

=>

fn f() {
    {
        (#[allow(arithmetic_overflow)]
        (1u8 + 255u8))
    }
}
Lingua principale
Rust
Stelle
7.1k
Fork
1.2k
Merge medio
1g 4h
PR unite (30g)
20

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/rustfmt

Tutte le issue di rust-lang/rustfmt

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.