-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Mark some derived methods as #[inline]. #10557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.)
bors
added a commit
that referenced
this pull request
Nov 19, 2013
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.)
mbrubeck
added a commit
to mbrubeck/servo
that referenced
this pull request
Apr 30, 2014
This code did not use derived traits previously because their methods were not inlined, but this was fixed in rust-lang/rust#10557.
bors-servo
pushed a commit
to servo/servo
that referenced
this pull request
Apr 30, 2014
This code did not use derived traits previously because their methods were not inlined, but this was fixed in rust-lang/rust#10557. r? @pcwalton
Manishearth
pushed a commit
to Manishearth/servo
that referenced
this pull request
May 2, 2014
This code did not use derived traits previously because their methods were not inlined, but this was fixed in rust-lang/rust#10557.
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this pull request
Sep 30, 2019
…y-cleanup); r=Ms2ger This code did not use derived traits previously because their methods were not inlined, but this was fixed in rust-lang/rust#10557. r? pcwalton Source-Repo: https://github.com/servo/servo Source-Revision: 8af9ce07f8ec9dddc926c1f76ade9e84427034db UltraBlame original commit: de3f2703b11e0d467bf92c052904cb1cfd484a9c
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this pull request
Sep 30, 2019
…y-cleanup); r=Ms2ger This code did not use derived traits previously because their methods were not inlined, but this was fixed in rust-lang/rust#10557. r? pcwalton Source-Repo: https://github.com/servo/servo Source-Revision: 8af9ce07f8ec9dddc926c1f76ade9e84427034db UltraBlame original commit: de3f2703b11e0d467bf92c052904cb1cfd484a9c
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this pull request
Oct 1, 2019
…y-cleanup); r=Ms2ger This code did not use derived traits previously because their methods were not inlined, but this was fixed in rust-lang/rust#10557. r? pcwalton Source-Repo: https://github.com/servo/servo Source-Revision: 8af9ce07f8ec9dddc926c1f76ade9e84427034db UltraBlame original commit: de3f2703b11e0d467bf92c052904cb1cfd484a9c
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
creates an instance like
(The change being the
#[inline]
attributes.)