Skip to content

Warn on missing edition field in Cargo.toml #16783

@nyurik

Description

@nyurik

What it does

In 2026, it should be a mistake not to explicitly set language edition

Advantage

  • avoid accidentally removing edition field from the Cargo.toml
  • prevent ambiguity

Drawbacks

Will warn on ancient code

Example

[package]
# no edition field

Comparison with existing lints

See also #6431 which discussed it 6 years ago as part of a bigger "cargo.toml" lint set up

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lints

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions