Offer to close TODO: parse rustflags
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Leggi src/rustflags.rs, in particolare il TODO alle righe 5 e 13-16, e confrontalo con l’API proposta TestCases::with_rustflags. È completato quando trybuild può passare flag forniti esplicitamente alla compilazione del test pertinente senza leggere lo stato dell’ambiente; l’issue non indica alcun file di test da eseguire.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
in
https://github.com/dtolnay/trybuild/blob/69689b3ff26787f18592ae9e13035aff619c2310/src/rustflags.rs#L5
you have
https://github.com/dtolnay/trybuild/blob/69689b3ff26787f18592ae9e13035aff619c2310/src/rustflags.rs#L13-L16
I now have a (very specific) use case where additional rustflags are required.
Suggestion & PR offer
I would be happy to offer to draft a PR (manually, not via AI) to offer something like the following API (reading from the env would clearly lead to flaky tests):
#[test]
fn specific_rustflags() {
let t = trybuild::TestCases::with_rustflags(vec!["-Zallow-features=", "--cfg", "some_cfg"]);
t.compile_fail("tests/some_cfg/*.rs");
}
Background
My case is the following - I'm sure there will be others who need rustflags for similar or very different reasons:
- I have a created wrapper around
proc_macro::Diagnosticforproc_macro2. - I provide a consistent API for all usage, regardless of which channel the final compilation occurs on.
- I also use additional experimental features (from the
try_trait_v2family) where available. - The API is consistent, regardless of which channel is used for the final compilation. I have fall-back to (acceptable, non-breaking & clearly documented) reduced functionality where certain features are not available.
- I would like to consistently test (not just manually) the outcomes in the following situation:
- current stable & beta: no diagnostics & no try_trait_v2 ✅ (I can run CI on various toolchains & cfg-gate the path passed to trybuild)
- current nightly: diagnostics & try_trait_v2 ✅ (I can run CI on various toolchains & cfg-gate the path passed to trybuild)
- possible future 1: diagnostics but no try_trait_v2 ❌ (can only test manually, I have no way to construct this situation in trybuild)
- possible future 2: try_trait_v2 but no diagnostics ❌ (can only test manually, I have no way to construct this situation in trybuild)
- Lingua principale
- Rust
- Stelle
- 1k
- Fork
- 87
- 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 dtolnay/trybuild
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 32/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 50/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Tutte le issue di dtolnay/trybuild
Issue simili
-
Selected chart highlights only its values, not its series names and category labelsForse già presa @Higgs32584 l’ha presa oggi. Apertabug priority: low ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
storytold/gridcraft#4390 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
bug bugfix priority: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
quarto-dev/q2#1219 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100