@@ -137,29 +137,6 @@ As non-Rust calling conventions do not support unwinding, unwinding past the end
137
137
of an extern function will cause the process to abort. In LLVM, this is
138
138
implemented by executing an illegal instruction.
139
139
140
- ## Attributes on functions
141
-
142
- [ Outer attributes] [ attributes ] are allowed on functions. [ Inner
143
- attributes] [ attributes ] are allowed directly after the ` { ` inside its [ block] .
144
-
145
- This example shows an inner attribute on a function. The function will only be
146
- available while running tests.
147
-
148
- ```
149
- fn test_only() {
150
- #![test]
151
- }
152
- ```
153
-
154
- > Note: Except for lints, it is idiomatic to only use outer attributes on
155
- > function items.
156
-
157
- The attributes that have meaning on a function are [ ` cfg ` ] , [ ` deprecated ` ] ,
158
- [ ` doc ` ] , ` export_name ` , ` link_section ` , ` no_mangle ` , [ the lint check
159
- attributes] , [ ` must_use ` ] , [ the procedural macro attributes] , [ the testing
160
- attributes] , and [ the optimization hint
161
- attributes] .
162
-
163
140
## Const functions
164
141
165
142
Functions qualified with the ` const ` keyword are const functions. _ Const
@@ -212,6 +189,29 @@ Exhaustive list of permitted structures in const functions:
212
189
only and you won't be able to call the ` const unsafe fn ` from within another
213
190
const function even if you use ` unsafe `
214
191
192
+ ## Attributes on functions
193
+
194
+ [ Outer attributes] [ attributes ] are allowed on functions. [ Inner
195
+ attributes] [ attributes ] are allowed directly after the ` { ` inside its [ block] .
196
+
197
+ This example shows an inner attribute on a function. The function will only be
198
+ available while running tests.
199
+
200
+ ```
201
+ fn test_only() {
202
+ #![test]
203
+ }
204
+ ```
205
+
206
+ > Note: Except for lints, it is idiomatic to only use outer attributes on
207
+ > function items.
208
+
209
+ The attributes that have meaning on a function are [ ` cfg ` ] , [ ` deprecated ` ] ,
210
+ [ ` doc ` ] , ` export_name ` , ` link_section ` , ` no_mangle ` , [ the lint check
211
+ attributes] , [ ` must_use ` ] , [ the procedural macro attributes] , [ the testing
212
+ attributes] , and [ the optimization hint
213
+ attributes] .
214
+
215
215
[ IDENTIFIER ] : identifiers.html
216
216
[ RAW_STRING_LITERAL ] : tokens.html#raw-string-literals
217
217
[ STRING_LITERAL ] : tokens.html#string-literals
0 commit comments