rust/tests/ui/async-await/non-trivial-drop.rs
Camille GILLOT 211d2ed07b Bless tests.
2023-09-23 13:47:30 +00:00

36 lines
472 B
Rust

// build-pass
// edition:2018
#![feature(generators)]
fn main() {
foo();
}
fn foo() {
|| {
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,
}