]> git.lizzy.rs Git - rust.git/commitdiff
disable validation code so that it all compiles against current nightly
authorRalf Jung <post@ralfj.de>
Wed, 26 Jul 2017 18:27:40 +0000 (11:27 -0700)
committerRalf Jung <post@ralfj.de>
Wed, 26 Jul 2017 18:27:40 +0000 (11:27 -0700)
src/librustc_mir/interpret/bin/miri.rs
src/librustc_mir/interpret/eval_context.rs
src/librustc_mir/interpret/memory.rs
src/librustc_mir/interpret/step.rs
src/librustc_mir/interpret/validation.rs

index 76a9b3d0e051aa82095bfae0c626203b5204069d..01a4a8656b40fd2c57d69e74d933a02796c6e498 100644 (file)
@@ -202,7 +202,6 @@ fn main() {
 
     // for auxilary builds in unit tests
     args.push("-Zalways-encode-mir".to_owned());
-    args.push("-Zmir-emit-validate".to_owned());
 
     rustc_driver::run_compiler(&args, &mut MiriCompilerCalls(RustcDefaultCalls), None, None);
 }
index 00ceec28074a083ec97d5bfee13d349a1406fcbf..331ae7e248b15e5bdf5f5a84c33d4eb894d369e8 100644 (file)
@@ -31,6 +31,8 @@ pub struct EvalContext<'a, 'tcx: 'a> {
     /// The virtual memory system.
     pub(crate) memory: Memory<'a, 'tcx>,
 
+    #[allow(dead_code)]
+    // FIXME(@RalfJung): validation branch
     /// Lvalues that were suspended by the validation subsystem, and will be recovered later
     pub(crate) suspended: HashMap<DynamicLifetime, Vec<ValidationQuery<'tcx>>>,
 
index be18f7affe3bb9565dd40bbdaaf4c483e6a0b82f..461fced3c6090652f07b561d8d1ba93a0acd05fe 100644 (file)
@@ -31,6 +31,8 @@ pub struct MemoryRange {
     }
 
     impl MemoryRange {
+        #[allow(dead_code)]
+        // FIXME(@RalfJung): validation branch
         pub fn new(offset: u64, len: u64) -> MemoryRange {
             assert!(len > 0);
             MemoryRange {
@@ -55,6 +57,8 @@ pub fn range(offset: u64, len: u64) -> ops::Range<MemoryRange> {
             left..right
         }
 
+        #[allow(dead_code)]
+        // FIXME(@RalfJung): validation branch
         pub fn contained_in(&self, offset: u64, len: u64) -> bool {
             assert!(len > 0);
             offset <= self.start && self.end <= (offset + len)
@@ -135,6 +139,8 @@ fn iter_locks<'a>(&'a self, offset: u64, len: u64) -> impl Iterator<Item=(&'a Me
             .filter(move |&(range, _)| range.overlaps(offset, len))
     }
 
+    #[allow(dead_code)]
+    // FIXME(@RalfJung): validation branch
     fn iter_locks_mut<'a>(&'a mut self, offset: u64, len: u64) -> impl Iterator<Item=(&'a MemoryRange, &'a mut LockInfo)> + 'a {
         self.locks.range_mut(MemoryRange::range(offset, len))
             .filter(move |&(range, _)| range.overlaps(offset, len))
@@ -537,6 +543,8 @@ pub(crate) fn check_locks(&self, ptr: MemoryPointer, len: u64, access: AccessKin
             .map_err(|lock| EvalError::MemoryLockViolation { ptr, len, frame, access, lock })
     }
 
+    #[allow(dead_code)]
+    // FIXME(@RalfJung): validation branch
     /// Acquire the lock for the given lifetime
     pub(crate) fn acquire_lock(&mut self, ptr: MemoryPointer, len: u64, region: Option<CodeExtent>, kind: AccessKind) -> EvalResult<'tcx> {
         use std::collections::btree_map::Entry::*;
@@ -565,6 +573,8 @@ pub(crate) fn acquire_lock(&mut self, ptr: MemoryPointer, len: u64, region: Opti
         Ok(())
     }
 
+    #[allow(dead_code)]
+    // FIXME(@RalfJung): validation branch
     /// Release a write lock prematurely. If there's a read lock or someone else's lock, fail.
     pub(crate) fn release_write_lock(&mut self, ptr: MemoryPointer, len: u64) -> EvalResult<'tcx> {
         assert!(len > 0);
index 4dac10ff24caad4adc89613fa98df485254eed0d..86e123233061b043029524430c99b026e314b990 100644 (file)
@@ -128,15 +128,8 @@ fn statement(&mut self, stmt: &mir::Statement<'tcx>) -> EvalResult<'tcx> {
                 self.deallocate_local(old_val)?;
             }
 
-            // Validity checks.
-            Validate(op, ref lvalues) => {
-                for operand in lvalues {
-                    self.validation_op(op, operand)?;
-                }
-            }
-            EndRegion(ce) => {
-                self.end_region(ce)?;
-            }
+            // NOPs for now.
+            EndRegion(_ce) => {}
 
             // Defined to do nothing. These are added by optimization passes, to avoid changing the
             // size of MIR constantly.
index eb8afa56e4fc24fc6d76fc1f4d6e7fc4b78477c2..4c9e239299dc778c3dd4a858c9e69699388d9711 100644 (file)
@@ -1,6 +1,9 @@
+// code for @RalfJung's validation branch is dead for now
+#![allow(dead_code)]
+
 use rustc::hir::Mutability;
 use rustc::hir::Mutability::*;
-use rustc::mir::{self, ValidationOp, ValidationOperand};
+use rustc::mir;
 use rustc::ty::{self, Ty, TypeFoldable};
 use rustc::ty::subst::Subst;
 use rustc::traits::Reveal;
 use value::{PrimVal, Value};
 use lvalue::{Lvalue, LvalueExtra};
 
+// FIXME remove this once it lands in rustc
+#[derive(Copy, Clone, PartialEq, Eq)]
+pub enum ValidationOp {
+    Acquire,
+    Release,
+    Suspend(CodeExtent),
+}
+
+#[derive(Clone, Debug)]
+pub struct ValidationOperand<'tcx, T> {
+    pub lval: T,
+    pub ty: Ty<'tcx>,
+    pub re: Option<CodeExtent>,
+    pub mutbl: Mutability,
+}
+// FIXME end
+
 pub type ValidationQuery<'tcx> = ValidationOperand<'tcx, Lvalue<'tcx>>;
 
 #[derive(Copy, Clone, Debug)]