From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/generator/clone-impl.rs | 73 ------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 src/test/ui/generator/clone-impl.rs (limited to 'src/test/ui/generator/clone-impl.rs') diff --git a/src/test/ui/generator/clone-impl.rs b/src/test/ui/generator/clone-impl.rs deleted file mode 100644 index cbfd65a53..000000000 --- a/src/test/ui/generator/clone-impl.rs +++ /dev/null @@ -1,73 +0,0 @@ -// gate-test-generator_clone -// Verifies that non-static generators can be cloned/copied if all their upvars and locals held -// across awaits can be cloned/copied. - -#![feature(generators, generator_clone)] - -struct NonClone; - -fn main() { - let copyable: u32 = 123; - let clonable_0: Vec = Vec::new(); - let clonable_1: Vec = Vec::new(); - let non_clonable: NonClone = NonClone; - - let gen_copy_0 = move || { - yield; - drop(copyable); - }; - check_copy(&gen_copy_0); - check_clone(&gen_copy_0); - let gen_copy_1 = move || { - /* - let v = vec!['a']; - let n = NonClone; - drop(v); - drop(n); - */ - yield; - let v = vec!['a']; - let n = NonClone; - drop(n); - drop(copyable); - }; - check_copy(&gen_copy_1); - check_clone(&gen_copy_1); - let gen_clone_0 = move || { - let v = vec!['a']; - yield; - drop(v); - drop(clonable_0); - }; - check_copy(&gen_clone_0); - //~^ ERROR the trait bound `Vec: Copy` is not satisfied - //~| ERROR the trait bound `Vec: Copy` is not satisfied - check_clone(&gen_clone_0); - let gen_clone_1 = 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: Copy` is not satisfied - //~| ERROR the trait bound `Vec: Copy` is not satisfied - check_clone(&gen_clone_1); - let gen_non_clone = move || { - yield; - drop(non_clonable); - }; - check_copy(&gen_non_clone); - //~^ ERROR the trait bound `NonClone: Copy` is not satisfied - check_clone(&gen_non_clone); - //~^ ERROR the trait bound `NonClone: Clone` is not satisfied -} - -fn check_copy(_x: &T) {} -fn check_clone(_x: &T) {} -- cgit v1.2.3