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
- [Trait definition functions][items.traits.associated-item-decls] with a body
151
+
The `naked` attribute may only be applied to [free functions], [associated functions] in an [inherent impl] or [traitimpl], and associated functions in a [trait definition] when those functions have a [default definition].
158
152
159
153
r[attributes.codegen.naked.duplicates]
160
-
The `naked` attribute may be used any number of times on a form.
154
+
Only the first useof `naked` on a function has effect.
161
155
162
156
> [!NOTE]
163
157
> `rustc` lints against any use following the first.
The [function body] must consist of exactly one [`naked_asm!`] macro invocation.
170
164
171
165
r[attributes.codegen.naked.prologue-epilogue]
172
-
No function prologue or epilogue is generated forthe attributed function.The assembly code in the `naked_asm!` block constitutes the full body of a naked function.
166
+
The compiler emits no prologue or epilogue fora naked function: the assembly code in the [`naked_asm!`] invocation constitutes its entire body.
173
167
174
168
r[attributes.codegen.naked.call-stack]
175
-
Theassembly code may assume that the call stack and register state are valid on entry asper the signature and calling convention of the function.
169
+
On entry the assembly code may assume that the call stack and register state are valid per the function's signature and calling convention.
176
170
177
171
r[attributes.codegen.naked.no-duplication]
178
-
Theassembly code may not be duplicated by the compiler except when monomorphizing polymorphic functions.
172
+
Thecompiler may not duplicate the assembly code except when monomorphizing a polymorphic function.
179
173
180
174
> [!NOTE]
181
-
> Guaranteeing when the assembly code may or may not be duplicated is importantfor naked functions that define symbols.
175
+
> This guarantee mattersfor naked functions that define symbols.
182
176
183
177
r[attributes.codegen.naked.unused-variables]
184
-
The [`unused_variables`] lint is suppressed within naked functions.
178
+
The [`unused_variables` lint] is suppressed in naked functions.
185
179
186
180
r[attributes.codegen.naked.inline]
187
-
The [`inline`](#the-inline-attribute) attribute cannot by applied to a naked function.
181
+
The [`inline` attribute] cannot be applied to a naked function.
188
182
189
183
r[attributes.codegen.naked.track_caller]
190
-
The [`track_caller`](#the-track_caller-attribute) attribute cannot be applied to a naked function.
184
+
The [`track_caller` attribute] cannot be applied to a naked function.
191
185
192
186
r[attributes.codegen.naked.testing]
193
-
The [testing attributes](testing.md) cannot be applied to a naked function.
187
+
The [testing attributes] cannot be applied to a naked function.
194
188
195
189
r[attributes.codegen.naked.target_feature]
196
-
The [`target_feature`][attributes.codegen.target_feature] attribute cannot be applied to a naked function.
190
+
The [`target_feature` attribute] cannot be applied to a naked function.
197
191
198
192
<!--TODO:Reflexive rules?-->
199
193
200
194
r[attributes.codegen.naked.abi]
201
-
Thefunction cannot have the ["Rust" ABI][items.extern.abi.rust].
195
+
A naked function cannot use the ["Rust" ABI].
202
196
203
197
<!-- template:attributes -->
204
198
r[attributes.codegen.no_builtins]
@@ -896,13 +890,16 @@ If the address of the function is taken as a function pointer, the low bit of th
0 commit comments