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};
22
33use crate :: utils;
44
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+
613static V1_COMMON_COMPONENT_LIST : & [ & str ] = & [ "cargo" , "rustc" , "rust-docs" ] ;
714
815#[ derive( Clone , Debug ) ]
Original file line number Diff line number Diff line change 33
44use std:: fs;
55use std:: io:: Write ;
6+ use std:: path:: PathBuf ;
67
78use rustup:: dist:: TargetTriple ;
89use rustup:: for_host;
@@ -392,17 +393,15 @@ async fn bad_manifest() {
392393 // install some toolchain
393394 cx. config . expect_ok ( & [ "rustup" , "update" , "nightly" ] ) . await ;
394395
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 > ( ) ;
406405
407406 assert ! ( cx. config. rustupdir. has( & path) ) ;
408407 let path = cx. config . rustupdir . join ( & path) ;
You can’t perform that action at this time.
0 commit comments