vhbit / lmdb-rs

Rust bindings for LMDB
MIT License
114 stars 47 forks source link

Could not compile `lmdb-rs`. #4

Closed janprill closed 9 years ago

janprill commented 9 years ago

Hey,

I'm a total noob in all regards 'rust', so it's very well possible that I'm doing something totally dumb here, but I'd nevertheless like to give you a heads up about the following error after git submodule update --init; cargo build:

msp-hh-nb22:lmdb-rs $ rustc --version rustc 0.13.0-nightly (fea5aa656 2014-12-30 00:42:13 +0000)

Compiling lmdb-rs v0.1.0 (file://$HOME/Documents/workspace/jan/lmdb-rs) $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:674:13: 674:19 error: mismatched types: expected std::sync::mutex::MutexGuard<'_, core::cell::UnsafeCell<std::collections::hash::map::HashMap<collections::string::String, u32>>>, found core::result::Result<_, _> (expected struct std::sync::mutex::MutexGuard, found enum core::result::Result) $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:674 Err() => Err(MdbError::CacheError), ^~ $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:675:13: 675:22 error: mismatched types: expected `std::sync::mutex::MutexGuard<', core::cell::UnsafeCell<std::collections::hash::map::HashMap<collections::string::String, u32>>>, foundcore::result::Result<, >`(expected struct std::sync::mutex::MutexGuard, found enum core::result::Result) $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:675 Ok(guard) => { ^~~~~ $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:676:32: 676:38 error: the type of this value must be known in this context $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:676 let ref cell = guard; ^~ $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:677:34: 677:39 error: the type of this value must be known in this context $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:677 let cache = cell.get(); ^~~~~ $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:680:39: 680:60 error: the type of this value must be known in this context $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:680 if let Some(db) = (cache).get(db_name) { ^~~~~ $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:681:68: 681:71 error: the type of this value must be known in this context $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:681 debug!("Cached value for {}: {}", db_name, *db); ^~~ note: in expansion of format_args!

:10:35: 10:58 note: expansion site :1:1: 13:2 note: in expansion of log! :2:46: 2:76 note: expansion site :1:1: 3:2 note: in expansion of debug! $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:681:25: 681:73 note: expansion site $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:705:21: 705:60 error: the type of this value must be known in this context $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:705 (*cache).insert(db_name.to_owned(), db); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:732:13: 732:19 error: mismatched types: expected`std::sync::mutex::MutexGuard<'_, core::cell::UnsafeCell>>`, found`core::result::Result<_, _>` (expected struct std::sync::mutex::MutexGuard, found enum core::result::Result) $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:732 Err(_) => (), ^~~~~~ $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:733:13: 733:22 error: mismatched types: expected `std::sync::mutex::MutexGuard<'_, core::cell::UnsafeCell>>`, found `core::result::Result<_, _>` (expected struct std::sync::mutex::MutexGuard, found enum core::result::Result) $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:733 Ok(guard) => { ^~~~~~~~~ $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:734:32: 734:38 error: the type of this value must be known in this context $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:734 let ref cell = _guard; ^~~~~~ $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:737:38: 737:43 error: the type of this value must be known in this context $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:737 let cache = cell.get(); ^~~~~ $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:740:35: 740:50 error: the type of this value must be known in this context $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:740 for (k, v) in (_cache).iter() { ^~~~~~~~~~~~~~~ $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:741:28: 741:30 error: the type of this value must be known in this context $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:741 if _v == handle { ^~ $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:741:28: 741:30 error: the type of this value must be known in this context $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:741 if *v == handle { ^~ $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:748:25: 748:45 error: the type of this value must be known in this context $HOME/Documents/workspace/jan/lmdb-rs/src/core.rs:748 (_cache).remove(key); ^~~~~~~~~~~~~~~~~~~~ error: aborting due to 15 previous errors Could not compile `lmdb-rs`.
vhbit commented 9 years ago

Should be fixed in tree or in updated crates.io package

vhbit commented 9 years ago

Ohh, sorry, it seems I've misread error messages. It looks vice versa - git version works but it works with a Rust built from master branch, it seems it hasn't hit yet to nightly. You can try to use c1f5ebf3a266ad703843bcb239908793059226f9 or update to newer Rust.