diff options
| author | bors <bors@rust-lang.org> | 2022-08-01 01:11:08 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-08-01 01:11:08 +0000 |
| commit | 6423ab3a755fed97f75b2361849155d4e996d02f (patch) | |
| tree | 30241f14b8068f0e26702892825809640dc56249 /library/std | |
| parent | 34805f36752fd81cabc5104579e065e62fc0fec6 (diff) | |
| parent | 20a5e9fd7cdf3f9b3e60f1f4d52148b5ff45819e (diff) | |
| download | rust-6423ab3a755fed97f75b2361849155d4e996d02f.tar.gz rust-6423ab3a755fed97f75b2361849155d4e996d02f.zip | |
Auto merge of #99998 - matthiaskrgr:rollup-igafy0r, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #99519 (Remove implicit names and values from `--cfg` in `--check-cfg`) - #99620 (`-Z location-detail`: provide option to disable all location details) - #99932 (Fix unwinding on certain platforms when debug assertions are enabled) - #99973 (Layout things) - #99980 (Remove more Clean trait implementations) - #99984 (Fix compat.rs for `cfg(miri)`) - #99986 (Add wrap suggestions for record variants) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/std')
| -rw-r--r-- | library/std/src/sys/windows/compat.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/library/std/src/sys/windows/compat.rs b/library/std/src/sys/windows/compat.rs index b4ffbdc9609..ccc90177a20 100644 --- a/library/std/src/sys/windows/compat.rs +++ b/library/std/src/sys/windows/compat.rs @@ -180,8 +180,8 @@ macro_rules! compat_fn_with_fallback { fn load_from_module(module: Option<Module>) -> F { unsafe { - static symbol_name: &CStr = ansi_str!(sym $symbol); - if let Some(f) = module.and_then(|m| m.proc_address(symbol_name)) { + static SYMBOL_NAME: &CStr = ansi_str!(sym $symbol); + if let Some(f) = module.and_then(|m| m.proc_address(SYMBOL_NAME)) { PTR.store(f.as_ptr(), Ordering::Relaxed); mem::transmute(f) } else { @@ -251,7 +251,7 @@ macro_rules! compat_fn_optional { pub fn option() -> Option<F> { let mut func = NonNull::new(PTR.load(Ordering::Relaxed)); if func.is_none() { - Module::new($module).map(preload); + unsafe { Module::new($module).map(preload) }; func = NonNull::new(PTR.load(Ordering::Relaxed)); } unsafe { @@ -262,8 +262,8 @@ macro_rules! compat_fn_optional { #[allow(unused)] pub(in crate::sys) fn preload(module: Module) { unsafe { - let symbol_name = ansi_str!(sym $symbol); - if let Some(f) = module.proc_address(symbol_name) { + static SYMBOL_NAME: &CStr = ansi_str!(sym $symbol); + if let Some(f) = module.proc_address(SYMBOL_NAME) { PTR.store(f.as_ptr(), Ordering::Relaxed); } } |
