dynomite icon indicating copy to clipboard operation
dynomite copied to clipboard

Expected enum `rusoto_signature::region::Region`, found enum `Region`

Open jeremymcjunkin opened this issue 4 years ago โ€ข 3 comments

Cargo.toml

[dependencies]
rusoto_core = "0.46"
dynomite = "0.10.0"

src/main.rs

use rusoto_core::Region;
use dynomite::{
  dynamodb::{
      DynamoDbClient
  },
};

fn main() {
  let client = DynamoDbClient::new(Region::default());
}
error[E0308]: mismatched types
 --> src/main.rs:9:36
  |
9 |   let client = DynamoDbClient::new(Region::default());
  |                                    ^^^^^^^^^^^^^^^^^ expected enum `rusoto_signature::region::Region`, found enum `Region`
  |
  = note: perhaps two different versions of crate `rusoto_signature` are being used?

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.

๐Ÿ› Bug description

There seems to be a dependency version issue with dynomite and rusoto_core. Using code from the examples, pared down, does not compile because of mismatched types.

๐Ÿค” Expected Behavior

I expected this code to compile.

๐Ÿ‘Ÿ Steps to reproduce

Create the Cargo.toml and main.rs that I have provided and run cargo check

๐ŸŒ Your environment

Ubuntu 20.04

dynomite version: 0.10

rustc version: rustc 1.49.0 (e1884a8e3 2020-12-29) cargo 1.49.0 (d00d64df9 2020-12-05)

jeremymcjunkin avatar Feb 02 '21 04:02 jeremymcjunkin

@jeremymcjunkin I just ran into this and tracked down the cause with cargo tree. Dynomite's master branch is pretty far ahead of 0.10, so you're going to want to crib from the examples under the 0.10 tag, not master. In particular, 0.10 is still using the 0.45 release of Rusoto, although there are some other changes as well.

terrence2 avatar Feb 05 '21 17:02 terrence2

Thanks @terrence2 ,

I was able to get it to compile with Cargo.toml

[dependencies]
dynomite = { version = "0.10.0", default_features = true }
rusoto_core_default = { package = "rusoto_core", version = "0.45", optional = true }

[features]
default = ["rusoto_core_default"]

src/main.rs

use rusoto_core_default::Region;

use dynomite::{
  dynamodb::{
      DynamoDbClient
  },
};

fn main() {
  let _client = DynamoDbClient::new(Region::default());
}

It's unclear to me why I needed to add

rusoto_core_default = { package = "rusoto_core", version = "0.45", optional = true }

[features]
default = ["rusoto_core_default"]

To pull in rusoto_core_default. Shouldn't

dynomite = { version = "0.10.0", default_features = true }

Pull rusoto_core_default because it's listed in the default features for dynomite? https://github.com/softprops/dynomite/blob/v0.10.0/dynomite/Cargo.toml#L43

[features]
default = ["uuid", "chrono", "derive", "rusoto_core_default", "rusoto_dynamodb_default"]
rustls = ["uuid", "chrono", "derive", "rusoto_core_rustls", "rusoto_dynamodb_rustls"]
derive = ["dynomite-derive"]

ci-brightai avatar Feb 09 '21 03:02 ci-brightai

I had the same issue and switched to the master branch in Cargo.toml: dynomite = { git = "https://github.com/softprops/dynomite.git" }

tdomhan avatar Feb 26 '22 11:02 tdomhan