]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #10557 : huonw/rust/inline-deriving, r=pcwalton
authorbors <bors@rust-lang.org>
Tue, 19 Nov 2013 12:06:25 +0000 (04:06 -0800)
committerbors <bors@rust-lang.org>
Tue, 19 Nov 2013 12:06:25 +0000 (04:06 -0800)
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.)


Trivial merge