From abf2bb499ee9c38d8e1c8fac086087b1608b39ea Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 29 Jul 2019 10:30:53 -0700 Subject: [PATCH] Further explain unused_patches. --- src/cargo/core/resolver/resolve.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cargo/core/resolver/resolve.rs b/src/cargo/core/resolver/resolve.rs index 17eccb5a981..9ced48f4d67 100644 --- a/src/cargo/core/resolver/resolve.rs +++ b/src/cargo/core/resolver/resolve.rs @@ -42,9 +42,10 @@ pub struct Resolve { /// forwards compatibility. metadata: Metadata, /// `[patch]` entries that did not match anything, preserved in - /// `Cargo.lock` as the `[[patch.unused]]` table array. - /// TODO: *Why* is this kept in `Cargo.lock`? Removing it doesn't seem to - /// affect anything. + /// `Cargo.lock` as the `[[patch.unused]]` table array. Tracking unused + /// patches helps prevent Cargo from being forced to re-update the + /// registry every time it runs, and keeps the resolve in a locked state + /// so it doesn't re-resolve the unused entries. unused_patches: Vec, /// A map from packages to a set of their public dependencies public_dependencies: HashMap>,