2022-07-01 05:05:00 +00:00
|
|
|
//@ build-pass
|
|
|
|
//@ edition:2018
|
|
|
|
|
2023-10-19 21:46:28 +00:00
|
|
|
#![feature(coroutines)]
|
2022-07-01 05:05:00 +00:00
|
|
|
|
|
|
|
fn main() {
|
2023-06-12 08:55:36 +00:00
|
|
|
foo();
|
2022-07-01 05:05:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn foo() {
|
2024-04-11 13:15:34 +00:00
|
|
|
#[coroutine] || {
|
2022-07-01 05:05:00 +00:00
|
|
|
yield drop(Config {
|
|
|
|
nickname: NonCopy,
|
|
|
|
b: NonCopy2,
|
|
|
|
}.nickname);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Default)]
|
|
|
|
struct NonCopy;
|
|
|
|
impl Drop for NonCopy {
|
|
|
|
fn drop(&mut self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Default)]
|
|
|
|
struct NonCopy2;
|
|
|
|
impl Drop for NonCopy2 {
|
|
|
|
fn drop(&mut self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Default)]
|
|
|
|
struct Config {
|
|
|
|
nickname: NonCopy,
|
|
|
|
b: NonCopy2,
|
|
|
|
}
|