Skip to content

feat(prerelease): support [patch] with -Zprerelease - #17613

Merged
epage merged 6 commits into
rust-lang:masterfrom
weihanglo:prerelease-patch
Oct 20, 2026
Merged

epage merged 6 commits into
rust-lang:masterfrom
weihanglo:prerelease-patch

Conversation

@weihanglo

Copy link
Copy Markdown
Member

What does this PR try to resolve?

With -Zprerelease,
use pre-release matching when matching the version requirment
from the [patch] entry's manifest.

cc #13290

Notes to reviewers

I planned to do this when I did #17464.
This is the remaining consumption side that didn't respect locked/selected pre-releases.

I feel like they should be shipped together with #17464 when stabilized, otherwise it is pretty inconsistent.

Also, we don't touch [replace] as its requirement is always exact from [replace] itself.


🤖 LLM involvement: Tests are a mix of LLM generated and hand-tweaked.

With `-Zprerelease`,
use pre-release matching when matching the version requirment
from the `[patch]` entry's manifest.

We don't touch `[replace]`
as its requirement is always exact from `[replace]` itself.
@weihanglo weihanglo added the A-semver Area: semver specifications, version matching, etc. label Oct 20, 2026
@rustbot rustbot added A-configuration Area: cargo config files and env vars A-crate-dependencies Area: [dependencies] of any kind A-documenting-cargo-itself Area: Cargo's documentation A-registries Area: registries S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 20, 2026
@rustbot

rustbot commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

r? @Muscraft

rustbot has assigned @Muscraft.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @Muscraft, @epage, @weihanglo
  • @Muscraft, @epage, @weihanglo expanded to Muscraft, epage, weihanglo
  • Random selection from Muscraft, epage

