Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nonsense rust-version values have a non-ideal error message #13768

Closed
shepmaster opened this issue Apr 17, 2024 · 1 comment · Fixed by #13771
Closed

Nonsense rust-version values have a non-ideal error message #13768

shepmaster opened this issue Apr 17, 2024 · 1 comment · Fixed by #13771
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.

Comments

@shepmaster
Copy link
Member

shepmaster commented Apr 17, 2024

Problem

Using a rust-version of x produces the error

thread 'main' panicked at crates/cargo-util-schemas/src/core/partial_version.rs:99:17:
assertion `left == right` failed: guaranteed by is_req
  left: 0
 right: 1

Steps

Create a new package with the following Cargo.toml:

[package]
name = "x"
version = "0.1.0"
edition = "2021"
rust-version = "x"

Run cargo build

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.77.1 (e52e36006 2024-03-26)
release: 1.77.1
commit-hash: e52e360061cacbbeac79f7f1215a7a90b6f08442
commit-date: 2024-03-26
host: aarch64-apple-darwin
libgit2: 1.7.2 (sys:0.18.2 vendored)
libcurl: 8.4.0 (sys:0.4.70+curl-8.5.0 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Mac OS 14.4.1 [64-bit]
cargo 1.79.0-nightly (a59aba136 2024-03-28)
release: 1.79.0-nightly
commit-hash: a59aba136aab5510c16b0750a36cbd9916f91796
commit-date: 2024-03-28
host: aarch64-apple-darwin
libgit2: 1.7.2 (sys:0.18.2 vendored)
libcurl: 8.4.0 (sys:0.4.72+curl-8.6.0 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Mac OS 14.4.1 [64-bit]
@shepmaster shepmaster added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Apr 17, 2024
@epage
Copy link
Contributor

epage commented Apr 17, 2024

... x is a valid semver::VersionReq wildcard?

https://github.com/dtolnay/semver/blob/master/src/parse.rs#L191-L201

epage added a commit to epage/cargo that referenced this issue Apr 17, 2024
bors added a commit that referenced this issue Apr 18, 2024
fix(msrv): Error, rather than panic, on rust-version 'x'

### What does this PR try to resolve?

Fixes #13768

### How should we test and review this PR?

### Additional information
bors added a commit that referenced this issue Apr 18, 2024
fix(msrv): Error, rather than panic, on rust-version 'x'

### What does this PR try to resolve?

Fixes #13768

### How should we test and review this PR?

### Additional information
@bors bors closed this as completed in 675d67d Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants