Skip to content

subtle documentation ambiguity #12112

Closed
@mcandre

Description

Problem

The Cargo Book says:

Caret requirements are an alternative syntax for the default strategy, ^1.2.3 is exactly equivalent to 1.2.3.

This phrasing has an unfortunate interpretation for Rust newbies, who may take the statement to mean that caret means the exact version identifier.

A very careful reading reveals that caret is merely the default semantic, but is not exactly equivalent to any fixed version. Some users may get tripped up by this ambiguity.

Possible Solution(s)

We can help the reader to disambiguate Cargo syntax and semantics. For example, adjust the section to say something like:

The caret prefix is also the default version resolution strategy; it may be omitted. Both ^1.2.3 and 1.2.3 match the latest available, Cargo SemVer compatible release that Cargo can find.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-documenting-cargo-itselfArea: Cargo's documentationA-semverArea: semver specifications, version matching, etc.C-bugCategory: bugE-easyExperience: EasyS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions