-
Notifications
You must be signed in to change notification settings - Fork 505
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
Documentation for #[inline] in the reference doesn't align with external resources #1140
Comments
It is currently deliberate. There are no guarantees as to what |
Ah, so people are wrong to read the reference as indicating that Or maybe this deserves to be in a Note:, after all there is already one about the rustc implementation on this attribute. |
Maybe I'm not understanding, but And there is a note about it:
|
My concern is that I told a user about the alteration to the way |
Maybe I'm not clear, but is your question "does |
I know what I think it would be a nice improvement to make the language in the reference either more vague, such as amending
To
Or more specific, mentioning what rustc does, or pointing to some rustc documentation for this attribute (which as far as I know, doesn't exist, why is why people are in the reference to begin with). |
It may be gratuitous. I wouldn't place the attribute on a function unless benchmarking indicated it was warranted.
As I mentioned, I think it is unlikely we would want to document the specifics of rustc (here or elsewhere). However, you can perhaps contact the compiler team if they would be interested in specifying its behavior. |
+1 the effect on codegen blowup should be documented properly |
The current documentation for
#[inline]
places huge emphasis on its effect as an inlining hint. I was recently referred to the reference when I tried to inform another user that its primary effect is enabling cross-crate inlining of non-generic functions. I'm not sure if this lack of documentation is just an oversight (which I'm happy to correct with a PR) or if this is deliberate because the cross-crate inlining effect is planned to be removed, or if the hint is guaranteed, but the codegen difference isn't.I'm particularly concerned, because this effect is well-known in resources outside of the reference:
https://matklad.github.io/2021/07/09/inline-in-rust.html
rust-lang/hashbrown#119 (comment)
The text was updated successfully, but these errors were encountered: