Last active
March 7, 2019 22:33
-
-
Save alexreg/f073d737ae1db10034082e1a3e9c906e to your computer and use it in GitHub Desktop.
associated type bounds in traits
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 Foo where <Self::Bar as Iterator>: Send { | |
type Bar: Iterator; | |
} | |
impl Foo for () { | |
type Bar = Iteerator<Item = ()>; | |
} |
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 Foo { | |
type Bar: Iterator<Item = _0>; | |
type _0: Send; | |
} | |
impl Foo for () { | |
type Bar = Iterator<Item = _0>; | |
type _0 = (); | |
} |
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 Foo { | |
type Bar: Iterator<Item: Send>; | |
} | |
impl Foo for () { | |
type Bar = Iterator<Item = ()>; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment