Skip to content

Instantly share code, notes, and snippets.

@alexreg
Last active March 7, 2019 22:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexreg/f073d737ae1db10034082e1a3e9c906e to your computer and use it in GitHub Desktop.
Save alexreg/f073d737ae1db10034082e1a3e9c906e to your computer and use it in GitHub Desktop.
associated type bounds in traits
trait Foo where <Self::Bar as Iterator>: Send {
type Bar: Iterator;
}
impl Foo for () {
type Bar = Iteerator<Item = ()>;
}
trait Foo {
type Bar: Iterator<Item = _0>;
type _0: Send;
}
impl Foo for () {
type Bar = Iterator<Item = _0>;
type _0 = ();
}
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