@@ -28,7 +28,7 @@ use {CodegenResults, CrateInfo};
28
28
use rustc:: util:: common:: time;
29
29
use rustc:: util:: fs:: fix_windows_verbatim_for_gcc;
30
30
use rustc:: hir:: def_id:: CrateNum ;
31
- use tempdir :: TempDir ;
31
+ use tempfile :: { Builder as TempFileBuilder , TempDir } ;
32
32
use rustc_target:: spec:: { PanicStrategy , RelroLevel , LinkerFlavor , TargetTriple } ;
33
33
use rustc_data_structures:: fx:: FxHashSet ;
34
34
use context:: get_reloc_model;
@@ -321,7 +321,7 @@ fn link_binary_output(sess: &Session,
321
321
// final destination, with a `fs::rename` call. In order for the rename to
322
322
// always succeed, the temporary file needs to be on the same filesystem,
323
323
// 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 ( ) ) {
325
325
Ok ( tmpdir) => tmpdir,
326
326
Err ( err) => sess. fatal ( & format ! ( "couldn't create a temp dir: {}" , err) ) ,
327
327
} ;
@@ -332,7 +332,7 @@ fn link_binary_output(sess: &Session,
332
332
out_filenames. push ( out_filename) ;
333
333
}
334
334
335
- let tmpdir = match TempDir :: new ( "rustc" ) {
335
+ let tmpdir = match TempFileBuilder :: new ( ) . prefix ( "rustc" ) . tempdir ( ) {
336
336
Ok ( tmpdir) => tmpdir,
337
337
Err ( err) => sess. fatal ( & format ! ( "couldn't create a temp dir: {}" , err) ) ,
338
338
} ;
0 commit comments