File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
library/std/src/sys/windows Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -102,21 +102,23 @@ macro_rules! compat_fn {
102102 }
103103
104104 #[ allow( dead_code) ]
105+ #[ inline( always) ]
105106 pub fn option( ) -> Option <F > {
106- unsafe { PTR }
107+ unsafe {
108+ if cfg!( miri) {
109+ // Miri does not run `init`, so we just call `get_f` each time.
110+ get_f( )
111+ } else {
112+ PTR
113+ }
114+ }
107115 }
108116
109117 #[ allow( dead_code) ]
110118 pub unsafe fn call( $( $argname: $argtype) ,* ) -> $rettype {
111- if let Some ( ptr) = PTR {
119+ if let Some ( ptr) = option ( ) {
112120 return ptr( $( $argname) ,* ) ;
113121 }
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- }
120122 $fallback_body
121123 }
122124 }
You can’t perform that action at this time.
0 commit comments