Enum rustc_middle::ty::error::TypeError[][src]

pub enum TypeError<'tcx> {
Show 27 variants Mismatch, ConstnessMismatch(ExpectedFound<BoundConstness>), UnsafetyMismatch(ExpectedFound<Unsafety>), AbiMismatch(ExpectedFound<Abi>), Mutability, ArgumentMutability(usize), TupleSize(ExpectedFound<usize>), FixedArraySize(ExpectedFound<u64>), ArgCount, RegionsDoesNotOutlive(Region<'tcx>, Region<'tcx>), RegionsInsufficientlyPolymorphic(BoundRegionKindRegion<'tcx>), RegionsOverlyPolymorphic(BoundRegionKindRegion<'tcx>), RegionsPlaceholderMismatch, Sorts(ExpectedFound<Ty<'tcx>>), ArgumentSorts(ExpectedFound<Ty<'tcx>>, usize), IntMismatch(ExpectedFound<IntVarValue>), FloatMismatch(ExpectedFound<FloatTy>), Traits(ExpectedFound<DefId>), VariadicMismatch(ExpectedFound<bool>), CyclicTy(Ty<'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 of ConstnessMismatch

0: ExpectedFound<BoundConstness>
UnsafetyMismatch(ExpectedFound<Unsafety>)

Tuple Fields of UnsafetyMismatch

0: ExpectedFound<Unsafety>
AbiMismatch(ExpectedFound<Abi>)

Tuple Fields of AbiMismatch

0: ExpectedFound<Abi>
Mutability
ArgumentMutability(usize)

Tuple Fields of ArgumentMutability

0: usize
TupleSize(ExpectedFound<usize>)

Tuple Fields of TupleSize

0: ExpectedFound<usize>
FixedArraySize(ExpectedFound<u64>)

Tuple Fields of FixedArraySize

0: ExpectedFound<u64>
ArgCount
RegionsDoesNotOutlive(Region<'tcx>, Region<'tcx>)

Tuple Fields of RegionsDoesNotOutlive

0: Region<'tcx>1: Region<'tcx>
RegionsInsufficientlyPolymorphic(BoundRegionKindRegion<'tcx>)

Tuple Fields of RegionsInsufficientlyPolymorphic

0: BoundRegionKind1: Region<'tcx>
RegionsOverlyPolymorphic(BoundRegionKindRegion<'tcx>)

Tuple Fields of RegionsOverlyPolymorphic

0: BoundRegionKind1: Region<'tcx>
RegionsPlaceholderMismatch
Sorts(ExpectedFound<Ty<'tcx>>)

Tuple Fields of Sorts

0: ExpectedFound<Ty<'tcx>>
ArgumentSorts(ExpectedFound<Ty<'tcx>>, usize)

Tuple Fields of ArgumentSorts

0: ExpectedFound<Ty<'tcx>>1: usize
IntMismatch(ExpectedFound<IntVarValue>)

Tuple Fields of IntMismatch

0: ExpectedFound<IntVarValue>
FloatMismatch(ExpectedFound<FloatTy>)

Tuple Fields of FloatMismatch

0: ExpectedFound<FloatTy>
Traits(ExpectedFound<DefId>)

Tuple Fields of Traits

0: ExpectedFound<DefId>
VariadicMismatch(ExpectedFound<bool>)

Tuple Fields of VariadicMismatch

0: ExpectedFound<bool>
CyclicTy(Ty<'tcx>)

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

Tuple Fields of CyclicTy

0: Ty<'tcx>
CyclicConst(&'tcx Const<'tcx>)

Tuple Fields of CyclicConst

0: &'tcx Const<'tcx>
ProjectionMismatched(ExpectedFound<DefId>)

Tuple Fields of ProjectionMismatched

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

Tuple Fields of ExistentialMismatch

0: ExpectedFound<&'tcx List<Binder<'tcx, ExistentialPredicate<'tcx>>>>
ObjectUnsafeCoercion(DefId)

Tuple Fields of ObjectUnsafeCoercion

0: DefId
ConstMismatch(ExpectedFound<&'tcx Const<'tcx>>)

Tuple Fields of ConstMismatch

0: ExpectedFound<&'tcx Const<'tcx>>
IntrinsicCast
TargetFeatureCast(DefId)

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

Tuple Fields of TargetFeatureCast

0: DefId

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Explains the source of a type err in a short, human readable way. This is meant to be placed in parentheses after some larger message. You should also invoke note_and_explain_type_err() afterwards to present additional details, particularly when it comes to lifetime-related errors.

Formats the value using the given formatter. Read more

Performs the conversion.

Returns true if self has any late-bound regions that are either bound by binder or bound by some binder outside of binder. If binder is ty::INNERMOST, this indicates whether there are any late-bound regions that appear free. Read more

Returns true if this self has any regions that escape binder (and hence are not bound by it). Read more

“Free” regions in this context means that it has any region that is not (a) erased or (b) late-bound. Read more

True if there are any un-erased free regions.

Indicates whether this value definitely references only ‘global’ generic parameters that are the same regardless of what fn we are in. This is used for caching. Read more

Indicates whether this value references only ‘global’ generic parameters that are the same regardless of what fn we are in. This is used for caching. Read more

True if there are any late-bound regions

Indicates whether this value still has parameters/placeholders/inference variables which could be replaced later, in a way that would change the results of impl specialization. Read more

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: