Skip to content

Commit

Permalink
Auto merge of #10494 - ehuss:deps-of-doc, r=Eh2406
Browse files Browse the repository at this point in the history
Update doc string for deps_of/compute_deps.

I noticed the `compute_deps` doc string was outdated due to some recent refactorings.  This updates the doc comments to try to clarify them and make them more accurate.
  • Loading branch information
bors committed Mar 21, 2022
2 parents 5e09899 + 9b5bc78 commit cd46164
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/cargo/core/compiler/unit_dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,10 @@ fn deps_of_roots(roots: &[Unit], state: &mut State<'_, '_>) -> CargoResult<()> {
Ok(())
}

/// Compute the dependencies of a single unit.
/// Compute the dependencies of a single unit, recursively computing all
/// transitive dependencies.
///
/// The result is stored in `state.unit_dependencies`.
fn deps_of(unit: &Unit, state: &mut State<'_, '_>, unit_for: UnitFor) -> CargoResult<()> {
// Currently the `unit_dependencies` map does not include `unit_for`. This should
// be safe for now. `TestDependency` only exists to clear the `panic`
Expand All @@ -246,10 +249,7 @@ fn deps_of(unit: &Unit, state: &mut State<'_, '_>, unit_for: UnitFor) -> CargoRe
Ok(())
}

/// For a package, returns all targets that are registered as dependencies
/// for that package.
/// This returns a `Vec` of `(Unit, UnitFor)` pairs. The `UnitFor`
/// is the profile type that should be used for dependencies of the unit.
/// Returns the direct unit dependencies for the given `Unit`.
fn compute_deps(
unit: &Unit,
state: &mut State<'_, '_>,
Expand Down

0 comments on commit cd46164

Please sign in to comment.