Skip to content

Instantly share code, notes, and snippets.

Created January 4, 2015 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/9978fc4970927eff3478 to your computer and use it in GitHub Desktop.
Save anonymous/9978fc4970927eff3478 to your computer and use it in GitHub Desktop.
#![feature(phase)]
#![no_std]
#![feature(globs)]
#[phase(plugin, link)]
extern crate "std" as std;
extern crate serialize;
#[prelude_import]
use std::prelude::v1::*;
struct Foo(int);
#[automatically_derived]
impl <__S: ::serialize::Encoder> ::serialize::Encodable<__S> for Foo {
fn encode(&self, __arg_0: &mut __S)
-> ::std::result::Result<(), ::__S::Error> {
match *self {
Foo(ref __self_0_0) =>
__arg_0.emit_struct("Foo", 1u, |_e| {
return _e.emit_struct_field("_field0", 0u,
|_e|
(*__self_0_0).encode(_e));
}),
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment