Rollup merge of #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 https://github.com/rust-lang/rust-analyzer/issues/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`
This commit is contained in:
Guillaume Gomez
2024-03-03 14:07:43 +01:00
committed by GitHub
13 changed files with 197 additions and 6 deletions

View File

@@ -1303,6 +1303,7 @@ symbols! {
pat,
pat_param,
path,
pattern_complexity,
pattern_parentheses,
phantom_data,
pic,