diff --git a/src/cargo/core/workspace.rs b/src/cargo/core/workspace.rs index 4f28a4efb..57e50ebef 100644 --- a/src/cargo/core/workspace.rs +++ b/src/cargo/core/workspace.rs @@ -306,7 +306,7 @@ impl<'gctx> Workspace<'gctx> { /// This is useful if the workspace has been updated, such as with `cargo /// fix` modifying the `Cargo.toml` file. pub fn reload(&self, gctx: &'gctx GlobalContext) -> CargoResult> { - let mut ws = Workspace::new(self.root_manifest(), gctx)?; + let mut ws = Workspace::new(&self.current_manifest, gctx)?; ws.set_resolve_honors_rust_version(Some(self.resolve_honors_rust_version)); ws.set_resolve_feature_unification(self.resolve_feature_unification); ws.set_requested_lockfile_path(self.requested_lockfile_path.clone()); diff --git a/tests/testsuite/workspaces.rs b/tests/testsuite/workspaces.rs index 64cdbc506..8ae6bc37a 100644 --- a/tests/testsuite/workspaces.rs +++ b/tests/testsuite/workspaces.rs @@ -2719,7 +2719,7 @@ fn nonexistence_package_together_with_workspace() { // A failing case from #[cargo_test] -fn clippy_fix_all_members_in_a_workspace() { +fn fix_only_check_manifest_path_member() { let p = project() .file( "Cargo.toml", @@ -2751,8 +2751,11 @@ fn clippy_fix_all_members_in_a_workspace() { .file("bar/src/main.rs", "fn main() {}") .build(); - p.cargo("clippy --manifest-path foo/Cargo.toml --fix --allow-no-vcs") - .with_stderr_contains("[CHECKING] foo v0.1.0 ([ROOT]/foo/foo)") - .with_stderr_contains("[CHECKING] bar v0.1.0 ([ROOT]/foo/bar)") + p.cargo("fix --manifest-path foo/Cargo.toml --allow-no-vcs") + .with_stderr_data(str![[r#" +[CHECKING] foo v0.1.0 ([ROOT]/foo/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]]) .run(); }