File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
library/std/src/sys/windows Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -103,20 +103,21 @@ macro_rules! compat_fn {
103103
104104 #[ allow( dead_code) ]
105105 pub fn option( ) -> Option <F > {
106- unsafe { PTR }
106+ unsafe {
107+ if cfg!( miri) {
108+ // Miri does not run `init`, so we just call `get_f` each time.
109+ get_f( )
110+ } else {
111+ PTR
112+ }
113+ }
107114 }
108115
109116 #[ allow( dead_code) ]
110117 pub unsafe fn call( $( $argname: $argtype) ,* ) -> $rettype {
111- if let Some ( ptr) = PTR {
118+ if let Some ( ptr) = option ( ) {
112119 return ptr( $( $argname) ,* ) ;
113120 }
114- if cfg!( miri) {
115- // Miri does not run `init`, so we just call `get_f` each time.
116- if let Some ( ptr) = get_f( ) {
117- return ptr( $( $argname) ,* ) ;
118- }
119- }
120121 $fallback_body
121122 }
122123 }
You can’t perform that action at this time.
0 commit comments