rust/tests/ui/async-await/default-struct-update.rs
2023-01-11 09:32:08 +00:00

23 lines
322 B
Rust

// build-pass
// edition:2018
// compile-flags: -Zdrop-tracking=y
fn main() {
let _ = foo();
}
async fn from_config(_: Config) {}
async fn foo() {
from_config(Config {
nickname: None,
..Default::default()
})
.await;
}
#[derive(Default)]
struct Config {
nickname: Option<Box<u8>>,
}