Skip to content

library/windows_targets: Fix macro expansion error in 'link' macro #144415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

itf
Copy link
Contributor

@itf itf commented Jul 24, 2025

A recent change altered the definition of the link! macro when the windows_raw_dylib feature is enabled, changing its syntax from pub macro {..} to pub macro($tt:tt) {..} in #143592

This change introduced a build failure with the error: "macros that expand to items must be delimited with braces or followed by a semicolon".

We also modify the non windows_raw_dylib link to make use of the link_dylib macro

A recent change altered the definition of the link! macro when the windows_raw_dylib feature is enabled, changing its syntax from pub macro {..} to pub macro($tt:tt) {..} in rust-lang#143592

This change introduced a build failure with the error: "macros that expand to items must be delimited with braces or followed by a semicolon". 

We also modify the non windows_raw_dylib link to make use of the link_dylib macro
@rustbot
Copy link
Collaborator

rustbot commented Jul 24, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 24, 2025
@rust-log-analyzer
Copy link
Collaborator

The job pr-check-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:5:1
   |
5  | windows_targets::link!("kernel32.dll" "system" fn AcquireSRWLockExclusive(srwlock : *mut SRWLOCK));
   | -------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:6:1
   |
6  | windows_targets::link!("kernel32.dll" "system" fn AcquireSRWLockShared(srwlock : *mut SRWLOCK));
   | ----------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:7:1
   |
7  | windows_targets::link!("kernel32.dll" "system" fn AddVectoredExceptionHandler(first : u32, handler : PVECTORED_EXCEPTION_HANDLER) -> *mut core::ffi::c_void);
   | ------------------------------------------------------------------------------------------------------------------------------------------------------------ in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:8:1
   |
8  | windows_targets::link!("kernel32.dll" "system" fn CancelIo(hfile : HANDLE) -> BOOL);
   | ----------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:9:1
   |
9  | windows_targets::link!("kernel32.dll" "system" fn CloseHandle(hobject : HANDLE) -> BOOL);
   | ---------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:10:1
   |
10 | windows_targets::link!("kernel32.dll" "system" fn CompareStringOrdinal(lpstring1 : PCWSTR, cchcount1 : i32, lpstring2 : PCWSTR, cchcount2 : i32, bignorecase : BOOL) -> COMPARESTRING_RESULT);
   | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:11:1
   |
11 | windows_targets::link!("kernel32.dll" "system" fn CopyFileExW(lpexistingfilename : PCWSTR, lpnewfilename : PCWSTR, lpprogressroutine : LPPROGRESS_ROUTINE, lpdata : *const core::ffi::c_void, pbcancel : *mut BOOL, dwcopyflags : COPYFILE_FLAGS) -> BOOL);
   | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:12:1
   |
12 | windows_targets::link!("kernel32.dll" "system" fn CreateDirectoryW(lppathname : PCWSTR, lpsecurityattributes : *const SECURITY_ATTRIBUTES) -> BOOL);
   | --------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:13:1
   |
13 | windows_targets::link!("kernel32.dll" "system" fn CreateEventW(lpeventattributes : *const SECURITY_ATTRIBUTES, bmanualreset : BOOL, binitialstate : BOOL, lpname : PCWSTR) -> HANDLE);
   | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:14:1
   |
