mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
Add pattern_complexity_limit
to Limits
.
It's similar to the other limits, e.g. obtained via `get_limit`. So it makes sense to handle it consistently with the other limits. We now use `Limit`/`usize` in most places instead of `Option<usize>`, so we use `Limit::new(usize::MAX)`/`usize::MAX` to emulate how `None` used to work. The commit also adds `Limit::unlimited`.
This commit is contained in:
parent
1aac8756bd
commit
30bcf2a6b5
@ -95,7 +95,7 @@ impl<'db> MatchCheckCtx<'db> {
|
||||
|
||||
let place_validity = PlaceValidity::from_bool(known_valid_scrutinee.unwrap_or(true));
|
||||
// Measured to take ~100ms on modern hardware.
|
||||
let complexity_limit = Some(500000);
|
||||
let complexity_limit = 500000;
|
||||
compute_match_usefulness(self, arms, scrut_ty, place_validity, complexity_limit)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user