Enum rustc_middle::traits::ObligationCauseCode [−][src]
pub enum ObligationCauseCode<'tcx> {
Show variants
MiscObligation,
SliceOrArrayElem,
TupleElem,
ProjectionWf(ProjectionTy<'tcx>),
ItemObligation(DefId),
BindingObligation(DefId, Span),
ReferenceOutlivesReferent(Ty<'tcx>),
ObjectTypeBound(Ty<'tcx>, Region<'tcx>),
ObjectCastObligation(Ty<'tcx>),
Coercion {
source: Ty<'tcx>,
target: Ty<'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>>),
Pattern {
span: Option<Span>,
root_ty: Ty<'tcx>,
origin_expr: bool,
},
ConstPatternStructural,
IfExpression(Box<IfExpressionCause>),
IfExpressionWithNoElse,
MainFunctionType,
StartFunctionType,
IntrinsicType,
MethodReceiver,
UnifyReceiver(Box<UnifyReceiverContext<'tcx>>),
ReturnNoExpression,
ReturnValue(HirId),
ReturnType,
BlockTailExpression(HirId),
TrivialBound,
OpaqueType,
}Variants
Expand description
Not well classified or should be obvious from the span.
Expand description
A slice or array is WF only if T: Sized.
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.
Expand description
Like ItemObligation, but with extra detail on the source of the obligation.
ReferenceOutlivesReferent(Ty<'tcx>)Expand description
A type like &'a T is WF only if T: 'a.
Expand description
A type like Box<Foo<'a> + 'b> is WF only if 'b: 'a.
ObjectCastObligation(Ty<'tcx>)Expand description
Obligation incurred due to an object cast.
Expand description
Obligation incurred due to a coercion.
Expand description
Various cases where expressions must be Sized / Copy / etc.
L = X implies that L is Sized.
Expand description
(x1, .., xn) must be Sized.
Expand description
S { ... } must be Sized.
VariableType(HirId)Expand description
Type of each variable must be Sized.
Expand description
Argument type must be Sized.
Expand description
Return type must be Sized.
Expand description
Yield type must be Sized.
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.
Expand description
Types of fields (other than the last, except for packed structs) in a struct must be sized.
Expand description
Constant expressions must be sized.
Expand description
static items must have Sync type.
BuiltinDerivedObligation(DerivedObligationCause<'tcx>)ImplDerivedObligation(DerivedObligationCause<'tcx>)DerivedObligation(DerivedObligationCause<'tcx>)Expand description
Error derived when matching traits/impls; see ObligationCause for more details
Expand description
Error derived when matching traits/impls; see ObligationCause for more details
Show fields
Expand description
Error derived when matching traits/impls; see ObligationCause for more details
Show fields
Expand description
Checking that this expression can be assigned where it needs to be
MatchExpressionArm(Box<MatchExpressionArmCause<'tcx>>)Expand description
Computing common supertype in the arms of a match expression
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: Ty<'tcx>Expand description
The root expected type induced by a scrutinee or type expression.
origin_expr: boolExpand description
Whether the Span came from an expression or a type expression.
Expand description
Constants in patterns must have Structural type.
IfExpression(Box<IfExpressionCause>)Expand description
Computing common supertype in an if expression
Expand description
Computing common supertype of an if expression with no else counter-part
Expand description
main has wrong type
Expand description
start has wrong type
Expand description
Intrinsic has wrong type
Expand description
Method receiver
UnifyReceiver(Box<UnifyReceiverContext<'tcx>>)Expand description
return with no expression
ReturnValue(HirId)Expand description
return with an expression
Expand description
Return type of this function
BlockTailExpression(HirId)Expand description
Block implicit return
Expand description
#[feature(trivial_bounds)] is not enabled
Expand description
If X is the concrete type of an opaque type impl Y, then X must implement Y
Implementations
impl ObligationCauseCode<'_>[src]
impl ObligationCauseCode<'_>[src]pub fn peel_derives(&self) -> &Self[src]
Trait Implementations
impl<'tcx> Clone for ObligationCauseCode<'tcx>[src]
impl<'tcx> Clone for ObligationCauseCode<'tcx>[src]fn clone(&self) -> ObligationCauseCode<'tcx>[src]
fn clone(&self) -> ObligationCauseCode<'tcx>[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]Performs copy-assignment from source. Read more
impl<'tcx> Debug for ObligationCauseCode<'tcx>[src]
impl<'tcx> Debug for ObligationCauseCode<'tcx>[src]impl<'tcx> Hash for ObligationCauseCode<'tcx>[src]
impl<'tcx> Hash for ObligationCauseCode<'tcx>[src]impl<'tcx, '__lifted> Lift<'__lifted> for ObligationCauseCode<'tcx>[src]
impl<'tcx, '__lifted> Lift<'__lifted> for ObligationCauseCode<'tcx>[src]type Lifted = ObligationCauseCode<'__lifted>
fn lift_to_tcx(
self,
__tcx: TyCtxt<'__lifted>
) -> Option<ObligationCauseCode<'__lifted>>[src]
self,
__tcx: TyCtxt<'__lifted>
) -> Option<ObligationCauseCode<'__lifted>>
impl<'tcx> PartialEq<ObligationCauseCode<'tcx>> for ObligationCauseCode<'tcx>[src]
impl<'tcx> PartialEq<ObligationCauseCode<'tcx>> for ObligationCauseCode<'tcx>[src]fn eq(&self, other: &ObligationCauseCode<'tcx>) -> bool[src]
fn eq(&self, other: &ObligationCauseCode<'tcx>) -> bool[src]This method tests for self and other values to be equal, and is used
by ==. Read more
fn ne(&self, other: &ObligationCauseCode<'tcx>) -> bool[src]
fn ne(&self, other: &ObligationCauseCode<'tcx>) -> bool[src]This method tests for !=.
impl<'tcx> Eq for ObligationCauseCode<'tcx>[src]
impl<'tcx> StructuralEq for ObligationCauseCode<'tcx>[src]
impl<'tcx> StructuralPartialEq for ObligationCauseCode<'tcx>[src]
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> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> MaybeResult<T> for T[src]
impl<T> MaybeResult<T> for T[src]impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
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]
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> WithConstness for T[src]
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]
T: ?Sized,