meh / rust-xcb-util

Rust bindings and wrappers for XCB utility functions.
MIT License
27 stars 17 forks source link

Error: Using xcb::base::Connection instead of xcb::Connection #2

Closed liftoff closed 7 years ago

liftoff commented 7 years ago

Not sure if this is a version mismatch or what but trying to use rust-xcb-util is resulting in the following error:

error[E0308]: mismatched types
  --> src/main.rs:42:38
   |
42 |         let r = xcb_util::image::get(&conn, root, x, y, width, height, plane_mask, format);
   |                                      ^^^^^ expected struct `xcb::base::Connection`, found struct `xcb::Connection`
   |
   = note: expected type `&xcb::base::Connection`
   = note:    found type `&xcb::Connection`

Am I doing something wrong?

meh commented 7 years ago

Definitely a version mismatch, what versions of xcb are in your Cargo.lock?

liftoff commented 7 years ago
[[package]]
name = "xcb"
version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
 "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
liftoff commented 7 years ago

In case it helps:

rustc --version
rustc 1.14.0-nightly (16eeeac78 2016-10-18)
meh commented 7 years ago

What's the entry for xcb_util instead?

liftoff commented 7 years ago
[[package]]
name = "xcb-util"
version = "0.1.6"
dependencies = [
 "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
 "xcb 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
liftoff commented 7 years ago

Nevermind... I was able to fix it by removing the "source" line from Cargo.toml (I was using a local copy of the Github code). Apparently Github version of rust-xcb does not work with Github version of rust-xcb-util