]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/interpret/memory.rs
make LockInfo non-Copy
[rust.git] / src / librustc_mir / interpret / memory.rs
index 36fb69cbe5bc73f3754206bd5dcf35f1b1556db8..88e5ebe556f4c35e1b047dd1638864c1ef87108f 100644 (file)
@@ -96,7 +96,7 @@ enum LockStatus {
 }
 
 /// Information about a lock that is or will be held.
-#[derive(Copy, Clone, Debug)]
+#[derive(Clone, Debug)]
 pub struct LockInfo {
     kind: AccessKind,
     lifetime: DynamicLifetime,
@@ -168,7 +168,7 @@ fn check_locks<'tcx>(&self, frame: usize, offset: u64, len: u64, access: AccessK
         for lock in self.iter_locks(offset, len) {
             // Check if the lock is active, and is in conflict with the access.
             if lock.status == LockStatus::Held && !lock.access_permitted(frame, access) {
-                return Err(*lock);
+                return Err(lock.clone());
             }
         }
         Ok(())