Skip to content

More helpful error message for unsupported editions: display the required rust-version #15305

Open
@tarcieri

Description

@tarcieri

Problem

When cargo encounters an unsupported edition, the error message it displays isn't actionable, where the action in this case is to upgrade cargo/rustc to 1.85 or newer:

Caused by:
  feature `edition2024` is required

  The package requires the Cargo feature called `edition2024`, but that feature is not stabilized in this version of Cargo (1.81.0 (2dbb1af80 2024-08-20)).

Proposed Solution

In the event an edition is unsupported, It would be more helpful if cargo printed the standard error for an out-of-date rust version by extracting package.rust-version when specified:

error: rustc 1.81.0 is not supported by the following package:
  [email protected] requires rustc 1.85

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-manifestArea: Cargo.toml issuesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions