-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix: Limiting pre-release match semantics to use only on OptVersionReq::Req
#14412
Conversation
r? @weihanglo rustbot has assigned @weihanglo. Use |
32df76c
to
b00cb99
Compare
Can you explain why? |
Thanks your swift review and forgive my typos.
The currrent approach of But the The current use of this function is cargo/src/cargo/sources/registry/mod.rs Lines 750 to 765 in d585829
cargo/src/cargo/sources/registry/mod.rs Lines 795 to 809 in d585829
so it's safe to limit its usage |
b00cb99
to
f570d5c
Compare
I think #14305 makes this a bit more clear. We are trying to emulate a proposed |
f570d5c
to
3a1bb8b
Compare
matches_prerelease
should be only used on OptVersionReq::Req
OptVersionReq::Req
@bors r+ |
☀️ Test successful - checks-actions |
Update cargo 12 commits in ba8b39413c74d08494f94a7542fe79aa636e1661..8f40fc59fb0c8df91c97405785197f3c630304ea 2024-08-16 22:48:57 +0000 to 2024-08-21 22:37:06 +0000 - Tests rely on absence of RUST_BACKTRACE (rust-lang/cargo#14441) - fix: -Cmetadata includes whether extra rustflags is same as host (rust-lang/cargo#14432) - [mdman] Normalize newlines when rendering options (rust-lang/cargo#14428) - fix: doctest respects Cargo's color options (rust-lang/cargo#14425) - Be more permissive while packaging unpublishable crates. (rust-lang/cargo#14408) - fix: Limiting pre-release match semantics to use only on `OptVersionReq::Req` (rust-lang/cargo#14412) - test: add a regression test for Issue 14409 (rust-lang/cargo#14430) - chore: update label trigger for Command-info (rust-lang/cargo#14422) - doc: add lockfile-path unstable doc section (rust-lang/cargo#14423) - doc: update lockfile-path tracking issue (rust-lang/cargo#14424) - fix: remove list owners feature of info subcommand (rust-lang/cargo#14418) - Lockfile path tests (follow-up) (rust-lang/cargo#14417)
What does this PR try to resolve?
The prerelease matches semantics should be only used on
OptVersionReq::Req
, but it dosn't. The otherOptVersionReq
types have specify matches logic already, for example aOptVersionReq::Precise
will failed onmatches_prerelease
, see #14140 (comment)How should we test and review this PR?
the first commit added the test, the second commit updated the test and fixed the issue.
Additional information