pub enum RecursionProfile {
}Expand description
Named recursion limit presets.
Each profile encodes a (max_depth, max_iterations) pair that is
appropriate for a particular kind of recursive computation. Using profiles
instead of raw numbers:
- Documents why a guard exists at every call site
- Centralises limit values so they can be tuned in one place
- Prevents copy-paste of magic numbers
Variants§
SubtypeCheck
Subtype checking: deep structural comparison of recursive types.
Used by SubtypeChecker and SubtypeTracer.
Needs the deepest depth limit because structural comparison of
recursive types can legitimately nest deeply before a cycle is found.
depth = 100, iterations = 100,000
TypeEvaluation
Type evaluation: conditional types, mapped types, indexed access.
Used by TypeEvaluator (both TypeId guard and DefId guard).
depth = 50, iterations = 100,000
TypeApplication
Generic type application / instantiation.
Used by TypeApplicationEvaluator.
Matches TypeScript’s instantiation depth limit for TS2589.
depth = 50, iterations = 100,000
PropertyAccess
Property access resolution on complex types.
Used by PropertyAccessEvaluator.
depth = 50, iterations = 100,000
Variance
Variance computation.
Used by VarianceVisitor.
depth = 50, iterations = 100,000
ShapeExtraction
Shape extraction for compatibility checking.
Used by ShapeExtractor.
depth = 50, iterations = 100,000
ShallowTraversal
Shallow type traversal: contains-type checks, type collection.
Used by RecursiveTypeCollector, ContainsTypeChecker.
Intentionally shallow — these just walk the top-level structure.
depth = 20, iterations = 100,000
ConstAssertion
Const assertion processing.
Used by ConstAssertionVisitor.
depth = 50, iterations = 100,000
ExpressionCheck
Expression type checking depth.
Used by ExpressionChecker.
Generous limit for deeply nested expressions.
depth = 500
TypeNodeCheck
Type node resolution depth.
Used by TypeNodeChecker.
Generous limit for deeply nested type annotations.
depth = 500
CallResolution
Function call resolution depth.
Used by get_type_of_call_expression.
Relatively low to catch infinite recursion in overload resolution.
depth = 20
CheckerRecursion
General checker recursion depth.
Used by enter_recursion/leave_recursion on checker functions.
depth = 50
Custom
Custom limits for one-off or test scenarios.
Implementations§
Trait Implementations§
Source§impl Clone for RecursionProfile
impl Clone for RecursionProfile
Source§fn clone(&self) -> RecursionProfile
fn clone(&self) -> RecursionProfile
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RecursionProfile
impl Debug for RecursionProfile
Source§impl PartialEq for RecursionProfile
impl PartialEq for RecursionProfile
impl Copy for RecursionProfile
impl Eq for RecursionProfile
impl StructuralPartialEq for RecursionProfile
Auto Trait Implementations§
impl Freeze for RecursionProfile
impl RefUnwindSafe for RecursionProfile
impl Send for RecursionProfile
impl Sync for RecursionProfile
impl Unpin for RecursionProfile
impl UnsafeUnpin for RecursionProfile
impl UnwindSafe for RecursionProfile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.