refactor: make resolve_with_previous clearer#13727
Merged
bors merged 4 commits intorust-lang:masterfrom Apr 10, 2024
Merged
Conversation
Collaborator
epage
reviewed
Apr 10, 2024
src/cargo/ops/resolve.rs
Outdated
|
|
||
| let keep = |p: &PackageId| pre_patch_keep(p) && !avoid_patch_ids.contains(p); | ||
| // Refine `keep` with patches that should avoid locking. | ||
| let keep = |p: &PackageId| keep(p) && !avoid_patch_ids.contains(p); |
Contributor
There was a problem hiding this comment.
While I'm normally a fan of shadowing, I feel like decorating a closure with another closure is likely going to make this easy to miss which could make reading the code confusing
Contributor
|
@bors r+ |
Contributor
Contributor
Contributor
|
☀️ Test successful - checks-actions |
1 similar comment
Contributor
|
☀️ Test successful - checks-actions |
Contributor
|
👀 Test was successful, but fast-forwarding failed: 422 Changes must be made through a pull request. |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 10, 2024
Update cargo 11 commits in 28e7b2bc0a812f90126be30f48a00a4ada990eaa..74fd5bc730b828dbc956335b229ac34ba47f7ef7 2024-04-05 19:31:01 +0000 to 2024-04-10 18:40:49 +0000 - chore: downgrade to openssl v1.1.1 (again) (rust-lang/cargo#13731) - fix(cargo-fix): dont apply same suggestion twice (rust-lang/cargo#13728) - refactor: make `resolve_with_previous` clearer (rust-lang/cargo#13727) - fix(package): Normalize paths in `Cargo.toml` (rust-lang/cargo#13729) - refactor: Track when MSRV is explicitly set, either way (rust-lang/cargo#13732) - [fix]:Build script not rerun when target rustflags change (rust-lang/cargo#13560) - feat(add): Stabilize MSRV-aware version req selection (rust-lang/cargo#13608) - Fix github fast path redirect. (rust-lang/cargo#13718) - Add release notes for 1.77.1 (rust-lang/cargo#13717) - doc(semver): remove mention of deprecated tool rust-semverver (rust-lang/cargo#13715) - chore: fix some typos (rust-lang/cargo#13714) r? ghost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR try to resolve?
Added more comments and extract patch registration to a function from
resolve_with_previous, so we'll have bothregister_previous_lockandregister_patch_entrieslooking symmetrical.How should we test and review this PR?
There should have no behavior change.
The construction of
pre_patch_keepclosure is moved intocargo updatemodule, since it is the only place using the closure, and I can't foresee anything will use it.Additional information