Skip to content

Commit

Permalink
Replace tempdir by tempfile in librustc_trans
Browse files Browse the repository at this point in the history
  • Loading branch information
Eijebong committed Jun 20, 2018
1 parent ae9a271 commit 677eeaa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Cargo.lock
Expand Up @@ -2103,7 +2103,7 @@ dependencies = [
"serialize 0.0.0",
"syntax 0.0.0",
"syntax_pos 0.0.0",
"tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_llvm/Cargo.toml
Expand Up @@ -32,7 +32,7 @@ rustc_mir = { path = "../librustc_mir" }
serialize = { path = "../libserialize" }
syntax = { path = "../libsyntax" }
syntax_pos = { path = "../libsyntax_pos" }
tempdir = "0.3"
tempfile = "3.0"

# not actually used but needed to make sure we enable the same feature set as
# winapi used in librustc
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_codegen_llvm/back/link.rs
Expand Up @@ -28,7 +28,7 @@ use {CodegenResults, CrateInfo};
use rustc::util::common::time;
use rustc::util::fs::fix_windows_verbatim_for_gcc;
use rustc::hir::def_id::CrateNum;
use tempdir::TempDir;
use tempfile::{Builder as TempFileBuilder, TempDir};
use rustc_target::spec::{PanicStrategy, RelroLevel, LinkerFlavor, TargetTriple};
use rustc_data_structures::fx::FxHashSet;
use context::get_reloc_model;
Expand Down Expand Up @@ -321,7 +321,7 @@ fn link_binary_output(sess: &Session,
// final destination, with a `fs::rename` call. In order for the rename to
// always succeed, the temporary file needs to be on the same filesystem,
// which is why we create it inside the output directory specifically.
let metadata_tmpdir = match TempDir::new_in(out_filename.parent().unwrap(), "rmeta") {
let metadata_tmpdir = match TempFileBuilder::new().prefix("rmeta").tempdir_in(out_filename.parent().unwrap()) {
Ok(tmpdir) => tmpdir,
Err(err) => sess.fatal(&format!("couldn't create a temp dir: {}", err)),
};
Expand All @@ -332,7 +332,7 @@ fn link_binary_output(sess: &Session,
out_filenames.push(out_filename);
}

let tmpdir = match TempDir::new("rustc") {
let tmpdir = match TempFileBuilder::new().prefix("rustc").tempdir() {
Ok(tmpdir) => tmpdir,
Err(err) => sess.fatal(&format!("couldn't create a temp dir: {}", err)),
};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_llvm/lib.rs
Expand Up @@ -56,7 +56,7 @@ extern crate syntax_pos;
extern crate rustc_errors as errors;
extern crate serialize;
extern crate cc; // Used to locate MSVC
extern crate tempdir;
extern crate tempfile;

use back::bytecode::RLIB_BYTECODE_EXTENSION;

Expand Down

0 comments on commit 677eeaa

Please sign in to comment.