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

Mark Array::size() as #[inline] #289

Merged
merged 1 commit into from Oct 2, 2022
Merged

Conversation

nikic
Copy link

@nikic nikic commented Oct 1, 2022

Array::size() is a trivial function -- in fact, it always returns a constant. Mark it as #[inline] so it is instantiated in each CGU, and can be optimized without relying on crate-local LTO. See rust-lang/rust#102539 for context.

It looks like SmallVec already marks pretty much all other trivial functions as #[inline], so this seems like an oversight.

Copy link
Collaborator

@mbrubeck mbrubeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mbrubeck mbrubeck merged commit b960b3a into servo:master Oct 2, 2022
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.

None yet

2 participants