pub(super) struct OverflowData {
    default_limit: Limit,
    current_limit: Limit,
    additional_depth: usize,
}
Expand description

When detecting a solver overflow, we return ambiguity. Overflow can be hidden by either a fatal error in an AND or a trivial success in an OR.

This is in issue in case of exponential blowup, e.g. if each goal on the stack has multiple nested (overflowing) candidates. To deal with this, we reduce the limit used by the solver when hitting the default limit for the first time.

FIXME: Get tests where always using the default_limit results in a hang and refer to them here. We can also improve the overflow strategy if necessary.

Fields§

§default_limit: Limit§current_limit: Limit§additional_depth: usize

When proving an AND we have to repeatedly iterate over the yet unproven goals.

Because of this each iteration also increases the depth in addition to the stack depth.

Implementations§

source§

impl OverflowData

source

pub(super) fn new(tcx: TyCtxt<'_>) -> OverflowData

source

pub(super) fn did_overflow(&self) -> bool

source

pub(super) fn has_overflow(&self, depth: usize) -> bool

source

fn deal_with_overflow(&mut self)

Updating the current limit when hitting overflow.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size:24 bytes