2022-10-01 05:19:31 -05:00
|
|
|
// revisions: no_drop_tracking drop_tracking drop_tracking_mir
|
|
|
|
// [drop_tracking] compile-flags: -Zdrop-tracking
|
|
|
|
// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir
|
2022-07-01 00:05:00 -05:00
|
|
|
// build-pass
|
|
|
|
// edition:2018
|
|
|
|
|
|
|
|
#![feature(generators)]
|
|
|
|
|
|
|
|
fn main() {
|
2023-06-12 03:55:36 -05:00
|
|
|
foo();
|
2022-07-01 00:05:00 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
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,
|
|
|
|
}
|