Enum rustc_infer::traits::ObligationCauseCode[−][src]

pub enum ObligationCauseCode<'tcx> {
Show variants MiscObligation, SliceOrArrayElem, TupleElem, ProjectionWf(ProjectionTy<'tcx>), ItemObligation(DefId), BindingObligation(DefId, Span), ReferenceOutlivesReferent(&'tcx TyS<'tcx>), ObjectTypeBound(&'tcx TyS<'tcx>, &'tcx RegionKind), ObjectCastObligation(&'tcx TyS<'tcx>), Coercion { source: &'tcx TyS<'tcx>, target: &'tcx TyS<'tcx>, }, AssignmentLhsSized, TupleInitializerSized, StructInitializerSized, VariableType(HirId), SizedArgumentType(Option<Span>), SizedReturnType, SizedYieldType, InlineAsmSized, RepeatVec(bool), FieldSized { adt_kind: AdtKind, span: Span, last: bool, }, ConstSized, SharedStatic, BuiltinDerivedObligation(DerivedObligationCause<'tcx>), ImplDerivedObligation(DerivedObligationCause<'tcx>), DerivedObligation(DerivedObligationCause<'tcx>), CompareImplConstObligation, CompareImplMethodObligation { item_name: Symbol, impl_item_def_id: DefId, trait_item_def_id: DefId, }, CompareImplTypeObligation { item_name: Symbol, impl_item_def_id: DefId, trait_item_def_id: DefId, }, ExprAssignable, MatchExpressionArm(Box<MatchExpressionArmCause<'tcx>, Global>), Pattern { span: Option<Span>, root_ty: &'tcx TyS<'tcx>, origin_expr: bool, }, ConstPatternStructural, IfExpression(Box<IfExpressionCause, Global>), IfExpressionWithNoElse, MainFunctionType, StartFunctionType, IntrinsicType, MethodReceiver, UnifyReceiver(Box<UnifyReceiverContext<'tcx>, Global>), ReturnNoExpression, ReturnValue(HirId), ReturnType, BlockTailExpression(HirId), TrivialBound, OpaqueType,
}

Variants

MiscObligation
Expand description

Not well classified or should be obvious from the span.

SliceOrArrayElem
Expand description

A slice or array is WF only if T: Sized.

TupleElem
Expand description

A tuple is WF only if its middle elements are Sized.

ProjectionWf(ProjectionTy<'tcx>)
Expand description

This is the trait reference from the given projection.

ItemObligation(DefId)
Expand description

In an impl of trait X for type Y, type Y must also implement all supertraits of X.

BindingObligation(DefId, Span)
Expand description

Like ItemObligation, but with extra detail on the source of the obligation.

ReferenceOutlivesReferent(&'tcx TyS<'tcx>)
Expand description

A type like &'a T is WF only if T: 'a.

ObjectTypeBound(&'tcx TyS<'tcx>, &'tcx RegionKind)
Expand description

A type like Box<Foo<'a> + 'b> is WF only if 'b: 'a.

ObjectCastObligation(&'tcx TyS<'tcx>)
Expand description

Obligation incurred due to an object cast.

Coercion
Expand description

Obligation incurred due to a coercion.

Show fields

Fields of Coercion

source: &'tcx TyS<'tcx>target: &'tcx TyS<'tcx>
AssignmentLhsSized
Expand description

Various cases where expressions must be Sized / Copy / etc. L = X implies that L is Sized.

TupleInitializerSized
Expand description

(x1, .., xn) must be Sized.

StructInitializerSized
Expand description

S { ... } must be Sized.

VariableType(HirId)
Expand description

Type of each variable must be Sized.

SizedArgumentType(Option<Span>)
Expand description

Argument type must be Sized.

SizedReturnType
Expand description

Return type must be Sized.

SizedYieldType
Expand description

Yield type must be Sized.

InlineAsmSized
Expand description

Inline asm operand type must be Sized.

RepeatVec(bool)
Expand description

[T, ..n] implies that T must be Copy. If the function in the array repeat expression is a const fn, display a help message suggesting to move the function call to a new const item while saying that T doesn’t implement Copy.

FieldSized
Expand description

Types of fields (other than the last, except for packed structs) in a struct must be sized.

Show fields

Fields of FieldSized

adt_kind: AdtKindspan: Spanlast: bool
ConstSized
Expand description

Constant expressions must be sized.

SharedStatic
Expand description

static items must have Sync type.

BuiltinDerivedObligation(DerivedObligationCause<'tcx>)
ImplDerivedObligation(DerivedObligationCause<'tcx>)
DerivedObligation(DerivedObligationCause<'tcx>)
CompareImplConstObligation
Expand description

Error derived when matching traits/impls; see ObligationCause for more details

CompareImplMethodObligation
Expand description

Error derived when matching traits/impls; see ObligationCause for more details

Show fields

Fields of CompareImplMethodObligation

item_name: Symbolimpl_item_def_id: DefIdtrait_item_def_id: DefId
CompareImplTypeObligation
Expand description

Error derived when matching traits/impls; see ObligationCause for more details

Show fields

Fields of CompareImplTypeObligation

item_name: Symbolimpl_item_def_id: DefIdtrait_item_def_id: DefId
ExprAssignable
Expand description

Checking that this expression can be assigned where it needs to be

MatchExpressionArm(Box<MatchExpressionArmCause<'tcx>, Global>)
Expand description

Computing common supertype in the arms of a match expression

Pattern
Expand description

Type error arising from type checking a pattern against an expected type.

Show fields

Fields of Pattern

span: Option<Span>
Expand description

The span of the scrutinee or type expression which caused the root_ty type.

root_ty: &'tcx TyS<'tcx>
Expand description

The root expected type induced by a scrutinee or type expression.

origin_expr: bool
Expand description

Whether the Span came from an expression or a type expression.

ConstPatternStructural
Expand description

Constants in patterns must have Structural type.

IfExpression(Box<IfExpressionCause, Global>)
Expand description

Computing common supertype in an if expression

IfExpressionWithNoElse
Expand description

Computing common supertype of an if expression with no else counter-part

MainFunctionType
Expand description

main has wrong type

StartFunctionType
Expand description

start has wrong type

IntrinsicType
Expand description

Intrinsic has wrong type

MethodReceiver
Expand description

Method receiver

UnifyReceiver(Box<UnifyReceiverContext<'tcx>, Global>)
ReturnNoExpression
Expand description

return with no expression

ReturnValue(HirId)
Expand description

return with an expression

ReturnType
Expand description

Return type of this function

BlockTailExpression(HirId)
Expand description

Block implicit return

TrivialBound
Expand description

#[feature(trivial_bounds)] is not enabled

OpaqueType
Expand description

If X is the concrete type of an opaque type impl Y, then X must implement Y

Auto Trait Implementations

impl<'tcx> !RefUnwindSafe for ObligationCauseCode<'tcx>

impl<'tcx> !Send for ObligationCauseCode<'tcx>

impl<'tcx> !Sync for ObligationCauseCode<'tcx>

impl<'tcx> Unpin for ObligationCauseCode<'tcx>

impl<'tcx> !UnwindSafe for ObligationCauseCode<'tcx>

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

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

Performs the conversion.

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.

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

Performs the conversion.

impl<T> WithConstness for T[src]

fn with_constness(self, constness: Constness) -> ConstnessAnd<Self>[src]

fn with_const(self) -> ConstnessAnd<Self>[src]

fn without_const(self) -> ConstnessAnd<Self>[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized, 
[src]