File tree 2 files changed +7
-7
lines changed
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -541,8 +541,8 @@ impl<'a> Builder<'a> {
541
541
fn run ( self , builder : & Builder ) -> Interned < PathBuf > {
542
542
let compiler = self . compiler ;
543
543
let config = & builder. build . config ;
544
- let lib = if compiler. stage >= 1 && config . libdir_relative ( ) . is_some ( ) {
545
- config. libdir_relative ( ) . unwrap ( )
544
+ let lib = if compiler. stage >= 1 {
545
+ config. libdir_relative ( )
546
546
} else {
547
547
Path :: new ( "lib" )
548
548
} ;
@@ -736,7 +736,7 @@ impl<'a> Builder<'a> {
736
736
. env ( "CFG_VERSION" , self . rust_version ( ) )
737
737
. env ( "CFG_PREFIX" , & self . config . install . prefix ) ;
738
738
739
- let libdir_relative = self . config . libdir_relative ( ) . unwrap_or ( Path :: new ( "lib" ) ) ;
739
+ let libdir_relative = self . config . libdir_relative ( ) ;
740
740
cargo. env ( "CFG_LIBDIR_RELATIVE" , libdir_relative) ;
741
741
742
742
// If we're not building a compiler with debugging information then remove
Original file line number Diff line number Diff line change @@ -572,13 +572,13 @@ impl Config {
572
572
}
573
573
574
574
/// Try to find the relative path of `libdir`.
575
- pub fn libdir_relative ( & self ) -> Option < & Path > {
576
- let libdir = self . install . libdir . as_ref ( ) ? ;
575
+ pub fn libdir_relative ( & self ) -> & Path {
576
+ let libdir = & self . install . libdir ;
577
577
if libdir. is_relative ( ) {
578
- Some ( libdir)
578
+ libdir
579
579
} else {
580
580
// Try to make it relative to the prefix.
581
- libdir. strip_prefix ( self . prefix . as_ref ( ) ? ) . ok ( )
581
+ libdir. strip_prefix ( & self . install . prefix ) . unwrap_or ( Path :: new ( "lib" ) )
582
582
}
583
583
}
584
584
You can’t perform that action at this time.
0 commit comments