Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Oct 29, 2018

Conversation

fitzgen
Copy link
Member

@fitzgen 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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 27, 2018
@SimonSapin
Copy link
Contributor

Looks good, thanks!

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Oct 28, 2018

📌 Commit dc77d49 has been approved by SimonSapin

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 28, 2018
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Oct 29, 2018
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
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
@scottmcm
Copy link
Member

scottmcm commented Nov 1, 2018

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

@SimonSapin
Copy link
Contributor

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants