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 {
103
103
104
104
#[ allow( dead_code) ]
105
105
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
+ }
107
114
}
108
115
109
116
#[ allow( dead_code) ]
110
117
pub unsafe fn call( $( $argname: $argtype) ,* ) -> $rettype {
111
- if let Some ( ptr) = PTR {
118
+ if let Some ( ptr) = option ( ) {
112
119
return ptr( $( $argname) ,* ) ;
113
120
}
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
121
$fallback_body
121
122
}
122
123
}
You can’t perform that action at this time.
0 commit comments