Skip to content

Commit 5d35548

Browse files
committed
helpers.rs cleanup
1 parent 2752d1b commit 5d35548

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/helpers.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -359,25 +359,25 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
359359
/// Helper function used inside the shims of foreign functions to check that isolation is
360360
/// disabled. It returns an error using the `name` of the foreign function if this is not the
361361
/// 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 {
364364
throw_unsup_format!(
365365
"`{}` not available when isolation is enabled. Pass the flag `-Zmiri-disable-isolation` to disable it.",
366-
name
366+
name,
367367
)
368368
}
369369
Ok(())
370370
}
371371
/// Helper function used inside the shims of foreign functions to assert that the target
372372
/// platform is `platform`. It panics showing a message with the `name` of the foreign function
373373
/// 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) {
375375
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(),
377377
platform,
378378
"`{}` is only available on the `{}` platform",
379379
name,
380-
platform
380+
platform,
381381
)
382382
}
383383

@@ -389,8 +389,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
389389
}
390390

391391
/// 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();
394394
let errno_place = this.machine.last_error.unwrap();
395395
this.read_scalar(errno_place.into())?.not_undef()
396396
}

0 commit comments

Comments
 (0)