diff options
| author | Michael Goulet <michael@errs.io> | 2024-09-29 22:17:30 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-10-01 13:55:46 -0400 |
| commit | 40465d2449f3d9a36c86b94885f58ed3ee2a99f0 (patch) | |
| tree | a98bcd2bbf0fe57748eba20e2c90eaf96c4471d8 /src/tools/rustfmt | |
| parent | e3a0da18633a8cfb5263bb975747352690b01fcf (diff) | |
Remove anon struct and union types
Diffstat (limited to 'src/tools/rustfmt')
| -rw-r--r-- | src/tools/rustfmt/src/types.rs | 2 | ||||
| -rw-r--r-- | src/tools/rustfmt/tests/target/anonymous-types.rs | 31 |
2 files changed, 0 insertions, 33 deletions
diff --git a/src/tools/rustfmt/src/types.rs b/src/tools/rustfmt/src/types.rs index 07b483b2b37..f75c4f0fad7 100644 --- a/src/tools/rustfmt/src/types.rs +++ b/src/tools/rustfmt/src/types.rs @@ -951,8 +951,6 @@ impl Rewrite for ast::Ty { ast::TyKind::Tup(ref items) => { rewrite_tuple(context, items.iter(), self.span, shape, items.len() == 1) } - ast::TyKind::AnonStruct(..) => Ok(context.snippet(self.span).to_owned()), - ast::TyKind::AnonUnion(..) => Ok(context.snippet(self.span).to_owned()), ast::TyKind::Path(ref q_self, ref path) => { rewrite_path(context, PathContext::Type, q_self, path, shape) } diff --git a/src/tools/rustfmt/tests/target/anonymous-types.rs b/src/tools/rustfmt/tests/target/anonymous-types.rs deleted file mode 100644 index e8c2d83878c..00000000000 --- a/src/tools/rustfmt/tests/target/anonymous-types.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Test for issue 85480 -// Pretty print anonymous struct and union types - -// pp-exact -// pretty-compare-only - -struct Foo { - _: union { - _: struct { - a: u8, - b: u16, - }, - c: u32, - }, - d: u64, - 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() {} |
