From 1e79cc1d33fb8842392b444f34fc3b34c62c8f8a Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 5 Oct 2021 20:47:06 -0400 Subject: [PATCH] Add test of trailing plus on bare (non-dyn) trait object Currently fails with: thread 'test_trailing_plus' panicked at 'called `Result::unwrap()` on an `Err` value: Error("unexpected end of input, expected identifier")', tests/test_ty.rs:334:5 --- tests/test_ty.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/test_ty.rs b/tests/test_ty.rs index 7a65b300..a03abaa3 100644 --- a/tests/test_ty.rs +++ b/tests/test_ty.rs @@ -328,4 +328,24 @@ fn test_trailing_plus() { ], } "###); + + #[rustfmt::skip] + let tokens = quote!(Trait +); + snapshot!(tokens as Type, @r###" + Type::TraitObject { + bounds: [ + Trait(TraitBound { + modifier: None, + path: Path { + segments: [ + PathSegment { + ident: "Trait", + arguments: None, + }, + ], + }, + }), + ], + } + "###); }