14 | windows_targets::link!("kernel32.dll" "sy..._AND_ATTRIBUTES, htemplatefile : HANDLE) -> HANDLE);
   | -----------------------------------------...--------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:15:1
   |
15 | windows_targets::link!("kernel32.dll" "system" fn CreateHardLinkW(lpfilename : PCWSTR, lpexistingfilename : PCWSTR, lpsecurityattributes : *const SECURITY_ATTRIBUTES) -> BOOL);
   | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:16:1
   |
16 | windows_targets::link!("kernel32.dll" "sy...attributes : *const SECURITY_ATTRIBUTES) -> HANDLE);
   | -----------------------------------------...--------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:17:1
   |
17 | windows_targets::link!("kernel32.dll" "system" fn CreatePipe(hreadpipe : *mut HANDLE, hwritepipe : *mut HANDLE, lppipeattributes : *const SECURITY_ATTRIBUTES, nsize : u32) -> BOOL);
   | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:18:1
   |
18 | windows_targets::link!("kernel32.dll" "sy...essinformation : *mut PROCESS_INFORMATION) -> BOOL);
   | -----------------------------------------...--------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:19:1
   |
19 | windows_targets::link!("kernel32.dll" "system" fn CreateSymbolicLinkW(lpsymlinkfilename : PCWSTR, lptargetfilename : PCWSTR, dwflags : SYMBOLIC_LINK_FLAGS) -> bool);
   | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:20:1
   |
20 | windows_targets::link!("kernel32.dll" "sy...D_CREATION_FLAGS, lpthreadid : *mut u32) -> HANDLE);
   | -----------------------------------------...--------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:21:1
   |
21 | windows_targets::link!("kernel32.dll" "system" fn CreateWaitableTimerExW(lptimerattributes : *const SECURITY_ATTRIBUTES, lptimername : PCWSTR, dwflags : u32, dwdesiredaccess : u32) -> HANDLE);
   | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:22:1
   |
22 | windows_targets::link!("kernel32.dll" "system" fn DeleteFileW(lpfilename : PCWSTR) -> BOOL);
   | ------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:23:1
   |
23 | windows_targets::link!("kernel32.dll" "system" fn DeleteProcThreadAttributeList(lpattributelist : LPPROC_THREAD_ATTRIBUTE_LIST));
   | -------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:24:1
   |
24 | windows_targets::link!("kernel32.dll" "sy... *mut u32, lpoverlapped : *mut OVERLAPPED) -> BOOL);
   | -----------------------------------------...--------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:25:1
   |
25 | windows_targets::link!("kernel32.dll" "system" fn DuplicateHandle(hsourceprocesshandle : HANDLE, hsourcehandle : HANDLE, htargetprocesshandle : HANDLE, lptargethandle : *mut HANDLE, dwdesiredaccess : u32, binherithandle : BOOL, dwoptions : DUPLICATE_HANDLE_OPTIONS) -> BOOL);
   | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:26:1
   |
26 | windows_targets::link!("kernel32.dll" "system" fn ExitProcess(uexitcode : u32) -> !);
   | ------------------------------------------------------------------------------------ in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:27:1
   |
27 | windows_targets::link!("kernel32.dll" "system" fn FindClose(hfindfile : HANDLE) -> BOOL);
   | ---------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:28:1
   |
28 | windows_targets::link!("kernel32.dll" "sy...dwadditionalflags : FIND_FIRST_EX_FLAGS) -> HANDLE);
   | -----------------------------------------...--------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:29:1
   |
29 | windows_targets::link!("kernel32.dll" "system" fn FindNextFileW(hfindfile : HANDLE, lpfindfiledata : *mut WIN32_FIND_DATAW) -> BOOL);
   | ------------------------------------------------------------------------------------------------------------------------------------ in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:30:1
   |
30 | windows_targets::link!("kernel32.dll" "system" fn FlushFileBuffers(hfile : HANDLE) -> BOOL);
   | ------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:31:1
   |
31 | windows_targets::link!("kernel32.dll" "system" fn FormatMessageW(dwflags : FORMAT_MESSAGE_OPTIONS, lpsource : *const core::ffi::c_void, dwmessageid : u32, dwlanguageid : u32, lpbuffer : PWSTR, nsize : u32, arguments : *const *const i8) -> u32);
   | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:32:1
   |
32 | windows_targets::link!("kernel32.dll" "system" fn FreeEnvironmentStringsW(penv : PCWSTR) -> BOOL);
   | ------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:33:1
   |
33 | windows_targets::link!("kernel32.dll" "system" fn GetActiveProcessorCount(groupnumber : u16) -> u32);
   | ---------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:34:1
   |
34 | windows_targets::link!("kernel32.dll" "system" fn GetCommandLineW() -> PCWSTR);
   | ------------------------------------------------------------------------------ in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:35:1
   |
35 | windows_targets::link!("kernel32.dll" "system" fn GetConsoleMode(hconsolehandle : HANDLE, lpmode : *mut CONSOLE_MODE) -> BOOL);
   | ------------------------------------------------------------------------------------------------------------------------------ in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:36:1
   |
36 | windows_targets::link!("kernel32.dll" "system" fn GetConsoleOutputCP() -> u32);
   | ------------------------------------------------------------------------------ in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:37:1
   |
37 | windows_targets::link!("kernel32.dll" "system" fn GetCurrentDirectoryW(nbufferlength : u32, lpbuffer : PWSTR) -> u32);
   | --------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:38:1
   |
38 | windows_targets::link!("kernel32.dll" "system" fn GetCurrentProcess() -> HANDLE);
   | -------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:39:1
   |
39 | windows_targets::link!("kernel32.dll" "system" fn GetCurrentProcessId() -> u32);
   | ------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:40:1
   |
40 | windows_targets::link!("kernel32.dll" "system" fn GetCurrentThread() -> HANDLE);
   | ------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:41:1
   |
41 | windows_targets::link!("kernel32.dll" "system" fn GetEnvironmentStringsW() -> PWSTR);
   | ------------------------------------------------------------------------------------ in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:42:1
   |
42 | windows_targets::link!("kernel32.dll" "system" fn GetEnvironmentVariableW(lpname : PCWSTR, lpbuffer : PWSTR, nsize : u32) -> u32);
   | --------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/pal/windows/c/windows_sys.rs:43:1
   |
43 | windows_targets::link!("kernel32.dll" "system" fn GetExitCodeProcess(hprocess : HANDLE, lpexitcode : *mut u32) -> BOOL);
   | ----------------------------------------------------------------------------------------------------------------------- in this macro invocation
---
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/alloc/windows.rs:23:1
   |
23 | windows_targets::link!("kernel32.dll" "system" fn GetProcessHeap() -> c::HANDLE);
   | -------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/alloc/windows.rs:39:1
   |
39 | windows_targets::link!("kernel32.dll" "system" fn HeapAlloc(hheap: c::HANDLE, dwflags: u32, dwbytes: usize) -> *mut c_void);
   | --------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 |   pub macro link {
   |   -------------- in this expansion of `windows_targets::link!`
42 |       ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                           ^^^^^^^^^
   |
  ::: library/std/src/sys/alloc/windows.rs:60:1
   |
60 | / windows_targets::link!("kernel32.dll" "system" fn HeapReAlloc(
61 | |     hheap: c::HANDLE,
62 | |     dwflags : u32,
63 | |     lpmem: *const c_void,
64 | |     dwbytes: usize
65 | | ) -> *mut c_void);
   | |_________________- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/sys/alloc/windows.rs:81:1
   |
81 | windows_targets::link!("kernel32.dll" "system" fn HeapFree(hheap: c::HANDLE, dwflags: u32, lpmem: *const c_void) -> c::BOOL);
   | ---------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:10:1
   |
10 | windows_targets::link!("dbghelp.dll" "system" fn EnumerateLoadedModulesW64(hprocess : HANDLE, enumloadedmodulescallback : PENUMLOADED_MODULES_CALLBACKW64, usercontext : *const core::ffi::c_void) -> BOOL);
   | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:11:1
   |
11 | windows_targets::link!("dbghelp.dll" "sys...ateaddress : PTRANSLATE_ADDRESS_ROUTINE64) -> BOOL);
   | -----------------------------------------...--------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:12:1
   |
12 | windows_targets::link!("dbghelp.dll" "sys...PTRANSLATE_ADDRESS_ROUTINE64, flags : u32) -> BOOL);
   | -----------------------------------------...--------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:13:1
   |
13 | windows_targets::link!("dbghelp.dll" "system" fn SymAddrIncludeInlineTrace(hprocess : HANDLE, address : u64) -> u32);
   | -------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:14:1
   |
14 | windows_targets::link!("dbghelp.dll" "system" fn SymFromAddrW(hprocess : HANDLE, address : u64, displacement : *mut u64, symbol : *mut SYMBOL_INFOW) -> BOOL);
   | ------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:15:1
   |
15 | windows_targets::link!("dbghelp.dll" "system" fn SymFromInlineContextW(hprocess : HANDLE, address : u64, inlinecontext : u32, displacement : *mut u64, symbol : *mut SYMBOL_INFOW) -> BOOL);
   | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:16:1
   |
16 | windows_targets::link!("dbghelp.dll" "system" fn SymFunctionTableAccess64(hprocess : HANDLE, addrbase : u64) -> *mut core::ffi::c_void);
   | --------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:17:1
   |
17 | windows_targets::link!("dbghelp.dll" "system" fn SymGetLineFromAddrW64(hprocess : HANDLE, dwaddr : u64, pdwdisplacement : *mut u32, line : *mut IMAGEHLP_LINEW64) -> BOOL);
   | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:18:1
   |
18 | windows_targets::link!("dbghelp.dll" "system" fn SymGetLineFromInlineContextW(hprocess : HANDLE, dwaddr : u64, inlinecontext : u32, qwmodulebaseaddress : u64, pdwdisplacement : *mut u32, line : *mut IMAGEHLP_LINEW64) -> BOOL);
   | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:19:1
   |
19 | windows_targets::link!("dbghelp.dll" "system" fn SymGetModuleBase64(hprocess : HANDLE, qwaddr : u64) -> u64);
   | ------------------------------------------------------------------------------------------------------------ in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:20:1
   |
20 | windows_targets::link!("dbghelp.dll" "system" fn SymGetOptions() -> u32);
   | ------------------------------------------------------------------------ in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:21:1
   |
21 | windows_targets::link!("dbghelp.dll" "system" fn SymGetSearchPathW(hprocess : HANDLE, searchpatha : PWSTR, searchpathlength : u32) -> BOOL);
   | ------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:22:1
   |
22 | windows_targets::link!("dbghelp.dll" "system" fn SymInitializeW(hprocess : HANDLE, usersearchpath : PCWSTR, finvadeprocess : BOOL) -> BOOL);
   | ------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:23:1
   |
23 | windows_targets::link!("dbghelp.dll" "system" fn SymQueryInlineTrace(hprocess : HANDLE, startaddress : u64, startcontext : u32, startretaddress : u64, curaddress : u64, curcontext : *mut u32, curframeindex : *mut u32) -> BOOL);
   | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:24:1
   |
24 | windows_targets::link!("dbghelp.dll" "system" fn SymSetOptions(symoptions : u32) -> u32);
   | ---------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:25:1
   |
25 | windows_targets::link!("dbghelp.dll" "system" fn SymSetSearchPathW(hprocess : HANDLE, searchpatha : PCWSTR) -> BOOL);
   | -------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:26:1
   |
26 | windows_targets::link!("kernel32.dll" "system" fn CloseHandle(hobject : HANDLE) -> BOOL);
   | ---------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:27:1
   |
27 | windows_targets::link!("kernel32.dll" "system" fn CreateFileMappingA(hfile : HANDLE, lpfilemappingattributes : *const SECURITY_ATTRIBUTES, flprotect : PAGE_PROTECTION_FLAGS, dwmaximumsizehigh : u32, dwmaximumsizelow : u32, lpname : PCSTR) -> HANDLE);
   | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:28:1
   |
28 | windows_targets::link!("kernel32.dll" "system" fn CreateMutexA(lpmutexattributes : *const SECURITY_ATTRIBUTES, binitialowner : BOOL, lpname : PCSTR) -> HANDLE);
   | --------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:29:1
   |
29 | windows_targets::link!("kernel32.dll" "system" fn CreateToolhelp32Snapshot(dwflags : CREATE_TOOLHELP_SNAPSHOT_FLAGS, th32processid : u32) -> HANDLE);
   | ---------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:30:1
   |
30 | windows_targets::link!("kernel32.dll" "system" fn GetCurrentProcess() -> HANDLE);
   | -------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:31:1
   |
31 | windows_targets::link!("kernel32.dll" "system" fn GetCurrentProcessId() -> u32);
   | ------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:32:1
   |
32 | windows_targets::link!("kernel32.dll" "system" fn GetCurrentThread() -> HANDLE);
   | ------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:33:1
   |
33 | windows_targets::link!("kernel32.dll" "system" fn GetProcAddress(hmodule : HMODULE, lpprocname : PCSTR) -> FARPROC);
   | ------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:34:1
   |
34 | windows_targets::link!("kernel32.dll" "system" fn LoadLibraryA(lplibfilename : PCSTR) -> HMODULE);
   | ------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:35:1
   |
35 | windows_targets::link!("kernel32.dll" "system" fn MapViewOfFile(hfilemappingobject : HANDLE, dwdesiredaccess : FILE_MAP, dwfileoffsethigh : u32, dwfileoffsetlow : u32, dwnumberofbytestomap : usize) -> MEMORY_MAPPED_VIEW_ADDRESS);
   | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:36:1
   |
36 | windows_targets::link!("kernel32.dll" "system" fn Module32FirstW(hsnapshot : HANDLE, lpme : *mut MODULEENTRY32W) -> BOOL);
   | ------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:37:1
   |
37 | windows_targets::link!("kernel32.dll" "system" fn Module32NextW(hsnapshot : HANDLE, lpme : *mut MODULEENTRY32W) -> BOOL);
   | ------------------------------------------------------------------------------------------------------------------------ in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:38:1
   |
38 | windows_targets::link!("kernel32.dll" "system" fn ReleaseMutex(hmutex : HANDLE) -> BOOL);
   | ---------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:39:1
   |
39 | windows_targets::link!("kernel32.dll" "system" fn RtlCaptureContext(contextrecord : *mut CONTEXT));
   | -------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:48:1
   |
48 | windows_targets::link!("kernel32.dll" "system" fn UnmapViewOfFile(lpbaseaddress : MEMORY_MAPPED_VIEW_ADDRESS) -> BOOL);
   | ---------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:49:1
   |
49 | windows_targets::link!("kernel32.dll" "system" fn WaitForSingleObjectEx(hhandle : HANDLE, dwmilliseconds : u32, balertable : BOOL) -> WAIT_EVENT);
   | ------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:50:1
   |
50 | windows_targets::link!("kernel32.dll" "system" fn WideCharToMultiByte(codepage : u32, dwflags : u32, lpwidecharstr : PCWSTR, cchwidechar : i32, lpmultibytestr : PSTR, cbmultibyte : i32, lpdefaultchar : PCSTR, lpuseddefaultchar : *mut BOOL) -> i32);
   | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

error: macros that expand to items must be delimited with braces or followed by a semicolon
  --> /checkout/library/windows_targets/src/lib.rs:42:41
   |
41 | pub macro link {
   | -------------- in this expansion of `windows_targets::link!`
42 |     ($($tt:tt)*) => ($crate::link_dylib!($($tt)*))
   |                                         ^^^^^^^^^
   |
  ::: library/std/src/../../backtrace/src/windows_sys.rs:51:1
   |
51 | windows_targets::link!("kernel32.dll" "system" fn lstrlenW(lpstring : PCWSTR) -> i32);
   | ------------------------------------------------------------------------------------- in this macro invocation

[RUSTC-TIMING] std test:false 8.809
error: could not compile `std` (lib) due to 177 previous errors
Build completed unsuccessfully in 0:05:59

@itf itf closed this Jul 24, 2025
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 24, 2025
itf added a commit to itf/rust that referenced this pull request Jul 24, 2025
…st-lang#144415

A recent change altered the definition of the link! macro when the windows_raw_dylib feature is enabled, changing its syntax from pub macro {..} to pub macro($tt:tt) {..} in rust-lang#143592

This change introduced a build failure with the error: "macros that expand to items must be delimited with braces or followed by a semicolon".

We revert this change, making it consistent with the link! macro when the windows_raw_dylib feature is not enabled.

For the case when it is not enabled, it also makes use of code repetition in order to avoid the macro expansion error. If instead we try to reuse the code, as seen in rust-lang#144415, we run into the same issue of "macros that expand to items must be delimited with braces or followed by a semicolon"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants