]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/rustfmt/tests/source/configs/use_field_init_shorthand/true.rs
Update upstream source from tag 'upstream/1.52.1+dfsg1'
[rustc.git] / src / tools / rustfmt / tests / source / configs / use_field_init_shorthand / true.rs
diff --git a/src/tools/rustfmt/tests/source/configs/use_field_init_shorthand/true.rs b/src/tools/rustfmt/tests/source/configs/use_field_init_shorthand/true.rs
new file mode 100644 (file)
index 0000000..dcde28d
--- /dev/null
@@ -0,0 +1,19 @@
+// rustfmt-use_field_init_shorthand: true
+// Use field initialization shorthand if possible.
+
+fn main() {
+    let a = Foo {
+        x: x,
+        y: y,
+        z: z,
+    };
+
+    let b = Bar {
+        x: x,
+        y: y,
+        #[attr]
+        z: z,
+        #[rustfmt::skip]
+        skipped: skipped,
+    };
+}