Skip to content

Commit 7a0001d

Browse files
committed
Use more appropriate basename for the tempdir
1 parent ce02401 commit 7a0001d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cargo/core/compiler/layout.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ impl Layout {
152152
if !root.as_path_unlocked().exists() {
153153
root.create_dir()?;
154154
}
155+
let dest_base = dest;
155156
let dest = root.join(dest);
156157
// If the root directory doesn't already exist go ahead and create it
157158
// here. Use this opportunity to exclude it from backups as well if the
@@ -169,7 +170,7 @@ impl Layout {
169170
// easily sure that rename() will succeed (the new name needs to be on the same mount
170171
// point as the old one).
171172
let tempdir = TempFileBuilder::new()
172-
.prefix("cargo-target")
173+
.prefix(dest_base)
173174
.tempdir_in(root.as_path_unlocked())?;
174175
exclude_from_backups(&tempdir.path());
175176
// Previously std::fs::create_dir_all() (through paths::create_dir_all()) was used

0 commit comments

Comments
 (0)