2 // compile-flags: -Zdrop-tracking
4 // A test to ensure generators capture values that were conditionally dropped,
5 // and also that values that are dropped along all paths to a yield do not get
6 // included in the generator type.
8 #![feature(generators, negative_impls)]
9 #![allow(unused_assignments, dead_code)]
12 impl<'a> Drop for Ptr {
17 impl !Send for NonSend {}
19 fn assert_send<T: Send>(_: T) {}
21 // This test case is reduced from tests/ui/drop/dynamic-drop-async.rs
22 fn one_armed_if(arg: bool) {
32 fn two_armed_if(arg: bool) {
44 fn if_let(arg: Option<i32>) {
47 if let Some(_) = arg {
54 fn init_in_if(arg: bool) {
66 fn init_in_match_arm(arg: Option<i32>) {
71 Some(_) => x = NonSend,
114 fn loop_continue(b: bool) {
134 init_in_match_arm(Some(41));