diff --git a/crates/cargo-util/src/paths.rs b/crates/cargo-util/src/paths.rs index bf3ca3f8288..f405c8f9742 100644 --- a/crates/cargo-util/src/paths.rs +++ b/crates/cargo-util/src/paths.rs @@ -694,7 +694,8 @@ pub fn create_dir_all_excluded_from_backups_atomic(p: impl AsRef) -> Resul // we can infer from it's another cargo process doing work. if let Err(e) = fs::rename(tempdir.path(), path) { if !path.exists() { - return Err(anyhow::Error::from(e)); + return Err(anyhow::Error::from(e)) + .with_context(|| format!("failed to create directory `{}`", path.display())); } } Ok(())