rustc_middle::ty::error

Type Alias TypeError

source
pub type TypeError<'tcx> = TypeError<TyCtxt<'tcx>>;

Aliased Type§

enum TypeError<'tcx> {
Show 24 variants Mismatch, ConstnessMismatch(ExpectedFound<BoundConstness>), PolarityMismatch(ExpectedFound<PredicatePolarity>), SafetyMismatch(ExpectedFound<Safety>), AbiMismatch(ExpectedFound<Abi>), Mutability, ArgumentMutability(usize), TupleSize(ExpectedFound<usize>), FixedArraySize(ExpectedFound<u64>), ArgCount, RegionsDoesNotOutlive(Region<'tcx>, Region<'tcx>), RegionsInsufficientlyPolymorphic(BoundRegion, Region<'tcx>), RegionsPlaceholderMismatch, Sorts(ExpectedFound<Ty<'tcx>>), ArgumentSorts(ExpectedFound<Ty<'tcx>>, usize), Traits(ExpectedFound<DefId>), VariadicMismatch(ExpectedFound<bool>), CyclicTy(Ty<'tcx>), CyclicConst(Const<'tcx>), ProjectionMismatched(ExpectedFound<DefId>), ExistentialMismatch(ExpectedFound<&'tcx RawList<(), Binder<TyCtxt<'tcx>, ExistentialPredicate<TyCtxt<'tcx>>>>>), ConstMismatch(ExpectedFound<Const<'tcx>>), IntrinsicCast, TargetFeatureCast(DefId),
}

Variants§

§

Mismatch

§

ConstnessMismatch(ExpectedFound<BoundConstness>)

§

PolarityMismatch(ExpectedFound<PredicatePolarity>)

§

SafetyMismatch(ExpectedFound<Safety>)

§

AbiMismatch(ExpectedFound<Abi>)

§

Mutability

§

ArgumentMutability(usize)

§

TupleSize(ExpectedFound<usize>)

§

FixedArraySize(ExpectedFound<u64>)

§

ArgCount

§

RegionsDoesNotOutlive(Region<'tcx>, Region<'tcx>)

§

RegionsInsufficientlyPolymorphic(BoundRegion, Region<'tcx>)

§

RegionsPlaceholderMismatch

§

Sorts(ExpectedFound<Ty<'tcx>>)

§

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

§

Traits(ExpectedFound<DefId>)

§

VariadicMismatch(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).

§

CyclicConst(Const<'tcx>)

§

ProjectionMismatched(ExpectedFound<DefId>)

§

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

§

ConstMismatch(ExpectedFound<Const<'tcx>>)

§

IntrinsicCast

§

TargetFeatureCast(DefId)

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

Trait Implementations§

source§

impl<'tcx> TypeErrorToStringExt<'tcx> for TypeError<'tcx>

source§

fn to_string(self, tcx: TyCtxt<'tcx>) -> Cow<'static, str>

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:

  • Mismatch: 0 bytes
  • ConstnessMismatch: 2 bytes
  • PolarityMismatch: 2 bytes
  • SafetyMismatch: 2 bytes
  • AbiMismatch: 4 bytes
  • Mutability: 0 bytes
  • ArgumentMutability: 15 bytes
  • TupleSize: 23 bytes
  • FixedArraySize: 23 bytes
  • ArgCount: 0 bytes
  • RegionsDoesNotOutlive: 23 bytes
  • RegionsInsufficientlyPolymorphic: 31 bytes
  • RegionsPlaceholderMismatch: 0 bytes
  • Sorts: 23 bytes
  • ArgumentSorts: 31 bytes
  • Traits: 19 bytes
  • VariadicMismatch: 2 bytes
  • CyclicTy: 15 bytes
  • CyclicConst: 15 bytes
  • ProjectionMismatched: 19 bytes
  • ExistentialMismatch: 23 bytes
  • ConstMismatch: 23 bytes
  • IntrinsicCast: 0 bytes
  • TargetFeatureCast: 11 bytes