-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
AsRef/AsMut implementations aren't inlined #58867
Comments
You just need You almost never want |
Thanks @jonas-schievink for the correction. |
I would like to do this, If no one else has taken it yet |
LLVM should normally be inlining in release builds these unless you're using multiple codegen units without LTO. |
@sfackler I haven't tweaked the config for codegen units nor LTO. So whatever the default is. Edit: Why was the E-easy tag removed? Isn't this just a matter of adding |
I remembered that we generally don't want to add |
Thanks @sfackler. This comment suggests using ThinLTO in release builds incremental builds disabled but obviously that isn't desired as incremental building is very desirable for rapid testing (especially in my case where I need to read the optimized assembly). |
Incremental ThinLTO works now IIRC. |
Cool. And enabled by default on at least the latest nightly. Should this be closed? |
This seems to be fixed. |
check that `AsRef` and `AsMut` are inlined Adds a regression test for rust-lang#58867 r? @Dylan-DPC
Closing this as it is covered by #71576 |
Many
AsRef
andAsMut
implementations in core do not have#[inline]
and yet these tiny no-op functions are called from the assembly.The following assembly maps to
AsMut<[T]> for [T]
Any quick search for
as_ref
oras_mut
inconvert.rs
shows many instances, some with but many without#[inline]
.Edit:
Default::default
is another example where more aggressive inlining should be usedThe text was updated successfully, but these errors were encountered: