1
Fork 0

Rollup merge of #136671 - nnethercote:middle-limits, r=Nadrieril

Overhaul `rustc_middle::limits`

In particular, to make `pattern_complexity` work more like other limits, which then enables some other simplifications.

r? ``@Nadrieril``
This commit is contained in:
Matthias Krüger 2025-02-17 06:37:35 +01:00 committed by GitHub
commit 0c051c8196
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 100 additions and 97 deletions

View file

@ -67,6 +67,11 @@ impl Limit {
Limit(value)
}
/// Create a new unlimited limit.
pub fn unlimited() -> Self {
Limit(usize::MAX)
}
/// Check that `value` is within the limit. Ensures that the same comparisons are used
/// throughout the compiler, as mismatches can cause ICEs, see #72540.
#[inline]
@ -119,6 +124,8 @@ pub struct Limits {
pub move_size_limit: Limit,
/// The maximum length of types during monomorphization.
pub type_length_limit: Limit,
/// The maximum pattern complexity allowed (internal only).
pub pattern_complexity_limit: Limit,
}
pub struct CompilerIO {