Enum rustc_typeck::ty::error::TypeError[−][src]

pub enum TypeError<'tcx> {
Show 29 variants Mismatch, ConstnessMismatch(ExpectedFound<BoundConstness>), PolarityMismatch(ExpectedFound<ImplPolarity>), UnsafetyMismatch(ExpectedFound<Unsafety>), AbiMismatch(ExpectedFound<Abi>), Mutability, ArgumentMutability(usize), TupleSize(ExpectedFound<usize>), FixedArraySize(ExpectedFound<u64>), ArgCount, FieldMisMatch(Symbol, Symbol), RegionsDoesNotOutlive(&'tcx RegionKind, &'tcx RegionKind), RegionsInsufficientlyPolymorphic(BoundRegionKind, &'tcx RegionKind), RegionsOverlyPolymorphic(BoundRegionKind, &'tcx RegionKind), RegionsPlaceholderMismatch, Sorts(ExpectedFound<&'tcx TyS<'tcx>>), ArgumentSorts(ExpectedFound<&'tcx TyS<'tcx>>, usize), IntMismatch(ExpectedFound<IntVarValue>), FloatMismatch(ExpectedFound<FloatTy>), Traits(ExpectedFound<DefId>), VariadicMismatch(ExpectedFound<bool>), CyclicTy(&'tcx TyS<'tcx>), CyclicConst(&'tcx Const<'tcx>), ProjectionMismatched(ExpectedFound<DefId>), ExistentialMismatch(ExpectedFound<&'tcx List<Binder<'tcx, ExistentialPredicate<'tcx>>>>), ObjectUnsafeCoercion(DefId), ConstMismatch(ExpectedFound<&'tcx Const<'tcx>>), IntrinsicCast, TargetFeatureCast(DefId),
}

Variants

Mismatch

ConstnessMismatch(ExpectedFound<BoundConstness>)

Tuple Fields

PolarityMismatch(ExpectedFound<ImplPolarity>)

Tuple Fields

UnsafetyMismatch(ExpectedFound<Unsafety>)

Tuple Fields

AbiMismatch(ExpectedFound<Abi>)

Tuple Fields

Mutability

ArgumentMutability(usize)

Tuple Fields

0: usize

TupleSize(ExpectedFound<usize>)

Tuple Fields

FixedArraySize(ExpectedFound<u64>)

Tuple Fields

ArgCount

FieldMisMatch(Symbol, Symbol)

Tuple Fields

0: Symbol
1: Symbol

RegionsDoesNotOutlive(&'tcx RegionKind, &'tcx RegionKind)

Tuple Fields

0: &'tcx RegionKind
1: &'tcx RegionKind

RegionsInsufficientlyPolymorphic(BoundRegionKind, &'tcx RegionKind)

Tuple Fields

1: &'tcx RegionKind

RegionsOverlyPolymorphic(BoundRegionKind, &'tcx RegionKind)

Tuple Fields

1: &'tcx RegionKind

RegionsPlaceholderMismatch

Sorts(ExpectedFound<&'tcx TyS<'tcx>>)

Tuple Fields

0: ExpectedFound<&'tcx TyS<'tcx>>

ArgumentSorts(ExpectedFound<&'tcx TyS<'tcx>>, usize)

Tuple Fields

0: ExpectedFound<&'tcx TyS<'tcx>>
1: usize

IntMismatch(ExpectedFound<IntVarValue>)

Tuple Fields

FloatMismatch(ExpectedFound<FloatTy>)

Tuple Fields

Traits(ExpectedFound<DefId>)

Tuple Fields

VariadicMismatch(ExpectedFound<bool>)

Tuple Fields

CyclicTy(&'tcx TyS<'tcx>)

Tuple Fields

0: &'tcx TyS<'tcx>

Instantiating a type variable with the given type would have created a cycle (because it appears somewhere within that type).

CyclicConst(&'tcx Const<'tcx>)

Tuple Fields

0: &'tcx Const<'tcx>

ProjectionMismatched(ExpectedFound<DefId>)

Tuple Fields

ExistentialMismatch(ExpectedFound<&'tcx List<Binder<'tcx, ExistentialPredicate<'tcx>>>>)

Tuple Fields

ObjectUnsafeCoercion(DefId)

Tuple Fields

0: DefId

ConstMismatch(ExpectedFound<&'tcx Const<'tcx>>)

Tuple Fields

0: ExpectedFound<&'tcx Const<'tcx>>

IntrinsicCast

TargetFeatureCast(DefId)

Tuple Fields

0: DefId

Safe #[target_feature] functions are not assignable to safe function pointers.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

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

recently added

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Layout

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 32 bytes

Size for each variant: