File tree 3 files changed +6
-4
lines changed
3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ pub fn get_rpath_relative_to_output(os: abi::Os,
133
133
}
134
134
135
135
pub fn get_install_prefix_rpath ( sysroot : & Path , target_triple : & str ) -> ~str {
136
- let install_prefix = env ! ( "CFG_PREFIX" ) ;
136
+ let install_prefix = option_env ! ( "CFG_PREFIX" ) . expect ( "CFG_PREFIX" ) ;
137
137
138
138
let tlib = filesearch:: relative_target_lib_path ( sysroot, target_triple) ;
139
139
let mut path = Path :: new ( install_prefix) ;
@@ -171,7 +171,7 @@ mod test {
171
171
fn test_prefix_rpath ( ) {
172
172
let sysroot = filesearch:: get_or_default_sysroot ( ) ;
173
173
let res = get_install_prefix_rpath ( & sysroot, "triple" ) ;
174
- let mut d = Path :: new ( env ! ( "CFG_PREFIX" ) ) ;
174
+ let mut d = Path :: new ( ( option_env ! ( "CFG_PREFIX" ) ) . expect ( "CFG_PREFIX" ) ) ;
175
175
d. push ( "lib" ) ;
176
176
d. push ( filesearch:: rustlibdir ( ) ) ;
177
177
d. push ( "triple/lib" ) ;
Original file line number Diff line number Diff line change @@ -802,7 +802,8 @@ pub fn host_triple() -> &'static str {
802
802
// Instead of grabbing the host triple (for the current host), we grab (at
803
803
// compile time) the target triple that this rustc is built with and
804
804
// calling that (at runtime) the host triple.
805
- env ! ( "CFG_COMPILER_HOST_TRIPLE" )
805
+ ( option_env ! ( "CFG_COMPILER_HOST_TRIPLE" ) ) .
806
+ expect ( "CFG_COMPILER_HOST_TRIPLE" )
806
807
}
807
808
808
809
pub fn build_session_options ( matches : & getopts:: Matches ) -> session:: Options {
Original file line number Diff line number Diff line change @@ -984,7 +984,8 @@ fn compile_unit_metadata(cx: &CrateContext) {
984
984
} ;
985
985
986
986
debug ! ( "compile_unit_metadata: {:?}" , compile_unit_name) ;
987
- let producer = format ! ( "rustc version {}" , env!( "CFG_VERSION" ) ) ;
987
+ let producer = format ! ( "rustc version {}" ,
988
+ ( option_env!( "CFG_VERSION" ) ) . expect( "CFG_VERSION" ) ) ;
988
989
989
990
compile_unit_name. with_ref ( |compile_unit_name| {
990
991
work_dir. as_vec ( ) . with_c_str ( |work_dir| {
You can’t perform that action at this time.
0 commit comments