@@ -359,25 +359,25 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
359
359
/// Helper function used inside the shims of foreign functions to check that isolation is
360
360
/// disabled. It returns an error using the `name` of the foreign function if this is not the
361
361
/// case.
362
- fn check_no_isolation ( & mut self , name : & str ) -> InterpResult < ' tcx > {
363
- if !self . eval_context_mut ( ) . machine . communicate {
362
+ fn check_no_isolation ( & self , name : & str ) -> InterpResult < ' tcx > {
363
+ if !self . eval_context_ref ( ) . machine . communicate {
364
364
throw_unsup_format ! (
365
365
"`{}` not available when isolation is enabled. Pass the flag `-Zmiri-disable-isolation` to disable it." ,
366
- name
366
+ name,
367
367
)
368
368
}
369
369
Ok ( ( ) )
370
370
}
371
371
/// Helper function used inside the shims of foreign functions to assert that the target
372
372
/// platform is `platform`. It panics showing a message with the `name` of the foreign function
373
373
/// if this is not the case.
374
- fn assert_platform ( & mut self , platform : & str , name : & str ) {
374
+ fn assert_platform ( & self , platform : & str , name : & str ) {
375
375
assert_eq ! (
376
- self . eval_context_mut ( ) . tcx. sess. target. target. target_os. to_lowercase( ) ,
376
+ self . eval_context_ref ( ) . tcx. sess. target. target. target_os. to_lowercase( ) ,
377
377
platform,
378
378
"`{}` is only available on the `{}` platform" ,
379
379
name,
380
- platform
380
+ platform,
381
381
)
382
382
}
383
383
@@ -389,8 +389,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
389
389
}
390
390
391
391
/// Gets the last error variable.
392
- fn get_last_error ( & mut self ) -> InterpResult < ' tcx , Scalar < Tag > > {
393
- let this = self . eval_context_mut ( ) ;
392
+ fn get_last_error ( & self ) -> InterpResult < ' tcx , Scalar < Tag > > {
393
+ let this = self . eval_context_ref ( ) ;
394
394
let errno_place = this. machine . last_error . unwrap ( ) ;
395
395
this. read_scalar ( errno_place. into ( ) ) ?. not_undef ( )
396
396
}
0 commit comments