rust-lang / rustlings

:crab: Small exercises to get you used to reading and writing Rust code!
https://rustlings.cool
MIT License
54.07k stars 10.15k forks source link

Error with cargo install --force --path . #1956

Closed meinders1980 closed 6 months ago

meinders1980 commented 6 months ago

Command: cargo install --force --path .

Gives the following error messages:

Installing rustlings v5.6.1 (C:\Users\xxx\source\repos\rustlings) Updating crates.io index Compiling notify v4.0.17 Compiling toml v0.7.8 error[E0432]: unresolved import winapi::shared::winerror --> C:\Users\xxx.cargo\registry\src\index.crates.io-6f17d22bba15001f\notify-4.0.17\src\windows.rs:11:21 | 11 | use winapi::shared::winerror::ERROR_OPERATION_ABORTED; | ^^^^^^^^ could not find winerror in shared

error[E0308]: mismatched types --> C:\Users\xxx.cargo\registry\src\index.crates.io-6f17d22bba15001f\notify-4.0.17\src\windows.rs:276:29 276 overlapped.hEvent = request_p; ----------------- ^^^^^^^^^ expected winapi::ctypes::c_void, found libc::c_void
expected due to the type of this binding
= note: `libc::c_void` and `winapi::ctypes::c_void` have similar names, but are actually distinct types

note: libc::c_void is defined in crate core --> /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04\library\core\src\ffi\mod.rs:173:1 note: winapi::ctypes::c_void is defined in crate winapi --> C:\Users\xxx.cargo\registry\src\index.crates.io-6f17d22bba15001f\winapi-0.3.9\src\lib.rs:38:5 | 38 | pub enum c_void {} | ^^^^^^^^^^^^^^^

error[E0308]: mismatched types --> C:\Users\xxx.cargo\registry\src\index.crates.io-6f17d22bba15001f\notify-4.0.17\src\windows.rs:282:13 280 let ret = winbase::ReadDirectoryChangesW( ------------------------------ arguments to this function are incorrect 281 handle, 282 req_buf, ^^^^^^^ expected winapi::ctypes::c_void, found libc::c_void
 = note: `libc::c_void` and `winapi::ctypes::c_void` have similar names, but are actually distinct types
note: libc::c_void is defined in crate core --> /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04\library\core\src\ffi\mod.rs:173:1 note: winapi::ctypes::c_void is defined in crate winapi --> C:\Users\xxx.cargo\registry\src\index.crates.io-6f17d22bba15001f\winapi-0.3.9\src\lib.rs:38:5 38 pub enum c_void {} ^^^^^^^^^^^^^^^ note: function defined here --> C:\Users\xxx.cargo\registry\src\index.crates.io-6f17d22bba15001f\winapi-0.3.9\src\um\winbase.rs:2072:12
2072 pub fn ReadDirectoryChangesW(
^^^^^^^^^^^^^^^^^^^^^

Some errors have detailed explanations: E0308, E0432. For more information about an error, try rustc --explain E0308. error: could not compile notify (lib) due to 3 previous errors warning: build failed, waiting for other jobs to finish...

Is there a solution for my situation?

My dev environment has rust version installed: rustc 1.77.2 (25ef9e3d8 2024-04-09)

mo8it commented 6 months ago

Should be resolved for now by https://github.com/rust-lang/rustlings/commit/71053101c32d0fd374f8e122880b3d682519bac6

@meinders1980 Please run the installation script again and tell me if you still face a problem :)