Skip to content

Commit cd46164

Browse files
committed
Auto merge of #10494 - ehuss:deps-of-doc, r=Eh2406
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.
2 parents 5e09899 + 9b5bc78 commit cd46164

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/cargo/core/compiler/unit_dependencies.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,10 @@ fn deps_of_roots(roots: &[Unit], state: &mut State<'_, '_>) -> CargoResult<()> {
226226
Ok(())
227227
}
228228

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

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

0 commit comments

Comments
 (0)