Hello,
I am new to rust and trying to cargo build the mdbx-rs package on windows 10 x64 with clion ide. Every time i run the cargo build command its giving error : expected u32
, found i32
. I have made the same tests on visual studio code and got the same problem.
How can i resolve this?
Best
Complete result :
Compiling cexpr v0.5.0
Compiling thiserror-impl v1.0.29
Compiling derive_more v0.99.16
Checking thiserror v1.0.29
Compiling mdbx-sys v0.9.3 (C:\Users\tarkan\CLionProjects\lmdbx_test_3\mdbx-rs\mdbx-sys)
Checking mdbx v0.1.0 (C:\Users\tarkan\CLionProjects\lmdbx_test_3\mdbx-rs)
error[E0308]: mismatched types
--> src\cursor.rs:384:28
|
384 | IterDup::new(self, ffi::MDBX_NEXT)
| ^^^^^^^^^^^^^^ expected u32
, found i32
|
help: you can convert an i32
to a u32
and panic if the converted value doesn't fit
|
384 | IterDup::new(self, ffi::MDBX_NEXT.try_into().unwrap())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> src\cursor.rs:394:28
|
394 | IterDup::new(self, ffi::MDBX_FIRST)
| ^^^^^^^^^^^^^^^ expected u32
, found i32
|
help: you can convert an i32
to a u32
and panic if the converted value doesn't fit
|
394 | IterDup::new(self, ffi::MDBX_FIRST.try_into().unwrap())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> src\cursor.rs:408:28
|
408 | IterDup::new(self, ffi::MDBX_GET_CURRENT)
| ^^^^^^^^^^^^^^^^^^^^^ expected u32
, found i32
|
help: you can convert an i32
to a u32
and panic if the converted value doesn't fit
|
408 | IterDup::new(self, ffi::MDBX_GET_CURRENT.try_into().unwrap())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> src\cursor.rs:444:76
|
444 | ffi::mdbx_cursor_put(self.cursor, &key_val, &mut data_val, flags.bits())
| ^^^^^^^^^^^^ expected i32
, found u32
|
help: you can convert a u32
to an i32
and panic if the converted value doesn't fit
|
444 | ffi::mdbx_cursor_put(self.cursor, &key_val, &mut data_val, flags.bits().try_into().unwrap())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> src\cursor.rs:460:51
|
460 | ffi::mdbx_cursor_del(self.cursor, flags.bits())
| ^^^^^^^^^^^^ expected i32
, found u32
|
help: you can convert a u32
to an i32
and panic if the converted value doesn't fit
|
460 | ffi::mdbx_cursor_del(self.cursor, flags.bits().try_into().unwrap())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> src\cursor.rs:811:43
|
811 | let op = mem::replace(op, ffi::MDBX_NEXT_NODUP);
| ^^^^^^^^^^^^^^^^^^^^ expected u32
, found i32
|
help: you can convert an i32
to a u32
and panic if the converted value doesn't fit
|
811 | let op = mem::replace(op, ffi::MDBX_NEXT_NODUP.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> src\cursor.rs:815:93
|
815 | unsafe { ffi::mdbx_cursor_get(cursor.cursor(), &mut key, &mut data, op) };
| ^^ expected i32
, found u32
|
help: you can convert a u32
to an i32
and panic if the converted value doesn't fit
|
815 | unsafe { ffi::mdbx_cursor_get(cursor.cursor(), &mut key, &mut data, op.try_into().unwrap()) };
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> src\database.rs:37:47
|
37 | ffi::mdbx_dbi_open(txn, name_ptr, flags, &mut dbi)
| ^^^^^ expected i32
, found u32
|
help: you can convert a u32
to an i32
and panic if the converted value doesn't fit
|
37 | ffi::mdbx_dbi_open(txn, name_ptr, flags.try_into().unwrap(), &mut dbi)
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named as_bytes
found for reference &OsStr
in the current scope
--> src\environment.rs:507:64
|
507 | let path = match CString::new(path.as_os_str().as_bytes()) {
| ^^^^^^^^ method not found in &OsStr
error[E0308]: mismatched types
--> src\transaction.rs:298:67
|
298 | ffi::mdbx_put(txn, db.dbi(), &key_val, &mut data_val, flags.bits())
| ^^^^^^^^^^^^ expected i32
, found u32
|
help: you can convert a u32
to an i32
and panic if the converted value doesn't fit
|
298 | ffi::mdbx_put(txn, db.dbi(), &key_val, &mut data_val, flags.bits().try_into().unwrap())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> src\transaction.rs:330:36
|
330 | flags.bits() | ffi::MDBX_RESERVE,
| ^^^^^^^^^^^^^^^^^ expected u32
, found i32
error[E0308]: mismatched types
--> src\transaction.rs:330:21
|
330 | flags.bits() | ffi::MDBX_RESERVE,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected i32
, found u32
|
help: you can convert a u32
to an i32
and panic if the converted value doesn't fit
|
330 | (flags.bits() | ffi::MDBX_RESERVE).try_into().unwrap(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: no implementation for u32 | i32
--> src\transaction.rs:330:34
|
330 | flags.bits() | ffi::MDBX_RESERVE,
| ^ no implementation for u32 | i32
|
= help: the trait BitOr<i32>
is not implemented for u32
error[E0308]: mismatched types
--> src\flags.rs:168:29
|
168 | const REVERSE_KEY = MDBX_REVERSEKEY;
| ^^^^^^^^^^^^^^^ expected u32
, found i32
error[E0308]: mismatched types
--> src\flags.rs:169:26
|
169 | const DUP_SORT = MDBX_DUPSORT;
| ^^^^^^^^^^^^ expected u32
, found i32
error[E0308]: mismatched types
--> src\flags.rs:170:29
|
170 | const INTEGER_KEY = MDBX_INTEGERKEY;
| ^^^^^^^^^^^^^^^ expected u32
, found i32
error[E0308]: mismatched types
--> src\flags.rs:171:27
|
171 | const DUP_FIXED = MDBX_DUPFIXED;
| ^^^^^^^^^^^^^ expected u32
, found i32
error[E0308]: mismatched types
--> src\flags.rs:172:29
|
172 | const INTEGER_DUP = MDBX_INTEGERDUP;
| ^^^^^^^^^^^^^^^ expected u32
, found i32
error[E0308]: mismatched types
--> src\flags.rs:173:29
|
173 | const REVERSE_DUP = MDBX_REVERSEDUP;
| ^^^^^^^^^^^^^^^ expected u32
, found i32
error[E0308]: mismatched types
--> src\flags.rs:174:24
|
174 | const CREATE = MDBX_CREATE;
| ^^^^^^^^^^^ expected u32
, found i32
error[E0308]: mismatched types
--> src\flags.rs:175:24
|
175 | const ACCEDE = MDBX_DB_ACCEDE;
| ^^^^^^^^^^^^^^ expected u32
, found i32
error[E0308]: mismatched types
--> src\flags.rs:183:24
|
183 | const UPSERT = MDBX_UPSERT;
| ^^^^^^^^^^^ expected u32
, found i32
error[E0308]: mismatched types
--> src\flags.rs:184:30
|
184 | const NO_OVERWRITE = MDBX_NOOVERWRITE;
| ^^^^^^^^^^^^^^^^ expected u32
, found i32
error[E0308]: mismatched types
--> src\flags.rs:185:29
|
185 | const NO_DUP_DATA = MDBX_NODUPDATA;
| ^^^^^^^^^^^^^^ expected u32
, found i32
error[E0308]: mismatched types
--> src\flags.rs:186:25
|
186 | const CURRENT = MDBX_CURRENT;
| ^^^^^^^^^^^^ expected u32
, found i32
error[E0308]: mismatched types
--> src\flags.rs:187:25
|
187 | const ALLDUPS = MDBX_ALLDUPS;
| ^^^^^^^^^^^^ expected u32
, found i32
error[E0308]: mismatched types
--> src\flags.rs:188:25
|
188 | const RESERVE = MDBX_RESERVE;
| ^^^^^^^^^^^^ expected u32
, found i32
error[E0308]: mismatched types
--> src\flags.rs:189:24
|
189 | const APPEND = MDBX_APPEND;
| ^^^^^^^^^^^ expected u32
, found i32
error[E0308]: mismatched types
--> src\flags.rs:190:28
|
190 | const APPEND_DUP = MDBX_APPENDDUP;
| ^^^^^^^^^^^^^^ expected u32
, found i32
error[E0308]: mismatched types
--> src\flags.rs:191:26
|