From afe753901b2fccf48eb882d572336c2873937709 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 22 Oct 2024 06:14:56 -0700 Subject: [PATCH 1/2] Fix example broken by recent rustc change https://github.com/rust-lang/rust/pull/129935 made `unsupported_calling_conventions` a hard-error, which in turn makes this test fail. --- src/items/external-blocks.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/items/external-blocks.md b/src/items/external-blocks.md index dbd55fb33..74a4666c1 100644 --- a/src/items/external-blocks.md +++ b/src/items/external-blocks.md @@ -66,6 +66,7 @@ standard C ABI on the specific platform. Other ABIs may be specified using an `abi` string, as shown here: ```rust +# #[cfg(any(windows, target_arch = "x86"))] // Interface to the Windows API unsafe extern "stdcall" { } ``` From 30a9afe2d39858b2e69d30fbfca9d07d62f3e4c9 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 22 Oct 2024 06:25:39 -0700 Subject: [PATCH 2/2] Remove `ignore` on windows test This removes the `ignore` on this test since it isn't needed if the test is properly marked for its intended target. --- src/items/external-blocks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/items/external-blocks.md b/src/items/external-blocks.md index 74a4666c1..21feb0eaf 100644 --- a/src/items/external-blocks.md +++ b/src/items/external-blocks.md @@ -296,8 +296,8 @@ 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. - -```rust,ignore +```rust +# #[cfg(all(windows, target_arch = "x86"))] #[link(name = "exporter", kind = "raw-dylib")] unsafe extern "stdcall" { #[link_ordinal(15)]