diff options
| author | bors <bors@rust-lang.org> | 2013-05-08 07:24:39 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-05-08 07:24:39 -0700 |
| commit | 8f94ac6118a3ce97d3d1186b38217a6ca4803771 (patch) | |
| tree | 31cd64d5fce64b71314c8ef1e9efcdae07f7e5ff /src/rt/rust_run_program.cpp | |
| parent | 37becd887e74383cafd2930a87dfbb8f19c5af15 (diff) | |
| parent | 08c80544662f53867551e689e47f8c4f363199cd (diff) | |
| download | rust-8f94ac6118a3ce97d3d1186b38217a6ca4803771.tar.gz rust-8f94ac6118a3ce97d3d1186b38217a6ca4803771.zip | |
auto merge of #6267 : huonw/rust/syntax-deriving-generaliseder, r=nikomatsakis
This "finishes" the generic deriving code (which I started in #5640), in the sense it supports everything that I can think of being useful. (Including lifetimes and type parameters on methods and traits, arguments and return values of (almost) any type, static methods.)
It closes #6149, but met with #6257, so the following doesn't work:
```rust
#[deriving(TotalEq)]
struct Foo<'self>(&'self int);
```
(It only fails for `TotalOrd`, `TotalEq` and `Clone`, since they are the only ones that call a method directly on sub-elements of the type, which means that the auto-deref interferes with the pointer.)
It also makes `Rand` (chooses a random variant, fills the fields with random values, including recursively for recursive types) and `ToStr` (`x.to_str()` is the same as `fmt!("%?", x)`) derivable, as well as converting IterBytes to the generic code (which made the code 2.5x shorter, more robust and added support for tuple structs).
({En,De}codable are trickier, so I'll convert them over later.)
Diffstat (limited to 'src/rt/rust_run_program.cpp')
0 files changed, 0 insertions, 0 deletions