Comment thread tests/testsuite/precise_pre_release.rs Resolved
Comment on lines +1230 to +1231
assert_e2e().eq(
&p.read_lockfile(),

@epage epage Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside: I wonder if we should add specialized p.assert_file("Cargo.lock", str![]); calls to simplify these patterns

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@epage
epage added this pull request to the merge queue Oct 20, 2026
Merged via the queue into rust-lang:master with commit 15be64a Oct 20, 2026
30 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 20, 2026
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Oct 21, 2026
Update cargo submodule

12 commits in 3960fa69bb617e3d93c4ddc087c1b32bf12ad907..15be64aa0859b5c36f7a86d52f7aa0db44ba4d84
2026-10-12 19:29:05 +0000 to 2026-10-20 16:03:21 +0000
- feat(prerelease): support `[patch]` with `-Zprerelease` (rust-lang/cargo#17613)
- chore(gh): Overhaul PR template (rust-lang/cargo#17612)
- fix(util-schemas): compile out the file-path hint where url can't build it (rust-lang/cargo#17600)
- feat(build-std): Add build.build-std.when and crates config keys (rust-lang/cargo#17602)
- refactor(confg): Create a config abstraction (rust-lang/cargo#17606)
- fix(config): Apply dotted tuple support for rustflags (rust-lang/cargo#17594)
- Feat: Shell completion show all the packages having the feature (rust-lang/cargo#17574)
- fix(config): Don't load registry config from credentials.toml (rust-lang/cargo#17599)
- fix(fingerprint): choose a stable path when source mtimes tie (rust-lang/cargo#17521)
- Update gix crates to address CVE-2026-82248, CVE-2026-82249, and CVE-2026-82250, and update git utils.rs to accommodate gix-url v0.38.0. (rust-lang/cargo#17484)
- fix: check crate type when pruning `-L` paths (rust-lang/cargo#17589)
- refactor(parser): Simplify dep source validation (rust-lang/cargo#17506)

r? ghost
@weihanglo
weihanglo deleted the prerelease-patch branch October 21, 2026 01:03
opensource-fork-sync Bot pushed a commit to cla7aye15I4nd/opensource-rust-lang__cargo that referenced this pull request Oct 21, 2026
### What does this PR try to resolve?

As requested in
<rust-lang#17613 (comment)>

### Notes to reviewers

---

🤖 LLM involvement: This is a trivial test change, so most of them are
LLM assisted except the doc ocmment.
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Oct 22, 2026
Update cargo submodule

12 commits in 3960fa69bb617e3d93c4ddc087c1b32bf12ad907..15be64aa0859b5c36f7a86d52f7aa0db44ba4d84
2026-10-12 19:29:05 +0000 to 2026-10-20 16:03:21 +0000
- feat(prerelease): support `[patch]` with `-Zprerelease` (rust-lang/cargo#17613)
- chore(gh): Overhaul PR template (rust-lang/cargo#17612)
- fix(util-schemas): compile out the file-path hint where url can't build it (rust-lang/cargo#17600)
- feat(build-std): Add build.build-std.when and crates config keys (rust-lang/cargo#17602)
- refactor(confg): Create a config abstraction (rust-lang/cargo#17606)
- fix(config): Apply dotted tuple support for rustflags (rust-lang/cargo#17594)
- Feat: Shell completion show all the packages having the feature (rust-lang/cargo#17574)
- fix(config): Don't load registry config from credentials.toml (rust-lang/cargo#17599)
- fix(fingerprint): choose a stable path when source mtimes tie (rust-lang/cargo#17521)
- Update gix crates to address CVE-2026-82248, CVE-2026-82249, and CVE-2026-82250, and update git utils.rs to accommodate gix-url v0.38.0. (rust-lang/cargo#17484)
- fix: check crate type when pruning `-L` paths (rust-lang/cargo#17589)
- refactor(parser): Simplify dep source validation (rust-lang/cargo#17506)

r? ghost
@rustbot rustbot added this to the 1.101.0 milestone Oct 22, 2026
WhySoBad pushed a commit to WhySoBad/miri that referenced this pull request Oct 23, 2026
Update cargo submodule

12 commits in 3960fa69bb617e3d93c4ddc087c1b32bf12ad907..15be64aa0859b5c36f7a86d52f7aa0db44ba4d84
2026-10-12 19:29:05 +0000 to 2026-10-20 16:03:21 +0000
- feat(prerelease): support `[patch]` with `-Zprerelease` (rust-lang/cargo#17613)
- chore(gh): Overhaul PR template (rust-lang/cargo#17612)
- fix(util-schemas): compile out the file-path hint where url can't build it (rust-lang/cargo#17600)
- feat(build-std): Add build.build-std.when and crates config keys (rust-lang/cargo#17602)
- refactor(confg): Create a config abstraction (rust-lang/cargo#17606)
- fix(config): Apply dotted tuple support for rustflags (rust-lang/cargo#17594)
- Feat: Shell completion show all the packages having the feature (rust-lang/cargo#17574)
- fix(config): Don't load registry config from credentials.toml (rust-lang/cargo#17599)
- fix(fingerprint): choose a stable path when source mtimes tie (rust-lang/cargo#17521)
- Update gix crates to address CVE-2026-82248, CVE-2026-82249, and CVE-2026-82250, and update git utils.rs to accommodate gix-url v0.38.0. (rust-lang/cargo#17484)
- fix: check crate type when pruning `-L` paths (rust-lang/cargo#17589)
- refactor(parser): Simplify dep source validation (rust-lang/cargo#17506)

r? ghost
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Oct 25, 2026
Update cargo submodule

12 commits in 3960fa69bb617e3d93c4ddc087c1b32bf12ad907..15be64aa0859b5c36f7a86d52f7aa0db44ba4d84
2026-10-12 19:29:05 +0000 to 2026-10-20 16:03:21 +0000
- feat(prerelease): support `[patch]` with `-Zprerelease` (rust-lang/cargo#17613)
- chore(gh): Overhaul PR template (rust-lang/cargo#17612)
- fix(util-schemas): compile out the file-path hint where url can't build it (rust-lang/cargo#17600)
- feat(build-std): Add build.build-std.when and crates config keys (rust-lang/cargo#17602)
- refactor(confg): Create a config abstraction (rust-lang/cargo#17606)
- fix(config): Apply dotted tuple support for rustflags (rust-lang/cargo#17594)
- Feat: Shell completion show all the packages having the feature (rust-lang/cargo#17574)
- fix(config): Don't load registry config from credentials.toml (rust-lang/cargo#17599)
- fix(fingerprint): choose a stable path when source mtimes tie (rust-lang/cargo#17521)
- Update gix crates to address CVE-2026-82248, CVE-2026-82249, and CVE-2026-82250, and update git utils.rs to accommodate gix-url v0.38.0. (rust-lang/cargo#17484)
- fix: check crate type when pruning `-L` paths (rust-lang/cargo#17589)
- refactor(parser): Simplify dep source validation (rust-lang/cargo#17506)

r? ghost
github-actions Bot pushed a commit to rust-lang/stdarch that referenced this pull request Oct 26, 2026
Update cargo submodule

12 commits in 3960fa69bb617e3d93c4ddc087c1b32bf12ad907..15be64aa0859b5c36f7a86d52f7aa0db44ba4d84
2026-10-12 19:29:05 +0000 to 2026-10-20 16:03:21 +0000
- feat(prerelease): support `[patch]` with `-Zprerelease` (rust-lang/cargo#17613)
- chore(gh): Overhaul PR template (rust-lang/cargo#17612)
- fix(util-schemas): compile out the file-path hint where url can't build it (rust-lang/cargo#17600)
- feat(build-std): Add build.build-std.when and crates config keys (rust-lang/cargo#17602)
- refactor(confg): Create a config abstraction (rust-lang/cargo#17606)
- fix(config): Apply dotted tuple support for rustflags (rust-lang/cargo#17594)
- Feat: Shell completion show all the packages having the feature (rust-lang/cargo#17574)
- fix(config): Don't load registry config from credentials.toml (rust-lang/cargo#17599)
- fix(fingerprint): choose a stable path when source mtimes tie (rust-lang/cargo#17521)
- Update gix crates to address CVE-2026-82248, CVE-2026-82249, and CVE-2026-82250, and update git utils.rs to accommodate gix-url v0.38.0. (rust-lang/cargo#17484)
- fix: check crate type when pruning `-L` paths (rust-lang/cargo#17589)
- refactor(parser): Simplify dep source validation (rust-lang/cargo#17506)

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

Labels

A-configuration Area: cargo config files and env vars A-crate-dependencies Area: [dependencies] of any kind A-documenting-cargo-itself Area: Cargo's documentation A-registries Area: registries A-semver Area: semver specifications, version matching, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants