diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-11-19 11:13:34 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-11-19 11:18:34 +1100 |
| commit | df0f50381c630c56adcd7ca0023b8daaa3ad2776 (patch) | |
| tree | c52ee43cf8f6a4eb13a76e6d217f1f95d7197d60 /src/rustllvm/RustWrapper.cpp | |
| parent | 3d569df41de221ce5b0ffd385caaa9fd6d5fb2ff (diff) | |
| download | rust-df0f50381c630c56adcd7ca0023b8daaa3ad2776.tar.gz rust-df0f50381c630c56adcd7ca0023b8daaa3ad2776.zip | |
Mark some derived methods as #[inline].
ToStr, Encodable and Decodable are not marked as such, since they're
already expensive, and lead to large methods, so inlining will bloat the
metadata & the binaries.
This means that something like
#[deriving(Eq)]
struct A { x: int }
creates an instance like
#[doc = "Automatically derived."]
impl ::std::cmp::Eq for A {
#[inline]
fn eq(&self, __arg_0: &A) -> ::bool {
match *__arg_0 {
A{x: ref __self_1_0} =>
match *self {
A{x: ref __self_0_0} => true && __self_0_0.eq(__self_1_0)
}
}
}
#[inline]
fn ne(&self, __arg_0: &A) -> ::bool {
match *__arg_0 {
A{x: ref __self_1_0} =>
match *self {
A{x: ref __self_0_0} => false || __self_0_0.ne(__self_1_0)
}
}
}
}
(The change being the `#[inline]` attributes.)
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
