]> git.lizzy.rs Git - rust.git/blob - tests/ui/generator/clone-impl-static.rs
Rollup merge of #106797 - FawazTirmizi:dev/issues/104284, r=bjorn3
[rust.git] / tests / ui / generator / clone-impl-static.rs
1 // gate-test-generator_clone
2 // Verifies that static generators cannot be cloned/copied.
3
4 #![feature(generators, generator_clone)]
5
6 fn main() {
7     let gen = static move || {
8         yield;
9     };
10     check_copy(&gen);
11     //~^ ERROR Copy` is not satisfied
12     check_clone(&gen);
13     //~^ ERROR Clone` is not satisfied
14 }
15
16 fn check_copy<T: Copy>(_x: &T) {}
17 fn check_clone<T: Clone>(_x: &T) {}