Build error in 0.4.0
sullivanmj opened this issue · comments
I'm trying to build an empty project with littlefs2 as the sole dependency, and I am getting a build error. The error message says that that some value was expected to be a u32
, but is actually an i32
. Here's the full build output from my build invocation of cargo build
:
Compiling version_check v0.9.4
Compiling proc-macro2 v1.0.56
Compiling quote v1.0.26
Compiling unicode-ident v1.0.8
Compiling glob v0.3.1
Compiling winapi v0.3.9
Compiling memchr v2.5.0
Compiling libc v0.2.141
Compiling semver v1.0.17
Compiling bindgen v0.56.0
Compiling nom v5.1.2
Compiling autocfg v1.1.0
Compiling regex-syntax v0.6.29
Compiling clang-sys v1.6.1
Compiling lock_api v0.4.9
Compiling rustc-hash v1.1.0
Compiling lazy_static v1.4.0
Compiling shlex v0.1.1
Compiling lazycell v1.3.0
Compiling peeking_take_while v0.1.2
Compiling bitflags v1.3.2
Compiling libloading v0.7.4
Compiling rustc_version v0.4.0
Compiling log v0.4.17
Compiling scopeguard v1.1.0
Compiling typenum v1.16.0
Compiling serde_derive v1.0.160
Compiling cc v1.0.79
Compiling heapless v0.7.16
Compiling syn v2.0.15
Compiling generic-array v0.14.7
Compiling regex v1.7.3
Compiling byteorder v1.4.3
Compiling cty v0.2.2
Compiling delog v0.1.6
Compiling serde v1.0.160
Compiling cexpr v0.4.0
Compiling cfg-if v1.0.0
Compiling hash32 v0.2.1
Compiling spin v0.9.8
Compiling stable_deref_trait v1.2.0
Compiling cstr_core v0.2.6
Compiling littlefs2-sys v0.1.7
Compiling littlefs2 v0.4.0
error[E0308]: mismatched types
--> C:\Users\<redacted>\.cargo\registry\src\github.com-1ecc6299db9ec823\littlefs2-0.4.0\src\fs.rs:212:13
|
211 | let file_type = match info.type_ as u32 {
| ----------------- this expression has type `u32`
212 | ll::lfs_type_LFS_TYPE_DIR => FileType::Dir,
| ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `i32`
error[E0308]: mismatched types
--> C:\Users\<redacted>\.cargo\registry\src\github.com-1ecc6299db9ec823\littlefs2-0.4.0\src\fs.rs:213:13
|
211 | let file_type = match info.type_ as u32 {
| ----------------- this expression has type `u32`
212 | ll::lfs_type_LFS_TYPE_DIR => FileType::Dir,
213 | ll::lfs_type_LFS_TYPE_REG => FileType::File,
| ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `i32`
For more information about this error, try `rustc --explain E0308`.
error: could not compile `littlefs2` due to 2 previous errors
System information:
Edition Windows 11 Home
Version 22H2
OS build 22621.1555
Experience Windows Feature Experience Pack 1000.22640.1000.0
I am building from Git-bash (MINGW64) with the following uname -a
ouput:
MINGW64_NT-10.0-22621 _<REDACTED>_ 3.1.7-340.x86_64 2021-03-26 22:17 UTC x86_64 Msys
cargo version:
cargo 1.68.2 (6feb7c9cf 2023-03-26)
rustc version:
rustc 1.68.2 (9eb3afe9e 2023-03-27)
Also I'm not sure if it's relevant, but this is my clang version info:
clang version 16.0.0
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
Hopefully, I have provided enough information, or am just doing something silly. Please advise if you need more information.
Possibly related:
Line 211 in f906960
This should be as lfs_type
instead of as u32
.