File tree 1 file changed +10
-8
lines changed
library/std/src/sys/windows
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 {
102
102
}
103
103
104
104
#[ allow( dead_code) ]
105
+ #[ inline( always) ]
105
106
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
+ }
107
115
}
108
116
109
117
#[ allow( dead_code) ]
110
118
pub unsafe fn call( $( $argname: $argtype) ,* ) -> $rettype {
111
- if let Some ( ptr) = PTR {
119
+ if let Some ( ptr) = option ( ) {
112
120
return ptr( $( $argname) ,* ) ;
113
121
}
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
- }
120
122
$fallback_body
121
123
}
122
124
}
You can’t perform that action at this time.
0 commit comments