Add regression test for issue 974

This commit is contained in:
David Tolnay 2021-03-09 10:45:44 -08:00
parent 78f78ab6a7
commit e39fca3d1e
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -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,
},
],
}
"###);
}