Skip to content

Commit

Permalink
Add regression test for jump in lhs of range
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dtolnay committed Dec 26, 2024
1 parent 53de985 commit 284ea65
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,8 @@ fn test_fixup() {
quote! { { (let _ = ()) } },
quote! { (#[attr] thing).field },
quote! { (self.f)() },
quote! { (return)..=return },
quote! { 1 + (return)..=1 + return },
] {
let original: Expr = syn::parse2(tokens).unwrap();

Expand Down

0 comments on commit 284ea65

Please sign in to comment.