commit
1f734250c5
|
@ -100,6 +100,7 @@ fn main() {
|
||||||
let pointer = foo as *const ();
|
let pointer = foo as *const ();
|
||||||
let function = unsafe {
|
let function = unsafe {
|
||||||
std::mem::transmute::<*const (), fn() -> i32>(pointer)
|
std::mem::transmute::<*const (), fn() -> i32>(pointer)
|
||||||
|
};
|
||||||
assert_eq!(function(), 0);
|
assert_eq!(function(), 0);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -101,6 +101,7 @@ fn main() {
|
||||||
let pointer = foo as *const ();
|
let pointer = foo as *const ();
|
||||||
let function = unsafe {
|
let function = unsafe {
|
||||||
std::mem::transmute::<*const (), fn() -> i32>(pointer)
|
std::mem::transmute::<*const (), fn() -> i32>(pointer)
|
||||||
|
};
|
||||||
assert_eq!(function(), 0);
|
assert_eq!(function(), 0);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue