mozilla/rust — pull request #14219 by kballard (2014-05-15 04:29:56+00:00)
Title: Extend #[deriving(Default)] to support specified field defaults

When deriving the Default trait, individual struct fields can be marked
up with a `#[default="expr"]` attribute to indicate that this field
should be given the results of `expr` instead of `Default::default()`.

Example:

#[deriving(Default)]
struct Foo {
#[default="42"]
x: int,
#[default="Ok(())"]
err: IoResult<()>
}