From e39fca3d1e7f02a3f13d64ae72a49ccd25b3e9aa Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 9 Mar 2021 10:45:44 -0800 Subject: [PATCH] Add regression test for issue 974 --- tests/test_item.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/test_item.rs b/tests/test_item.rs index 7695f19906..712c6c6f42 100644 --- a/tests/test_item.rs +++ b/tests/test_item.rs @@ -241,3 +241,28 @@ fn test_supertraits() { } "###); } + +#[test] +fn test_type_empty_bounds() { + #[rustfmt::skip] + let tokens = quote! { + trait Foo { + type Bar: ; + } + }; + + snapshot!(tokens as ItemTrait, @r###" + ItemTrait { + vis: Inherited, + ident: "Foo", + generics: Generics, + items: [ + TraitItem::Type { + ident: "Bar", + generics: Generics, + colon_token: Some, + }, + ], + } + "###); +}