about summary refs log tree commit diff
path: root/library/std/src/sys
diff options
context:
space:
mode:
authorSimonas Kazlauskas <git@kazlauskas.me>2021-10-02 22:10:00 +0300
committerSimonas Kazlauskas <git@kazlauskas.me>2021-10-02 22:16:23 +0300
commit5b4873a7597648998285c191a7a7a05fdec15ad4 (patch)
tree1c585a804606d8092a6706d75a63298e7cea5f0e /library/std/src/sys
parentb7d2b465b9a3d375ad3c1fbce75fa2ed47cc9e99 (diff)
Run the #85441 regression test on MSVC only
On MinGW toolchains the various features (such as function sections)
necessary to eliminate dead function references are disabled due to
various bugs. This means that the windows sockets library will most
likely remain linked to any mingw toolchain built program that also
utilizes libstd.

That said, I made an attempt to also enable `function-sections` and
`--gc-sections` during my experiments, but the symbol references
remained, sadly.
Diffstat (limited to 'library/std/src/sys')
-rw-r--r--library/std/src/sys/windows/net.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/sys/windows/net.rs b/library/std/src/sys/windows/net.rs
index 84a5a389e0d..9c631e7e51c 100644
--- a/library/std/src/sys/windows/net.rs
+++ b/library/std/src/sys/windows/net.rs
@@ -29,12 +29,12 @@ pub mod netc {
 
 pub struct Socket(OwnedSocket);
 
-static WSA: SyncOnceCell<unsafe extern "system" fn() -> i32> = SyncOnceCell::new();
+static WSA_CLEANUP: SyncOnceCell<unsafe extern "system" fn() -> i32> = SyncOnceCell::new();
 
 /// Checks whether the Windows socket interface has been started already, and
 /// if not, starts it.
 pub fn init() {
-    let _ = WSA.get_or_init(|| unsafe {
+    let _ = WSA_CLEANUP.get_or_init(|| unsafe {
         let mut data: c::WSADATA = mem::zeroed();
         let ret = c::WSAStartup(
             0x202, // version 2.2
@@ -51,7 +51,7 @@ pub fn init() {
 
 pub fn cleanup() {
     // only perform cleanup if network functionality was actually initialized
-    if let Some(cleanup) = WSA.get() {
+    if let Some(cleanup) = WSA_CLEANUP.get() {
         unsafe {
             cleanup();
         }