diff --git a/Cargo.toml b/Cargo.toml index 53bcbec..ab1cb70 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "typewit" -version = "1.10.0" +version = "1.10.1" authors = ["rodrimati1992 "] rust-version = "1.57.0" edition = "2021" diff --git a/Changelog.md b/Changelog.md index bc8f3af..b7282b8 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,10 @@ This is the changelog, summarising changes in each version(some minor changes ma # 1.0 +### 1.10.1 + +Fixed `TypeWitnessTypeArg` impl for `BoolWitG`, it was overconstrained in a way that made `HasTypeWitness>` not work as a bound. + ### 1.10.0 Added `typewit::const_marker::BoolWitG` enum @@ -239,4 +243,4 @@ Declared these crate features: - `mut_refs` - `nightly_mut_refs` -Set the Minimum Supported Rust Version to 1.61.0 \ No newline at end of file +Set the Minimum Supported Rust Version to 1.61.0 diff --git a/src/const_marker/boolwit.rs b/src/const_marker/boolwit.rs index cf89277..3c349fe 100644 --- a/src/const_marker/boolwit.rs +++ b/src/const_marker/boolwit.rs @@ -171,6 +171,27 @@ pub type BoolWit = BoolWitG>; /// Use this over [`BoolWit`] if you want to write a [`HasTypeWitness`] bound /// and adding a `const B: bool` parameter would be impossible. /// +/// # Example +/// +/// This basic example demonstrates where `BoolWitG` would be used instead of `BoolWit`. +/// +/// ```rust +/// use typewit::const_marker::{Bool, BoolWitG}; +/// use typewit::HasTypeWitness; +/// +/// +/// trait Boolean: Sized + HasTypeWitness> { +/// type Not: Boolean; +/// } +/// +/// impl Boolean for Bool { +/// type Not = Bool; +/// } +/// +/// impl Boolean for Bool { +/// type Not = Bool; +/// } +/// ``` /// /// [`HasTypeWitness`]: crate::HasTypeWitness pub enum BoolWitG { @@ -197,8 +218,8 @@ impl Debug for BoolWitG> { } } -impl TypeWitnessTypeArg for BoolWitG> { - type Arg = Bool; +impl TypeWitnessTypeArg for BoolWitG { + type Arg = B; } impl MakeTypeWitness for BoolWitG> {