struct CoerceVisitor<'a, D> {
delegate: &'a D,
errored: bool,
unsize_did: TraitId,
coerce_unsized_did: TraitId,
span: Span,
}Expand description
Recursively visit goals to decide whether an unsizing is possible.
Breaks when it isn’t, and an error should be raised.
Continues when an unsizing ok based on an implementation of the Unsize trait / lang item.
Fields§
§delegate: &'a D§errored: boolWhether the coercion is impossible. If so we sometimes still try to coerce in these cases to emit better errors. This changes the behavior when hitting the recursion limit.
unsize_did: TraitId§coerce_unsized_did: TraitId§span: SpanTrait Implementations§
Source§impl<'a, 'db, D: CoerceDelegate<'db>> ProofTreeVisitor<'db> for CoerceVisitor<'a, D>
impl<'a, 'db, D: CoerceDelegate<'db>> ProofTreeVisitor<'db> for CoerceVisitor<'a, D>
type Result = ControlFlow<()>
fn span(&self) -> Span
fn visit_goal(&mut self, goal: &InspectGoal<'_, 'db>) -> Self::Result
fn on_recursion_limit(&mut self) -> Self::Result
fn config(&self) -> InspectConfig
Auto Trait Implementations§
impl<'a, D> Freeze for CoerceVisitor<'a, D>
impl<'a, D> RefUnwindSafe for CoerceVisitor<'a, D>where
D: RefUnwindSafe,
impl<'a, D> Send for CoerceVisitor<'a, D>where
D: Sync,
impl<'a, D> Sync for CoerceVisitor<'a, D>where
D: Sync,
impl<'a, D> Unpin for CoerceVisitor<'a, D>
impl<'a, D> UnsafeUnpin for CoerceVisitor<'a, D>
impl<'a, D> UnwindSafe for CoerceVisitor<'a, D>where
D: RefUnwindSafe,
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
Mutably borrows from an owned value. Read more
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more