diff options
| author | Michael Goulet <michael@errs.io> | 2025-05-29 12:34:50 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-07-17 17:42:28 +0000 |
| commit | 216cdb7b22b637cef75b7225c642cb7587192643 (patch) | |
| tree | b6394c00088fafc75e45f3907d6553b1b4835858 /tests/ui/coroutine/clone-impl.rs | |
| parent | 72bc11d14688599fbcaedf2be9175aa374e1c0d9 (diff) | |
| download | rust-216cdb7b22b637cef75b7225c642cb7587192643.tar.gz rust-216cdb7b22b637cef75b7225c642cb7587192643.zip | |
Eagerly unify coroutine witness in old solver
Diffstat (limited to 'tests/ui/coroutine/clone-impl.rs')
| -rw-r--r-- | tests/ui/coroutine/clone-impl.rs | 25 |
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); } |
