Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fuel to match checking #9528

Closed
matklad opened this issue Jul 8, 2021 · 1 comment · Fixed by #16879
Closed

Add fuel to match checking #9528

matklad opened this issue Jul 8, 2021 · 1 comment · Fixed by #16879
Labels
A-pattern pattern handling related things E-medium S-actionable Someone could pick this issue up and work on it right now

Comments

@matklad
Copy link
Member

matklad commented Jul 8, 2021

https://niedzejkob.p4.team/rust-np/

Exhaustiveness checking can be arbitrary slow, we need to have an ability to give up after some time.

@Nadrieril
Copy link
Member

Workin on it :)

@Nadrieril Nadrieril added the A-pattern pattern handling related things label Jan 24, 2024
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Mar 3, 2024
…limit.rs, r=Nadrieril

Add new `pattern_complexity` attribute to add possibility to limit and check recursion in pattern matching

Needed for rust-lang/rust-analyzer#9528.

This PR adds a new attribute only available when running rust testsuite called `pattern_complexity` which allows to set the maximum recursion for the pattern matching. It is quite useful to ensure the complexity doesn't grow, like in `tests/ui/pattern/usefulness/issue-118437-exponential-time-on-diagonal-match.rs`.

r? `@Nadrieril`
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Mar 3, 2024
Rollup merge of rust-lang#121917 - GuillaumeGomez:pattern-complexity_limit.rs, r=Nadrieril

Add new `pattern_complexity` attribute to add possibility to limit and check recursion in pattern matching

Needed for rust-lang/rust-analyzer#9528.

This PR adds a new attribute only available when running rust testsuite called `pattern_complexity` which allows to set the maximum recursion for the pattern matching. It is quite useful to ensure the complexity doesn't grow, like in `tests/ui/pattern/usefulness/issue-118437-exponential-time-on-diagonal-match.rs`.

r? `@Nadrieril`
@bors bors closed this as completed in a2f73d3 Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-pattern pattern handling related things E-medium S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants