about summary refs log tree commit diff
path: root/tests/ui/coroutine/clone-impl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/coroutine/clone-impl.rs')
-rw-r--r--tests/ui/coroutine/clone-impl.rs25
1 files changed, 13 insertions, 12 deletions
diff --git a/tests/ui/coroutine/clone-impl.rs b/tests/ui/coroutine/clone-impl.rs
index b07fad18aee..e528f031d52 100644
--- a/tests/ui/coroutine/clone-impl.rs
+++ b/tests/ui/coroutine/clone-impl.rs
@@ -38,39 +38,40 @@ fn test2() {
     check_clone(&gen_copy_1);
 }
 
-fn test3() {
+fn test3_upvars() {
     let clonable_0: Vec<u32> = Vec::new();
     let gen_clone_0 = #[coroutine]
     move || {
-        let v = vec!['a'];
-        yield;
-        drop(v);
         drop(clonable_0);
     };
     check_copy(&gen_clone_0);
     //~^ ERROR the trait bound `Vec<u32>: Copy` is not satisfied
-    //~| ERROR the trait bound `Vec<char>: Copy` is not satisfied
     check_clone(&gen_clone_0);
 }
 
+fn test3_witness() {
+    let gen_clone_1 = #[coroutine]
+    move || {
+        let v = vec!['a'];
+        yield;
+        drop(v);
+    };
+    check_copy(&gen_clone_1);
+    //~^ ERROR the trait bound `Vec<char>: Copy` is not satisfied
+    check_clone(&gen_clone_1);
+}
+
 fn test4() {
     let clonable_1: Vec<u32> = Vec::new();
     let gen_clone_1 = #[coroutine]
     move || {
-        let v = vec!['a'];
-        /*
-        let n = NonClone;
-        drop(n);
-        */
         yield;
         let n = NonClone;
         drop(n);
-        drop(v);
         drop(clonable_1);
     };
     check_copy(&gen_clone_1);
     //~^ ERROR the trait bound `Vec<u32>: Copy` is not satisfied
-    //~| ERROR the trait bound `Vec<char>: Copy` is not satisfied
     check_clone(&gen_clone_1);
 }