Skip to content

Commit abf2bb4

Browse files
committed
Further explain unused_patches.
1 parent e26ef01 commit abf2bb4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/cargo/core/resolver/resolve.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ pub struct Resolve {
4242
/// forwards compatibility.
4343
metadata: Metadata,
4444
/// `[patch]` entries that did not match anything, preserved in
45-
/// `Cargo.lock` as the `[[patch.unused]]` table array.
46-
/// TODO: *Why* is this kept in `Cargo.lock`? Removing it doesn't seem to
47-
/// affect anything.
45+
/// `Cargo.lock` as the `[[patch.unused]]` table array. Tracking unused
46+
/// patches helps prevent Cargo from being forced to re-update the
47+
/// registry every time it runs, and keeps the resolve in a locked state
48+
/// so it doesn't re-resolve the unused entries.
4849
unused_patches: Vec<PackageId>,
4950
/// A map from packages to a set of their public dependencies
5051
public_dependencies: HashMap<PackageId, HashSet<PackageId>>,

0 commit comments

Comments
 (0)