Skip to content

Commit 284ea65

Browse files
committed
Add regression test for jump in lhs of range
This syntax tree incorrectly gets turned into `return ..=return` when printed, which is a return whose value is a RangeToInclusive. The original is a Range whose endpoints are returns.
1 parent 53de985 commit 284ea65

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/test_expr.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ fn test_fixup() {
704704
quote! { { (let _ = ()) } },
705705
quote! { (#[attr] thing).field },
706706
quote! { (self.f)() },
707+
quote! { (return)..=return },
708+
quote! { 1 + (return)..=1 + return },
707709
] {
708710
let original: Expr = syn::parse2(tokens).unwrap();
709711

0 commit comments

Comments
 (0)