Offer to close TODO: parse rustflags
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 55/100
Línea de trabajo
Lee src/rustflags.rs, especialmente el TODO de las líneas 5 y 13-16, y compáralo con la API propuesta TestCases::with_rustflags. Está hecho cuando trybuild puede pasar flags suministrados explícitamente a la compilación de prueba pertinente sin leer el estado del entorno; el issue no indica ningún archivo de prueba que ejecutar.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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)
- Lenguaje dominante
- Rust
- Estrellas
- 1k
- Forks
- 87
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de dtolnay/trybuild
-
Dificultad 4/5 3-5 días Aptitud para principiantes 32/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 50/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Todos los issues de dtolnay/trybuild
Issues similares
-
priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
storytold/photocraft#15350 ·
Los mantenedores suelen responder en 1 día
-
area:davinci
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ubugeeei-prod/vize#13167 ·
Los mantenedores suelen responder en 1 día
-
area:ui enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
transit-audio/transit#738 ·
Los mantenedores suelen responder en 1 día
-
enhancement good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 91/100
hocinehacherouf/liberarr#78 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día