@@ -79,7 +79,7 @@ impl<'mir, 'tcx> EvalContextExt<'mir, 'tcx> for crate::MiriEvalContext<'mir, 'tc
79
79
pub trait EvalContextExt < ' mir , ' tcx : ' mir > : crate :: MiriEvalContextExt < ' mir , ' tcx > {
80
80
fn getenv ( & mut self , name_op : OpTy < ' tcx , Tag > ) -> InterpResult < ' tcx , Scalar < Tag > > {
81
81
let this = self . eval_context_mut ( ) ;
82
- let target_os = this. tcx . sess . target . target . target_os . as_str ( ) ;
82
+ let target_os = & this. tcx . sess . target . target . target_os ;
83
83
assert ! ( target_os == "linux" || target_os == "macos" , "`getenv` is only available for the UNIX target family" ) ;
84
84
85
85
let name_ptr = this. read_scalar ( name_op) ?. not_undef ( ) ?;
@@ -179,7 +179,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
179
179
value_op : OpTy < ' tcx , Tag > ,
180
180
) -> InterpResult < ' tcx , i32 > {
181
181
let mut this = self . eval_context_mut ( ) ;
182
- let target_os = this. tcx . sess . target . target . target_os . as_str ( ) ;
182
+ let target_os = & this. tcx . sess . target . target . target_os ;
183
183
assert ! ( target_os == "linux" || target_os == "macos" , "`setenv` is only available for the UNIX target family" ) ;
184
184
185
185
let name_ptr = this. read_scalar ( name_op) ?. not_undef ( ) ?;
@@ -252,7 +252,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
252
252
253
253
fn unsetenv ( & mut self , name_op : OpTy < ' tcx , Tag > ) -> InterpResult < ' tcx , i32 > {
254
254
let this = self . eval_context_mut ( ) ;
255
- let target_os = this. tcx . sess . target . target . target_os . as_str ( ) ;
255
+ let target_os = & this. tcx . sess . target . target . target_os ;
256
256
assert ! ( target_os == "linux" || target_os == "macos" , "`unsetenv` is only available for the UNIX target family" ) ;
257
257
258
258
let name_ptr = this. read_scalar ( name_op) ?. not_undef ( ) ?;
0 commit comments