Skip to content

Document that #[inline] is needed for inlining across crate boundaries - #2326

Open
de-vri-es wants to merge 1 commit into
rust-lang:masterfrom
de-vri-es:document-inlining-across-crate-boundaries
Open

Document that #[inline] is needed for inlining across crate boundaries#2326
de-vri-es wants to merge 1 commit into
rust-lang:masterfrom
de-vri-es:document-inlining-across-crate-boundaries

Conversation

@de-vri-es

@de-vri-es de-vri-es commented Aug 14, 2026

Copy link
Copy Markdown

Adding an #[inline] hint may not be the right wayTM to allow in-lining across crate boundaries, but as far as I'm aware it is the only way. It would be nice to document that, to have something to point at when people ask why I think this attribute should be added.

The current docs suggest it should almost never be used, unless you know better than the compiler (which I don't want to claim, normally). But using it to allow the compiler to be smart is a good thing.

Alternatively, if this is no longer necessary, it would be good to explicitly document that (to have something to point at).

If there are plans to change this behavior I suppose this could also be added as a note instead.

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Aug 14, 2026
@de-vri-es de-vri-es changed the title Document that #[inline] is needed for inlining across crate boundar… Document that #[inline] is needed for inlining across crate boundaries Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: The marked PR is awaiting review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants