You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/attributes/codegen.md
+6-16Lines changed: 6 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,23 +7,16 @@ r[attributes.codegen.hint]
7
7
## Optimization hints
8
8
9
9
r[attributes.codegen.hint.cold-inline]
10
-
The `cold` and `inline`[attributes] give suggestions to generate code in a
11
-
way that may be faster than what it would do without the hint. The attributes
12
-
are only hints, and may be ignored.
10
+
The `cold` and `inline`[attributes] give suggestions to generate code in a way that may be faster than what it would do without the hint. The attributes are only hints, and may be ignored.
13
11
14
12
r[attributes.codegen.hint.usage]
15
-
Both attributes can be used on [functions]. When applied to a function in a
16
-
[trait], they apply only to that function when used as a default function for
17
-
a trait implementation and not to all trait implementations. The attributes
18
-
have no effect on a trait function without a body.
13
+
Both attributes can be used on [functions]. When applied to a function in a [trait], they apply only to that function when used as a default function for a trait implementation and not to all trait implementations. The attributes have no effect on a trait function without a body.
19
14
20
15
r[attributes.codegen.inline]
21
16
### The `inline` attribute
22
17
23
18
r[attributes.codegen.inline.intro]
24
-
The *`inline`[attribute]* suggests that a copy of the attributed function
25
-
should be placed in the caller, rather than generating code to call the
26
-
function where it is defined.
19
+
The *`inline`[attribute]* suggests that a copy of the attributed function should be placed in the caller, rather than generating code to call the function where it is defined.
27
20
28
21
> [!NOTE]
29
22
> The `rustc` compiler automatically inlines functions based on internal heuristics. Incorrectly inlining functions can make the program slower, so this attribute should be used with care.
0 commit comments