vault713 / wallet713

A wallet that makes it easy to send, store, and swap Grin.
Apache License 2.0
196 stars 74 forks source link

Build error "Box::new(self.db.iter(&[CONTACT_PREFIX]).unwrap())" #148

Closed Water-bamboo closed 5 years ago

Water-bamboo commented 5 years ago

I does not change any source code, but it builds fail in below some files, it's very odd. Is there any problem of these code?

error[E0271]: type mismatch resolving `<grin_store::SerIterator<_> as std::iter::Iterator>::Item == contacts::types::Contact`
  --> src/contacts/backend.rs:43:9
   |
43 |         Box::new(self.db.iter(&[CONTACT_PREFIX]).unwrap())
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected tuple, found struct `contacts::types::Contact`
   |
   = note: expected type `(std::vec::Vec<u8>, _)`
              found type `contacts::types::Contact`
   = note: required for the cast to the object type `dyn std::iter::Iterator<Item=contacts::types::Contact>`

error[E0271]: type mismatch resolving `<grin_store::SerIterator<_> as std::iter::Iterator>::Item == wallet::types::output_data::OutputData`
   --> src/wallet/backend/lmdb_backend.rs:185:9
    |
185 |         Box::new(self.db.iter(&[OUTPUT_PREFIX]).unwrap())
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected tuple, found struct `wallet::types::output_data::OutputData`
    |
    = note: expected type `(std::vec::Vec<u8>, _)`
               found type `wallet::types::output_data::OutputData`
    = note: required for the cast to the object type `dyn std::iter::Iterator<Item=wallet::types::output_data::OutputData>`

error[E0271]: type mismatch resolving `<grin_store::SerIterator<_> as std::iter::Iterator>::Item == wallet::types::tx_log_entry::TxLogEntry`
   --> src/wallet/backend/lmdb_backend.rs:194:9
    |
194 |         Box::new(self.db.iter(&[TX_LOG_ENTRY_PREFIX]).unwrap())
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected tuple, found struct `wallet::types::tx_log_entry::TxLogEntry`
    |
    = note: expected type `(std::vec::Vec<u8>, _)`
               found type `wallet::types::tx_log_entry::TxLogEntry`
    = note: required for the cast to the object type `dyn std::iter::Iterator<Item=wallet::types::tx_log_entry::TxLogEntry>`

error[E0271]: type mismatch resolving `<grin_store::SerIterator<_> as std::iter::Iterator>::Item == wallet::types::acct_path_mapping::AcctPathMapping`
   --> src/wallet/backend/lmdb_backend.rs:214:9
    |
214 |         Box::new(self.db.iter(&[ACCOUNT_PATH_MAPPING_PREFIX]).unwrap())
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected tuple, found struct `wallet::types::acct_path_mapping::AcctPathMapping`
    |
    = note: expected type `(std::vec::Vec<u8>, _)`
               found type `wallet::types::acct_path_mapping::AcctPathMapping`
    = note: required for the cast to the object type `dyn std::iter::Iterator<Item=wallet::types::acct_path_mapping::AcctPathMapping>`

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0271`.
error: Could not compile `wallet713`.
jaspervdm commented 5 years ago

I just did a fresh build from master, and it is succesful for me. Are you running the latest rustc version? I recommend trying to run rustup update.

Water-bamboo commented 5 years ago

Thanks.