File tree 3 files changed +22
-11
lines changed
parallel-rustc-no-overwrite
3 files changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,6 @@ run-make/invalid-library/Makefile
79
79
run-make/invalid-so/Makefile
80
80
run-make/invalid-staticlib/Makefile
81
81
run-make/issue-107094/Makefile
82
- run-make/issue-10971-temps-dir/Makefile
83
82
run-make/issue-109934-lto-debuginfo/Makefile
84
83
run-make/issue-14698/Makefile
85
84
run-make/issue-15460/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ // When two instances of rustc are invoked in parallel, they
2
+ // can conflict on their temporary files and overwrite each others',
3
+ // leading to unsuccessful compilation. The -Z temps-dir flag adds
4
+ // separate designated directories for each rustc invocation, preventing
5
+ // conflicts. This test uses this flag and checks for successful compilation.
6
+ // See https://github.com/rust-lang/rust/pull/83846
7
+
8
+ use run_make_support:: { fs_wrapper, rustc} ;
9
+ use std:: thread;
10
+
11
+ fn main ( ) {
12
+ fs_wrapper:: create_file ( "lib.rs" ) ;
13
+ let handle1 = thread:: spawn ( move || {
14
+ rustc ( ) . crate_type ( "lib" ) . arg ( "-Ztemps-dir=temp1" ) . input ( "lib.rs" ) ;
15
+ } ) ;
16
+
17
+ let handle2 = thread:: spawn ( move || {
18
+ rustc ( ) . crate_type ( "staticlib" ) . arg ( "-Ztemps-dir=temp2" ) . input ( "lib.rs" ) ;
19
+ } ) ;
20
+ handle1. join ( ) . expect ( "lib thread panicked" ) ;
21
+ handle2. join ( ) . expect ( "staticlib thread panicked" ) ;
22
+ }
You can’t perform that action at this time.
0 commit comments