diff --git a/src/cargo/ops/lockfile.rs b/src/cargo/ops/lockfile.rs index 6f655b8c309..91eb0b4d81e 100644 --- a/src/cargo/ops/lockfile.rs +++ b/src/cargo/ops/lockfile.rs @@ -84,8 +84,9 @@ pub fn write_pkg_lockfile(ws: &Workspace, resolve: &Resolve) -> CargoResult<()> "--frozen" }; bail!( - "the lock file needs to be updated but {} was passed to \ + "the lock file {} needs to be updated but {} was passed to \ prevent this", + ws.root().to_path_buf().join("Cargo.lock").display(), flag ); } diff --git a/tests/testsuite/lockfile_compat.rs b/tests/testsuite/lockfile_compat.rs index 218144a421f..a4adcdc8303 100644 --- a/tests/testsuite/lockfile_compat.rs +++ b/tests/testsuite/lockfile_compat.rs @@ -480,7 +480,7 @@ fn locked_correct_error() { .with_stderr( "\ [UPDATING] `[..]` index -error: the lock file needs to be updated but --locked was passed to prevent this +error: the lock file [CWD]/Cargo.lock needs to be updated but --locked was passed to prevent this ", ).run(); }