Skip to content

Commit 677eeaa

Browse files
committed
Replace tempdir by tempfile in librustc_trans
1 parent ae9a271 commit 677eeaa

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/Cargo.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -2103,7 +2103,7 @@ dependencies = [
21032103
"serialize 0.0.0",
21042104
"syntax 0.0.0",
21052105
"syntax_pos 0.0.0",
2106-
"tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
2106+
"tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
21072107
]
21082108

21092109
[[package]]

src/librustc_codegen_llvm/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ rustc_mir = { path = "../librustc_mir" }
3232
serialize = { path = "../libserialize" }
3333
syntax = { path = "../libsyntax" }
3434
syntax_pos = { path = "../libsyntax_pos" }
35-
tempdir = "0.3"
35+
tempfile = "3.0"
3636

3737
# not actually used but needed to make sure we enable the same feature set as
3838
# winapi used in librustc

src/librustc_codegen_llvm/back/link.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use {CodegenResults, CrateInfo};
2828
use rustc::util::common::time;
2929
use rustc::util::fs::fix_windows_verbatim_for_gcc;
3030
use rustc::hir::def_id::CrateNum;
31-
use tempdir::TempDir;
31+
use tempfile::{Builder as TempFileBuilder, TempDir};
3232
use rustc_target::spec::{PanicStrategy, RelroLevel, LinkerFlavor, TargetTriple};
3333
use rustc_data_structures::fx::FxHashSet;
3434
use context::get_reloc_model;
@@ -321,7 +321,7 @@ fn link_binary_output(sess: &Session,
321321
// final destination, with a `fs::rename` call. In order for the rename to
322322
// always succeed, the temporary file needs to be on the same filesystem,
323323
// which is why we create it inside the output directory specifically.
324-
let metadata_tmpdir = match TempDir::new_in(out_filename.parent().unwrap(), "rmeta") {
324+
let metadata_tmpdir = match TempFileBuilder::new().prefix("rmeta").tempdir_in(out_filename.parent().unwrap()) {
325325
Ok(tmpdir) => tmpdir,
326326
Err(err) => sess.fatal(&format!("couldn't create a temp dir: {}", err)),
327327
};
@@ -332,7 +332,7 @@ fn link_binary_output(sess: &Session,
332332
out_filenames.push(out_filename);
333333
}
334334

335-
let tmpdir = match TempDir::new("rustc") {
335+
let tmpdir = match TempFileBuilder::new().prefix("rustc").tempdir() {
336336
Ok(tmpdir) => tmpdir,
337337
Err(err) => sess.fatal(&format!("couldn't create a temp dir: {}", err)),
338338
};

src/librustc_codegen_llvm/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ extern crate syntax_pos;
5656
extern crate rustc_errors as errors;
5757
extern crate serialize;
5858
extern crate cc; // Used to locate MSVC
59-
extern crate tempdir;
59+
extern crate tempfile;
6060

6161
use back::bytecode::RLIB_BYTECODE_EXTENSION;
6262

0 commit comments

Comments
 (0)