File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -103,8 +103,15 @@ fn replace_root(s: &mut String, direction: bool) {
103
103
}
104
104
105
105
fn replace_fake_sys_root ( s : & mut String ) {
106
- let root = get_test_path ( "fake-sysroot" ) ;
107
- * s = s. replace ( root. to_str ( ) . expect ( "expected str" ) , "$FAKESYSROOT$" )
106
+ let fake_sysroot_path = get_test_path ( "fake-sysroot" ) ;
107
+ let fake_sysroot_path = if cfg ! ( windows) {
108
+ let normalized_path =
109
+ fake_sysroot_path. to_str ( ) . expect ( "expected str" ) . replace ( r#"\"# , r#"\\"# ) ;
110
+ format ! ( r#"{}\\"# , normalized_path)
111
+ } else {
112
+ format ! ( "{}/" , fake_sysroot_path. to_str( ) . expect( "expected str" ) )
113
+ } ;
114
+ * s = s. replace ( & fake_sysroot_path, "$FAKESYSROOT$" )
108
115
}
109
116
110
117
fn get_test_path ( file : & str ) -> PathBuf {
You can’t perform that action at this time.
0 commit comments