typewit
type-witness-based abstractions, mostly for emulating polymorphism in const fns
1.15.2
17M downloads/mo
#2259 most downloaded on crates.io
rodrimati1992/typewit
What this package is like to depend on
Last release 4 months ago
14 Apr 2026
Release timing varies
gaps range from 9 days to 11 months
Most releases are documented
notes for 19 of 23 stable releases
1 version withdrawn
withdrawn after publishing
3 years old
24 releases · first in 2023
6 releases in the last 12 months
see the full history below
Release timeline
24 releases · Apr 2023 to Apr 2026Releases
latest 24-
1.15.214 Apr 2026 -
1.15.104 Apr 2026 -
1.15.001 Apr 2026Release notes
Open source →This release adds some std and serde impls for const marker types.
Changelog
Added opt-in
"serde"featureAdded these impls for const marker types:
DefaultHashOrdPartialOrdserde::Deserialize(gated on"serde"feature)serde::Serialize(gated on"serde"feature)
Release notes
Open source →Added opt-in
"serde"featureAdded these impls for const marker types:
DefaultHashOrdPartialOrdserde::Deserialize(gated on"serde"feature)serde::Serialize(gated on"serde"feature)
-
1.14.211 Sep 2025Nothing published for this version
-
1.14.106 Sep 2025Release notes
Open source →Fix: Added docs to
simple_type_witness-generatedequalsmethod to avoid triggeringmissing_docslint in downstream crates. -
1.14.001 Sep 2025Release notes
Open source →This release adds traits for abstracting over const markers, traits for const marker comparison, and
expect_*methods toBoolWitGandTypeCmp.Changelog
1.14.0
Added
expect_trueandexpect_falsemethods totypewit::const_marker::BoolWitGAdded
expect_eqandexpect_nemethods totypewit::TypeCmpAdded these items:
typewit::const_marker::ConstMarkertraittypewit::const_marker::ConstMarkerOftrait (alias forConstMarker)
Added these items (gated on
"rust_1_83"feature):typewit::const_marker::CmEqualstype aliastypewit::const_marker::ConstMarkerEqtraittypewit::const_marker::ConstMarkerEqOftrait (alias forConstMarkerEq)typewit::const_marker::ConstMarkerHasWitnesstrait (with a blanket impl)typewit::const_marker::HasConstMarkertraittypewit::const_marker::StdTypeEqualitytype
Added
ConstMarker,ConstMarkerEqimpls for std-related marker types fromtypewit::const_marker.Added
HasConstMarkerimpls for std types.Changed Debug impls of const marker types from only formatting their type name to delegating to the const parameter.
Added
PartialEqandEqimpls for const marker types.Release notes
Open source →Added
expect_trueandexpect_falsemethods totypewit::const_marker::BoolWitGAdded
expect_eqandexpect_nemethods totypewit::TypeCmpAdded these items:
typewit::const_marker::ConstMarkertraittypewit::const_marker::ConstMarkerOftrait (alias forConstMarker)
Added these items (gated on
"rust_1_83"feature):typewit::const_marker::CmEqualstype aliastypewit::const_marker::ConstMarkerEqtraittypewit::const_marker::ConstMarkerEqOftrait (alias forConstMarkerEq)typewit::const_marker::ConstMarkerHasWitnesstrait (with a blanket impl)typewit::const_marker::HasConstMarkertraittypewit::const_marker::StdTypeEqualitytype
Added
ConstMarker,ConstMarkerEqimpls for std-related marker types fromtypewit::const_marker.Added
HasConstMarkerimpls for std types.Changed Debug impls of const marker types from only formatting their type name to delegating to the const parameter.
Added
PartialEqandEqimpls for const marker types. -
1.13.023 Aug 2025Release notes
Open source →This release adds the
map_to_argandproject_to_argmethods toTypeNeto use the fact thatf(a) != f(b)impliesa != b, and anEqualsderive insimple_type_witnessmacro.Changelog
1.13.0
Added
TypeNe::{map_to_arg, project_to_arg}methods.Added
Equalsderive tosimple_type_witnessmacro, which definesequalsinherent method on the type witness.1.12.0
Added
"generic_const_exprs"crate feature, currently only used for doc examples.Fixed outdated README feature section.
Release notes
Open source →Added
TypeNe::{map_to_arg, project_to_arg}methods.Added
Equalsderive tosimple_type_witnessmacro, which definesequalsinherent method on the type witness. -
1.12.120 Jul 2025Nothing published for this version
-
1.12.020 Jul 2025Release notes
Open source →Added
"generic_const_exprs"crate feature, currently only used for doc examples.Fixed outdated README feature section.
-
1.11.004 Dec 2024Release notes
Open source →This release allows using functions that use
&mutin const contexts on the latest Rust release (Rust 1.83.0).Changelog
1.11.0
Added
"rust_1_83"feature, which turnstypewitfunctions that use&mutinto const fns.Added these methods to
BoolWitG:is_trueis_falseto_trueto_falseunwrap_trueunwrap_false
Relaxed
Copy + Clone + Debugimpls ofBooleanWitGto work for any<B> BooleanWitG<B>, instead of requiring<const B: bool> BoolWitG<Bool<B>>.1.10.1
Fixed
TypeWitnessTypeArgimpl forBoolWitG, it was overconstrained in a way that madeHasTypeWitness<BoolWitG<T>>not work as a bound.1.10.0
Added
typewit::const_marker::BoolWitGenumReplaced
typewit::const_marker::BoolWitenum with type alias to `BoolWitG``Added
Copy + Clone + Debugimpls toBoolWitFixed
"adt_const_marker"crate featureRelease notes
Open source →Added
"rust_1_83"feature, which turnstypewitfunctions that use&mutinto const fns.Added these methods to
BoolWitG:is_trueis_falseto_trueto_falseunwrap_trueunwrap_false
Relaxed
Copy + Clone + Debugimpls ofBooleanWitGto work for any<B> BooleanWitG<B>, instead of requiring<const B: bool> BoolWitG<Bool<B>>. -
1.10.126 Nov 2024Release notes
Open source →Fixed
TypeWitnessTypeArgimpl forBoolWitG, it was overconstrained in a way that madeHasTypeWitness<BoolWitG<T>>not work as a bound. -
1.10.026 Nov 2024 withdrawnRelease notes
Open source →Added
typewit::const_marker::BoolWitGenumReplaced
typewit::const_marker::BoolWitenum with type alias to `BoolWitG``Added
Copy + Clone + Debugimpls toBoolWitFixed
"adt_const_marker"crate feature -
1.9.006 Jan 2024Release notes
Open source →This release deprecates
TypeCmp::with_anyandTypeNe::with_anydue to an unsoundness bug.Changelog
1.9.0
Deprecated
{TypeCmp, TypeNe}::with_anydue to unsoundness: both constructors rely onTypeId::of::<L>() != TypeId::of::<R>()implyingL != R, which is not true in the general case.Release notes
Open source →Deprecated
{TypeCmp, TypeNe}::with_anydue to unsoundness: both constructors rely onTypeId::of::<L>() != TypeId::of::<R>()implyingL != R, which is not true in the general case. -
1.8.005 Oct 2023Release notes
Open source →This release includes many new features, with these as the main ones:
- injective type-level functions
TypeCmpenum for representing "TypeEqorTypeNe"- Parity of
TypeEqAPIs inTypeNe - more generic free function equivalents of
TypeCmp/TypeEq/TypeNemethods inmethodsmodule
Changelog
The changes since the 1.7 version
1.8
Added
"rust_1_65"featureAdded
BaseTypeWitnesstrait, which requires"rust_1_61"feature.Added
MetaBaseTypeWitenum, which requires"rust_1_61"feature.Added these items to
type_fnmodule:InjTypeFntraitRevTypeFntraitFnRevtype-level functionCallInjFntype aliasUncallFntype alias
Added
inj_type_fnmacroAdded reexport of these in
type_fnmodule:inj_type_fnmacrotype_fnmacro
Added
TypeCmpenumAdded these associated items to
TypeEq:with_anyconstructorto_cmpmethodunmapmethodunprojectmethod
Added
type_nemacroAdded these associated items to
TypeNe:with_anyconstructorwith_fnconstructorto_cmpmethodflipmethodjoin_leftmethodjoin_rightmethodmapmethodprojectmethodunmapmethodunprojectmethodin_mutmethodin_refmethodin_arraymethod (requires"rust_1_61"feature)zipmethod (requires"rust_1_61"feature)zip3method (requires"rust_1_61"feature)zip4method (requires"rust_1_61"feature)
Removed the need to enable
"const_marker"feature to enableconst_markermodule.Added
equalsmethod to all marker types inconst_markermodule.Deprecated
eqmethods of all marker types inconst_markermodule.Added
type_constructorsmodule, which requires"rust_1_65"and includes these items:BaseTypeWitnessTctraitTcTypeCmpstructTcTypeEqstructTcTypeNestructBaseTypeWitnessReparamtype aliasBaseTypeWitnessToTctype aliasMapBaseTypeWitnesstype aliasTcToBaseTypeWitnesstype alias
Added
methodsmodule, which requires"rust_1_65"and includes these items:zippingmodulein_arrayfunctionzip2functionzip3functionzip4function
The
methods::zippingsubmodule (which requires"rust_1_65") contains:Zip2traitZip3traitZip4traitZip2Outtype aliasZip3Outtype aliasZip4Outtype alias
Added
type_nemodule, which contains:- reexport of
TypeNe - reexport of
type_nemacro LeftArgmarker typeRightArgmarker type
Added
typewit_proc_macrosoptional dependency.Added
"proc_macros"feature, enabled by default, which enablestypewit_proc_macrosdependency.Release notes
Open source →Added
"rust_1_65"featureAdded
BaseTypeWitnesstrait, which requires"rust_1_61"feature.Added
MetaBaseTypeWitenum, which requires"rust_1_61"feature.Added these items to
type_fnmodule:InjTypeFntraitRevTypeFntraitFnRevtype-level functionCallInjFntype aliasUncallFntype alias
Added
inj_type_fnmacroAdded reexport of these in
type_fnmodule:inj_type_fnmacrotype_fnmacro
Added
TypeCmpenumAdded these associated items to
TypeEq:with_anyconstructorto_cmpmethodunmapmethodunprojectmethod
Added
type_nemacroAdded these associated items to
TypeNe:with_anyconstructorwith_fnconstructorto_cmpmethodflipmethodjoin_leftmethodjoin_rightmethodmapmethodprojectmethodunmapmethodunprojectmethodin_mutmethodin_refmethodin_arraymethod (requires"rust_1_61"feature)zipmethod (requires"rust_1_61"feature)zip3method (requires"rust_1_61"feature)zip4method (requires"rust_1_61"feature)
Removed the need to enable
"const_marker"feature to enableconst_markermodule.Added
equalsmethod to all marker types inconst_markermodule.Deprecated
eqmethods of all marker types inconst_markermodule.Added
type_constructorsmodule, which requires"rust_1_65"and includes these items:BaseTypeWitnessTctraitTcTypeCmpstructTcTypeEqstructTcTypeNestructBaseTypeWitnessReparamtype aliasBaseTypeWitnessToTctype aliasMapBaseTypeWitnesstype aliasTcToBaseTypeWitnesstype alias
Added
methodsmodule, which requires"rust_1_65"and includes these items:zippingmodulein_arrayfunctionzip2functionzip3functionzip4function
The
methods::zippingsubmodule (which requires"rust_1_65") contains:Zip2traitZip3traitZip4traitZip2Outtype aliasZip3Outtype aliasZip4Outtype alias
Added
type_nemodule, which contains:- reexport of
TypeNe - reexport of
type_nemacro LeftArgmarker typeRightArgmarker type
Added
typewit_proc_macrosoptional dependency.Added
"proc_macros"feature, enabled by default, which enablestypewit_proc_macrosdependency. -
1.7.010 Sep 2023Release notes
Open source →This release adds a
polymatchmacro.(don't know how it took me until this release to start marking the releases on GitHub)
Changelog
All of the changelog up to this point.
1.0
1.7.0
Added
polymatchmacro.1.6.0
Added
"adt_const_marker"feature.Added
BoolWitintypewit::const_markerAdded these structs in
typewit::const_marker(under the"adt_const_marker"feature):Str(unit struct)
Added these structs in
typewit::const_marker::slice(under the"adt_const_marker"feature):BoolSlice(unit struct)CharSlice(unit struct)I8Slice(unit struct)I16Slice(unit struct)I32Slice(unit struct)I64Slice(unit struct)I128Slice(unit struct)IsizeSlice(unit struct)StrSlice(unit struct)U8Slice(unit struct)U16Slice(unit struct)U32Slice(unit struct)U64Slice(unit struct)U128Slice(unit struct)UsizeSlice(unit struct)
Changed
"nightly_mut_refs*"crate feature to enable the"rust_stable"feature.1.5.0
Added support for these to
simple_type_witnessmacro:- Generic parameters using
< >syntax - Non-
[ ]-surroundedwhereclauses #[cfg(...)]attributes on variants and generic parameters- Using
__Witin constraints. - Defaulted generic parameters (only used for defaulting generic arguments in
MakeTypeWitnessimpls)
Added support for
#[cfg(...)]attributes on generic parameters totype_fnmacro.1.4.0
Added
Identitytrait1.3.0
Added
type_fnmacro.1.2.0
Added
"const_marker"feature, enabled by the default feature.Added
const_markermodule, conditional on"const_marker"feature, with these items:Bool(unit struct)Char(unit struct)I128(unit struct)I16(unit struct)I32(unit struct)I64(unit struct)I8(unit struct)Isize(unit struct)U128(unit struct)U16(unit struct)U32(unit struct)U64(unit struct)U8(unit struct)Usize(unit struct)
Every type in
const_markerdefines aneqmethod, and implementCopy + Clone + Debug.Added
TypeNetype, with anew_uncheckedconstructor function.
TypeNeimplementsClone,Copy,Debug,Eq,Hash,Ord,PartialEq,PartialOrd.Added
TypeEq::{in_array, zip, zip3, zip4}methodsAdded
typewit::type_fn::FnIdentitytype-level function.1.1.0
Reduced Minimum Supported Rust Version to 1.57.0
Added
"rust_stable"and"rust_1_61"featuresAdded
type_fn::Invokestruct, which implementsTypeFn.Removed blanket impl of
TypeFnforFn(minor breaking change)1.0.0
Declared
TypeEqstruct, with these associated items:NEW(associated constant)flip(method)in_box(method)in_mut(method)in_ref(method)join(method)map(method)new(method)new_unchecked(method)project(method)reachability_hint(method)to_left(method)to_right(method)
TypeEqimplementsClone,Copy,Debug,Default,Eq,Hash,MakeTypeWitness,Ord,PartialEq,PartialOrd,TypeWitnessTypeArg.
Declared
type_eqfunction.Declared
HasTypeWitness,MakeTypeWitness,TypeWitnessTypeArgtraits.Declared
simple_type_witnessmacro.Declared
type_fnmodule with these items:TypeFntraitCallFntype alias- GBox (structs), this implements
TypeFn - GRef (structs), this implements
TypeFn - GRefMut (structs), this implements
TypeFn
Declared these crate features:
allocmut_refsnightly_mut_refs
Set the Minimum Supported Rust Version to 1.61.0
-
1.6.007 Sep 2023Release notes
Open source →Added
"adt_const_marker"feature.Added
BoolWitintypewit::const_markerAdded these structs in
typewit::const_marker(under the"adt_const_marker"feature):Str(unit struct)
Added these structs in
typewit::const_marker::slice(under the"adt_const_marker"feature):BoolSlice(unit struct)CharSlice(unit struct)I8Slice(unit struct)I16Slice(unit struct)I32Slice(unit struct)I64Slice(unit struct)I128Slice(unit struct)IsizeSlice(unit struct)StrSlice(unit struct)U8Slice(unit struct)U16Slice(unit struct)U32Slice(unit struct)U64Slice(unit struct)U128Slice(unit struct)UsizeSlice(unit struct)
Changed
"nightly_mut_refs*"crate feature to enable the"rust_stable"feature. -
1.5.023 Jul 2023Release notes
Open source →Added support for these to
simple_type_witnessmacro:- Generic parameters using
< >syntax - Non-
[ ]-surroundedwhereclauses #[cfg(...)]attributes on variants and generic parameters- Using
__Witin constraints. - Defaulted generic parameters (only used for defaulting generic arguments in
MakeTypeWitnessimpls)
Added support for
#[cfg(...)]attributes on generic parameters totype_fnmacro. - Generic parameters using
-
1.4.013 Jun 2023 -
1.3.024 May 2023 -
1.2.018 May 2023Release notes
Open source →Added
"const_marker"feature, enabled by the default feature.Added
const_markermodule, conditional on"const_marker"feature, with these items:Bool(unit struct)Char(unit struct)I128(unit struct)I16(unit struct)I32(unit struct)I64(unit struct)I8(unit struct)Isize(unit struct)U128(unit struct)U16(unit struct)U32(unit struct)U64(unit struct)U8(unit struct)Usize(unit struct)
Every type in
const_markerdefines aneqmethod, and implementCopy + Clone + Debug.Added
TypeNetype, with anew_uncheckedconstructor function.TypeNeimplementsClone,Copy,Debug,Eq,Hash,Ord,PartialEq,PartialOrd.Added
TypeEq::{in_array, zip, zip3, zip4}methodsAdded
typewit::type_fn::FnIdentitytype-level function. -
1.1.130 Apr 2023Nothing published for this version
-
1.1.030 Apr 2023Release notes
Open source →Reduced Minimum Supported Rust Version to 1.57.0
Added
"rust_stable"and"rust_1_61"featuresAdded
type_fn::Invokestruct, which implementsTypeFn.Removed blanket impl of
TypeFnforFn(minor breaking change) -
1.0.029 Apr 2023Release notes
Open source →Declared
TypeEqstruct, with these associated items:NEW(associated constant)flip(method)in_box(method)in_mut(method)in_ref(method)join(method)map(method)new(method)new_unchecked(method)project(method)reachability_hint(method)to_left(method)to_right(method)TypeEqimplementsClone,Copy,Debug,Default,Eq,Hash,MakeTypeWitness,Ord,PartialEq,PartialOrd,TypeWitnessTypeArg.
Declared
type_eqfunction.Declared
HasTypeWitness,MakeTypeWitness,TypeWitnessTypeArgtraits.Declared
simple_type_witnessmacro.Declared
type_fnmodule with these items:TypeFntraitCallFntype alias- GBox (structs), this implements
TypeFn - GRef (structs), this implements
TypeFn - GRefMut (structs), this implements
TypeFn
Declared these crate features:
allocmut_refsnightly_mut_refs
Set the Minimum Supported Rust Version to 1.61.0
-
0.0.123 Apr 2023Nothing published for this version