# Function cargo::core::compiler::unit_dependencies::artifact_targets_to_unit_deps

source ·

    fn artifact_targets_to_unit_deps(
        parent: &Unit,
        parent_unit_for: UnitFor,
        state: &State<'_, '_>,
        compile_kind: CompileKind,
        artifact_pkg: &Package,
        dep: &Dependency
    ) -> CargoResult<Vec<UnitDep>>

Expand description

Given a `parent` unit containing a dependency `dep` whose package is `artifact_pkg`, find all targets in `artifact_pkg` which refer to the `dep`s artifact declaration and turn them into units. Due to the nature of artifact dependencies, a single dependency in a manifest can cause one or more targets to be build, for instance with `artifact = ["bin:a", "bin:b", "staticlib"]`, which is very different from normal dependencies which cause only a single unit to be created.

`compile_kind` is the computed kind for the future artifact unit dependency, only the caller can pick the correct one.