GoalKind in rustc_next_trait_solver::solve::assembly - Rust
Description: Methods used to assemble candidates for either trait or projection goals.

Skip to main content

## GoalKind

# Trait GoalKind

Source

    pub(super) trait GoalKind<D, I = I>:
        TypeFoldable<I>
        + Copy
        + Eq
        + Displaywhere
        D: SolverDelegate<Interner = I>,
        I: Interner,{
    Show 34 methods    // Required methods
        fn self_ty(self) -> I::Ty;
        fn trait_ref(self, cx: I) -> TraitRef<I>;
        fn with_replaced_self_ty(self, cx: I, self_ty: I::Ty) -> Self;
        fn trait_def_id(self, cx: I) -> I::TraitId;
        fn consider_additional_alias_assumptions(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
            alias_ty: AliasTy<I>,
        ) -> Vec<Candidate<I>>;
        fn fast_reject_assumption(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
            assumption: I::Clause,
        ) -> Result<(), NoSolution>;
        fn match_assumption(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
            assumption: I::Clause,
            then: impl FnOnce(&mut EvalCtxt<'_, D>) -> QueryResultOrRerunNonErased<I>,
        ) -> QueryResultOrRerunNonErased<I>;
        fn consider_impl_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
            impl_def_id: I::ImplId,
            then: impl FnOnce(&mut EvalCtxt<'_, D>, Certainty) -> QueryResultOrRerunNonErased<I>,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_error_guaranteed_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            guar: I::ErrorGuaranteed,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_auto_trait_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_trait_alias_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_builtin_sizedness_candidates(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
            sizedness: SizedTraitKind,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_builtin_copy_clone_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_builtin_fn_ptr_trait_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_builtin_fn_trait_candidates(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
            kind: ClosureKind,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_builtin_async_fn_trait_candidates(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
            kind: ClosureKind,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_builtin_async_fn_kind_helper_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_builtin_tuple_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_builtin_pointee_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_builtin_future_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_builtin_iterator_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_builtin_fused_iterator_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_builtin_async_iterator_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_builtin_coroutine_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_builtin_discriminant_kind_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_builtin_destruct_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_builtin_transmute_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_builtin_bikeshed_guaranteed_no_drop_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;
        fn consider_structural_builtin_unsize_candidates(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
        ) -> Result<Vec<Candidate<I>>, RerunNonErased>;
        fn consider_builtin_field_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>;

        // Provided methods
        fn probe_and_consider_implied_clause(
            ecx: &mut EvalCtxt<'_, D>,
            parent_source: CandidateSource<I>,
            goal: Goal<I, Self>,
            assumption: I::Clause,
            requirements: impl IntoIterator<Item = (GoalSource, Goal<I, I::Predicate>)>,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased> { ... }
        fn probe_and_consider_object_bound_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            source: CandidateSource<I>,
            goal: Goal<I, Self>,
            assumption: I::Clause,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased> { ... }
        fn probe_and_consider_param_env_candidate(
            ecx: &mut EvalCtxt<'_, D>,
            goal: Goal<I, Self>,
            assumption: I::Clause,
        ) -> Result<Result<Candidate<I>, CandidateHeadUsages>, RerunNonErased> { ... }
        fn probe_and_match_goal_against_assumption(
            ecx: &mut EvalCtxt<'_, D>,
            source: CandidateSource<I>,
            goal: Goal<I, Self>,
            assumption: I::Clause,
            then: impl FnOnce(&mut EvalCtxt<'_, D>) -> QueryResultOrRerunNonErased<I>,
        ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased> { ... }
    }

Expand description

Methods used to assemble candidates for either trait or projection goals.

## Required Methods§

Source

#### fn self_ty(self) -> I::Ty

Source

#### fn trait_ref(self, cx: I) -> TraitRef<I>

Source

#### fn with_replaced_self_ty(self, cx: I, self_ty: I::Ty) -> Self

Source

#### fn trait_def_id(self, cx: I) -> I::TraitId

Source

#### fn consider_additional_alias_assumptions( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, alias_ty: AliasTy<I>, ) -> Vec<Candidate<I>>

Assemble additional assumptions for an alias that are not included in the item bounds of the alias. For now, this is limited to the `explicit_implied_const_bounds` for an associated type.

Source

#### fn fast_reject_assumption( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, assumption: I::Clause, ) -> Result<(), NoSolution>

Try to reject the assumption based off of simple heuristics, such as `ty::ClauseKind` and `DefId`.

Source

#### fn match_assumption( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, assumption: I::Clause, then: impl FnOnce(&mut EvalCtxt<'_, D>) -> QueryResultOrRerunNonErased<I>, ) -> QueryResultOrRerunNonErased<I>

Relate the goal and assumption.

Source

#### fn consider_impl_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, impl_def_id: I::ImplId, then: impl FnOnce(&mut EvalCtxt<'_, D>, Certainty) -> QueryResultOrRerunNonErased<I>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source

#### fn consider_error_guaranteed_candidate( ecx: &mut EvalCtxt<'_, D>, guar: I::ErrorGuaranteed, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

If the predicate contained an error, we want to avoid emitting unnecessary trait errors but still want to emit errors for other trait goals. We have some special handling for this case.

Trait goals always hold while projection goals never do. This is a bit arbitrary but prevents incorrect normalization while hiding any trait errors.

Source

#### fn consider_auto_trait_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

A type implements an `auto trait` if its components do as well.

These components are given by built-in rules from `structural_traits::instantiate_constituent_tys_for_auto_trait`.

Source

#### fn consider_trait_alias_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

A trait alias holds if the RHS traits and `where` clauses hold.

Source

#### fn consider_builtin_sizedness_candidates( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, sizedness: SizedTraitKind, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

A type is `Sized` if its tail component is `Sized` and a type is `MetaSized` if its tail component is `MetaSized`.

These components are given by built-in rules from `structural_traits::instantiate_constituent_tys_for_sizedness_trait`.

Source

#### fn consider_builtin_copy_clone_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

A type is `Copy` or `Clone` if its components are `Copy` or `Clone`.

These components are given by built-in rules from `structural_traits::instantiate_constituent_tys_for_copy_clone_trait`.

Source

#### fn consider_builtin_fn_ptr_trait_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

A type is a `FnPtr` if it is of `FnPtr` type.

Source

#### fn consider_builtin_fn_trait_candidates( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, kind: ClosureKind, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

A callable type (a closure, fn def, or fn ptr) is known to implement the `Fn<A>` family of traits where `A` is given by the signature of the type.

Source

#### fn consider_builtin_async_fn_trait_candidates( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, kind: ClosureKind, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

An async closure is known to implement the `AsyncFn<A>` family of traits where `A` is given by the signature of the type.

Source

#### fn consider_builtin_async_fn_kind_helper_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Compute the built-in logic of the `AsyncFnKindHelper` helper trait, which is used internally to delay computation for async closures until after upvar analysis is performed in HIR typeck.

Source

#### fn consider_builtin_tuple_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

`Tuple` is implemented if the `Self` type is a tuple.

Source

#### fn consider_builtin_pointee_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

`Pointee` is always implemented.

See the projection implementation for the `Metadata` types for all of the built-in types. For structs, the metadata type is given by the struct tail.

Source

#### fn consider_builtin_future_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

A coroutine (that comes from an `async` desugaring) is known to implement `Future<Output = O>`, where `O` is given by the coroutine’s return type that was computed during type-checking.

Source

#### fn consider_builtin_iterator_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

A coroutine (that comes from a `gen` desugaring) is known to implement `Iterator<Item = O>`, where `O` is given by the generator’s yield type that was computed during type-checking.

Source

#### fn consider_builtin_fused_iterator_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

A coroutine (that comes from a `gen` desugaring) is known to implement `FusedIterator`

Source

#### fn consider_builtin_async_iterator_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source

#### fn consider_builtin_coroutine_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

A coroutine (that doesn’t come from an `async` or `gen` desugaring) is known to implement `Coroutine<R, Yield = Y, Return = O>`, given the resume, yield, and return types of the coroutine computed during type-checking.

Source

#### fn consider_builtin_discriminant_kind_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source

#### fn consider_builtin_destruct_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source

#### fn consider_builtin_transmute_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source

#### fn consider_builtin_bikeshed_guaranteed_no_drop_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source

#### fn consider_structural_builtin_unsize_candidates( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Vec<Candidate<I>>, RerunNonErased>

Consider (possibly several) candidates to upcast or unsize a type to another type, excluding the coercion of a sized type into a `dyn Trait`.

We return the `BuiltinImplSource` for each candidate as it is needed for unsize coercion in hir typeck and because it is difficult to otherwise recompute this for codegen. This is a bit of a mess but the easiest way to maintain the existing behavior for now.

Source

#### fn consider_builtin_field_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

## Provided Methods§

Source

#### fn probe_and_consider_implied_clause( ecx: &mut EvalCtxt<'_, D>, parent_source: CandidateSource<I>, goal: Goal<I, Self>, assumption: I::Clause, requirements: impl IntoIterator<Item = (GoalSource, Goal<I, I::Predicate>)>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Consider a clause, which consists of a “assumption” and some “requirements”, to satisfy a goal. If the requirements hold, then attempt to satisfy our goal by equating it with the assumption.

Source

#### fn probe_and_consider_object_bound_candidate( ecx: &mut EvalCtxt<'_, D>, source: CandidateSource<I>, goal: Goal<I, Self>, assumption: I::Clause, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Consider a clause specifically for a `dyn Trait` self type. This requires additionally checking all of the supertraits and object bounds to hold, since they’re not implied by the well-formedness of the object type. `NormalizesTo` overrides this to not check the supertraits for backwards compatibility with the old solver. cc trait-system-refactor-initiative#245.

Source

#### fn probe_and_consider_param_env_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, assumption: I::Clause, ) -> Result<Result<Candidate<I>, CandidateHeadUsages>, RerunNonErased>

Source

#### fn probe_and_match_goal_against_assumption( ecx: &mut EvalCtxt<'_, D>, source: CandidateSource<I>, goal: Goal<I, Self>, assumption: I::Clause, then: impl FnOnce(&mut EvalCtxt<'_, D>) -> QueryResultOrRerunNonErased<I>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Try equating an assumption predicate against a goal’s predicate. If it holds, then execute the `then` callback, which should do any additional work, then produce a response (typically by executing `EvalCtxt::evaluate_added_goals_and_make_canonical_response`).

## Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

## Implementations on Foreign Types§

Source§

### impl<D, I> GoalKind<D> for HostEffectPredicate<I>
where D: SolverDelegate<Interner = I>, I: Interner,

Source§

#### fn consider_additional_alias_assumptions( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, alias_ty: AliasTy<I>, ) -> Vec<Candidate<I>>

Register additional assumptions for aliases corresponding to `[const]` item bounds.

Unlike item bounds, they are not simply implied by the well-formedness of the alias. Instead, they only hold if the const conditions on the alias also hold. This is why we also register the const conditions of the alias after matching the goal against the assumption.

Source§

#### fn self_ty(self) -> I::Ty

Source§

#### fn trait_ref(self, _: I) -> TraitRef<I>

Source§

#### fn with_replaced_self_ty(self, cx: I, self_ty: I::Ty) -> Self

Source§

#### fn trait_def_id(self, _: I) -> I::TraitId

Source§

#### fn fast_reject_assumption( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, assumption: I::Clause, ) -> Result<(), NoSolution>

Source§

#### fn match_assumption( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, assumption: I::Clause, then: impl FnOnce(&mut EvalCtxt<'_, D>) -> QueryResultOrRerunNonErased<I>, ) -> QueryResultOrRerunNonErased<I>

Source§

#### fn consider_impl_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, impl_def_id: I::ImplId, then: impl FnOnce(&mut EvalCtxt<'_, D>, Certainty) -> QueryResultOrRerunNonErased<I>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_error_guaranteed_candidate( ecx: &mut EvalCtxt<'_, D>, _guar: I::ErrorGuaranteed, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_auto_trait_candidate( ecx: &mut EvalCtxt<'_, D>, _goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_trait_alias_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_sizedness_candidates( _ecx: &mut EvalCtxt<'_, D>, _goal: Goal<I, Self>, _sizedness: SizedTraitKind, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_copy_clone_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_fn_ptr_trait_candidate( _ecx: &mut EvalCtxt<'_, D>, _goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_fn_trait_candidates( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, _kind: ClosureKind, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_async_fn_trait_candidates( _ecx: &mut EvalCtxt<'_, D>, _goal: Goal<I, Self>, _kind: ClosureKind, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_async_fn_kind_helper_candidate( _ecx: &mut EvalCtxt<'_, D>, _goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_tuple_candidate( _ecx: &mut EvalCtxt<'_, D>, _goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_pointee_candidate( _ecx: &mut EvalCtxt<'_, D>, _goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_future_candidate( _ecx: &mut EvalCtxt<'_, D>, _goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_iterator_candidate( _ecx: &mut EvalCtxt<'_, D>, _goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_fused_iterator_candidate( _ecx: &mut EvalCtxt<'_, D>, _goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_async_iterator_candidate( _ecx: &mut EvalCtxt<'_, D>, _goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_coroutine_candidate( _ecx: &mut EvalCtxt<'_, D>, _goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_discriminant_kind_candidate( _ecx: &mut EvalCtxt<'_, D>, _goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_destruct_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_transmute_candidate( _ecx: &mut EvalCtxt<'_, D>, _goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_bikeshed_guaranteed_no_drop_candidate( _ecx: &mut EvalCtxt<'_, D>, _goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_structural_builtin_unsize_candidates( _ecx: &mut EvalCtxt<'_, D>, _goal: Goal<I, Self>, ) -> Result<Vec<Candidate<I>>, RerunNonErased>

Source§

#### fn consider_builtin_field_candidate( _ecx: &mut EvalCtxt<'_, D>, _goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

### impl<D, I> GoalKind<D> for NormalizesTo<I>
where D: SolverDelegate<Interner = I>, I: Interner,

Source§

#### fn consider_error_guaranteed_candidate( _ecx: &mut EvalCtxt<'_, D>, _guar: I::ErrorGuaranteed, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Fail to normalize if the predicate contains an error, alternatively, we could normalize to `ty::Error` and succeed. Can experiment with this to figure out what results in better error messages.

Source§

#### fn self_ty(self) -> I::Ty

Source§

#### fn trait_ref(self, cx: I) -> TraitRef<I>

Source§

#### fn with_replaced_self_ty(self, cx: I, self_ty: I::Ty) -> Self

Source§

#### fn trait_def_id(self, cx: I) -> I::TraitId

Source§

#### fn fast_reject_assumption( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, assumption: I::Clause, ) -> Result<(), NoSolution>

Source§

#### fn match_assumption( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, assumption: I::Clause, then: impl FnOnce(&mut EvalCtxt<'_, D>) -> QueryResultOrRerunNonErased<I>, ) -> QueryResultOrRerunNonErased<I>

Source§

#### fn probe_and_consider_object_bound_candidate( ecx: &mut EvalCtxt<'_, D>, source: CandidateSource<I>, goal: Goal<I, Self>, assumption: I::Clause, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_additional_alias_assumptions( _ecx: &mut EvalCtxt<'_, D>, _goal: Goal<I, Self>, _alias_ty: AliasTy<I>, ) -> Vec<Candidate<I>>

Source§

#### fn consider_impl_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, NormalizesTo<I>>, impl_def_id: I::ImplId, then: impl FnOnce(&mut EvalCtxt<'_, D>, Certainty) -> QueryResultOrRerunNonErased<I>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_auto_trait_candidate( ecx: &mut EvalCtxt<'_, D>, _goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_trait_alias_candidate( _ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_sizedness_candidates( _ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, _sizedness: SizedTraitKind, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_copy_clone_candidate( _ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_fn_ptr_trait_candidate( _ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_fn_trait_candidates( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, goal_kind: ClosureKind, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_async_fn_trait_candidates( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, goal_kind: ClosureKind, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_async_fn_kind_helper_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_tuple_candidate( _ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_pointee_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_future_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_iterator_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_fused_iterator_candidate( _ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_async_iterator_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_coroutine_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_structural_builtin_unsize_candidates( _ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Vec<Candidate<I>>, RerunNonErased>

Source§

#### fn consider_builtin_discriminant_kind_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_destruct_candidate( _ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_transmute_candidate( _ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_bikeshed_guaranteed_no_drop_candidate( _ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_field_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

### impl<D, I> GoalKind<D> for TraitPredicate<I>
where D: SolverDelegate<Interner = I>, I: Interner,

Source§

#### fn consider_builtin_tuple_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

ⓘ

    impl Tuple for () {}
    impl Tuple for (T1,) {}
    impl Tuple for (T1, T2) {}
    impl Tuple for (T1, .., Tn) {}

Source§

#### fn consider_builtin_bikeshed_guaranteed_no_drop_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

NOTE: This is implemented as a built-in goal and not a set of impls like:

ⓘ

    impl<T> BikeshedGuaranteedNoDrop for T where T: Copy {}
    impl<T> BikeshedGuaranteedNoDrop for ManuallyDrop<T> {}

because these impls overlap, and I’d rather not build a coherence hack for this harmless overlap.

This trait is indirectly exposed on stable, so do not extend the set of types that implement the trait without FCP!

Source§

#### fn consider_structural_builtin_unsize_candidates( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Vec<Candidate<I>>, RerunNonErased>

ⓘ

    trait Trait {
        fn foo(&self);
    }
    // results in the following builtin impl
    impl<'a, T: Trait + 'a> Unsize<dyn Trait + 'a> for T {}

Source§

#### fn self_ty(self) -> I::Ty

Source§

#### fn trait_ref(self, _: I) -> TraitRef<I>

Source§

#### fn with_replaced_self_ty(self, cx: I, self_ty: I::Ty) -> Self

Source§

#### fn trait_def_id(self, _: I) -> I::TraitId

Source§

#### fn consider_additional_alias_assumptions( _ecx: &mut EvalCtxt<'_, D>, _goal: Goal<I, Self>, _alias_ty: AliasTy<I>, ) -> Vec<Candidate<I>>

Source§

#### fn consider_impl_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, TraitPredicate<I>>, impl_def_id: I::ImplId, then: impl FnOnce(&mut EvalCtxt<'_, D>, Certainty) -> QueryResultOrRerunNonErased<I>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_error_guaranteed_candidate( ecx: &mut EvalCtxt<'_, D>, _guar: I::ErrorGuaranteed, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn fast_reject_assumption( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, assumption: I::Clause, ) -> Result<(), NoSolution>

Source§

#### fn match_assumption( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, assumption: I::Clause, then: impl FnOnce(&mut EvalCtxt<'_, D>) -> QueryResultOrRerunNonErased<I>, ) -> QueryResultOrRerunNonErased<I>

Source§

#### fn consider_auto_trait_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_trait_alias_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_sizedness_candidates( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, sizedness: SizedTraitKind, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_copy_clone_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_fn_ptr_trait_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_fn_trait_candidates( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, goal_kind: ClosureKind, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_async_fn_trait_candidates( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, goal_kind: ClosureKind, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_async_fn_kind_helper_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_pointee_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_future_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_iterator_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_fused_iterator_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_async_iterator_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_coroutine_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_discriminant_kind_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_destruct_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_transmute_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

Source§

#### fn consider_builtin_field_candidate( ecx: &mut EvalCtxt<'_, D>, goal: Goal<I, Self>, ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased>

## Implementors§