mozilla/rust — pull request #3757 by erickt (2012-10-13 17:32:47+00:00)
Title: libstd: make Serializer a trait-level typaram (#3740)

This patch implements @nikomatsakis's serialization specializtion (issue #3740). It does not yet extend `#[auto_serialize]` to implement `Serializable` for a specific serializer however.

Even though I got this to work, I'm not sure if I want to merge it in. It feels wrong that either one can make a `Serializable` that works for all `Serializer`s, or that only works with one specific `Serializer`. This means we can't write code like https://gist.github.com/3885448. Threading state through the serializers may make things a little more ugly, it might be more flexible in the future.