Skip to content

In Cargo.toml I missspelled "version" and it still worked, but after I corrected it I now get compile errors. #13918

Closed
@exo-cortex

Description

@exo-cortex

Problem

The code is in this github repo: https://github.com/exo-cortex/simple_axum_button_response
In Cargo.toml I missspelled "version" in the line

tower-http = { verion = "0.4", features = ["fs"] }

Everything still worked fine and compiled without errors.
But once I corrected the mistake my project now does not compile anymore. I don't completely understand what's happening here. While compiling cargo displayed that it compiled tower-html v0.5.2 - so it somehow read the package name, but ignored the malformed version-statement.

I fixed my problem with the newer version (that cargo somehow used), but It is problematic IMHO that cargo does not warn the user of a misspelled dependency version statement; I did not correctly state the version and it still installed some version.
I don't think this is intended.

Steps

  1. git clone the repo at https://github.com/exo-cortex/simple_axum_button_response
  2. run cargo build
  3. correct the misspelled word "verion" in Cargo.toml
  4. run cargo build again
    this should give you an errror.

Possible Solution(s)

Check toml file integrity when running cargo commands and warn user.

Notes

No response

Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugS-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