File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed 
library/std/src/sys/windows Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -180,8 +180,8 @@ macro_rules! compat_fn_with_fallback {
180180
181181            fn  load_from_module( module:  Option <Module >)  -> F  { 
182182                unsafe  { 
183-                     static  symbol_name :  & CStr  = ansi_str!( sym $symbol) ; 
184-                     if  let  Some ( f)  = module. and_then( |m| m. proc_address( symbol_name ) )  { 
183+                     static  SYMBOL_NAME :  & CStr  = ansi_str!( sym $symbol) ; 
184+                     if  let  Some ( f)  = module. and_then( |m| m. proc_address( SYMBOL_NAME ) )  { 
185185                        PTR . store( f. as_ptr( ) ,  Ordering :: Relaxed ) ; 
186186                        mem:: transmute( f) 
187187                    }  else { 
@@ -251,7 +251,7 @@ macro_rules! compat_fn_optional {
251251            pub  fn  option( )  -> Option <F > { 
252252                let  mut  func = NonNull :: new( PTR . load( Ordering :: Relaxed ) ) ; 
253253                if  func. is_none( )  { 
254-                     Module :: new( $module) . map( preload) ; 
254+                     unsafe   {   Module :: new( $module) . map( preload)   } ; 
255255                    func = NonNull :: new( PTR . load( Ordering :: Relaxed ) ) ; 
256256                } 
257257                unsafe  { 
@@ -262,8 +262,8 @@ macro_rules! compat_fn_optional {
262262            #[ allow( unused) ] 
263263            pub ( in crate :: sys)  fn  preload( module:  Module )  { 
264264                unsafe  { 
265-                     let  symbol_name  = ansi_str!( sym $symbol) ; 
266-                     if  let  Some ( f)  = module. proc_address( symbol_name )  { 
265+                     static   SYMBOL_NAME :   & CStr  = ansi_str!( sym $symbol) ; 
266+                     if  let  Some ( f)  = module. proc_address( SYMBOL_NAME )  { 
267267                        PTR . store( f. as_ptr( ) ,  Ordering :: Relaxed ) ; 
268268                    } 
269269                } 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments