diff --git a/src/cargo/core/resolver/resolve.rs b/src/cargo/core/resolver/resolve.rs index 90a33f0ea75..221fbeec6fc 100644 --- a/src/cargo/core/resolver/resolve.rs +++ b/src/cargo/core/resolver/resolve.rs @@ -46,9 +46,11 @@ pub struct Resolve { summaries: HashMap, } -/// A version to indicate how a `Cargo.lock` should be serialized. Currently -/// V2 is the default when creating a new lockfile. If a V1 lockfile already -/// exists, it will stay as V1. +/// A version to indicate how a `Cargo.lock` should be serialized. +/// +/// When creating a new lockfile, the default version defined in +/// [`ResolveVersion::default`] is used. +/// If an old version of lockfile already exists, it will stay as-is. /// /// It's theorized that we can add more here over time to track larger changes /// to the `Cargo.lock` format, but we've yet to see how that strategy pans out. @@ -59,12 +61,13 @@ pub enum ResolveVersion { /// A more compact format, more amenable to avoiding source-control merge /// conflicts. The `dependencies` arrays are compressed and checksums are /// listed inline. Introduced in 2019 in version 1.38. New lockfiles use - /// V2 by default starting in 1.41. + /// V2 by default from 1.41 to 1.52. V2, /// A format that explicitly lists a `version` at the top of the file as /// well as changing how git dependencies are encoded. Dependencies with /// `branch = "master"` are no longer encoded the same way as those without - /// branch specifiers. + /// branch specifiers. Introduced in 2020 in version 1.47. New lockfiles use + /// V3 by default staring in 1.53. V3, } @@ -395,7 +398,7 @@ impl fmt::Debug for Resolve { impl Default for ResolveVersion { /// The default way to encode new or updated `Cargo.lock` files. /// - /// It's important that if a new version of `ResolveVersion` is added that + /// It's important that if a new version of [`ResolveVersion`] is added that /// this is not updated until *at least* the support for the version is in /// the stable release of Rust. ///