File tree 2 files changed +6
-11
lines changed
src/tools/compiletest/src
2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -1146,11 +1146,9 @@ fn expand_variables(mut value: String, config: &Config) -> String {
1146
1146
}
1147
1147
1148
1148
if value. contains ( RUST_SRC_BASE ) {
1149
- let src_base = config
1150
- . sysroot_base
1151
- . join ( "lib/rustlib/src/rust" )
1152
- . read_link ( )
1153
- . expect ( "lib/rustlib/src/rust in target is a symlink to checkout root" ) ;
1149
+ let src_base = config. sysroot_base . join ( "lib/rustlib/src/rust" ) ;
1150
+ src_base. try_exists ( ) . expect ( & * format ! ( "{} should exists" , src_base. display( ) ) ) ;
1151
+ let src_base = src_base. read_link ( ) . unwrap_or ( src_base) ;
1154
1152
value = value. replace ( RUST_SRC_BASE , & src_base. to_string_lossy ( ) ) ;
1155
1153
}
1156
1154
Original file line number Diff line number Diff line change @@ -2311,12 +2311,9 @@ impl<'test> TestCx<'test> {
2311
2311
normalize_path ( parent_build_dir, "$BUILD_DIR" ) ;
2312
2312
2313
2313
// Real paths into the libstd/libcore
2314
- let rust_src_dir = & self
2315
- . config
2316
- . sysroot_base
2317
- . join ( "lib/rustlib/src/rust" )
2318
- . read_link ( )
2319
- . expect ( "lib/rustlib/src/rust in target is a symlink to checkout root" ) ;
2314
+ let rust_src_dir = & self . config . sysroot_base . join ( "lib/rustlib/src/rust" ) ;
2315
+ rust_src_dir. try_exists ( ) . expect ( & * format ! ( "{} should exists" , rust_src_dir. display( ) ) ) ;
2316
+ let rust_src_dir = rust_src_dir. read_link ( ) . unwrap_or ( rust_src_dir. to_path_buf ( ) ) ;
2320
2317
normalize_path ( & rust_src_dir. join ( "library" ) , "$SRC_DIR_REAL" ) ;
2321
2318
2322
2319
if json {
You can’t perform that action at this time.
0 commit comments