about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/rustfmt/tests/target/anonymous-types.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/target/anonymous-types.rs b/src/tools/rustfmt/tests/target/anonymous-types.rs
index 8e08c314ed1..e8c2d83878c 100644
--- a/src/tools/rustfmt/tests/target/anonymous-types.rs
+++ b/src/tools/rustfmt/tests/target/anonymous-types.rs
@@ -16,4 +16,16 @@ struct Foo {
     e: f32,
 }
 
+// Test for https://github.com/rust-lang/rust/issues/117942
+struct Foo {
+    _: union  {
+        #[rustfmt::skip]
+    f: String,
+    },
+    #[rustfmt::skip]
+    _: struct {
+    g: i32,
+    },
+}
+
 fn main() {}