]> git.lizzy.rs Git - rust.git/blobdiff - src/machine.rs
Fix merge conflicts
[rust.git] / src / machine.rs
index c22b3805d46ba2c12b9560e9db78f70d21b414be..7904e1cc123b359fbc08603f7325c5abbad80b5d 100644 (file)
@@ -91,8 +91,8 @@ pub struct Evaluator<'tcx> {
     pub(crate) argv: Option<Pointer<Tag>>,
     pub(crate) cmd_line: Option<Pointer<Tag>>,
 
-    /// Last OS error.
-    pub(crate) last_error: Option<Pointer<Tag>>,
+    /// Last OS error location in memory. It is a 32-bit integer.
+    pub(crate) last_error: Option<MPlaceTy<'tcx, Tag>>,
 
     /// TLS state.
     pub(crate) tls: TlsData<'tcx>,
@@ -164,7 +164,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
 
     #[inline(always)]
     fn enforce_validity(ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
-        ecx.memory().extra.validate
+        ecx.memory.extra.validate
     }
 
     #[inline(always)]
@@ -244,10 +244,7 @@ fn box_alloc(
         ecx.write_scalar(Scalar::from_uint(align, arg.layout.size), arg)?;
 
         // No more arguments.
-        assert!(
-            args.next().is_none(),
-            "`exchange_malloc` lang item has more arguments than expected"
-        );
+        args.next().expect_none("`exchange_malloc` lang item has more arguments than expected");
         Ok(())
     }
 
@@ -349,7 +346,7 @@ fn retag(
     fn stack_push(
         ecx: &mut InterpCx<'mir, 'tcx, Self>,
     ) -> InterpResult<'tcx, stacked_borrows::CallId> {
-        Ok(ecx.memory().extra.stacked_borrows.borrow_mut().new_call())
+        Ok(ecx.memory.extra.stacked_borrows.borrow_mut().new_call())
     }
 
     #[inline(always)]
@@ -358,7 +355,7 @@ fn stack_pop(
         extra: stacked_borrows::CallId,
     ) -> InterpResult<'tcx> {
         Ok(ecx
-            .memory()
+            .memory
             .extra
             .stacked_borrows
             .borrow_mut()