Skip to content

Commit

Permalink
fix: use find root to traverse all manifests as a validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustin170506 committed Apr 12, 2024
1 parent 02b2b76 commit f74eabe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cargo/core/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ impl<'gctx> Workspace<'gctx> {
ws.member_ids.insert(id);
ws.default_members.push(ws.current_manifest.clone());
ws.set_resolve_behavior();
// The find_root function is used here to traverse the directory tree and locate the root of the workspace.
// Despite being ephemeral, we still need to validate all the manifests in the workspace,
// which is what `find_root` helps us achieve here.
ws.find_root(ws.current_manifest.clone().as_path())?;
Ok(ws)
}

Expand Down

0 comments on commit f74eabe

Please sign in to comment.