Skip to content

fix: range pattern inside a parenthesis parsed as tuple pattern - #23242

Open
dfireBird wants to merge 1 commit into
rust-lang:masterfrom
dfireBird:push-vrtuqvnutkrn
Open

fix: range pattern inside a parenthesis parsed as tuple pattern#23242
dfireBird wants to merge 1 commit into
rust-lang:masterfrom
dfireBird:push-vrtuqvnutkrn

Conversation

@dfireBird

@dfireBird dfireBird commented Aug 26, 2026

Copy link
Copy Markdown
Member

Fixes #22985

Let me know if we want to split up the expression.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 26, 2026
Comment thread crates/parser/src/tests/top_entries.rs Outdated
check(
TopEntryPoint::Expr,
r#"
match 1 {

@A4-Tacks A4-Tacks Aug 28, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not create an inline test? Like // test or_pattern

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used this test, to debug the issue and just kept it 😅
I could replace this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline testing includes syntax tree, you need cargo xtask codegen

You see crates/parser/test_data/

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I missed to check the last line, sorry.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I remove this test and only inline then?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FP expected i32, found ({unknown},), match on const, pattern

3 participants