FYI for new warn-by-default lint `mismatched_lifetime_syntaxes`

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

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
tooling

Direzione di ricerca

Non è specificato alcun file o test preciso. Inizia esaminando l’implementazione della generazione e i crate generati interessati, come stm32f4, quindi determina se sia appropriata una sintassi coerente per i lifetime o un attributo allow; il lavoro è completato quando i crate generati non producono più impatto sul tempo di build correlato agli avvisi.

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

Descrizione

(Meta: this issue is a forward of https://github.com/stm32-rs/stm32-rs/issues/1245.)

Hi svd2rust maintainers, we landed a new warn-by-default lint mismatched_lifetime_syntaxes on the nightly channel. The lint is intended to warn on cases where the same lifetime is referred to by different syntactical forms between function arguments and return types, which has been a long-standing source of confusion for users. See https://doc.rust-lang.org/nightly/rustc/lints/listing/warn-by-default.html#mismatched-lifetime-syntaxes.

For certain generated crates (e.g. stm32f4), it was reported that the performance of the lint might be a concern. We analyzed the performance regression, and found that the performance regression is dominated by the emission of a lot of warnings on the generated code.

This is expected to only impact build times when working on the generated crates, not when the crates are used as dependencies because in that case they will be built with --cap-lints=allow preventing warnings from being emitted.

To address the build time impact for when working on the generated crates:

  • You may wish to #[allow(mismatched_lifetime_syntaxes)] on the generated crates. Or,
  • You may wish to adjust the generation implementation to emit code that uses consistent lifetime syntaxes for function arguments and return values.

For your reference,

(Please use the threads or new rust-lang/rust issues for feedback, as otherwise I may lose the notification.)

Lingua principale
Rust
Stelle
865
Fork
164
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 rust-embedded/svd2rust

Tutte le issue di rust-embedded/svd2rust

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.