@@ -21,7 +21,7 @@ External blocks provide _declarations_ of items that are not _defined_ in the
2121current crate and are the basis of Rust's foreign function interface. These are
2222akin to unchecked imports.
2323
24- r[ items.extern.restriction ]
24+ r[ items.extern.allowed-kinds ]
2525Two kinds of item _ declarations_ are allowed in external blocks: [ functions] and
2626[ statics] .
2727
@@ -38,10 +38,13 @@ r[items.extern.fn]
3838r[ items.extern.fn.body]
3939Functions within external blocks are declared in the same way as other Rust
4040functions, with the exception that they must not have a body and are instead
41- terminated by a semicolon
41+ terminated by a semicolon.
4242
43- r[ items.extern.fn.restriction]
44- Patterns are not allowed in parameters, only [ IDENTIFIER] or ` _ ` may be used. The ` safe ` and ` unsafe ` function qualifiers are
43+ r[ items.extern.fn.param-patterns]
44+ Patterns are not allowed in parameters, only [ IDENTIFIER] or ` _ ` may be used.
45+
46+ r[ items.extern.fn.qualifiers]
47+ The ` safe ` and ` unsafe ` function qualifiers are
4548allowed, but other function qualifiers (e.g. ` const ` , ` async ` , ` extern ` ) are
4649not.
4750
@@ -200,19 +203,19 @@ r[items.extern.attributes.link.raw-dylib]
200203 an import library to link against (see [ ` dylib ` versus ` raw-dylib ` ] below
201204 for details). This is only valid for Windows targets.
202205
203- r[ items.extern.attributes.link.constraint ]
206+ r[ items.extern.attributes.link.name-requirement ]
204207The ` name ` key must be included if ` kind ` is specified.
205208
206209r[ items.extern.attributes.link.modifiers]
207210The optional ` modifiers ` argument is a way to specify linking modifiers for the
208211library to link.
209212
210- r[ items.extern.attributes.link.modifiers- syntax]
213+ r[ items.extern.attributes.link.modifiers. syntax]
211214Modifiers are specified as a comma-delimited string with each modifier prefixed
212215with either a ` + ` or ` - ` to indicate that the modifier is enabled or disabled,
213216respectively.
214217
215- r[ items.extern.attributes.link.modifiers-constraint ]
218+ r[ items.extern.attributes.link.modifiers.multiple ]
216219Specifying multiple ` modifiers ` arguments in a single ` link ` attribute,
217220or multiple identical modifiers in the same ` modifiers ` argument is not currently supported. \
218221Example: ` #[link(name = "mylib", kind = "static", modifiers = "+whole-archive")] ` .
@@ -249,69 +252,69 @@ block.
249252
250253#### Linking modifiers: ` bundle `
251254
252- r[ items.extern.attributes.link.modifier- bundle]
255+ r[ items.extern.attributes.link.modifiers. bundle]
253256
254- r[ items.extern.attributes.link.modifier- bundle.constraint ]
257+ r[ items.extern.attributes.link.modifiers. bundle.allowed-kinds ]
255258This modifier is only compatible with the ` static ` linking kind.
256259Using any other kind will result in a compiler error.
257260
258- r[ items.extern.attributes.link.modifier- bundle.behaviour ]
261+ r[ items.extern.attributes.link.modifiers. bundle.behavior ]
259262When building a rlib or staticlib ` +bundle ` means that the native static library
260263will be packed into the rlib or staticlib archive, and then retrieved from there
261264during linking of the final binary.
262265
263- r[ items.extern.attributes.link.modifier- bundle.behaviour -negative]
266+ r[ items.extern.attributes.link.modifiers. bundle.behavior -negative]
264267When building a rlib ` -bundle ` means that the native static library is registered as a dependency
265268of that rlib "by name", and object files from it are included only during linking of the final
266269binary, the file search by that name is also performed during final linking. \
267270When building a staticlib ` -bundle ` means that the native static library is simply not included
268271into the archive and some higher level build system will need to add it later during linking of
269272the final binary.
270273
271- r[ items.extern.attributes.link.modifier- bundle.no-effect]
274+ r[ items.extern.attributes.link.modifiers. bundle.no-effect]
272275This modifier has no effect when building other targets like executables or dynamic libraries.
273276
274- r[ items.extern.attributes.link.modifier- bundle.default]
277+ r[ items.extern.attributes.link.modifiers. bundle.default]
275278The default for this modifier is ` +bundle ` .
276279
277280More implementation details about this modifier can be found in
278281[ ` bundle ` documentation for rustc] .
279282
280283#### Linking modifiers: ` whole-archive `
281284
282- r[ items.extern.attributes.link.modifier- whole-archive]
285+ r[ items.extern.attributes.link.modifiers. whole-archive]
283286
284- r[ items.extern.attributes.link.modifier- whole-archive.constraint ]
287+ r[ items.extern.attributes.link.modifiers. whole-archive.allowed-kinds ]
285288This modifier is only compatible with the ` static ` linking kind.
286289Using any other kind will result in a compiler error.
287290
288- r[ items.extern.attributes.link.modifier- whole-archive.behaviour ]
291+ r[ items.extern.attributes.link.modifiers. whole-archive.behavior ]
289292` +whole-archive ` means that the static library is linked as a whole archive
290293without throwing any object files away.
291294
292- r[ items.extern.attributes.link.modifier- whole-archive.default]
295+ r[ items.extern.attributes.link.modifiers. whole-archive.default]
293296The default for this modifier is ` -whole-archive ` .
294297
295298More implementation details about this modifier can be found in
296299[ ` whole-archive ` documentation for rustc] .
297300
298301### Linking modifiers: ` verbatim `
299302
300- r[ items.extern.attributes.link.modifier- verbatim]
303+ r[ items.extern.attributes.link.modifiers. verbatim]
301304
302- r[ items.extern.attributes.link.modifier- verbatim.constraint ]
305+ r[ items.extern.attributes.link.modifiers. verbatim.allowed-kinds ]
303306This modifier is compatible with all linking kinds.
304307
305- r[ items.extern.attributes.link.modifier- verbatim.behaviour ]
308+ r[ items.extern.attributes.link.modifiers. verbatim.behavior ]
306309` +verbatim ` means that rustc itself won't add any target-specified library prefixes or suffixes
307310(like ` lib ` or ` .a ` ) to the library name, and will try its best to ask for the same thing from the
308311linker.
309312
310- r[ items.extern.attributes.link.modifier- verbatim.behaviour -negative]
313+ r[ items.extern.attributes.link.modifiers. verbatim.behavior -negative]
311314` -verbatim ` means that rustc will either add a target-specific prefix and suffix to the library
312315name before passing it to linker, or won't prevent linker from implicitly adding it.
313316
314- r[ items.extern.attributes.link.modifier- verbatim.default]
317+ r[ items.extern.attributes.link.modifiers. verbatim.default]
315318The default for this modifier is ` -verbatim ` .
316319
317320More implementation details about this modifier can be found in
@@ -420,7 +423,7 @@ unsafe extern "stdcall" {
420423}
421424```
422425
423- r[ items.extern.attributes.link_ordinal.constraints ]
426+ r[ items.extern.attributes.link_ordinal.allowed-kinds ]
424427This attribute is only used with the ` raw-dylib ` linking kind.
425428Using any other kind will result in a compiler error.
426429
0 commit comments