Skip to content

Commit 9d865bf

Browse files
committed
Add rule about meaning of inline with async
On lang, we had earlier made a decision about how `inline` should apply to `async fn`. Let's document that here.
1 parent 4e3d6b2 commit 9d865bf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/attributes/codegen.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ The `inline` attribute supports these modes:
7474
r[attributes.codegen.inline.trait]
7575
When `inline` is applied to a function in a [trait], it applies only to the code of the [default definition].
7676
77+
r[attributes.codegen.inline.async]
78+
When `inline` is applied to an async function or async closure, it applies only to the code of the generated `poll` function.
79+
80+
> [!NOTE]
81+
> For more details, see [Rust issue #129347](https://github.com/rust-lang/rust/issues/129347).
82+
7783
r[attributes.codegen.inline.externally-exported]
7884
The `inline` attribute is ignored if the function is externally exported with [`no_mangle`] or [`export_name`].
7985

0 commit comments

Comments
 (0)