Compiling fd-lock v1.1.0 (C:\Users\Peter\Code\wincheck\fd-lock)
error[E0432]: unresolved import `winapi::um::fileapi::LOCKFILE_EXCLUSIVE_LOCK`
--> src\windows.rs:3:61
|
3 | use winapi::um::fileapi::{LockFile, LockFileEx, UnlockFile, LOCKFILE_EXCLUSIVE_LOCK};
| ^^^^^^^^^^^^^^^^^^^^^^^ no `LOCKFILE_EXCLUSIVE_LOCK` in `um::fileapi`
error[E0433]: failed to resolve: use of undeclared type or module `ErrorKind`
--> src\windows.rs:11:13
|
11 | Err(ErrorKind::Locked.into())
| ^^^^^^^^^ use of undeclared type or module `ErrorKind`
error[E0433]: failed to resolve: use of undeclared type or module `ErrorKind`
--> src\windows.rs:21:13
|
21 | Err(ErrorKind::Locked.into())
| ^^^^^^^^^ use of undeclared type or module `ErrorKind`
error[E0433]: failed to resolve: use of undeclared type or module `ErrorKind`
--> src\windows.rs:81:17
|
81 | Err(ErrorKind::Other.into())
| ^^^^^^^^^ use of undeclared type or module `ErrorKind`
error[E0433]: failed to resolve: use of undeclared type or module `ErrorKind`
--> src\windows.rs:97:17
|
97 | Err(ErrorKind::Other.into())
| ^^^^^^^^^ use of undeclared type or module `ErrorKind`
error[E0412]: cannot find type `LockGuard` in this scope
--> src\windows.rs:7:42
|
7 | pub fn lock(handle: RawHandle) -> Result<LockGuard, Error> {
| ^^^^^^^^^ help: a struct with a similar name exists: `FdLockGuard`
error[E0412]: cannot find type `Error` in this scope
--> src\windows.rs:7:53
|
7 | pub fn lock(handle: RawHandle) -> Result<LockGuard, Error> {
| ^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
|
1 | use core::fmt::Error;
|
1 | use crate::error::Error;
|
1 | use failure::Error;
|
1 | use std::error::Error;
|
and 2 other candidates
error[E0422]: cannot find struct, variant or union type `LockGuard` in this scope
--> src\windows.rs:9:12
|
9 | Ok(LockGuard { handle })
| ^^^^^^^^^ help: a struct with a similar name exists: `FdLockGuard`
error[E0412]: cannot find type `HANDLE` in this scope
--> src\windows.rs:17:19
|
17 | fn unlock(handle: HANDLE) -> Result<(), Error> {
| ^^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
|
1 | use std::os::windows::raw::HANDLE;
|
1 | use winapi::shared::ntdef::HANDLE;
|
1 | use winapi::um::winnt::HANDLE;
|
error[E0412]: cannot find type `Error` in this scope
--> src\windows.rs:17:41
|
17 | fn unlock(handle: HANDLE) -> Result<(), Error> {
| ^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
|
1 | use core::fmt::Error;
|
1 | use crate::error::Error;
|
1 | use failure::Error;
|
1 | use std::error::Error;
|
and 2 other candidates
error[E0425]: cannot find value `handle` in this scope
--> src\windows.rs:51:33
|
51 | if unsafe { !UnlockFile(handle, 0, 0, 1, 0) } {
| ^^^^^^ not found in this scope
error[E0412]: cannot find type `Error` in this scope
--> src\windows.rs:76:58
|
76 | pub fn lock(&mut self) -> Result<FdLockGuard<'_, T>, Error> {
| ^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
|
1 | use core::fmt::Error;
|
1 | use crate::error::Error;
|
1 | use failure::Error;
|
1 | use std::error::Error;
|
and 2 other candidates
error[E0425]: cannot find value `handle` in this scope
--> src\windows.rs:78:32
|
78 | if unsafe { LockFileEx(handle, LOCKFILE_EXCLUSIVE_LOCK, 0, 1, 0) } {
| ^^^^^^ not found in this scope
error[E0412]: cannot find type `Error` in this scope
--> src\windows.rs:92:62
|
92 | pub fn try_lock(&mut self) -> Result<FdLockGuard<'_, T>, Error> {
| ^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
|
1 | use core::fmt::Error;
|
1 | use crate::error::Error;
|
1 | use failure::Error;
|
1 | use std::error::Error;
|
and 2 other candidates
error[E0425]: cannot find value `handle` in this scope
--> src\windows.rs:94:30
|
94 | if unsafe { LockFile(handle, 0, 0, 1, 0) } {
| ^^^^^^ not found in this scope
error[E0308]: mismatched types
--> src\windows.rs:8:17
|
8 | if unsafe { LockFile(handle, 0, 0, 1, 0) } {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found i32
error[E0308]: mismatched types
--> src\windows.rs:18:17
|
18 | if unsafe { UnlockFile(handle, 0, 0, 1, 0) } {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found i32
error[E0599]: no method named `as_raw_fd` found for type `T` in the current scope
--> src\windows.rs:50:30
|
50 | let fd = self.lock.t.as_raw_fd();
| ^^^^^^^^^
error[E0308]: mismatched types
--> src\windows.rs:51:21
|
51 | if unsafe { !UnlockFile(handle, 0, 0, 1, 0) } {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found i32
error[E0599]: no method named `as_raw_fd` found for type `T` in the current scope
--> src\windows.rs:77:25
|
77 | let fd = self.t.as_raw_fd();
| ^^^^^^^^^
error[E0061]: this function takes 6 parameters but 5 parameters were supplied
--> src\windows.rs:78:21
|
78 | if unsafe { LockFileEx(handle, LOCKFILE_EXCLUSIVE_LOCK, 0, 1, 0) } {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 6 parameters
error[E0308]: mismatched types
--> src\windows.rs:78:21
|
78 | if unsafe { LockFileEx(handle, LOCKFILE_EXCLUSIVE_LOCK, 0, 1, 0) } {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found i32
error[E0599]: no method named `as_raw_fd` found for type `T` in the current scope
--> src\windows.rs:93:25
|
93 | let fd = self.t.as_raw_fd();
| ^^^^^^^^^
error[E0308]: mismatched types
--> src\windows.rs:94:21
|
94 | if unsafe { LockFile(handle, 0, 0, 1, 0) } {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found i32
error: aborting due to 24 previous errors
Some errors have detailed explanations: E0061, E0308, E0412, E0422, E0425, E0432, E0433, E0599.
For more information about an error, try `rustc --explain E0061`.
error: Could not compile `fd-lock`.