[][src]Function cargo::core::resolver::resolve

pub fn resolve(
    summaries: &[(Summary, Method)],
    replacements: &[(PackageIdSpec, Dependency)],
    registry: &mut dyn Registry,
    try_to_use: &HashSet<PackageId>,
    config: Option<&Config>,
    print_warnings: bool
) -> CargoResult<Resolve>

Builds the list of all packages required to build the first argument.

  • summaries - the list of package summaries along with how to resolve their features. This is a list of all top-level packages that are intended to be part of the lock file (resolve output). These typically are a list of all workspace members.

  • replacements - this is a list of [replace] directives found in the root of the workspace. The list here is a PackageIdSpec of what to replace and a Dependency to replace that with. In general it's not recommended to use [replace] any more and use [patch] instead, which is supported elsewhere.

  • registry - this is the source from which all package summaries are loaded. It's expected that this is extensively configured ahead of time and is idempotent with our requests to it (aka returns the same results for the same query every time). Typically this is an instance of a PackageRegistry.

  • try_to_use - this is a list of package ids which were previously found in the lock file. We heuristically prefer the ids listed in try_to_use when sorting candidates to activate, but otherwise this isn't used anywhere else.

  • config - a location to print warnings and such, or None if no warnings should be printed

  • print_warnings - whether or not to print backwards-compatibility warnings and such