[rust-dev] Addressing "the hashtable problem" with type classes

Lindsey Kuper lindsey at rockstargirl.org
Mon Jul 2 10:46:44 PDT 2012


On Fri, Jun 29, 2012 at 12:54 PM, Lindsey Kuper
<lindsey at rockstargirl.org> wrote:
> So, I want to get an actual-running-code example of the instance
> coherence problem as it stands in Rust, and Niko's example here seems
> like a good place to start.  Is "impl hash for uint" a typo for "impl
> of hash for uint"?

For those playing at home, yes, the missing "of" was a typo.  Here's a
version that compiles (with the addition of `/~` at the end of the
vector, if your version of Rust uses the transitional vector syntax)
and runs that demonstrates instance coherence:
http://pastebin.com/TfReiNUR .  Thanks to gwillen on IRC for
contributing it.

Lindsey


More information about the Rust-dev mailing list