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

Make a bunch of trivial methods of NonNull be `#[inline]` #55426

Merged
merged 1 commit into from Oct 29, 2018

Conversation

Projects
None yet
5 participants
@fitzgen
Member

fitzgen commented Oct 27, 2018

I was seeing super trivial methods not getting inlined in some of my builds, so I went ahead and just marked all the methods inline where it seemed appropriate.

r? @SimonSapin

@SimonSapin

This comment has been minimized.

Contributor

SimonSapin commented Oct 28, 2018

Looks good, thanks!

@bors r+ rollup

@bors

This comment has been minimized.

Contributor

bors commented Oct 28, 2018

📌 Commit dc77d49 has been approved by SimonSapin

pietroalbini added a commit to pietroalbini/rust that referenced this pull request Oct 29, 2018

Rollup merge of rust-lang#55426 - fitzgen:nonnull-inline, r=SimonSapin
Make a bunch of trivial methods of NonNull be `#[inline]`

I was seeing super trivial methods not getting inlined in some of my builds, so I went ahead and just marked all the methods inline where it seemed appropriate.

r? @SimonSapin

bors added a commit that referenced this pull request Oct 29, 2018

Auto merge of #55462 - pietroalbini:rollup, r=pietroalbini
Rollup of 9 pull requests

Successful merges:

 - #54965 (update tcp stream documentation)
 - #55269 (fix typos in various places)
 - #55384 (Avoid unnecessary allocations in `float_lit` and `integer_lit`.)
 - #55423 (back out bogus `Ok`-wrapping suggestion on `?` arm type mismatch)
 - #55426 (Make a bunch of trivial methods of NonNull be `#[inline]`)
 - #55438 (Avoid directly catching BaseException in bootstrap configure script)
 - #55439 (Remove unused sys import from generate-deriving-span-tests)
 - #55440 (Remove unreachable code in hasClass function in Rustdoc)
 - #55447 (Fix invalid path in generate-deriving-span-tests.py.)

Failed merges:

r? @ghost

@bors bors merged commit dc77d49 into rust-lang:master Oct 29, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@scottmcm

This comment has been minimized.

Member

scottmcm commented Nov 1, 2018

These are all generic, aren't they? I thought we didn't usually mark generics are inline...

@SimonSapin

This comment has been minimized.

Contributor

SimonSapin commented Nov 1, 2018

IIRC being generic makes metadata (MIR?) available to other crates such that cross-crate inlining is possible. #[inline] does the same, and also boosts LLVM’s heuristic that decides whether to inline a particular call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment