cheako

Untitled

Feb 2nd, 2022
1,819
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.71 KB | None | 0 0
  1. error[E0308]: `match` arms have incompatible types
  2.   --> src/lib.rs:89:37
  3.    |
  4. 87 |       let result = catch_unwind(|| match unsafe { CStr::from_ptr(p_name) }.to_bytes() {
  5.    |                                    -------------------------------------------------- `match` arms have incompatible types
  6. 88 |           b"vkCreateInstance" => &CheakoCache_CreateInstance as *const vk::PFN_vkVoidFunction,
  7.    |                                  ------------------------------------------------------------ this is found to be of type `*const Option<unsafe extern "system" fn()>`
  8. 89 |           b"vkGetInstanceProcAddr" => Some(std::mem::transmute::<_, unsafe extern "system" fn()>(
  9.    |  _____________________________________^
  10. 90 | |             CheakoCache_GetInstanceProcAddr as *const fn(),
  11. 91 | |         )),
  12.    | |__________^ expected *-ptr, found enum `Option`
  13.    |
  14.    = note: expected type `*const Option<unsafe extern "system" fn()>`
  15.               found enum `Option<unsafe extern "system" fn()>`
  16.  
  17. error[E0606]: casting `&unsafe extern "system" fn(*const InstanceCreateInfo, Option<*const AllocationCallbacks>, *mut ash::vk::Instance) -> ash::vk::Result {CheakoCache_CreateInstance}` as `*const Option<unsafe extern "system" fn()>` is invalid
  18.   --> src/lib.rs:88:32
  19.    |
  20. 88 |         b"vkCreateInstance" => &CheakoCache_CreateInstance as *const vk::PFN_vkVoidFunction,
  21.    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  22.  
  23. Some errors have detailed explanations: E0308, E0606.
  24. For more information about an error, try `rustc --explain E0308`.
  25. warning: `vk_layer_cache` (lib) generated 2 warnings
  26. error: could not compile `vk_layer_cache` due to 2 previous errors; 2 warnings emitted
  27.  
Advertisement
Add Comment
Please, Sign In to add comment