summaryrefslogtreecommitdiffstats
path: root/src/test/ui/async-await/default-struct-update.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/async-await/default-struct-update.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/ui/async-await/default-struct-update.rs b/src/test/ui/async-await/default-struct-update.rs
new file mode 100644
index 000000000..64fb6280d
--- /dev/null
+++ b/src/test/ui/async-await/default-struct-update.rs
@@ -0,0 +1,22 @@
+// 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>>,
+}