Skip to content

Update comment about ResolveVersion default version #11095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/cargo/core/resolver/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ pub struct Resolve {
summaries: HashMap<PackageId, Summary>,
}

/// 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.
Expand All @@ -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,
}

Expand Down Expand Up @@ -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.
///
Expand Down