[][src]Struct chalk_engine::FlounderedSubgoal

pub struct FlounderedSubgoal<C: Context> {
    pub floundered_literal: Literal<C>,
    pub floundered_time: TimeStamp,
}

A "floundered" subgoal is one that contains unbound existential variables for which it cannot produce a value. The classic example of floundering is a negative subgoal:

not { Implemented(?T: Foo) }

The way the prolog solver works, it basically enumerates all the ways that a given goal can be true. But we can't use this technique to find all the ways that ?T: Foo can be false -- so we call it floundered. In other words, we can evaluate a negative goal, but only if we know what ?T is -- we can't use the negative goal to help us figuring out ?T.

In addition to negative goals, we use floundering to prevent the trait solver from trying to enumerate very large goals with tons of answers. For example, we consider a goal like ?T: Sized to "flounder", since we can't hope to enumerate all types that are Sized. The same is true for other special traits like Clone.

Floundering can also occur indirectly. For example:

trait Foo { }
impl<T> Foo for T { }

trying to solve ?T: Foo would immediately require solving ?T: Sized, and hence would flounder.

Fields

floundered_literal: Literal<C>

Literal that floundered.

floundered_time: TimeStamp

Current value of the strand's clock at the time of floundering.

Trait Implementations

impl<C: Clone + Context> Clone for FlounderedSubgoal<C>[src]

impl<C: Debug + Context> Debug for FlounderedSubgoal<C>[src]

impl<C: Eq + Context> Eq for FlounderedSubgoal<C>[src]

impl<C: Hash + Context> Hash for FlounderedSubgoal<C>[src]

impl<C: PartialEq + Context> PartialEq<FlounderedSubgoal<C>> for FlounderedSubgoal<C>[src]

impl<C: Context> StructuralEq for FlounderedSubgoal<C>[src]

impl<C: Context> StructuralPartialEq for FlounderedSubgoal<C>[src]

Auto Trait Implementations

impl<C> RefUnwindSafe for FlounderedSubgoal<C> where
    <C as Context>::GoalInEnvironment: RefUnwindSafe

impl<C> Send for FlounderedSubgoal<C> where
    <C as Context>::GoalInEnvironment: Send

impl<C> Sync for FlounderedSubgoal<C> where
    <C as Context>::GoalInEnvironment: Sync

impl<C> Unpin for FlounderedSubgoal<C> where
    <C as Context>::GoalInEnvironment: Unpin

impl<C> UnwindSafe for FlounderedSubgoal<C> where
    <C as Context>::GoalInEnvironment: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.