Enhancement: report the Rust runtime from `rust-version` / `rust-toolchain.toml`, not only the edition year

Abierto
#722 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
rust, typescript
Área
backend, cli, tooling

Línea de trabajo

Read src/core-open/scanners/rust-scanner.ts and src/core-open/runtimes/catalog.ts, then inspect test/cargo-rust-edition.test.ts for the existing edition behavior. Trace how Cargo manifests and toolchain files are read, and follow the runtime refresh path in scripts/refresh-runtimes.mjs. Add tests covering manifest and toolchain pins, workspace inheritance, channel names, and edition fallback; done means pinned versions use catalog based lag and EOL while edition only cases retain their current behavior.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement help wanted
  • Difficulty: medium
  • Area: Cargo / runtime catalog
Problem

scanOneRustProject in src/core-open/scanners/rust-scanner.ts (around lines 665–674 and 771) sets runtime to the Cargo edition (2015 / 2018 / 2021 / 2024) and compares it to a hard-coded latestEdition = 2024. Rust is not in RUNTIME_PRODUCTS in src/core-open/runtimes/catalog.ts (that list is nodejs, python, dotnet, java, php, ruby, go, swift, dart). There is no reader for:

# Cargo.toml
[package]
rust-version = "1.76"
# or rust-version.workspace = true, from [workspace.package]
# rust-toolchain.toml
[toolchain]
channel = "1.76.0"
# rust-toolchain (legacy one-liner)
1.76.0

Edition is not a compiler version, so runtime lag and EOL are wrong or missing for crates that declare an MSRV or a toolchain pin. #632 (edition.workspace) stays separate and should still fill the edition when that is all the caller needs.

Expected behaviour

Prefer a compiler pin when one exists, in this order: [package] rust-version (including rust-version.workspace = true from [workspace.package]), then rust-toolchain.toml / rust-toolchain in the crate directory or the workspace root, then the current edition fallback if nothing else is present. Add rust to the runtime catalog (endoflife.date product, refreshed by the existing scripts/refresh-runtimes.mjs path) so runtimeLatest, runtimeMajorsBehind, and runtimeEol use rustc cycles, not 2024 - edition / 3. When only an edition is known, keep today’s edition behaviour so existing test/cargo-rust-edition.test.ts cases stay valid. Channel names such as stable, nightly, or beta are not a concrete version; skip them rather than inventing a rustc release.

Acceptance
  • rust-version = "1.76" reports runtime 1.76 (or 1.76.0 — pin one form) and catalog-based lag / EOL, not edition 2021.
  • rust-version.workspace = true reads [workspace.package] rust-version.
  • rust-toolchain.toml is used only when rust-version is absent.
  • Edition-only crates still report the edition and the existing edition lag.
  • stable / nightly toolchain channels do not become a fake rustc version.
  • Tests next to test/cargo-rust-edition.test.ts.

Lenguaje dominante
TypeScript
Estrellas
4
Forks
3
Merge medio
1 d 22 h
PR fusionados (30 d)
76

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de vibgrate/cli

Todos los issues de vibgrate/cli

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.