fn type_category<'tcx>(t: Ty<'tcx>) -> Option<u32> {
            match t.sty {
                ty::TyBool => Some(0),
                ty::TyChar => Some(1),
                ty::TyStr => Some(2),
                ty::TyInt(..) | ty::TyUint(..) | ty::TyInfer(ty::IntVar(..)) => Some(3),
                ty::TyFloat(..) | ty::TyInfer(ty::FloatVar(..)) => Some(4),
                ty::TyRef(..) | ty::TyRawPtr(..) => Some(5),
                ty::TyArray(..) | ty::TySlice(..) => Some(6),
                ty::TyFnDef(..) | ty::TyFnPtr(..) => Some(7),
                ty::TyDynamic(..) => Some(8),
                ty::TyClosure(..) => Some(9),
                ty::TyTuple(..) => Some(10),
                ty::TyProjection(..) => Some(11),
                ty::TyParam(..) => Some(12),
                ty::TyAnon(..) => Some(13),
                ty::TyNever => Some(14),
                ty::TyAdt(adt, ..) => match adt.adt_kind() {
                    AdtKind::Struct => Some(15),
                    AdtKind::Union => Some(16),
                    AdtKind::Enum => Some(17),
                },
                ty::TyGenerator(..) => Some(18),
                ty::TyForeign(..) => Some(19),
                ty::TyGeneratorWitness(..) => Some(20),
                ty::TyInfer(..) | ty::TyError => None
            }
        }
/// returns the fuzzy category of a given type, or None
/// if the type can be equated to any type.
returns the fuzzy category of a given type, or None
if the type can be equated to any type.
returns the fuzzy category of a given type or None if the type can be equated to any type .
fn type_category<'tcx>(t: Ty<'tcx>) -> Option<u32> {
            match t.sty {
                ty::TyBool => Some(0),
                ty::TyChar => Some(1),
                ty::TyStr => Some(2),
                ty::TyInt(..) | ty::TyUint(..) | ty::TyInfer(ty::IntVar(..)) => Some(3),
                ty::TyFloat(..) | ty::TyInfer(ty::FloatVar(..)) => Some(4),
                ty::TyRef(..) | ty::TyRawPtr(..) => Some(5),
                ty::TyArray(..) | ty::TySlice(..) => Some(6),
                ty::TyFnDef(..) | ty::TyFnPtr(..) => Some(7),
                ty::TyDynamic(..) => Some(8),
                ty::TyClosure(..) => Some(9),
                ty::TyTuple(..) => Some(10),
                ty::TyProjection(..) => Some(11),
                ty::TyParam(..) => Some(12),
                ty::TyAnon(..) => Some(13),
                ty::TyNever => Some(14),
                ty::TyAdt(adt, ..) => match adt.adt_kind() {
                    AdtKind::Struct => Some(15),
                    AdtKind::Union => Some(16),
                    AdtKind::Enum => Some(17),
                },
                ty::TyGenerator(..) => Some(18),
                ty::TyForeign(..) => Some(19),
                ty::TyGeneratorWitness(..) => Some(20),
                ty::TyInfer(..) | ty::TyError => None
            }
        }
fn type_category < ' tcx > ( t : Ty < ' tcx > ) -> Option < u32 > { match t . sty { ty :: TyBool => Some ( 0 ) , ty :: TyChar => Some ( 1 ) , ty :: TyStr => Some ( 2 ) , ty :: TyInt ( .. ) | ty :: TyUint ( .. ) | ty :: TyInfer ( ty :: IntVar ( .. ) ) => Some ( 3 ) , ty :: TyFloat ( .. ) | ty :: TyInfer ( ty :: FloatVar ( .. ) ) => Some ( 4 ) , ty :: TyRef ( .. ) | ty :: TyRawPtr ( .. ) => Some ( 5 ) , ty :: TyArray ( .. ) | ty :: TySlice ( .. ) => Some ( 6 ) , ty :: TyFnDef ( .. ) | ty :: TyFnPtr ( .. ) => Some ( 7 ) , ty :: TyDynamic ( .. ) => Some ( 8 ) , ty :: TyClosure ( .. ) => Some ( 9 ) , ty :: TyTuple ( .. ) => Some ( 10 ) , ty :: TyProjection ( .. ) => Some ( 11 ) , ty :: TyParam ( .. ) => Some ( 12 ) , ty :: TyAnon ( .. ) => Some ( 13 ) , ty :: TyNever => Some ( 14 ) , ty :: TyAdt ( adt , .. ) => match adt . adt_kind ( ) { AdtKind :: Struct => Some ( 15 ) , AdtKind :: Union => Some ( 16 ) , AdtKind :: Enum => Some ( 17 ) , } , ty :: TyGenerator ( .. ) => Some ( 18 ) , ty :: TyForeign ( .. ) => Some ( 19 ) , ty :: TyGeneratorWitness ( .. ) => Some ( 20 ) , ty :: TyInfer ( .. ) | ty :: TyError => None } }
returns the fuzzy category of a given type, or None
if the type can be equated to any type.
returns the fuzzy category of a given type or None if the type can be equated to any type .
t
Ty<'tcx>
t
Ty<'tcx>