Skip to content

Commit

Permalink
Update details about inlining.
Browse files Browse the repository at this point in the history
Because Rust 1.75 made some changes, allowing cross-crate inlining in
some additional circumstances.

Fixes #84.
  • Loading branch information
nnethercote committed Jun 17, 2024
1 parent e5156af commit bc59371
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/inlining.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ small but easy speed wins.

There are four inline attributes that can be used on Rust functions.
- **None**. The compiler will decide itself if the function should be inlined.
This will depend on factors such as the optimization level and the size of
the function. Non-generic functions will never be inlined across crate
boundaries unless link-time optimization is used; generic functions might be.
- **`#[inline]`**. This suggests that the function should be inlined, including
across crate boundaries.
This will depend on factors such as the optimization level, the size of the
function, whether the function is generic, and if the inlining is across a
crate boundary.
- **`#[inline]`**. This suggests that the function should be inlined.
- **`#[inline(always)]`**. This strongly suggests that the function should be
inlined, including across crate boundaries.
inlined.
- **`#[inline(never)]`**. This strongly suggests that the function should not
be inlined.

Expand Down

0 comments on commit bc59371

Please sign in to comment.