File tree Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,14 @@ use std::path::{Path, PathBuf};
2
2
3
3
use crate :: utils;
4
4
5
- const REL_MANIFEST_DIR : & str = "lib/rustlib" ;
5
+ /// The relative path to the manifest directory in a Rust installation,
6
+ /// with path components separated by [`std::path::MAIN_SEPARATOR`].
7
+ const REL_MANIFEST_DIR : & str = match std:: path:: MAIN_SEPARATOR {
8
+ '/' => "lib/rustlib" ,
9
+ '\\' => r"lib\rustlib" ,
10
+ _ => panic ! ( "unknown `std::path::MAIN_SEPARATOR`" ) ,
11
+ } ;
12
+
6
13
static V1_COMMON_COMPONENT_LIST : & [ & str ] = & [ "cargo" , "rustc" , "rust-docs" ] ;
7
14
8
15
#[ derive( Clone , Debug ) ]
Original file line number Diff line number Diff line change 3
3
4
4
use std:: fs;
5
5
use std:: io:: Write ;
6
+ use std:: path:: PathBuf ;
6
7
7
8
use rustup:: dist:: TargetTriple ;
8
9
use rustup:: for_host;
@@ -392,17 +393,15 @@ async fn bad_manifest() {
392
393
// install some toolchain
393
394
cx. config . expect_ok ( & [ "rustup" , "update" , "nightly" ] ) . await ;
394
395
395
- #[ cfg( not( target_os = "windows" ) ) ]
396
- let path = format ! (
397
- "toolchains/nightly-{}/lib/rustlib/multirust-channel-manifest.toml" ,
398
- this_host_triple( ) ,
399
- ) ;
400
-
401
- #[ cfg( target_os = "windows" ) ]
402
- let path = format ! (
403
- r"toolchains\nightly-{}\lib/rustlib\multirust-channel-manifest.toml" ,
404
- this_host_triple( ) ,
405
- ) ;
396
+ let path = [
397
+ "toolchains" ,
398
+ for_host ! ( "nightly-{}" ) ,
399
+ "lib" ,
400
+ "rustlib" ,
401
+ "multirust-channel-manifest.toml" ,
402
+ ]
403
+ . into_iter ( )
404
+ . collect :: < PathBuf > ( ) ;
406
405
407
406
assert ! ( cx. config. rustupdir. has( & path) ) ;
408
407
let path = cx. config . rustupdir . join ( & path) ;
You can’t perform that action at this time.
0 commit comments