File tree 1 file changed +8
-0
lines changed
src/tools/compiletest/src
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 1
1
use std:: collections:: HashSet ;
2
2
use std:: env;
3
3
use std:: fs:: File ;
4
+ use std:: fs:: canonicalize;
4
5
use std:: io:: prelude:: * ;
5
6
use std:: io:: BufReader ;
6
7
use std:: path:: { Path , PathBuf } ;
@@ -795,6 +796,7 @@ fn expand_variables(mut value: String, config: &Config) -> String {
795
796
const CWD : & str = "{{cwd}}" ;
796
797
const SRC_BASE : & str = "{{src-base}}" ;
797
798
const BUILD_BASE : & str = "{{build-base}}" ;
799
+ const RUST_SRC_BASE : & str = "{{rust-src-base}}" ;
798
800
799
801
if value. contains ( CWD ) {
800
802
let cwd = env:: current_dir ( ) . unwrap ( ) ;
@@ -809,6 +811,12 @@ fn expand_variables(mut value: String, config: &Config) -> String {
809
811
value = value. replace ( BUILD_BASE , & config. build_base . to_string_lossy ( ) ) ;
810
812
}
811
813
814
+ if value. contains ( RUST_SRC_BASE ) {
815
+ let src = config. sysroot_base . join ( "lib/rustlib/src/rust" ) ;
816
+ let canonical = canonicalize ( & src) . unwrap ( ) ;
817
+ value = value. replace ( RUST_SRC_BASE , & canonical. to_string_lossy ( ) ) ;
818
+ }
819
+
812
820
value
813
821
}
814
822
You can’t perform that action at this time.
0 commit comments