From f0604ae918c4441bcd0b33b1ed5e1d20883befeb Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 17 Mar 2023 02:10:24 -0500 Subject: [PATCH] docs(contrib): Move some lower resolver details from ops to core --- src/cargo/core/resolver/mod.rs | 11 +++++++++++ src/cargo/ops/resolve.rs | 12 ------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/cargo/core/resolver/mod.rs b/src/cargo/core/resolver/mod.rs index ee848ac51eaf..b9c29fb872b6 100644 --- a/src/cargo/core/resolver/mod.rs +++ b/src/cargo/core/resolver/mod.rs @@ -37,6 +37,17 @@ //! everything to bail out immediately and return success, and only if *nothing* //! works do we actually return an error up the stack. //! +//! Resolution is currently performed twice +//! 1. With all features enabled (this is what gets saved to `Cargo.lock`) +//! 2. With only the specific features the user selected on the command-line. Ideally this +//! run will get removed in the future when transitioning to the new feature resolver. +//! +//! A new feature-specific resolver was added in 2020 which adds more sophisticated feature +//! resolution. It is located in the [`features`] module. The original dependency resolver still +//! performs feature unification, as it can help reduce the dependencies it has to consider during +//! resolution (rather than assuming every optional dependency of every package is enabled). +//! Checking if a feature is enabled must go through the new feature resolver. +//! //! ## Performance //! //! Note that this is a relatively performance-critical portion of Cargo. The diff --git a/src/cargo/ops/resolve.rs b/src/cargo/ops/resolve.rs index 0cd1191dc56b..ea5eded4aa2c 100644 --- a/src/cargo/ops/resolve.rs +++ b/src/cargo/ops/resolve.rs @@ -12,18 +12,6 @@ //! - [`resolve_with_previous`]: A low-level function for running the resolver, //! providing the most power and flexibility. //! -//! Resolution is currently performed twice -//! 1. With all features enabled (this is what gets saved to `Cargo.lock`) -//! 2. With only the specific features the user selected on the command-line. Ideally this -//! run will get removed in the future when transitioning to the new feature resolver. -//! -//! A new feature-specific resolver was added in 2020 which adds more sophisticated feature -//! resolution. It is located in the [`crate::core::resolver::features`] module. The original -//! dependency resolver still performs feature unification, as it can help reduce the dependencies -//! it has to consider during resolution (rather than assuming every optional dependency of every -//! package is enabled). Checking if a feature is enabled must go through the new feature -//! resolver. -//! //! ### Data Structures //! //! - [`Workspace`]: