Skip to content

Commit

Permalink
Add regression test for issue 1073
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Oct 3, 2021
1 parent a1096c2 commit a153bc9
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/test_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,3 +299,38 @@ fn test_impl_type_parameter_defaults() {
self_ty: Type::Tuple,
}"###);
}

#[test]
fn test_impl_trait_trailing_plus() {
let tokens = quote! {
fn f() -> impl Sized + {}
};

snapshot!(tokens as Item, @r###"
Item::Fn {
vis: Inherited,
sig: Signature {
ident: "f",
generics: Generics,
output: Type(
Type::ImplTrait {
bounds: [
Trait(TraitBound {
modifier: None,
path: Path {
segments: [
PathSegment {
ident: "Sized",
arguments: None,
},
],
},
}),
],
},
),
},
block: Block,
}
"###);
}

0 comments on commit a153bc9

Please sign in to comment.