File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,23 @@ The *`naked` [attribute]* prevents the compiler from emitting a function prologu
144144> # }
145145> ```
146146
147+ r[attributes. codegen. naked. syntax]
148+ The `naked` attribute uses the [MetaWord ] syntax and thus does not take any inputs.
149+
150+ r[attributes. codegen. naked. allowed- positions]
151+ The `naked` attribute may only be applied to:
152+
153+ - [Free functions][items. fn ]
154+ - [Inherent associated functions][items. associated. fn ]
155+ - [Trait impl functions][items. impl . trait ]
156+ - [Trait definition functions][items. traits] with a body
157+
158+ r[attributes. codegen. naked. duplicates]
159+ Duplicate instances of the `naked` attribute have no effect.
160+
161+ > [! NOTE ]
162+ > `rustc` currently warns on subsequent duplicate `naked` attributes.
163+
147164r[attributes. codegen. naked. body]
148165The [function body] must consist of exactly one [`naked_asm! `] macro invocation.
149166
You can’t perform that action at this time.
0 commit comments