From 02f965f97ae5001ad26df658b0292d70be34091a Mon Sep 17 00:00:00 2001 From: Maarten de Vries Date: Fri, 14 Aug 2026 11:16:45 +0200 Subject: [PATCH] Document that `#[inline]` is needed for inlining across crate boundaries. --- src/attributes/codegen.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/attributes/codegen.md b/src/attributes/codegen.md index d3ecf00b88..b2910c1ee9 100644 --- a/src/attributes/codegen.md +++ b/src/attributes/codegen.md @@ -10,6 +10,10 @@ r[attributes.codegen.inline] r[attributes.codegen.inline.intro] The *`inline` [attribute]* suggests whether a copy of the attributed function's code should be placed in the caller rather than generating a call to the function. +r[attribute.codegen.inline.crate-boundaries] +The attribute also makes it possible for the compiler to inline non-generic functions across crate boundaries. +Non-generic functions without the *`inline`* [attribute] can not be inlined in another crate. + > [!EXAMPLE] > ```rust > #[inline]