Created
July 10, 2017 16:54
-
-
Save kyleheadley/8a25a08e44c226202aa6a3f221a23bf8 to your computer and use it in GitHub Desktop.
Possible alternative for missing type equality in rust trait impl's
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait F<V,X> {} | |
struct D; | |
trait TheV2 { | |
type IsThis; | |
} | |
impl<V1,V2> TheV2 for F<V1,V2> { | |
type IsThis = V2; | |
} | |
impl<V1,V2> F<V1,V2> for D where | |
V1:F<V2,bool>, | |
V2:F<usize,V1>, | |
//V1==V2 // not implemented in compiler | |
F<V1,V2>: TheV2<IsThis=V1> // alternative!? | |
{} | |
fn main() { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment