about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-11-19 04:06:25 -0800
committerbors <bors@rust-lang.org>2013-11-19 04:06:25 -0800
commit32f6c11dfab019181b77fe48a876c3ba38b0c72a (patch)
treeee6b97038606bf0069cc1354e177a3365fad3d3b /src/rustllvm/RustWrapper.cpp
parentc4e28ae06842c2066fadb70a1a4f3dc3f1e26e3c (diff)
parentdf0f50381c630c56adcd7ca0023b8daaa3ad2776 (diff)
downloadrust-32f6c11dfab019181b77fe48a876c3ba38b0c72a.tar.gz
rust-32f6c11dfab019181b77fe48a876c3ba38b0c72a.zip
auto merge of #10557 : huonw/rust/inline-deriving, r=pcwalton
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