From 62df0056836443345052541636f6dc06a24c2696 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Wed, 4 Nov 2026 15:57:52 +0100 Subject: [PATCH] Update #[link_ordinal] behavior --- src/items/external-blocks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/items/external-blocks.md b/src/items/external-blocks.md index 662fb235ce..4da13b9b19 100644 --- a/src/items/external-blocks.md +++ b/src/items/external-blocks.md @@ -431,7 +431,7 @@ r[items.extern.attributes.link_ordinal] ### The `link_ordinal` attribute r[items.extern.attributes.link_ordinal.intro] -The *`link_ordinal` attribute* can be applied on declarations inside an `extern` block to indicate the numeric ordinal to use when generating the import library to link against. An ordinal is a unique number per symbol exported by a dynamic library on Windows and can be used when the library is being loaded to find that symbol rather than having to look it up by name. +The *`link_ordinal` attribute* can be applied on declarations inside an `extern` block to indicate the numeric ordinal to import from the specified dynamic library and use when referencing the import from Rust. An ordinal is a unique number per symbol exported by a dynamic library on Windows and can be used when the library is being loaded to find that symbol rather than having to look it up by name. > [!WARNING] > `link_ordinal` should only be used in cases where the ordinal of the symbol is known to be stable: if the ordinal of a symbol is not explicitly set when its containing binary is built then one will be automatically assigned to it, and that assigned ordinal may change between builds of the binary.