Advertisement
kajacx

Untitled

Jan 30th, 2023
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.39 KB | None | 0 0
  1. // FIRST ERROR:
  2. async fn import_u32_async() -> u32; // Example of added imported function
  3.  
  4. :\Programming\Rust\fp-bindgen-simple-example\examples\example-protocol\bindings\rust-plugin\src\import.rs:123:1
  5. |
  6. 123 | #[fp_bindgen_support::fp_import_signature]
  7. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  8. | |
  9. | expected `u64`, found `u32`
  10. | arguments to this function are incorrect
  11. |
  12. note: associated function defined here
  13. --> E:\Programming\Rust\fp-bindgen-simple-example\fp-bindgen-support\src\guest\async\mod.rs:26:19
  14. |
  15. 26 | pub unsafe fn new(async_value_ptr: FatPtr) -> Self {
  16. | ^^^
  17. = note: this error originates in the attribute macro `fp_bindgen_support::fp_import_signature` (in Nightly builds, run with -Z macro-backtrace for more info)
  18. help: you can convert a `u32` to a `u64`
  19. |
  20. 123 | #[fp_bindgen_support::fp_import_signature].into()
  21. | +++++++
  22.  
  23.  
  24.  
  25. // SECOND ERROR:
  26. async fn export_u64_async() -> u64; // Exported async function returning u64
  27.  
  28. error[E0308]: mismatched types
  29. --> src\spec\bindings.rs:883:67
  30. |
  31. 883 | let result = result.map(|ref data| deserialize_from_slice(data));
  32. | ---------------------- ^^^^ expected slice `[u8]`, found `u64`
  33. | |
  34. | arguments to this function are incorrect
  35. |
  36. = note: expected reference `&[u8]`
  37. found reference `&u64`
  38. note: function defined here
  39. --> E:\Programming\Rust\fp-bindgen-simple-example\fp-bindgen-support\src\host\mem.rs:18:8
  40. |
  41. 18 | pub fn deserialize_from_slice<'a, T: Deserialize<'a>>(slice: &'a [u8]) -> T {
  42. | ^^^^^^^^^^^^^^^^^^^^^^
  43.  
  44. error[E0308]: mismatched types
  45. --> src\spec\bindings.rs:896:12
  46. |
  47. 896 | Ok(result)
  48. | -- ^^^^^^ expected `u64`, found struct `Vec`
  49. | |
  50. | arguments to this enum variant are incorrect
  51. |
  52. = note: expected type `u64`
  53. found struct `Vec<u8>`
  54. note: tuple variant defined here
  55. --> C:\Programs\Rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\result.rs:508:5
  56. |
  57. 508 | Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
  58. | ^^
  59.  
  60. error[E0308]: mismatched types
  61. --> src\wasi_spec\bindings.rs:886:67
  62. |
  63. 886 | let result = result.map(|ref data| deserialize_from_slice(data));
  64. | ---------------------- ^^^^ expected slice `[u8]`, found `u64`
  65. | |
  66. | arguments to this function are incorrect
  67. |
  68. = note: expected reference `&[u8]`
  69. found reference `&u64`
  70. note: function defined here
  71. --> E:\Programming\Rust\fp-bindgen-simple-example\fp-bindgen-support\src\host\mem.rs:18:8
  72. |
  73. 18 | pub fn deserialize_from_slice<'a, T: Deserialize<'a>>(slice: &'a [u8]) -> T {
  74. | ^^^^^^^^^^^^^^^^^^^^^^
  75.  
  76. error[E0308]: mismatched types
  77. --> src\wasi_spec\bindings.rs:899:12
  78. |
  79. 899 | Ok(result)
  80. | -- ^^^^^^ expected `u64`, found struct `Vec`
  81. | |
  82. | arguments to this enum variant are incorrect
  83. |
  84. = note: expected type `u64`
  85. found struct `Vec<u8>`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement