Skip to content

Pull #1601 broke single-instance  #1730

@thedtvn

Description

@thedtvn
error[E0308]: mismatched types
  --> C:\Users\duong\.cargo\git\checkouts\plugins-workspace-fd0259fcb18f51ad\104f482\plugins\single-instance\src\platform_impl\windows.rs:52:32
   |
52 |                     if hwnd != 0 {
   |                        ----    ^ expected `*mut c_void`, found `usize`
   |                        |
   |                        expected because this is `*mut c_void`
   |
   = note: expected raw pointer `*mut c_void`
                     found type `usize`
help: if you meant to create a null pointer, use `std::ptr::null_mut()`
   |
52 |                     if hwnd != std::ptr::null_mut() {
   |                                ~~~~~~~~~~~~~~~~~~~~

error[E0308]: mismatched types
  --> C:\Users\duong\.cargo\git\checkouts\plugins-workspace-fd0259fcb18f51ad\104f482\plugins\single-instance\src\platform_impl\windows.rs:72:40
   |
72 |                 app.manage(MutexHandle(hmutex));
   |                            ----------- ^^^^^^ expected `isize`, found `*mut c_void`
   |                            |
   |                            arguments to this struct are incorrect
   |
   = note:     expected type `isize`
           found raw pointer `*mut c_void`
note: tuple struct defined here
  --> C:\Users\duong\.cargo\git\checkouts\plugins-workspace-fd0259fcb18f51ad\104f482\plugins\single-instance\src\platform_impl\windows.rs:25:8
   |
25 | struct MutexHandle(isize);
   |        ^^^^^^^^^^^

error[E0308]: mismatched types
  --> C:\Users\duong\.cargo\git\checkouts\plugins-workspace-fd0259fcb18f51ad\104f482\plugins\single-instance\src\platform_impl\windows.rs:83:47
   |
83 |                 app.manage(TargetWindowHandle(hwnd));
   |                            ------------------ ^^^^ expected `isize`, found `*mut c_void`
   |                            |
   |                            arguments to this struct are incorrect
   |
   = note:     expected type `isize`
           found raw pointer `*mut c_void`
note: tuple struct defined here
  --> C:\Users\duong\.cargo\git\checkouts\plugins-workspace-fd0259fcb18f51ad\104f482\plugins\single-instance\src\platform_impl\windows.rs:26:8
   |
26 | struct TargetWindowHandle(isize);
   |        ^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
   --> C:\Users\duong\.cargo\git\checkouts\plugins-workspace-fd0259fcb18f51ad\104f482\plugins\single-instance\src\platform_impl\windows.rs:99:26
    |
99  |             ReleaseMutex(hmutex.0);
    |             ------------ ^^^^^^^^ expected `*mut c_void`, found `isize`
    |             |
    |             arguments to this function are incorrect
    |
    = note: expected raw pointer `*mut c_void`
                      found type `isize`
note: function defined here
   --> C:\Users\duong\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.59.0\src\Windows\Win32\System\Threading\mod.rs:264:51
    |
264 | windows_targets::link!("kernel32.dll" "system" fn ReleaseMutex(hmutex : super::super::Foundation:: HANDLE) -> super::super::Foundation:: ...
    |                                                   ^^^^^^^^^^^^

error[E0308]: mismatched types
   --> C:\Users\duong\.cargo\git\checkouts\plugins-workspace-fd0259fcb18f51ad\104f482\plugins\single-instance\src\platform_impl\windows.rs:100:25
    |
100 |             CloseHandle(hmutex.0);
    |             ----------- ^^^^^^^^ expected `*mut c_void`, found `isize`
    |             |
    |             arguments to this function are incorrect
    |
    = note: expected raw pointer `*mut c_void`
                      found type `isize`
note: function defined here
   --> C:\Users\duong\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.59.0\src\Windows\Win32\Foundation\mod.rs:1:51
    |
1   | windows_targets::link!("kernel32.dll" "system" fn CloseHandle(hobject : HANDLE) -> BOOL);
    |                                                   ^^^^^^^^^^^

error[E0308]: mismatched types
   --> C:\Users\duong\.cargo\git\checkouts\plugins-workspace-fd0259fcb18f51ad\104f482\plugins\single-instance\src\platform_impl\windows.rs:104:32
    |
104 |         unsafe { DestroyWindow(hwnd.0) };
    |                  ------------- ^^^^^^ expected `*mut c_void`, found `isize`
    |                  |
    |                  arguments to this function are incorrect
    |
    = note: expected raw pointer `*mut c_void`
                      found type `isize`
note: function defined here
   --> C:\Users\duong\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.59.0\src\Windows\Win32\UI\WindowsAndMessaging\mod.rs:90:49
    |
90  | windows_targets::link!("user32.dll" "system" fn DestroyWindow(hwnd : super::super::Foundation:: HWND) -> super::super::Foundation:: BOOL);
    |                                                 ^^^^^^^^^^^^^

error[E0308]: mismatched types
   --> C:\Users\duong\.cargo\git\checkouts\plugins-workspace-fd0259fcb18f51ad\104f482\plugins\single-instance\src\platform_impl\windows.rs:148:20
    |
148 |             hIcon: 0,
    |                    ^ expected `*mut c_void`, found `usize`
    |
    = note: expected raw pointer `*mut c_void`
                      found type `usize`
help: if you meant to create a null pointer, use `std::ptr::null_mut()`
    |
148 |             hIcon: std::ptr::null_mut(),
    |                    ~~~~~~~~~~~~~~~~~~~~

error[E0308]: mismatched types
   --> C:\Users\duong\.cargo\git\checkouts\plugins-workspace-fd0259fcb18f51ad\104f482\plugins\single-instance\src\platform_impl\windows.rs:149:22
    |
149 |             hCursor: 0,
    |                      ^ expected `*mut c_void`, found `usize`
    |
    = note: expected raw pointer `*mut c_void`
                      found type `usize`
help: if you meant to create a null pointer, use `std::ptr::null_mut()`
    |
149 |             hCursor: std::ptr::null_mut(),
    |                      ~~~~~~~~~~~~~~~~~~~~

error[E0308]: mismatched types
   --> C:\Users\duong\.cargo\git\checkouts\plugins-workspace-fd0259fcb18f51ad\104f482\plugins\single-instance\src\platform_impl\windows.rs:150:28
    |
150 |             hbrBackground: 0,
    |                            ^ expected `*mut c_void`, found `usize`
    |
    = note: expected raw pointer `*mut c_void`
                      found type `usize`
help: if you meant to create a null pointer, use `std::ptr::null_mut()`
    |
150 |             hbrBackground: std::ptr::null_mut(),
    |                            ~~~~~~~~~~~~~~~~~~~~

error[E0308]: mismatched types
   --> C:\Users\duong\.cargo\git\checkouts\plugins-workspace-fd0259fcb18f51ad\104f482\plugins\single-instance\src\platform_impl\windows.rs:153:22
    |
153 |             hIconSm: 0,
    |                      ^ expected `*mut c_void`, found `usize`
    |
    = note: expected raw pointer `*mut c_void`
                      found type `usize`
help: if you meant to create a null pointer, use `std::ptr::null_mut()`
    |
153 |             hIconSm: std::ptr::null_mut(),
    |                      ~~~~~~~~~~~~~~~~~~~~

error[E0308]: arguments to this function are incorrect
   --> C:\Users\duong\.cargo\git\checkouts\plugins-workspace-fd0259fcb18f51ad\104f482\plugins\single-instance\src\platform_impl\windows.rs:158:20
    |
158 |         let hwnd = CreateWindowExW(
    |                    ^^^^^^^^^^^^^^^
    |
note: expected `*mut c_void`, found `usize`
   --> C:\Users\duong\.cargo\git\checkouts\plugins-workspace-fd0259fcb18f51ad\104f482\plugins\single-instance\src\platform_impl\windows.rs:177:13
    |
177 |             0,
    |             ^
    = note: expected raw pointer `*mut c_void`
                      found type `usize`
note: expected `*mut c_void`, found `usize`
   --> C:\Users\duong\.cargo\git\checkouts\plugins-workspace-fd0259fcb18f51ad\104f482\plugins\single-instance\src\platform_impl\windows.rs:178:13
    |
178 |             0,
    |             ^
    = note: expected raw pointer `*mut c_void`
                      found type `usize`
note: function defined here
   --> C:\Users\duong\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.59.0\src\Windows\Win32\UI\WindowsAndMessaging\mod.rs:71:49
    |
71  | windows_targets::link!("user32.dll" "system" fn CreateWindowExW(dwexstyle : WINDOW_EX_STYLE, lpclassname : windows_sys::core::PCWSTR, lpw...
    |                                                 ^^^^^^^^^^^^^^^
help: if you meant to create a null pointer, use `std::ptr::null_mut()`
    |
177 |             std::ptr::null_mut(),
    |             ~~~~~~~~~~~~~~~~~~~~
help: if you meant to create a null pointer, use `std::ptr::null_mut()`
    |
178 |             std::ptr::null_mut(),
    |             ~~~~~~~~~~~~~~~~~~~~

For more information about this error, try `rustc --explain E0308`.
error: could not compile `tauri-plugin-single-instance` (lib) due to 11 previous errors
warning: build failed, waiting for other jobs to finish...

err from pull #1601

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions