rust/tests/ui/async-await/non-trivial-drop.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
487 B
Rust
Raw Normal View History

//@ build-pass
//@ edition:2018
2023-10-19 21:46:28 +00:00
#![feature(coroutines)]
fn main() {
foo();
}
fn foo() {
#[coroutine] || {
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,
}