]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/non-trivial-drop.rs
Rollup merge of #107186 - GuillaumeGomez:correct-pseudo-element-selector, r=notriddle
[rust.git] / tests / ui / async-await / non-trivial-drop.rs
1 // build-pass
2 // edition:2018
3 // compile-flags: -Zdrop-tracking=y
4
5 #![feature(generators)]
6
7 fn main() {
8     let _ = foo();
9 }
10
11 fn foo() {
12     || {
13         yield drop(Config {
14             nickname: NonCopy,
15             b: NonCopy2,
16         }.nickname);
17     };
18 }
19
20 #[derive(Default)]
21 struct NonCopy;
22 impl Drop for NonCopy {
23     fn drop(&mut self) {}
24 }
25
26 #[derive(Default)]
27 struct NonCopy2;
28 impl Drop for NonCopy2 {
29     fn drop(&mut self) {}
30 }
31
32 #[derive(Default)]
33 struct Config {
34     nickname: NonCopy,
35     b: NonCopy2,
36 }