diff options
| author | bors <bors@rust-lang.org> | 2015-03-26 13:38:41 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-03-26 13:38:41 +0000 |
| commit | 557d4346a26266d2eb13f6b0adf106b8873b0da1 (patch) | |
| tree | d090541009a2400121f5bac3bca1002598eade28 /src/libstd/thread | |
| parent | 1501f33e76f6f9621aa08fb0cbbc5f85a5ac7f0f (diff) | |
| parent | 9cabe273d3adb06a19f63460deda96ae224b28bf (diff) | |
| download | rust-557d4346a26266d2eb13f6b0adf106b8873b0da1.tar.gz rust-557d4346a26266d2eb13f6b0adf106b8873b0da1.zip | |
Auto merge of #21237 - erickt:derive-assoc-types, r=erickt
This PR adds support for associated types to the `#[derive(...)]` syntax extension. In order to do this, it switches over to using where predicates to apply the type constraints. So now this:
```rust
type Trait {
type Type;
}
#[derive(Clone)]
struct Foo<A> where A: Trait {
a: A,
b: <A as Trait>::Type,
}
```
Gets expended into this impl:
```rust
impl<A: Clone> Clone for Foo<A> where
A: Trait,
<A as Trait>::Type: Clone,
{
fn clone(&self) -> Foo<T> {
Foo {
a: self.a.clone(),
b: self.b.clone(),
}
}
}
```
Diffstat (limited to 'src/libstd/thread')
0 files changed, 0 insertions, 0 deletions
