about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@mozilla.com>2014-06-07 02:20:44 -0700
committerCameron Zwarich <zwarich@mozilla.com>2014-06-07 02:31:01 -0700
commit8a543ffc76eea08db59cffbd6f8be7926bdb78c2 (patch)
tree4ca5e5706528283a98ce1d48a81343f359fa4816 /src
parent53198ffda6cb39721afab0fc35941b4379ecae1f (diff)
downloadrust-8a543ffc76eea08db59cffbd6f8be7926bdb78c2.tar.gz
rust-8a543ffc76eea08db59cffbd6f8be7926bdb78c2.zip
Make borrowck test functions better match their names
A number of borrowck field-sensitivity tests perform more moves and
copies than their naming scheme would indicate. This is only necessary
for borrowed pointers (to ensure that the borrowws stay alive in the
near future when borrow liveness is tracked), but all other test
functions should be changed to match their name more closely.
Diffstat (limited to 'src')
-rw-r--r--src/test/run-pass/borrowck-field-sensitivity.rs26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/test/run-pass/borrowck-field-sensitivity.rs b/src/test/run-pass/borrowck-field-sensitivity.rs
index 9baa9ca7c6b..202df70f5d2 100644
--- a/src/test/run-pass/borrowck-field-sensitivity.rs
+++ b/src/test/run-pass/borrowck-field-sensitivity.rs
@@ -28,15 +28,13 @@ fn move_after_fu_copy() {
 fn fu_move_after_copy() {
     let x = A { a: 1, b: box 2 };
     drop(x.a);
-    let y = A { a: 3, .. x };
-    drop(y.b);
+    let _y = A { a: 3, .. x };
 }
 
 fn fu_move_after_fu_copy() {
     let x = A { a: 1, b: box 2 };
     let _y = A { b: box 3, .. x };
-    let z = A { a: 4, .. x };
-    drop(z.b);
+    let _z = A { a: 4, .. x };
 }
 
 fn copy_after_move() {
@@ -49,7 +47,6 @@ fn copy_after_fu_move() {
     let x = A { a: 1, b: box 2 };
     let y = A { a: 3, .. x };
     drop(x.a);
-    drop(y.b);
 }
 
 fn fu_copy_after_move() {
@@ -60,9 +57,8 @@ fn fu_copy_after_move() {
 
 fn fu_copy_after_fu_move() {
     let x = A { a: 1, b: box 2 };
-    let y = A { a: 3, .. x };
+    let _y = A { a: 3, .. x };
     let _z = A { b: box 3, .. x };
-    drop(y.b);
 }
 
 fn borrow_after_move() {
@@ -73,9 +69,8 @@ fn borrow_after_move() {
 
 fn borrow_after_fu_move() {
     let x = A { a: 1, b: box 2 };
-    let y = A { a: 3, .. x };
+    let _y = A { a: 3, .. x };
     borrow(&x.a);
-    drop(y.b);
 }
 
 fn move_after_borrow() {
@@ -87,8 +82,7 @@ fn move_after_borrow() {
 fn fu_move_after_borrow() {
     let x = A { a: 1, b: box 2 };
     borrow(&x.a);
-    let y = A { a: 3, .. x };
-    drop(y.b);
+    let _y = A { a: 3, .. x };
 }
 
 fn mut_borrow_after_mut_borrow() {
@@ -109,7 +103,6 @@ fn move_after_fu_move() {
     let x = B { a: box 1, b: box 2 };
     let y = B { a: box 3, .. x };
     drop(x.a);
-    drop(y.b);
 }
 
 fn fu_move_after_move() {
@@ -121,10 +114,8 @@ fn fu_move_after_move() {
 
 fn fu_move_after_fu_move() {
     let x = B { a: box 1, b: box 2 };
-    let y = B { b: box 3, .. x };
-    let z = B { a: box 4, .. x };
-    drop(y.a);
-    drop(z.b);
+    let _y = B { b: box 3, .. x };
+    let _z = B { a: box 4, .. x };
 }
 
 fn copy_after_assign_after_move() {
@@ -157,10 +148,9 @@ fn borrow_after_field_assign_after_move() {
 
 fn move_after_assign_after_move() {
     let mut x = A { a: 1, b: box 2 };
-    let y = x.b;
+    let _y = x.b;
     x = A { a: 3, b: box 4 };
     drop(x.b);
-    drop(y);
 }
 
 fn move_after_field_assign_after_move() {