Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure in empty project: expected enum winapi::ctypes::c_void, found enum std::ffi::c_void #16

Closed
jamesgecko opened this issue Feb 5, 2023 · 3 comments

Comments

@jamesgecko
Copy link

jamesgecko commented Feb 5, 2023

In a new project where junction is the only dependency, I get the following build failures on Windows 11 with Rust 1.67.0 (fc594f156 2023-01-24). I do not see these errors when running cargo build in the library directory; it's entirely possible I'm doing something wrong.

Similar failures seem to have happened in wezterm and tokio.

cargo build --target x86_64-pc-windows-msvc
   Compiling junction v0.2.0
error[E0308]: mismatched types
   --> C:\Users\james\.cargo\registry\src\github.com-1ecc6299db9ec823\junction-0.2.0\src\internals.rs:78:32
    |
78  |     helpers::set_reparse_point(file.as_raw_handle(), rdb, u32::from(in_buffer_size))
    |     -------------------------- ^^^^^^^^^^^^^^^^^^^^ expected enum `winapi::ctypes::c_void`, found enum `std::ffi::c_void`
    |     |
    |     arguments to this function are incorrect
    |
    = note: enum `std::ffi::c_void` and enum `winapi::ctypes::c_void` have similar names, but are actually distinct types
note: enum `std::ffi::c_void` is defined in crate `core`
   --> C:\Users\james\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\ffi\mod.rs:203:1
    |
203 | pub enum c_void {
    | ^^^^^^^^^^^^^^^
note: enum `winapi::ctypes::c_void` is defined in crate `winapi`
   --> C:\Users\james\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.3.9\src\lib.rs:38:5
    |
38  |     pub enum c_void {}
    |     ^^^^^^^^^^^^^^^
note: function defined here
   --> C:\Users\james\.cargo\registry\src\github.com-1ecc6299db9ec823\junction-0.2.0\src\internals\helpers.rs:121:8
    |
121 | pub fn set_reparse_point(handle: HANDLE, rdb: *mut ReparseDataBuffer, len: u32) -> io::Result<()> {
    |        ^^^^^^^^^^^^^^^^^ --------------

error[E0308]: mismatched types
   --> C:\Users\james\.cargo\registry\src\github.com-1ecc6299db9ec823\junction-0.2.0\src\internals.rs:83:35
    |
83  |     helpers::delete_reparse_point(file.as_raw_handle())
    |     ----------------------------- ^^^^^^^^^^^^^^^^^^^^ expected enum `winapi::ctypes::c_void`, found enum `std::ffi::c_void`
    |     |
    | ^^^^^^^^^^^^^^^
note: enum `winapi::ctypes::c_void` is defined in crate `winapi`
   --> C:\Users\james\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.3.9\src\lib.rs:38:5
    |
38  |     pub enum c_void {}
    |     ^^^^^^^^^^^^^^^
note: function defined here
   --> C:\Users\james\.cargo\registry\src\github.com-1ecc6299db9ec823\junction-0.2.0\src\internals\helpers.rs:142:8
    |
142 | pub fn delete_reparse_point(handle: HANDLE) -> io::Result<()> {
    |        ^^^^^^^^^^^^^^^^^^^^ --------------

error[E0308]: mismatched types
   --> C:\Users\james\.cargo\registry\src\github.com-1ecc6299db9ec823\junction-0.2.0\src\internals.rs:93:47
    |
93  |     let rdb = helpers::get_reparse_data_point(file.as_raw_handle(), &mut data)?;
    |               ------------------------------- ^^^^^^^^^^^^^^^^^^^^ expected enum `winapi::ctypes::c_void`, found enum `std::ffi::c_void`    
    |               |
    |               arguments to this function are incorrect
    |    = note: enum `std::ffi::c_void` and enum `winapi::ctypes::c_void` have similar names, but are actually distinct typesnote: enum `std::ffi::c_void` is defined in crate `core`
   --> C:\Users\james\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\ffi\mod.rs:203:1
    |
203 | pub enum c_void {
    | ^^^^^^^^^^^^^^^
note: enum `winapi::ctypes::c_void` is defined in crate `winapi`
   --> C:\Users\james\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.3.9\src\lib.rs:38:5
    |
38  |     pub enum c_void {}
    |     ^^^^^^^^^^^^^^^
note: function defined here
   --> C:\Users\james\.cargo\registry\src\github.com-1ecc6299db9ec823\junction-0.2.0\src\internals\helpers.rs:97:8
    |
97  | pub fn get_reparse_data_point<'a>(handle: HANDLE, data: &'a mut [u8]) -> io::Result<&'a ReparseDataBuffer> {
    |        ^^^^^^^^^^^^^^^^^^^^^^     --------------

error[E0308]: mismatched types
   --> C:\Users\james\.cargo\registry\src\github.com-1ecc6299db9ec823\junction-0.2.0\src\internals.rs:104:47
    |
104 |     let rdb = helpers::get_reparse_data_point(file.as_raw_handle(), &mut data)?;
    |               ------------------------------- ^^^^^^^^^^^^^^^^^^^^ expected enum `winapi::ctypes::c_void`, found enum `std::ffi::c_void`    
    |               |
    |               arguments to this function are incorrect
    |
    = note: enum `std::ffi::c_void` and enum `winapi::ctypes::c_void` have similar names, but are actually distinct typesnote: enum `std::ffi::c_void` is defined in crate `core`   --> C:\Users\james\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\ffi\mod.rs:203:1
    |
203 | pub enum c_void {
    | ^^^^^^^^^^^^^^^
note: enum `winapi::ctypes::c_void` is defined in crate `winapi`
   --> C:\Users\james\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.3.9\src\lib.rs:38:5
    |
38  |     pub enum c_void {}
    |     ^^^^^^^^^^^^^^^
note: function defined here
   --> C:\Users\james\.cargo\registry\src\github.com-1ecc6299db9ec823\junction-0.2.0\src\internals\helpers.rs:97:8
    |
97  | pub fn get_reparse_data_point<'a>(handle: HANDLE, data: &'a mut [u8]) -> io::Result<&'a ReparseDataBuffer> {
    |        ^^^^^^^^^^^^^^^^^^^^^^     --------------
@tesuji
Copy link
Owner

tesuji commented Feb 24, 2023

Sorry I couldn't reproduce your issue on local machine or CI either.

Could you recheck the issue. If the issue is continue to be your problem, could you
post your Cargo.lock file and rustc -Vv?

@tesuji
Copy link
Owner

tesuji commented Feb 25, 2023

I'm sorry. I'd have read your OP more carefully. I fixed the issue now.

@tesuji
Copy link
Owner

tesuji commented Feb 25, 2023

Released v0.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants