Skip to content
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

Slice::swap should be inlineable #22988

Merged
merged 1 commit into from
Mar 3, 2015
Merged

Conversation

dcrewi
Copy link
Contributor

@dcrewi dcrewi commented Mar 3, 2015

No description provided.

@rust-highfive
Copy link
Collaborator

r? @pcwalton

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

@bors: r+ 1d647a0 rollup

@alexcrichton alexcrichton assigned alexcrichton and unassigned pcwalton Mar 3, 2015
Manishearth added a commit to Manishearth/rust that referenced this pull request Mar 3, 2015
@bors bors merged commit 1d647a0 into rust-lang:master Mar 3, 2015
@dcrewi dcrewi deleted the slice-swap-inline branch March 3, 2015 21:55
@bluss
Copy link
Member

bluss commented Mar 3, 2015

Did you have any indication it was not inlinable? It's a generic method, so it has to be inlinable already.

@dcrewi
Copy link
Contributor Author

dcrewi commented Mar 3, 2015

I'm under the impression that without the inline attribute, llvm will not consider inlining a function cross-crate.

@alexcrichton
Copy link
Member

Ah yes @bluss I forgot to note that! @dcrewi all generics are instantiated downstream with concrete types and are hence available for inlining. Functions which are otherwise not able to cross crates (e.g. those that have no generics) are not candidates for inlining and hence require the #[inline] tag. In this case the function is generic (because the trait is generic) so it was already a candidate for inlining.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants