Struct rustc_trait_selection::solve::search_graph::overflow::OverflowData
source · 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: usizeWhen 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
impl OverflowData
pub(super) fn new(tcx: TyCtxt<'_>) -> OverflowData
pub(super) fn did_overflow(&self) -> bool
pub(super) fn has_overflow(&self, depth: usize) -> bool
sourcefn deal_with_overflow(&mut self)
fn deal_with_overflow(&mut self)
Updating the current limit when hitting overflow.
Auto Trait Implementations§
impl RefUnwindSafe for OverflowData
impl Send for OverflowData
impl Sync for OverflowData
impl Unpin for OverflowData
impl UnwindSafe for OverflowData
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
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